Ad
Log in to vote
0

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

Asked by 4 days 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)

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

2 answers

Log in to vote
0
Answered by 4 days 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 4 days 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 — 3d

Answer this question



Ad