✓ Accepted answer
I think I catch your drift on what you're trying to do.
Try to post a bit more content on what you want done though, because I only have a vague idea.
So I'm assuming the variable randy is a tool, so to run a script when this item is equipped, you want to do something along these lines with the Equipped event:
randy.Equipped:connect(function(mouse)
end)
You can place all the code you want in between randy.Equipped:connect(function(mouse) and end) where the comment is.
__
On the contrary, if you want to have code execute when your tool is deselected/unequipped, you can use the event Unequipped:
randy.Unequipped:connect(function()
end)
Once again you can place all the code you want in between randy.Unequipped:connect(function(mouse) and end) where the comment is.
__
Hope this helps! If you have any questions, feel free to leave a comment on my answer.
2 comments
randy is random, my script give a random tool from lightning
I do not understand much about tools, I thought this would run this script would give a random item to the player who used it