Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

this short script doesnt work ?

can you tell me why this doesnt work? my username is in second.Value but it still doesnt work

while true do
local play2 = game.Workspace:FindFirstChild(second.Value)
play2.Head:Destroy()
wait(1)
end

1 answer

✓ Accepted answer

Well, there is only one issue I see with this script. When you destroy play2.Head, you are not checking to make sure it is present in the game first. The best method is to use the WaitForChild() function on lines 2 and 3:

while true do
	local play2=game.Workspace:WaitForChild(second.Value)
	play2:WaitForChild("Head"):Destroy()
	wait(1)
end

You can read up more on WaitForChild here. I hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.