1. What do you want to achieve? Keep it simple and clear!
Hello! First time posting here! Basically, I’ve been trying to write a script where:
If I click a certain part, existing in the workspace (in this case a tea model) it goes transparent and it goes into my inventory, and if I click on the same spot again it reappears!
2. What is the issue? Include screenshots / videos if possible!
My issue is that I cannot figure out how to progress from here, (oh and also the effects don’t disappear when I set their rot speed to ungodly amounts to make them disappear when clicked)
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve looked on the dev forum many times, at different scripts and I still haven’t been able to figure out anything
By reading your script, I’ve not seen the part giving the tea, in your place I would use Clone() on a tool in server storage because it appears that’s where you placed it and put the Parent property of the clone to the player’s backpack, the MouseClick event returns the player making that finding the player would not be a problem.
About the putting back the tea part you can check if he haves the tea by using the boolean you made and use Destroy() to take the tea back.
Thanks a lot! I’ve made some progress but once again I’ve gotten stuck at the cloning part specifically cloning the Tea into the backpack , here’s what the script looks like now:
I’ve done some research and some people say that it needs to run inside a local script to work, some don’t.
Also I don’t think it’ll help but the script worked once the TeaClone.Parent was set to StarterPack, only problem that I had was that I had to reset to get the Tea.
Your variable playerer is nil because calling LocalPlayer only works from a local script. You should be able to remove that line altogether and then just change the first line of your Connect function like so: