Skip to content
RoRoScripts
OP auto diig  open source preview
Unknown

OP auto diig open source

Script
Dig itneutral
Views
6.6K
Likes
2
Dislikes
1
Added
Script
local game = game
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local character = localPlayer.Character
local runService = game:GetService("RunService")
local replicatedStorage = game:GetService("ReplicatedStorage")
runService.RenderStepped:Connect(function()
    character = localPlayer.Character
    if character:FindFirstChildWhichIsA("Tool") and string.find(string.lower(character:FindFirstChildWhichIsA("Tool").Name), "shovel") then
        for _,v in workspace.TreasurePiles:GetChildren() do
            if v:GetAttribute("Owner") == localPlayer.UserId then
                replicatedStorage.Source.Network.RemoteEvents.Digging:FireServer({["Command"] = "IsInArea",["TargetPileIndex"] = v:GetAttribute("PileIndex"),["State"] = true})
                replicatedStorage.Source.Network.RemoteFunctions.Digging:InvokeServer({["Command"] = "DigPile",["TargetPileIndex"] = v:GetAttribute("PileIndex")})
            end
        end
        replicatedStorage.Source.Network.RemoteFunctions.Digging:InvokeServer({["Command"] = "CreatePile"})
    end
end)