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

why wont this script work?

Asked by
Benqazx 108
8 years ago
local function upright()
    local seat = script.Parent.Parent.ca.Value 
    local bg = Instance.new("BodyGyro",seat) 
    bg.MaxForce = Vector3.new(4000000,4000000,4000000)
    bg.P = 3000
    game.Debris:AddItem(bg,3.5)
end

this car is in a flip button that is for a car. so basically i want this button to do is that if the car is upside down or flip over and when u press flip it will put the car on its wheels. even if the player is not in the car if u press flip the car should flip on its wheels if it is upside down. but this script doesnt do that.

1 answer

Log in to vote
1
Answered by 8 years ago

.. You're putting the bodygyro in a value? O3o Also MaxForce isn't a property of Bodygyro, It's MaxTorque. I think this would work

local function upright()
    local seat = script.Parent.Parent 
    local bg = Instance.new("BodyGyro",seat) 
    bg.MaxTorque = Vector3.new(4000000,4000000,4000000)
    bg.P = 3000
    game.Debris:AddItem(bg,3.5)
end

0
ca may be an ObjectValue.. Wutras 294 — 8y
0
ca was object value. i forgot that it was a gui button so i forgot to add the mousebutton1click thing but ty for the maxtorque thing tho Benqazx 108 — 8y
Ad

Answer this question