I’m stumped. I’ve made a simple code to mount and dismount a vehicle using a ProximityPrompt, but the Steer and SteerFloat properties go insane if you input too quickly. After double tapping an input, it starts throwing false positives.
local seat = script.Parent.Parent ----- Vehicle seat
local function start(player)
task.wait()
print(seat.SteerFloat)
if seat.Occupant ~= nil then
start(player)
else
seat:SetNetworkOwner(nil)
script.Parent.Enabled = true
end
end
local function initialize(player)
seat:SetNetworkOwner(player)
seat:Sit(workspace:FindFirstChild(player.Name):FindFirstChildWhichIsA("Humanoid"))
start(player)
end
script.Parent.Triggered:Connect(function(player) ----- Proximity prompt
initialize(player)
end)
The output:
22:04:05.476 0 (x2) - Server - Script:5
22:04:05.531 1 - Server - Script:5
22:04:05.543 0 (x2) - Server - Script:5
22:04:05.587 1 - Server - Script:5
22:04:05.620 0 (x2) - Server - Script:5
22:04:05.660 1 - Server - Script:5
22:04:05.676 0 (x2) - Server - Script:5
22:04:05.726 1 - Server - Script:5
22:04:05.773 0 (x2) - Server - Script:5
22:04:05.834 1 - Server - Script:5
22:04:05.847 0 (x3) - Server - Script:5
22:04:05.900 1 - Server - Script:5
22:04:05.911 0 (x2) - Server - Script:5
22:04:05.945 1 - Server - Script:5
22:04:05.964 0 (x2) - Server - Script:5
22:04:05.995 1 - Server - Script:5
22:04:06.011 0 (x2) - Server - Script:5
22:04:06.043 1 - Server - Script:5
22:04:06.059 0 (x2) - Server - Script:5
22:04:06.092 1 - Server - Script:5
22:04:06.109 0 (x209) - Server - Script:5
???
EDIT: Even simplifying the script even more doesn’t work, with it parented to VehicleSeat, it still steers left and right without any input…
local seat = script.Parent
seat.Changed:Connect(function(property)
seat.Parent.FL.sc.TargetAngle = seat.SteerFloat * 45
seat.Parent.FR.sc.TargetAngle = seat.SteerFloat * 45
seat.Parent.rlt.HingeConstraint.AngularVelocity = seat.ThrottleFloat * 100
seat.Parent.rrt.HingeConstraint.AngularVelocity = -seat.ThrottleFloat * 100
end)
Does it have to be local??