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

Error with a local script in startergui. Problems with ends. Help?

Asked by
xp5u 25
3 years ago
pad1 = workspace["Open me"].Stop
pad = workspace["Open me"].Start
pad.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

        local Playing = plr.Playing

        Playing.Value = true
    end
pad1.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

        local Playing = plr.Playing

            Playing.Value = false
            wait(3)
            Playing:destroy()

    end
end)

Error: Players.xp5u.PlayerScripts.LocalScript:22: Expected 'end' (to close 'function' at line 3), got <eof>; did you forget to close 'then' at line 12? - Studio - LocalScript:22

2 answers

Log in to vote
0
Answered by 3 years ago

Remove the closing parenthesis on line 22 so it just says "end" not "end)".

0
It doesn't exactly work, I got: Players.xp5u.PlayerScripts.LocalScript:22: Expected ')' (to close '(' at line 11), got <eof> - Studio - LocalScript:22 xp5u 25 — 3y
0
Oh yeah... Try Hate_ZEU's response below then. Voltaicmimic 43 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

At line 10 you got just an end, you need another end) to close the first touched event.

Answer this question