What do you want to achieve? I want to make a script that detect the client memory changes.
What is the issue? I don’t know how to detect client memory.
What solutions have you tried so far? I tried to look but couldn’t find anything.
I tried writing a script to see if this would work but Memory isn’t inside of plr.
local players = game:GetService("Players")
local plr = players.LocalPlayer
local memory = plr.Memory
while wait() do
if memory > 25.95 then
print("hacking")
end
end
On what basis did you get that value? Did you know Client-sided memory leaks could increase the memory consumption and your criteria could mislabel players for hacking?
A better way to detect if someone is hacking is simply to use sanity checks, such as monitoring a player’s Humanoid Root Part’s Y position for fly hacks, maybe use modules designed for detecting and handling exploiting , it’s better than attempting to detect client memory usage to label them as a hacker.
Memory is not at all a good way to detect exploiting for reasons I’ve mentioned already.
Also the figure 25.95 is not an exact figure that would determine a person to be exploiting. The link you’ve posted gets the total amount of memory consumed by the current game session, how will you use this to check every players memory consumption??
Sorry for barging in late, but just would like to give you a tip.
If you want to find out if memory use is above average, try using this function.
local function FindPlateau(triallength) -- How many time the process will repeat, wouldn't recommend anything too high
local data_table = {}
for i=0,triallength do
local t = game:GetService("Stats"):GetTotalMemoryUsageMb()
table.insert(data_table,t)
end
local added = 0 -- Ignore this
for _,v in ipairs(data_table) do
added = added+v
end
return added/#data_table; -- returns average memory usage
end
Again, I apologize for being 8 months late.
(P.S: Memory spikes don’t always assure cheating. Autosaving can also cause memory spikes.)