0% found this document useful (0 votes)
4 views1 page

Vehicle Steering and Acceleration Script

The document contains a script for controlling a vehicle in a game environment. It defines variables for the vehicle's seat and wheels, sets steering and speed parameters, and includes functions to adjust the steering angle and motor velocity based on user input. The script responds to changes in the vehicle seat's steering and throttle properties to manipulate the front and back wheels accordingly.

Uploaded by

lipagu.dev
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Vehicle Steering and Acceleration Script

The document contains a script for controlling a vehicle in a game environment. It defines variables for the vehicle's seat and wheels, sets steering and speed parameters, and includes functions to adjust the steering angle and motor velocity based on user input. The script responds to changes in the vehicle seat's steering and throttle properties to manipulate the front and back wheels accordingly.

Uploaded by

lipagu.dev
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- variables

local seat = [Link]


local backLeft = [Link]
local backRight = [Link]
local frontLeft = [Link]
local frontRight = [Link]

-- ángulo de giro
local steerAngle = 30

-- la velocidad del coche


local speed = 60

-- una función que gira el coche cada vez que se pulsan las teclas de ajuste del
teclado

-- una función que acelera y desacelera el coche cada vez que se pulsan las teclas
de ajuste del teclado
seat:GetPropertyChangedSignal("Steer"):Connect(function()
[Link] = steerAngle * [Link]
[Link] = steerAngle * [Link]
end)

seat:GetPropertyChangedSignal("Throttle"):Connect(function()
[Link] = speed * [Link]
[Link] = speed * -[Link]
[Link] = speed * [Link]
[Link] = speed * -[Link]
end)

You might also like