1.geting the MPH of my a-chassis car and making the DR “driveshaft” to spin at that speed
2. What is the issue?robloxapp-20200518-2249114.wmv (2.6 MB)
it doesent move when i start driving the car it stays put when i want it to move
3. What solutions have you tried so far?
i spent my hole afternoon on the dev hub and then back on studio multiple times nothing seems to be helping
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
my first attempt fail
-- script.Parent.Parent["A-Chassis Interface"].Values.Horsepower.Value.Changed:Connect(function(t)
--script.Parent.Parent.Parent.Misc.DR.move.AngularVelocity = t
--end)
my seccond attempt
--while true do
--script.Parent.Parent.DriveSeat.Torque.Changed:Connect(function(NewValue)
-- print(NewValue)
-- script.DR.move.AngularVelocity = (NewValue)
--end)
--wait(5)
--end
if you guys want you can take the model and see if there is any problems with the model
What Model? You didn’t post a link or the model itself.
If you don’t care about the actual rotational direction just use the magnitude of the Part. Put a Driveshaft with a HingeConstraint in it attached to the frame with the ActuatorType set to Motor and put this script into it to make it spin faster depending on the driveshaft’s speed:
local driveshaft = script.Parent.HingeConstraint
while true do
…wait(.1)
…driveshaft.AngularVelocity = script.Parent.Velocity.Magnitude
end
Let me analyze your script first so you can see what you did wrong.
script.Parent.Parent["A-Chassis Interface"].Values.Horsepower.Value.Changed:Connect(function(t)
You’re checking how much horsepower the car is producing, not at which speed the car is going.
This line is also wrong - Values.Horsepower.Value.
You don’t need the .value part to check if a IntValue changed.
script.Parent.Parent.Parent.Misc.DR.move.AngularVelocity = t
Since the gui gets parented to the player, you’re actually checking the parent of PlayerGui and not the car itself.
At the end, your script should look like this:
local car = script.Parent.Car.Value
script.Parent.Parent[“A-Chassis Interface”].Values.Velocity.Changed:Connect(function(t)
car.Misc.Script.DR.move.AngularVelocity = t.magnitude
car.Misc.Script.DR.move.MotorMaxTorque = t.magnitude
end)
Hope this helps you, and sorry for the bad formatting.
evrything in a-chassis interface is put into player gui so now it cant find it i gess
also the values only change in the player gui so i tryed getteng it from the drive sseat no luck im about to try and get the script to find the car itsself
The new script should replace the already existing driveshaft script, since I just modified it.
I also use the .magnitude to get the speed of the car, since the velocity value of the A-Chassis is a Vector3.
problem
script.Parent.Parent[“A-Chassis Interface”].Values.Velocity.Changed:Connect(function(t)
it would need to be like this to get to that XD
script.Parent.Parent[“A-Chassis Tune”][“A-Chassis Interface”].Values.Velocity.Changed:Connect(function(t)
and on start the car value is set to the name of the model by the script called drive