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

How can I make a player script diabled until they touch the ring?

I have a punch script put I want it to be disabled until you touch the ring and the script I wrote won't work. Any idea how I can do this?

script.Parent.Touched:connect(function() game.Players.LocalPlayer.PlayerScripts.Left_Punch_Local.Disabled = false game.Players.LocalPlayer.PlayerScripts.Right_Punch_Local.Disabled = false end)

2 answers

✓ Accepted answer
local touchPart = workspace.Part

local scripts = {workspace.Script1, workspace.Script2}

touchPart.Touched:Wait() --Will wait for the part to be touched


for _,cscript in pairs(scripts) do 

cscript.Disabled = false

end

This will only execute once, if you want it to execute several times you do

touchPart.Touched:Connect(function()
--continue code here..
end)

1 comment

0

doesn't work

Can't you just put the whole script into an If statement that fires off on touch?

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