Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Expected identifier when parsing expression, got ‘)’?

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

✓ Accepted answer

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)

1 comment

0

the reason you need another end is because you need to end the if then

This discussion is preserved as it was. New answers, comments, and votes are closed.