Hello there! I have just created a system kill everyone in my admin area but also to log it in my discord server the problem is that the code gets repeated 5 - 6 times in my discord. I've tried multiple sulutions like putting a wait but that doesn't work.
Here is my code:
local part = script.Parent; local http = game:GetService("HttpService"); local Players = game:GetService("Players"); part.Touched:Connect ( function (hit) local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid"); if humanoid then local player = Players:GetPlayerFromCharacter(hit.Parent); player:LoadCharacter() local Data = { ["content"] = player.Name.." was detected in the admin system!" } Data = http:JSONEncode(Data) http:PostAsync("NOT IMPORTANT!", Data) end end)
add debounce.. rewrite it like this:
local part = script.Parent; local http = game:GetService("HttpService"); local Players = game:GetService("Players"); local db = false part.Touched:Connect ( function (hit) if(db) then return end db = true local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid"); if humanoid then local player = Players:GetPlayerFromCharacter(hit.Parent); player:LoadCharacter() local Data = { ["content"] = player.Name.." was detected in the admin system!" } Data = http:JSONEncode(Data) http:PostAsync("NOT IMPORTANT!", Data) end wait(2) db= false end)