Hihi, I’m quite new to scripting, I encounter many scripting issues but I always experiment it myself or asking a friend of mine who is a scripter.
I am currently trying to make a system that detects the speed of a vehicle that uses A-chassis. If the vehicle exceeded a certain speed, the system will give a warning sound and a icon will lit up.
The issue I’m facing right now is that I am unable to make the system detect the speed of the vehicle despite trying a few methods such as directly getting the speed from the GUI gauges which did not work. I’ve looked through DevForum where they said to use the Velocity of the vehicle or to use RayCast. However I could not reinterpret it into a script format as I have very less scripting experience. I’ve also tried asking my friend but he did not seem to understand it as well. I’ve already made part of the system like the warning sound and the lighting up of icon but it’s just the top part that is not working.
EDIT: [This system is in the vehicle and it’s part of the vehicle body.]
The script below is the current one I have now.
while true do
script.Parent.Value.Value = script.Parent.Parent.Parent["A-Chassis Tune"]["A-Chassis Interface"].AC6_Stock.Gauges.Speed.Text
if script.Parent.Value.Value >= 30 then
script.Parent.Speeding.BrickColor = BrickColor.new(134, 189, 71)
script.Parent.Speeding.Material = "Neon"
script.Parent.Speeding.Transparency = 0.5
script.Parent.Sound.Beep:Play()
wait(5)
script.Parent.Speeding.BrickColor = BrickColor.new(17, 17, 17)
script.Parent.Speeding.Material = "SmoothPlastic"
script.Parent.Speeding.Transparency = 0
else
script.Parent.Speeding.BrickColor = BrickColor.new(17, 17, 17)
script.Parent.Speeding.Material = "SmoothPlastic"
script.Parent.Speeding.Transparency = 0
end
end