Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my event not require an end) and when I play it doesn't work?

Asked by
Auxigin 47
4 years ago
Edited 4 years ago

stupid = true script.Parent.Touched:Connect(function(player) if stupid == true then do stupid = false script.Parent.Position = Vector3.new(-65.597, 0.36, 1.5) wait(4) script.Parent.Position = Vector3.new(-65.597, 0.672, 1.5) stupid = true wait(1) end end)



This is my button script with a reset and it doesn't work? The event doesn't sense an end and the end) has a red line under it and nothing works... I might look stupid but I'm a new member of this community.

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

use it as you have your code in the lua block also here is the working version

local stupid = true

script.Parent.Touched:Connect(function(player)
    if stupid == true then
        stupid = false
        script.Parent.Position = Vector3.new(-65.597, 0.36, 1.5)
        wait(4)
        script.Parent.Position = Vector3.new(-65.597, 0.672, 1.5)
        wait(1)
        stupid = true
    end
end)
1
Please Accept My Answer If It Worked. EnzoTDZ_YT 275 — 4y
1
Did you mean to put stupid = true after the wait(1)? palav 104 — 4y
1
nope ill fix that EnzoTDZ_YT 275 — 4y
0
Sorry, the end) still has a red line under it :( Auxigin 47 — 4y
View all comments (2 more)
0
ok 1 moment ill check it again EnzoTDZ_YT 275 — 4y
0
Try now i checked and it definatly works now EnzoTDZ_YT 275 — 4y
Ad

Answer this question