How do you track client memeoy

Old thread / question, please delete.

1 Like
3 Likes

I’m pretty sure you can find a solution when googling this.

It would be impossible to tell if someone is “hacking” (it’s actually called exploiting) by using this.
You should not implement this as their memory may change at any time, it also depends on the client.

3 Likes

I know, that’s why I’m going to add other checks not just memory, but I want to start with mem checks.

I’m assuming you’re planning on a client-sided anticheat? I wouldn’t recommend that.
Any exploiter can disable and remove your script completely.

You can’t even detect that as they have the ability to do certain tasks at the same time.
They don’t even need a LuaSourceContainer | Documentation - Roblox Creator Hub to execute their code.

1 Like

I know about anti-cheats, that’s actually what I do I make anti-cheats, I have already a client-side and server-side in my game because some exploits can only be detected by the client-side such as this, and yes I know they can use external programs but very few exploiters will go to that extent to exploit and I don’t really care about those. What I am asking for is how to detect when client mem usage goes past a certain number and when that is triggered my anti-cheat will start scanning for exploits such as fly, speed, noclip, GUI’s, and more.

Missing an end, this only runs once, ineffective solution to cheating.

1 Like

@RageOfficial_Support - I’m pretty sure your lack of end would have displayed within the Studio output.

I advise checking Studio output to try and find any errors before asking for support.

With that, another thing I do is add print functions all around my code if something breaks and nothing is displaying in the output. That way I can determine where the script has broke.

Umm I dont think its memeoy :flushed:

You can view roblox devhub but its not enough,
You have to get all memory usage as MB and collect them all then divide them by 2 so you can get a stable memory usage and detect memory hops.

What I mean is get the total or get the stats frequently and detect hops also DO NOT KICK THEM just teleport them back to same place, same location so any CoreGui exploit will be cleared.

1 Like

Dont run this in a loop, it will fill your memory and kick you for no reason. Try getting total of memory usage in every 10 seconds and do not kick them, teleport them to same place so your game will not give false positives, and detect memory hops

1 Like

Never trust the client.

Any exploiter has this ability, so you shouldn’t be like “Yeah but very few know this”.
That is false.
Everyone who is able to exploit (which is a lot, simply google it and download a software), is able to counter your client-sided code.

If you have any RemoteEvents, secure them on the server-side.

1 Like

I wouldn’t suggest kicking players based on high memory usage, but it’s your game so…

local StatsService = game:GetService("Stats")

local totalMemoryUsage = StatsService:GetTotalMemoryUsageMb()
if totalMemoryUsage = > 700 then
    Player:Kick("Suspected hacks")
end
3 Likes

Please read the full thread. I don’t only kick for memory once the memory limit is triggered my anti-cheat will run scans on the players and make sure they are not cheating. Those factors all have to be flagged in order for the anticheat to ban them and theres no such thing as a “false ban” with my anticheat because it does multiple checks client and serversided, and thanks for the telling me about the end I make silly mistakes some times.

I said very few know how to use external programs that are uncatchable. smh please read it carefully.

I will try that approach, thanks.

Would this work as a loop?
If I added wait loops or while and for loops?

I use this method in my anti exploit script for my game (which is not released yet). Apparently its not such a good way of handling exploiters as this could kick innocent players, personally I’m willing to sacrifice innocent players so exploiters cant steal my assets.
I made sure to make it server sided so I check for the Player.PlayerAdded
(Also this is my first ever devforum post)
Hope this helps!
Please send feedback.

game.Players.PlayerAdded:Connect(function(player)
while true do
wait(5)
if game:GetService(“Stats”):GetTotalMemoryUsageMb() > 700 then
print(“Suspicious activity detected!”,player.Name)
player:kick(“Suspicious activity detected!”)
end
end
end)

Mark this post as solution if this answered your question.

EDIT: Make this in a server script and place in ServerScriptService.
EDIT2: Make sure to test this in your Roblox client for accurate results and not in studio as there is a 2000 MB difference.

2 Likes

An anti-exploit should NOT ban innocent players. It’s a whole lot better not ban all exploiters then getting innocents in the crossfire.

Like how you wouldn’t praise the military for killing a terrorist group if they bombed a whole city to do so.

1 Like

This would kick every single player since loops are just wasting alot of memory.