Doing this again since the last answer failed. So I'm making this RC car system, controlled by a tool. When the player clicks the button in the GUI, it fires a RemoteEvent from a local script. In a server script, it responds to that RemoteEvent and regenerates it. But the problem is that when there's more than 1 player, the script causes massive duplication. I still have no idea why this is happening, or what is causing it.
SERVER:
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)
LOCAL:
script.Parent.MouseButton1Click:connect(function()
game.ReplicatedStorage.LowenherzRemotes.RegenLowenherz:FireServer()
end)

2 comments
Where is the Serverscript Located at?
Inside the GUIButton. Along with the LocalScript.