Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to drop a tool when clicking on a new tool? [closed]

Asked by 3 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

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!

0
This isn't a code request site. You need to write the code yourself and we answer any errors that you can't solve. SethHeinzman 284 — 3y

Closed as Not Constructive by Lakodex, JesseSong, imKirda, Leamir, jediplocoon, matiss112233, and TaxesArentAwesome

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
sheepposu 561 Moderation Voter
3 years ago
Edited 3 years ago

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.

0
add roblox api refferences(links) to help him doing that Leamir 3138 — 3y
Ad