I am making a script that activates night vision, and for the time being I had it set up for me so I could test it out. Now that I am done and finished, how do I make it so it looks for the local player instead of me?
script.Parent.MouseButton1Down:connect(function(click)
if script.Parent.Parent.Parent.vision.Visible == true then
game.Workspace.ReeseTP.Face.NVG5On.Light.Enabled = false
elseif script.Parent.Parent.Parent.vision.Visible == false then
game.Workspace.ReeseTP.Face.NVG5On.Light.Enabled = true
end
end)

4 comments
"LocalPlayer" is a property of the "Players" service. All you need to do is get the "Players" service and access the LocalPlayer property. local players = game:GetService("Players"); local player = players.LocalPlayer.
It's pretty straightforward. This needs to be a LocalScript for the LocalPlayer property to be accessible. Also, the ":GetService("service")" method of "game" is recommended, especially on the client.
Thanks Phlegethon!
No problem! Be sure to put [Solved] in your title so people know that you don't need help anymore.