For some reason when this regenerate script runs, it duplicates the car by amount of players. How do I stop this annoying thing?
model = game.Workspace.Lowenherz -- Change "Compressor" to the name of your model. new = model:clone() enabled = true game.ReplicatedStorage.LowenherzRemotes.RegenLowenherz.OnServerEvent:Connect(function() if enabled then model:Destroy() script.Parent["Car Ignition Startup"]:Play() enabled = false wait(0.3) -- This is how long it will take to regen model = new:clone() model.Parent = game.Workspace wait(5) -- This is how long it will take for the regen button to be enabled after being used enabled = true end end)
Try this, it might take some adjustments.
local model = game.Workspace.Lowenherz game.ReplicatedStorage.LowenherzRemotes.RegenLowenherz.OnServerEvent:Connect(function() local enabled = true if enabled == true then local new - model:Clone() model:Destroy() enabled = false wait(3) model = new model.Parent = game.Workspace wait(5) enabled = true end end)