Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix this script so the VehicleSeat can work?

Asked by 9 years ago

So I found this Hovercraft and the whole script works but the DriverSeat (Vehicle Seat) Does not work and I tried to fix it but having a hard time... I tried to change the settings in the VehicleSeat but that does not work. It seems like it's missing a few things in the script to fully function better.

What's not happening is that it's not letting me drive but the hover function is working just not the driving part.

Hierarchy

Script

local Maxheight = 4

local Maxspeed = 10

local vehicle = script.Parent
local seat = vehicle.Functional.DriverSeat
local main = vehicle.Functional.Main
local t1 = vehicle.Functional.Thruster1
local t2 = vehicle.Functional.Thruster2
local t3 = vehicle.Functional.Thruster3
local t4 = vehicle.Functional.Thruster4


function Raycast()
    local ray1 = Ray.new(t1.CFrame.p, Vector3.new(0,-100,0))
    local hit1, hitpos1 = game.Workspace:FindPartOnRay(ray1, t1)
    local ray2 = Ray.new(t1.CFrame.p, Vector3.new(0,-100,0))
    local hit2, hitpos2 = game.Workspace:FindPartOnRay(ray2, t2)
    local ray3 = Ray.new(t1.CFrame.p, Vector3.new(0,-100,0))
    local hit3, hitpos3 = game.Workspace:FindPartOnRay(ray3, t3)
    local ray4 = Ray.new(t1.CFrame.p, Vector3.new(0,-100,0))
    local hit4, hitpos4 = game.Workspace:FindPartOnRay(ray4, t4)
    print("all rays created")

    t1.BodyPosition.position = hitpos1 + Vector3.new(0,Maxheight,0)
    t2.BodyPosition.position = hitpos2 + Vector3.new(0,Maxheight,0)
    t3.BodyPosition.position = hitpos3 + Vector3.new(0,Maxheight,0)
    t4.BodyPosition.position = hitpos4 + Vector3.new(0,Maxheight,0)
end

Raycast()
0
Saying that something does not work is not very helpful. Please explain what "working" means (tell us what the expected behavior is) and tell me what "not working" means (tell us what is actually happening instead). We have no idea how to help fix your code if we have no idea how it is supposed to work. Unclear 1776 — 9y
0
I edited the post with what's happening the hover function works but not letting anyone drive though it's stuck just hovering. Anciteify 70 — 9y

Answer this question