So I am making this in a client script and you can’t use :Sit on client so I made this:
local VehicleSeat = script.Parent.Parent
local FlyPrompt = VehicleSeat:WaitForChild("FlyPrompt")
local function Sit(player)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
local weld = Instance.new("Weld")
weld.Part0 = HumanoidRootPart
weld.Part1 = VehicleSeat
weld.Parent = HumanoidRootPart
humanoid.Sit = true
end
FlyPrompt.Triggered:Connect(function(player)
Sit(player)
end)
VehicleSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
if VehicleSeat.Occupant then
FlyPrompt.Enabled = false
else
FlyPrompt.Enabled = true
end
end)
But now there is a problem because the occupant would still be nil so how can I set the occupant to the humanoid?