Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how could I make this pickaxe script slowly delete every child in this model called "Rock"?

Asked by 7 years ago
local tool = script.Parent
local head = tool.AxeHead
local stick = tool.Stick
local wielder = game.Players.LocalPlayer
local mouse = wielder:GetMouse()

tool.Activated:Connect(function(rock)
    print("wielder has selected" , mouse.Target)
    if mouse.Target.Parent.Name == "Rock" and mouse.Target.Parent:IsA("Model") then
        local rock = mouse.Target.Parent
        local rocks = rock:FindFirstChild("Part")
        while rocks ~= nil do
            rocks:Destroy()
            wait(.02)

        end
    end
end)

1 answer

Log in to vote
0
Answered by 7 years ago

Change line 11 to

local rocks = rock:FindFirstChild("Rock")

0
-_- that wouldn't work macabe55101 38 — 7y
Ad

Answer this question