Hello DevFourm, I need to add a debouce on this ServerScript. Could Someone help me?
local Event = game.ReplicatedStorage.ItemSpawn
local Item = game.ReplicatedStorage.Items.Cube
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local RootPart = Player.Character:WaitForChild("HumanoidRootPart")
script.Parent.MouseButton1Click:Connect(function()
Event.OnServerEvent:Connect(function(plr, position)
local ItemClone = Item:Clone()
ItemClone.Parent = workspace
ItemClone.Position = position
end)
end)
This is why I need a debounce:
It should be spawning once per click but it spawns more than once. I’m not familiar with denounces so could someone add them for me?
Thank you