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

This Script Wont Work For Me, Help?

This Function Ontouch Script Wont Work For Me, But It Will Work For My Friend, orangylemon. Help?

function OnTouched() game.Workspace.Sound:Play() script.Disabled = true wait(87) script.Disabled = false end if script.Parent.Touched:connect(OnTouched)

1 comment

0

Thank You 1waffle1, i can now run my script, thank you c:

1 answer

✓ Accepted answer

A disabled script cannot enable itself. What you seem to be trying to do is this, though:

local busy=false
script.Parent.Touched:connect(function()
	if busy then return end
	busy=true
	workspace.Sound:Play()
	wait(87)
	busy=false
end)

This creates a variable busy and cancels if it's true, then sets it back to false when it's done.

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