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

How do i make my seat be destroyed WITH my boat?

Asked by 7 years ago
Edited 7 years ago

Currently when im testing in Studio, whenever i shoot at a test-boat to see how it destroys, the seat still continues to function perfectly fine even though everything around it is completely obliterated (i kinda made the power of my test-cannons a pretty high as well...the Force is about... 18,000,000... lol)

Here is the boat script i have:

seat = script.Parent

gyro = seat.BodyGyro

pos = seat.BodyPosition

vel = seat.BodyVelocity


pos.position = seat.Position

gyro.cframe = seat.CFrame

speed = 0

ready = true

wait()

seat.Anchored = false


function move(property)

if property == "Steer" then

    if not ready then

        return

    end

    ready = false

    steer = seat.Steer

    while steer ~= 0 do

        steer = seat.Steer

        if steer == 1 then

            gyro.cframe = gyro.cframe * CFrame.fromEulerAnglesXYZ(0,-.1,0)

        elseif steer == -1 then

            gyro.cframe = gyro.cframe * CFrame.fromEulerAnglesXYZ(0,.1,0)

        end

        wait()

        vel.velocity = seat.CFrame.lookVector * speed

    end

    ready = true

elseif property == "Throttle" then

    throttle = seat.Throttle

    while throttle ~= 0 do

        if throttle == 1 and speed < seat.MaxSpeed then

            speed = speed + 1

        elseif throttle == -1 and speed > 0 then

            speed = speed - 1

        end

        wait()

        vel.velocity = seat.CFrame.lookVector * speed

    end

end

end


seat.Changed:connect(move)

1 answer

Log in to vote
0
Answered by
Bertox 159
7 years ago

Group the Boat with your seat and then

seat.Parent:Destroy()
0
So....where exactly? I already have them grouped and stuff, cause thats the first thing i tried.... When simply i pasted that into my script, all it did was destroy the boat as soon as spawned Pilot13579 0 — 7y
Ad

Answer this question