I'm currently trying to script a keyboard-controlled plane with KSP controls, but I can't get it to detect when you've entered the seat, and it won't print, no errors or anything.
local RS = game:GetService("RunService")
local VS = script.Parent.VehicleSeat
local Base = script.Parent.Base
Throttle = 0
active = false
local bv = Instance.new("BodyVelocity",Base)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = Base.CFrame.lookVector * Throttle
local bg = Instance.new("BodyGyro",Base)
VS.ChildAdded:connect(function()
if (VS:findFirstChild("SeatWeld")) then
local p = game.Players:GetPlayerFromCharacter(VS.SeatWeld.Part1.Parent)
if not p then return end
active = true
end
end)
I also tried checking for a property change for Occupant, no luck. Any way to fix this + detect keyboard presses from the player who's in the vehicle seat?
