Hi there! I made a script that gives a player an item when they click it, and it works. But it only gives them the item once and then stops working. Here is my script:
local tool = game.ServerStorage.Card local klone = tool:clone script.Parent.ClickDetector.MouseClick:connect (function(plr) if klone.Parent ~= plr.Backpack then klone.Parent = plr.Backpack else end end)
Can somebody help me?
So in this script, there is an if-then statement
that checks if you currently have the item. If you remove the statement, then it should fix it.
local tool = game.ServerStorage.Card local klone = tool:clone script.Parent.ClickDetector.MouseClick:connect (function(plr) klone.Parent = plr.Backpack else end)
Here you go.
script.Parent.ClickDetector.MouseClick:connect (function(plr) local tool = game.ServerStorage.Card:Clone() if tool.Parent ~= plr.Backpack then tool.Parent = plr.Backpack else tool:Destroy() warn("This player already has the tool!") return end end)