I am trying to make a part rotation to stay 0,0,-90 and if it’s not then I want the part to flip back to 0,0,-90. When I try this read lines appear and I don’t. know way. Can someone help me out.
-- SERVER SCRIPT LOCATED IN PART
-- <<VARIABLES>>
local part = script.Parent
local runService = game:GetService("RunService")
-- <<FUNCTIONS>>
-- Function to continuously update part's velocity, simulating deceleration
local function updateVelocity()
if part.Rotation == 0,0,-90 then
return end
if part.Rotation not == 0,0-90 then
part.Rotation = 0,0,-90
end
end
-- <<CONNECTIONS>>
runService.Heartbeat:Connect(updateVelocity) -- Connect the updateVelocity function to the Heartbeat event