toolname = "LinkedSword" Tool = true game.Players.PlayerAdded:connect(function(newPlayer) newPlayer.CharacterAdded:connect(function(char) script.Parent.ClickDetector.MouseClick:connect(function() if Tool == false then return end wait() Tool = game.Lighting:findFirstChild(Toolname):remove() Tool.Parent = game.Players:findFirstChild(char.Name).Backpack game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Char) if Player.Backpack:findFirstChild(Toolname) then Player.Backpack:findFirstChild(Toolname):remove() end end)
Could you help me please?
You're using remove(), use Destroy()!
You forgot an end.
Replaced your removes with Destroy()
Added an end
toolname = "LinkedSword" Tool = true game.Players.PlayerAdded:connect(function(newPlayer) newPlayer.CharacterAdded:connect(function(char) script.Parent.ClickDetector.MouseClick:connect(function() if Tool == false then return end wait() Tool = game.Lighting:findFirstChild(Toolname):Destroy() Tool.Parent = game.Players:findFirstChild(char.Name).Backpack game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Char) if Player.Backpack:findFirstChild(Toolname) then Player.Backpack:findFirstChild(Toolname):Destroy() end end) end) end) end) end)