Hello, so my friend made it to where you can click on a tool to pick it up, which I like, but I want the players who play the game to only be able to hold one tool at a time. I was wondering if there was a way to make it where if a player is already holding a tool, and they click on a new tool, the tool they are currently holding is placed where the new tool was, and the player is now holding the new tool. Thanks in advance!
COMMUNITY QUESTION
How to drop a tool when clicking on a new tool?
1 answer
Since this isn't a code request site I'll tell you how you can write the code yourself. I'd suggest making a script in ServerScriptService. In the script, make an event for when a player joins, then make an event to detect when a child is added to the player's character. Check if the object is a tool, and if it is, then check the player for another tool. If the player has another tool, simply set its parent to the workspace and it will be dropped. I think that should work fine. Try and write the code and if it's not working, then, you can come and ask for help with your code.
1 comment
0
add roblox api refferences(links) to help him doing that
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This isn't a code request site. You need to write the code yourself and we answer any errors that you can't solve.