In this script, I'm creating a bodygyro to fix a flipped car. In studio, it works fine, but in game the gyro doesn't delete itself.
I've tried :Destroy(), game.Debris:Additem(), and setting the gyro's stats to 0.
local Gyro = Instance.new("BodyGyro",Car.VehicleSeat) Gyro.MaxTorque = Vector3.new(9999999,0,0) Gyro.D = 500 Gyro.P = 3000 wait(1) game.Debris:AddItem(Gyro,1)
Any help would be appreciated.
EDIT:
I think I found the issue. With a wait() in between spawning and deleting the gyro, it never got deleted for some reason. Deleting that fixed it.
Perhaps the game hasn't registered Debris as a service? Try changing line 9 to:
game:GetService('Debris'):AddItem(Gyro, 1)