I'm working on making an ammo box and I wasn't quite sure on how to access the specific person that touched the box in order for me to be able to access the gun that that person is holding and ammo to the IntValue that is a child of the tool. I know that while the tool is equipped, it enters the player's model in the workspace, but I don't know how to get to that character without using the name of the model, which obviously I won't be able to do while the game is running and for every character. I tried making the variable of "player = game.Players.LocalPlayer" in both server and local scripts, but nothing was able to work. I used the .Touched event and connected the function that I made to change the IntValue but had no result at all. --Sorry if I wasn't specific enough or didn't include something important this is my first post :)
You can use
local player = game.Players.LocalPlayer.Character
to get the players character