Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Where to put Number Values Inside a Player to be Accessed from Scripts in a Tool?

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!

1 comment

0

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

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.