local rock = script.Parent:WaitForChild("newRock") -- help me with this line
function onTouched(hit)
local humanoid =hit.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid ~= nil then
print(humanoid)
humanoid:TakeDamage(100)
end
end
rock.Touched:Connect(onTouched)
the newrock is a clone and i want the rock variable to wait for the another clones, any help?
" the cloning script "
local rock = script.Parent.Part
local function copyRock()
local newRock = rock:Clone()
newRock.Name = "newRock"
newRock.Anchored = false
newRock.Parent = script.Parent
wait(5)
newRock:Destroy()
end
while true do
wait(1)
copyRock()
end

1 comment
Is it giving you any errors?