Its not a local script so i did this:
player = script.Parent.Parent.Parent --my script is in a screenGui that's in StarterGui. Did i do it right?
Yes although scripts should generally never be located in screen GUI's it's a bad practice you should only use regular scripts inside Server sided environments not inside client (local) environments.
That way is Valid too, and useful for making coding shorter and easier. There are Different ways where you can get the player as well , And remember that the way I'm doing it with a LocalScript can not be operated with a Normal Script, same with a Normal Script.
local player = game.Players.LocalPlayer--this would get the LocalPlayer(you) and only works on a local script f.y.i
game.Players.PlayerAdded:connect(function(player)-- the player inside the Parenthesis, is the player that Joined(you, or some other player) --etc end)
These ways are a bit long, But if you want to make your coding easier then, you would use:
player = script.Parent.Parent.Parent--Easier :)