local color = BrickColor.new("Bright red") script.Parent.Touched:connect(function(hit) local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p then if p.TeamColor == color then game.Lighting.GK:Clone().Parent = p.Backpack end end end)
this gives the player the tool but if he keeps standing on it, he will keep getting the tool can someone help me make the player only get the tool if he doesn't have it already PLEASE!!
Make it check if the player already has the tool.
local color = BrickColor.new("Bright red") local tool = "GK" script.Parent.Touched:connect(function(hit) local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p and p.TeamColor == color and not p.Backpack:FindFirstChild(tool)and not hit.Parent:FindFirstChild(tool)then game.Lighting[tool]:Clone().Parent = p.Backpack end end)
I also recommend not using Lighting to store objects.