I need to get the player in order to make my script work however, I don´t know how to "get" the player from their mouse. Here´s my script.
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Tool.Equipped:Connect(function(player) player.Hidden.Tool.Value = 1 end) Tool.Unequipped:Connect(function(player) player.Hidden.Tool.Value = 0 end)
Tool.Parent would be your character, then use GetPlayerFromCharacter to get the player itself.
Alright, so, let's see
A tool should typically have a localscript, because those are the ones you should be using to interact with the client, so first things first move the code to a localscript.
After you have that, you can just use
local Player=game:GetService"Players".LocalPlayer
to figure out which player the script is running for, and then use remote events and functions where necessary in order to interact with the server.
I hope these wiki articles can help you get used to communicating between local and server scripts.
https://developer.roblox.com/en-us/articles/Converting-From-Experimental-Mode
https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events