My friend gave me this, and i put it in the tool script, but when i test it says player is a nil value
local Tool = script.Parent local Player = game.Players:findFirstChild(Tool.Parent.Name)
The script running should be a LocalScript.
If the script is a LocalScript, then we can ask for the LocalScript to find the LocalPlayer executing the script.
local PlayerHoldingTheTool = game.Players.LocalPlayer local PlayerName = PlayerHoldingTheTool.Name
PlayerHoldingTheTool is the LocalPlayer himself. PlayerName is his name.
If this helped, accept the answer! Hope this helped!