I am making a potion that boosts your strength. But there is a problem I’m trying to solve so that it would work, for some reason this script wont change the value of a certain numbervalue. (I cloned the potion from ReplicatedStorage and placed in the players backpack).
The problem is you said I can’t backtrack and in order for me to get the players character i have to say tool.Parent.Parent.Character which doesn’t work.
When your tool is equipped, the parent changes from the backpack to the player’s character in the workspace. To get your player’s character, you would say script.Parent, while the tool is equipped. You may also want to check that your tool has “handle required” on false, if you want to use your tool without a handle.
You should use a RemoteEvent, since ServerScripts can’t access the Player’s Children (PlayerGui, Stats)
The LocalScript could be in StarterPlayerScripts
Could you be a bit more clear on what didn’t work, like if there are any errors? Also, just in case, don’t forget that the first parameter of OnServerEvent is always the Player who fired the RemoteEvent.
Using serverscripts doesnt work in tools, but localscript does and what I’m trying to do involves the serverscript, it doesn’t give errors, and it wouldn’t even print anything.