I made a shotgun. It has a number value inside the shotgun which is the ammo. The shotgun has ammo, and ammopool. I want ammopool to be increased when a player clicks a part in workspace. However, I wish for ammopool to be inside the player so even if the player drops the tool or switches tool the ammopool will stay with the player. I just need to know where would I put the Number Value and how would I reach it inside a script? Thank you!
✓ ANSWER ACCEPTED
Where to put Number Values Inside a Player to be Accessed from Scripts in a Tool?
1 answer
✓ Accepted answer
Personally, I would recommend the player. If you're using a localScript (and you should be) you can just do game.Player.LocalPlayer:FindFirstChild("Ammo") you could also put it inside the player backpack, and use a series of script.Parent's to get to it, but in my opinion, the former looks nicer.
As for using a ServerScript, don't, because you seem to be trying to get player input.
1 comment
0
I know I need to put it in the player, but like exactly where? starterPlayer?
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Just anywhere in the player, absolutely anywhere is perfectly fine, as long as you make sure that it can stay there.