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

Expected identifier when parsing expression, got ‘)’?

Asked by 3 years ago

Hello, so I was making a blocker system for my open gui, when someone is sitting in a car and clicks on it, it is supposed to play an error sound. But for some reason it is not working. I get Expected identifier when parsing expression, got ‘)’. But you need a ) for the end for it to work properly??

local remEvent = game.ReplicatedStorage:WaitForChild("OpenGUI")
script.Parent.ClickDetector.MouseClick:Connect(function(player)
    local character = player.Character or player.CharacterAdded:wait()
if character.Humanoid.Sit == false then
        remEvent:FireClient(player)
    else
        script.Parent.ERROR:Play()
end)

1 answer

Log in to vote
2
Answered by 3 years ago

try this

local remEvent = game.ReplicatedStorage:WaitForChild("OpenGUI")
script.Parent.ClickDetector.MouseClick:Connect(function(player)
    local character = player.Character or player.CharacterAdded:wait()
if character.Humanoid.Sit == false then
        remEvent:FireClient(player)
    else
                script.Parent.ERROR:Play()
        end
end)
0
the reason you need another end is because you need to end the if then CrownedFigure 45 — 3y
Ad

Answer this question