isnt there a way to make a function run once as example the backpack is a folder and if something gets added into it a function runs ? is that possible ?
Mhm! There is. You can use ChildAdded
in the Backpack.
would it be something like
local PlayerBackpack = script.Parent
PlayerBackpack.ChildAdded:connect(function(plr)
if Child.Name = InvisibleItem then
plr.Kick(StopExploitingNerd)
end
The parameter of ChildAdded
is the child that was added.
can the function not also get the player so it can kick the player when the invisible item was found in the exploiters backpack
This will not work since the exploit is client-side. Even if you detect the tools being added on the client that can easily be disabled by the exploiter.
Just because it wonât work doesnât mean you shouldnât add. Not all exploiters have the tools to disabled/delete these scripts.
I prefer a small fence than no fence.
A solution like that is neither practical or useful. The logical solution to this problem would be simply to check if the player has the tool on the server.
How. ? im not a experienced scripter.
Could it be also when a player gets a tool before he gets a tool that a event is being fired ? or a remote is being fired as it would go client â server â client ?.
and if that would be a good solution idk how to code it oof im really helpless in at this point
when i look at the steal tool exploits they use the âfindclassâ parameter to only steal tools so my idea wouldnt work cause it dosent steal the whole backpack what i thought at first
The only way the exploiter would benefit is having a tool with no server-side checks.
Here is a quick example of how you would implement a check.
--LocalScript
local Tool = script.Parent
local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
Tool.Activated:Connect(function()
RemoteEvent:FireServer() --Fires an event when the Tool is Activated
end)
--ServerScript
local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
RemoteEvent.OnServerEvent:Connect(function(Player)
if Player.Character:FindFirstChild("BloxyCola") then -- Checks if "BloxyCola" is equipped
--Code here
end
end)
oh okey but what if i have different tools with different names do i have to always do findfirstchild ???
oh wait my bad im stupid. I have to place the local and the serverscript in the tool right ? so that means i just have to replace the name bloxycola depending on the tool its inside
If the tools use the same RemoteEvents
you could either make a table and iterate through it or check multiple statements. For example:
--ServerScript
RemoteEvent.OnServerEvent:Connect(function(Player)
if Player.Character:FindFirstChild("BloxyCola") or Player.Character:FindFirstChild("Pizza") then
--Code here
end
end)
just to make sure the local and the severscript i have to place in the tool right ? or can i place the server script in serverscriptservice
You can place the serverscript in ServerScriptService
(the preferred place to place them).
yo bro thanks man. I just tested the script what i added to the serverscript is that if the tool is not found the player gets kicked and i tested it and i got kicked.
im just worried that exploiters also can fire remoteevents ? oof is there a way for the exploiter to go around this security ?