So I'm trying to make a floating boat simple alright. But I think while true do loop is going to lag the place up with lots of them. So I'm looking for a simpler/cleaner way to do this opinions?
I've tryed do a function but it didn't work what am I doing wrong?
seat:FindFirstChild('SeatWeld'):connect(function() end)
local seat = script.Parent local loc = script.Parent.Parent local base = loc:WaitForChild('Base') local bodygyro = base:WaitForChild('BodyGyro') local bodyvelocity = base:WaitForChild('BodyVelocity') local bodyposition = base:WaitForChild('BodyPosition') bodyposition.Position = base.Position -- adjusting :P base.BodyGyro.CFrame = base.CFrame value1 = 7 while true do wait() local speed = seat.MaxSpeed local turnspeed = seat.TurnSpeed if seat.Throttle== 1 then if value1 < speed then value1 = value1+1 end bodyvelocity.Velocity = base.CFrame.lookVector*value1 end if seat.Throttle == 0 then value1 = 0 bodyvelocity.Velocity = base.CFrame.lookVector*value1 end if seat.Throttle== -1 then if value1<14 then value1 = value1+1 end bodyvelocity.Velocity = base.CFrame.lookVector*-value1 end if seat.Steer == 1 then bodygyro.CFrame = bodygyro.CFrame * CFrame.fromEulerAnglesXYZ(0,-(turnspeed),0) end if seat.Steer == -1 then bodygyro.CFrame = bodygyro.CFrame * CFrame.fromEulerAnglesXYZ(0,turnspeed,0) end end