I usually have used game.Players.LocalPlayer
while I'm trying to connect to the player from workspace. While this for some reason only works in - studio. If you could I would really like some other way to connect to the player.
game.Players.LocalPlayer
only works in a local script. Anyway there is another way to get the player. You could use the function :GetPlayerFromCharacter()
In the () you put the character of the player. For example :
local tool = script.Parent --tool local char = tool.Parent --the player's character local player = game.Players:GetPlayerFromCharacter(char) -- this get the player that has this tool
Remember you can use :GetPlayerFromCharacter()
for anything, it doesn't have to be a tool.