So this script is supposed to make a textlabel visible above a vehicle that the player is trying to enter but it stops at line 9 and says “Attempt to index nill with Label” how do i fix this issue?
function SitRequest(name, state, input)
if (state ~= Enum.UserInputState.Begin) then return end
local player = game.Players.LocalPlayer
local seat = workspace:FindFirstChild(player.Name.."'s Car").DriveSeat
if (player.Character and player:DistanceFromCharacter(seat.Position) < 30) then
seat:FindFirstChild("EnterGUI").Label.Visible = true
seat:Sit(player.Character.Humanoid)
--wait(1)
--seat.EnterGui.TextLabel.Visible = false
end
end
game:GetService("ContextActionService"):BindAction(
"Sit",
SitRequest,
false,
Enum.KeyCode.E,
Enum.KeyCode.ButtonX
)