parent.MouseButton1Click:connect(function()
if game.Players.LocalPlayer.Backpack.EarthOrb
then game.Players.LocalPlayer.Backpack.EarthOrb.parent = game.ReplicatedStorage
game.ReplicatedStorage.FireOrb.Parent = game.Players.LocalPlayer.Backpack
end)
✓ ANSWER ACCEPTED
Line 5, expected identifier, got ')' How do I fix this? I'm new sorry if coding is messed up
2 answers
✓ Accepted answer
You didn't close your if statement. Here's what it should look like:
parent.MouseButton1Click:connect(function()
if game.Players.LocalPlayer.Backpack.EarthOrb then
game.Players.LocalPlayer.Backpack.EarthOrb.Parent = game.ReplicatedStorage
game.ReplicatedStorage.FireOrb.Parent = game.Players.LocalPlayer.Backpack
end
end)
Also, if you have FilteringEnabled on and this is from a LocalScript (I'm assuming it is), you should use RemoteEvents.
This is what is called a syntax error. You're in luck because these are the easiest to fix but you probably shouldn't be asking it here seeing as a quick double check would most likely allow you to identify the problem...
The simple problem here is that your if statement does not have an end.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Wow, I never knew you have to close 'if' statements, thanks!