#The code working twice
1 messages · Page 1 of 1 (latest)
I'm gonna need to see more than that
where are you using goMessage()
show me that part of the script
just do button:Once() instead
But it will be workable again
no it wont
i mean i want to make it workable always
then why'd you turn off CanTouch for your button
To make it work once when touched, i will add lines to make it true again in .5 seconds
** You are now Level 2! **
It would work 4, 5 times when touched once if i don't add it
make a seperate function for the code from
button.CanTouch = false
to
elseif stalVal==7 then
end
let me know once you've done that
I didn't understand what to do
make a function at the beginning of the script and name it whatever you want and put everything inside the touched event inside your new function
local function ShowIt(button)
button.CanTouch = false
stage.Value = button.Name
task.wait()
plr.Character:MoveTo(workspace.Bases[plr.Name].Checkpoints[stage.Value].Position)
local staVal = stage.Value
if staVal == 2 then
goMessage("fasfas", "fhdhfhdf")
return
elseif staVal == 3 then
elseif staVal == 4 then
elseif staVal == 5 then
elseif staVal == 6 then
elseif staVal == 7 then
end
end
button.Touched:Connect(function()
ShowIt(button)
end)
You meant that right?
But now the code works only once but it's okay actually