Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a car spoiler use body position?

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!

2 comments

0

Add the Position properties, like x = script.Parent.Position.X, and please, that script isn't formatted as a Lua script.

0

^That hurts man :'/

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.