I'm trying to run this script:
local tier = stats:findFirstChild("Tier") game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if tier.Value == 0 then game.ServerStorage.Tier1Sword:Clone().Parent = game.Players.LocalPlayer.Backpack end end
But I get an error message in the output: ')' expected (to close '(' at line 3) near '<eof>'
Help?
What is happening is for one thing you do not have enough ends. You need one end for the if then statement on 4 and you need two ends for the functions on lines 2 and 3. You will also need a parenthesis to close the function since you're using an anonymous function.
Add that end, and put a close parenthesis to the last two ends.
local tier = stats:findFirstChild("Tier") game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if tier.Value == 0 then game.ServerStorage.Tier1Sword:Clone().Parent = game.Players.LocalPlayer.Backpack end end) end)
It's a syntax error caused by unmatched parenthesis:
local tier = stats:findFirstChild("Tier") game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if tier.Value == 0 then game.ServerStorage.Tier1Sword:Clone().Parent = game.Players.LocalPlayer.Backpack end end) end)