#how do i make a serversided debounce for when summoning my stand?

1 messages · Page 1 of 1 (latest)

dim rover
#

i got no idea how, imma send screenshots of my scripts

#

^^^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

keen agate
#

):FindFirstChild("StandDatabase")) you can't really do that you have to make a local StandDataBase = replicatedStorage.StandDataBase

buoyant sleet
#

add a boolean for each player added

neat relic
#

obviously the player can be stated differently

#

as long as its the actual player

dim rover
#

I wanted to download sum uncopylocked games that got leaked to study how devs approach this

#

aswll

buoyant sleet