Hey!
Today while making a script for A-chassis car we faced some very weird bug. We have a script that should be moving the spirit of Ecstasy up and down depending is the Engine on or off. Script:
-- Siromanets was here
script.Parent.Anchored = false
local PositioningWeld = script.Parent.PositioningWeld
local UpPosition = PositioningWeld.C0
local TweenService = game:GetService('TweenService')
local WaitTime = 1.5
local TInfo = TweenInfo.new(WaitTime, Enum.EasingStyle.Linear)
local Debounce = false
local function CheckEngineState()
local Engine = script.Parent.Parent.Parent.Parent.Parent.DriveSeat.Engine
if Engine then
if Debounce then return end
Debounce = true
local EngineState = Engine.Value
if EngineState == true then
print("Engine is ON")
TweenService:Create(PositioningWeld, TInfo, { C0 = CFrame.new(0, 0, 0) }):Play()
elseif EngineState == false then
print("Engine is OFF")
TweenService:Create(PositioningWeld, TInfo, { C0 = UpPosition }):Play()
end
Debounce = false
else
print("Engine Not Found")
end
end
while true do
CheckEngineState()
print("Checking Engine State")
task.wait(1)
end
Video on which you can see that both Engine and IsOn value are on however the script says that Engine is off: Watch 2024-11-08 18-32-50 | Streamable