Problem is in the script.
function inHitbox (p) p.Player.PlayerGui.GetInCarGui.TextLabel.Visible = true --Heres the problem, when I do "p.Player" I'm trying to get to the player of the, the player is the "game.Player", it works to get from the player to the model, but using player.character but I wanna get from the model to the player. if script.Parent.Hitbox.TouchEnded then return(7) p.Player.PlayerGui.GetInCarGui.TextLabel.Visible = false end end script.Parent.Hitbox.Touched:connect(inHitbox)
There is a function of game.Players
called GetPlayerFromCharacter
that takes in arguments of the character you're getting the player of.
script.Parent.Hitbox.Touched:connect(function(p) --Get the player local plr = game.Players:GetPlayerFromCharacter(p) --Check if player exists if plr then plr.PlayerGui.GetInCarGui.TextLabel.Visible = true --Wait for the TouchEnded event to fire script.Parent.TouchEnded:wait() plr.PlayerGui.GetInCarGui.TextLabel.Visible = false end end)