how to prevent exploiter to prevent RemoteEvent from firing?
and how to prevent exploiter to fire remoteevent without permission?
because I use to do a weapon so we need to enter character who will deal damage but @Asinphi said exploiter can enter will deal damage who too
what is the solution of this?
Put the local script into ServerScriptService with this script inside of it:
local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function()
local now = tick()
local resumePool
for thread, resumeTime in pairs(threads) do
local diff = (resumeTime - now)
if diff < 0.005 then
if not resumePool then
resumePool = {}
end
table.insert(resumePool, thread)
end
end
if resumePool then
for _,thread in pairs(resumePool) do
threads[thread] = nil
coroutine.resume(thread, now)
end
end
end)
local function fastWait(t)
local t = tonumber(t) or 1 / 30
local start = tick()
local thread = coroutine.running()
threads[thread] = start + t
local now = coroutine.yield()
return now - start, elapsedTime()
end
while true do
fastWait()
for i,player in pairs(game.Players:GetChildren()) do
if player.ClassName=="Player" and player.PlayerGui:FindFirstChild("nameofscript")==nil then
clone = script.Parent:Clone()
clone.Parent = player.PlayerGui
clone:FindFirstChild("Clone"):Remove()
end
end
end
“Clone” is the name of the script. The script constantly checks the PlayerGui of all players and if the script no longer exists within the PlayerGui, it clones it to their PlayerGui.
but i think exploiter will just remove the script on client side (I mean script that cloned)
So server can’t know because it doesn’t replicated to server…
This script constantly removes and clones the local script to the PlayerGui of all players. If your local script doesn’t include any wait()s, this (should) work fine.
In testing, this worked for a short anti-exploit local script I made containing just one function.
local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function()
local now = tick()
local resumePool
for thread, resumeTime in pairs(threads) do
local diff = (resumeTime - now)
if diff < 0.005 then
if not resumePool then
resumePool = {}
end
table.insert(resumePool, thread)
end
end
if resumePool then
for _,thread in pairs(resumePool) do
threads[thread] = nil
coroutine.resume(thread, now)
end
end
end)
local function fastWait(t)
local t = tonumber(t) or 1 / 30
local start = tick()
local thread = coroutine.running()
threads[thread] = start + t
local now = coroutine.yield()
return now - start, elapsedTime()
end
while true do
fastWait()
for i,player in pairs(game.Players:GetChildren()) do
if player.ClassName=="Player" then
if player.PlayerGui:FindFirstChild("nameoflocalscript")~=nil then
player.PlayerGui.nameoflocalscript:Remove()
end
clone = script.Parent:Clone()
clone.Parent = player.PlayerGui
clone:FindFirstChild("nameofclonescript"):Remove()
end
end
end
ok but what about how to prevent exploiter to prevent remoteevent from firing? and how to prevent exploiter to put argument because he can hurt anyone because it for deal damage in weapon.
From what I’m aware, it is impossible to stop exploiters from firing RemoteEvents. However, I believe you can have scripts to detect if a RemoteEvent is being fired too rapidly. Don’t use RemoteEvents for anything too important, such as money or purchases.
i have use script and i have modify something this is script i use
local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function()
local now = tick()
local resumePool
for thread, resumeTime in pairs(threads) do
local diff = (resumeTime - now)
if diff < 0.005 then
if not resumePool then
resumePool = {}
end
table.insert(resumePool, thread)
end
end
if resumePool then
for _,thread in pairs(resumePool) do
threads[thread] = nil
coroutine.resume(thread, now)
end
end
end)
local function fastWait(t)
local t = tonumber(t) or 1 / 30
local start = tick()
local thread = coroutine.running()
threads[thread] = start + t
local now = coroutine.yield()
return now - start, elapsedTime()
end
while true do
fastWait()
for i,player in pairs(game.Players:GetChildren()) do
if player.ClassName=="Player" then
if player.PlayerGui:FindFirstChild("WeaponGiver")~=nil then
player.PlayerGui.WeaponGiver:Destroy()
end
clone = game.ServerStorage.WeaponGiver:Clone()
clone.Parent = player.PlayerGui
end
end
end
i have fake this script to name WeaponGiver.
but this script working too fast
my script didn’t detects anything yet, and it got destroy and create new one
this is script inside my localscript
local char = game.Players.LocalPlayer.Character
local plr = game.Players.LocalPlayer
died = false
if not char:FindFirstChild("Humanoid") then
script:Destroy()
end
char.Humanoid.Died:Connect(function()
died = true
end)
repeat wait() while wait() do if char.Humanoid.WalkSpeed ~= 16 then if char.Humanoid.WalkSpeed ~= 30 then plr:Kick("Why cheating bro") print("kicked with speed " .. char.Humanoid.WalkSpeed ) end end if char.Humanoid.JumpPower ~= 50 then plr:Kick("Why you keep cheating") end end until die ==true
I think i have solution for to prevent exploiter to change walkspeed , jump power etc. now but i don’t know solution about the remote event yet anyway i’ll try to find solution with my self.
game.Players.GalaxySMediaXz.PlayerGui.ChildAdded:Connect(function(child) if child:IsA("LocalScript") then child:Destroy() end end)
so we can protect
it print this error
10:24:45.860 - Something unexpectedly tried to set the parent of WeaponGiver to NULL while trying to set the parent of WeaponGiver. Current parent is PlayerGui.