Is there a way to slow down the player from pushing the button real fast like a delay?
local Main = script.Parent:FindFirstChild('Main') local Test = Main.Glass:FindFirstChild('Test') -- This is a screen gui Button Test.MouseButton1Down:connect(function() local rS = game:GetService("ReplicatedStorage") local remote = rS.EventsBlocks:WaitForChild("Test1") remote:FireServer() end)
you need a debounce and to get that you type the following
debounce = false if not debounce then debounce = true wait(the time u want to wait in here) debounce = true
here is the full script if u dont understand
local Main = script.Parent:FindFirstChild("Main") local Test = Main.Glass:FindFirstChild("Test") debounce = false Test.MouseButton1Down:Connect(function() if not debounce then--this will see if debounce is false and if it is then it will run debounce = true--this sets the debounce to true so the function cant be run again local rS = game:GetService("ReplicatedStorage") local remote = rS.EventsBlocks:WaitForChild("Test1") remote:FireServer() wait(time in here) debounce = false--after the time set debounce will return to false so the function can run end)
also when you attempt to find the first child you dont use ' instead you use "