I am developing a very small anticheat and I'd like to know if it would be possible to check the class of a RobloxLocked object. I don't want to post the details on the anticheat for obvious reasons but here's a snippet of the code I'm trying to use:
if object:IsA("LocalScript") or object:IsA("CoreScript") then -- Detection stuff end
I do not want to use pcall because it would be easy for an exploiter to get around that by RobloxLocking the script.
You can't. However, you can do
tostring(RobloxLockedObject)
to check its name.
If you're trying to patch CoreGui exploits, it would be something like:
local Bad = { "Dex", } local function CheckIfLocked(Object) local Status = pcall(function() Object:GetFullName() end) return Status and false or not Status and true end local function CheckIfBad(Name) for I, V in next, Bad do if V == Name then return true end end return false end game.DescendantAdded:Connect(function(Object) if CheckIfLocked(Object) and CheckIfBad(tostring(Object)) then --// Detected end end)
Through some crafty mechanics and thinking, you can get the ClassName of the RobloxLocked object if it's picked up in the game.DescendantAdded event. (It's really easy)