I'm trying to make it to where once I enable a tool It gives me a sword This script is the closest I have came to it but I need a click detector and it doesn't give me a sword when I enable it.
function hi(x)
y = x.Backpack
z = game.Lighting["LinkedSword"]
z:Clone().Parent = y
end
script.Parent.ClickDetector.MouseClick:connect(hi)
The problem with this is that I need a click detector, and when I enable the tool it doesnt give me a sword, I have to click the tool when its laying down on the ground instead. Any idea on how I could enable a tool and it will give me a sword?

4 comments
Yes that is true, I have experimented with taking the scripts out of the Roblox Game Card gear because they have the same mechanics that I'm trying to script, but My trouble is that I don't want the item or card to disappear once I click with it
That is not something that would result from this solution unless you are having a different problem.
Yea, i do not want a click detector where you can click it when not even holding it. Its like you have a sword in your hand, and to swing the sword you must click the screen, but I'm trying to script it to where once I swing the sword it gives me another sword
Then your problem is about writing a sword that does that and has nothing to do with ClickDetectors.