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

Line 5, expected identifier, got ')' How do I fix this? I'm new sorry if coding is messed up

Asked by 5 years ago
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)

2 answers

Log in to vote
0
Answered by
popeeyy 493 Moderation Voter
5 years ago

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.

0
Wow, I never knew you have to close 'if' statements, thanks! Shaablowski -1 — 5y
Ad
Log in to vote
0
Answered by
RayCurse 1518 Moderation Voter
5 years ago

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.

Answer this question