Sword = game.ReplicatedStorage.Sword:Clone() Sword.Parent = game.Players.LocalPlayer.Backpack elseif game.Players.LocalPlayer:FindFirstChild("Sword") then print(game.Players.LocalPlayer.Name.." Already received the sword.") end end)
So this is a script to add a sword to there inventory when they get the rank they need.
So could someone fix it if there is a error. And does anyone know how to make it remove the old sword?
thanks
Like Ruben said, elseif statements only work with if statements.
Sword = game.ReplicatedStorage.Sword:Clone() if game.Players.LocalPlayer:FindFirstChild("Sword") then print(game.Players.LocalPlayer.Name.." Already received the sword.") else Sword.Parent = game.Players.LocalPlayer.Backpack end)
You don't even need and elseif statement.
Just check if they have it, if not, then give it to them.
You add an elseif statement without an if statement, that would make your error. (Or your code isn't completely posted.)