So I made this script inside a VehicleSeat for a vehicle I'm making. I'm trying to acces the players PlayerGui to set a Gui to visible. After some research on this very site I found the best way of doing this was to use "game.Players:GetPlayerFromCharacter()". However, after the script does this, it refuses to do anything else
Script code:
local Player = game.Players:GetPlayerFromCharacter(script.Parent.Occupant.Parent)
print("ANYTHING")
To simplify my problem, this is the code. It does not actually print anything. Nothing after line 1 works, including things involving the "Player" variable. I have tried "while true do" loops, functions, but nothing seems to give any output.
I use "script.Parent.Occupant.Parent" because "script.Parent.Occupant" would give me the Humanoid of the player, not the player itself.
I have another script in this VehicleSeat, which also uses GetPlayerFromCharacter, this script does give an output, but is only able to acces the GUI itself, and not any objects inside of it???
Can someone please explain to me why the first script will not do anything after line 1?

2 comments
It did help! Thanks
Glad to hear it helped, but could you mark my answer as correct please?