So you can spawn in a car as a player using a GUI button, but I've accidentally spawned 2 cars clicking the button.
Script in ServerScriptService
game.ReplicatedStorage.DuneBuggy.OnServerEvent:Connect(function()
local endPosition = Vector3.new(23.473, 25.199, -151.075)
local model = game.ServerStorage.DuneBuggy:Clone()
local cframe = model.PrimaryPart.CFrame
model.Parent = game.Workspace
model:SetPrimaryPartCFrame(cframe * CFrame.Angles(0,math.rad(180),0))
model:MoveTo(endPosition)
end)
Basically the RemoteEvent got fired twice and caused 2 cars to spawn. Any way to prevent this? I added a debounce script to the GUI button but still managed to spawn the car twice.

4 comments
Is it actually a button that you click or is it something you walk on like a spawner pad?
GUI BUTTON
TEXTBUTTON
Can you include the Local Script that's firing the Event? As the problem seems to be in there as it's firing the event repeatedly.