Ad
Log in to vote
0

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

Asked by 8 months ago

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

Log in to vote
0
Answered by 8 months ago

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

Ad
Log in to vote
0
Answered by 8 months ago
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)
0
doesn't work YogamingHenshaw 0 — 8mo

Answer this question