So, I'm trying to make something that when the player walks into the "Hitbox" a Gui in the player's Guis, will turn visible, and then when they walk out it goes back to visible = false.
function inHitbox(thing) local player = game.Players:GetPlayerFromCharacter(thing) player.PlayerGui.GetInCarGui.TextLabel.Visible = true if script.Parent.Hitbox.TouchEnded then player.PlayerGui.GetInCarGui.TextLable.Visible = false end end script.Parent.Hitbox.Touched:connect(inHitbox)
It doesn't work..... Help me? I tryed other things and the output says nothing.
script.Parent.Hitbox.Touched:connect(funciton(Part) if Part.Parent and Part.Parent:findFirstChild("Humanoid") and game.Players:findFirstChild(Part.Parent.Name) then local player = game.Players:GetPlayerFromCharacter(thing.Parent) player.PlayerGui.GetInCarGui.TextLabel.Visible = true repeat wait(0.1) until player:DistanceFromCharacter(script.Parent.Hitbox.Position) > 0-- Put a number here player.PlayerGui.GetInCarGui.TextLable.Visible = false end end)