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

How do I make a car spoiler use body position?

Asked by 9 years ago

I am trying to make a spoiler rise when my car does a certain speed. Here is my script, I am quite new but I need this on my car so please be patient with me.

local x = Script.Parent.Position
local y = Script.Parent.Position
local z = Script.Parent.Position
if Script.Parent.Parent.Parent.Chassis.VehicleSeat1.Speed == 10 
    then 
instance.new {BodyPosition,Parent}
script.Parent.BodyPosition.position = Vector3.new(x,y+1,z )
end

Please help me out! Thanks!

0
Add the Position properties, like x = script.Parent.Position.X, and please, that script isn't formatted as a Lua script. Tesouro 407 — 9y
0
^That hurts man :'/ Champion121212 22 — 9y

1 answer

Log in to vote
0
Answered by
wjs3456 90
9 years ago

You need to do what Tesouro said plus a few case sensitive things.

0n 04 it should be

if script.Parent

I think it needs to be on 06:

Instance.new

And then also it might have on 06:

(BodyPosition,Parent)

I'm sure other more experienced people will be able to help you out.

Ad

Answer this question