#how do i make a serversided debounce for when summoning my stand?
1 messages · Page 1 of 1 (latest)
^^^Server Sided^^^
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
local CallHumanoidEvent = game:GetService("ReplicatedStorage"):FindFirstChild("HumanoidEvents"):FindFirstChild("CallStand")
local CallNonHumanoidEvent = game:GetService("ReplicatedStorage"):FindFirstChild("HumanoidEvents"):FindFirstChild("CallStand")
local ForceUncall = game:GetService("ReplicatedStorage"):FindFirstChild("ForceUncall")
local StandDatabase = require(game:GetService("ReplicatedStorage"):FindFirstChild("StandDatabase"))
local debounce = false
local IsSummoning = true
local UserStand = char:FindFirstChild("Stand").Value
UIS.InputBegan:Connect(function(input, isbusy)
if isbusy then return end
if debounce then return end
if IsSummoning then
if input.KeyCode == Enum.KeyCode.Q then
if StandDatabase.IsHumanoid(UserStand) then
CallHumanoidEvent:FireServer(true)
end
if not StandDatabase.IsHumanoid(UserStand) then
CallNonHumanoidEvent:FireServer(true)
end
IsSummoning = false
debounce = true
task.wait(1.5)
debounce = false
end
elseif not IsSummoning then
if input.KeyCode == Enum.KeyCode.Q then
if StandDatabase.IsHumanoid(UserStand) then
CallHumanoidEvent:FireServer(false)
end
if not StandDatabase.IsHumanoid(UserStand) then
CallNonHumanoidEvent:FireServer(false)
end
IsSummoning = true
debounce = true
task.wait(1.5)
debounce = false
end
end
end)
^^^local^^^
some variables are messed up because roblox studio didnt load my last script save
the system itself that I did does not matter whatsoever
what matters is that i have no idea how to implement a server sided debounce which stops a guy that is exploiting from spamming abilities if i were to make a similar system for abilities
):FindFirstChild("StandDatabase")) you can't really do that you have to make a local StandDataBase = replicatedStorage.StandDataBase
Create an empty table
add a boolean for each player added
local standDebounce={}
game.Players.PlayerAdded:Connect(function(player)
if standDebounce[player]==nil then
standDebounce[player]=false
end
end)```
obviously the player can be stated differently
as long as its the actual player
is that rlly the way
I wanted to download sum uncopylocked games that got leaked to study how devs approach this
aswll
Wym is that rlly the way