I know basically NOTHING about this so help is needed
Also just to clarify, i mean if your holding an object and click another part it knows and does something
You need to do your research first bro, before making posts. As to avoid repeating subjects. Best places for it is right here in the dev forum, or on YouTube.
You can try adding a bool value in the script, that says true when the player clicks it. and false when the player decides to let go of it. The event would be called .MouseClick
in the click detector.
Fair. I do agree that i should do a bit of research first but I did a little. I dont know if im not doing it correctly but when i search this up on YouTube it has no results. Some of my posts are quite lazy but in the future, i will do more research before posting
Na don’t worry, I ain’t scolding ya.
(But Terms Of Service does recommend not reposting already [posibly] solved subjects, which can be considered spam, and can be flagged, ultimately giving you a strike)
Also try to include a script so that we can take a look at whats going on in there.
Now to your issue.
The object is inside the workspace right. Well for it to be held by the player. It needs to be a Tool
, a special kind Model
that does pretty much the same thing as a model, only that it allow’s for the player to hold it. Normally it will also show up in their backpack when picked up.
Now for clicking the object, to have it in the inventory, we can duplicate the object, and send one for being clicked, and the other to go to ReplicatedStorage
inside a Tool.
ReplicatedStorage
is just one the game service’s, nice for storing things out of sight, and replicating the same object for every player when the time come’s.
A few videos I found one how to do that.
Then, you’d want to create a local script inside the player, that detect when the player is holding the tool in their hand.
You can replace the line that deals with opening a GUI for anything else you’re planning to do.
And that should fix the issue, let me know if it isn’t what you intended.
EDIT:Fixed spelling errors and grammar.