I’m creating a social-type game, and users keep using animations to glitch into areas they’re not supposed to be in. How can I fix this? I’ve tried adding more invisible barriers, and thicker parts however this doesn’t seem to work. Any feedback would be helpful.
Kill brick barriers, it will prevent wall glitchers.
Are the animations from you or are they somehow loading them into the game themselves?
Give this a whirl (let me know if it works against these exploiters)
Just group all of your invisible walls into a Folder called ‘Barriers’ and create a script in ServerScriptService, put the below code in and it will do the rest.
(I’ve tried to make it so that accidental wall brushing doesn’t give players strikes but if this does happen - just move your invisible walls back a bit - this also won’t work against players that fly over the walls using genuine exploits - you could try putting barriers in the ceiling and floors)
Players exploiting will be attributed ‘strikes’
1st strike - kill
2nd to 3rd - remove character and wait an extended length of time to respawn
4th - kick
--By WingItMan
--ServerScriptService > Script
local barriers = game.Workspace.Barriers -- create a folder with all your invisible walls in and reference it here.
local playerStrikes = {} -- players who abuse will be put in here with a number - if the number > 3 - kick
--strike 1 - kill player
-- strike 2-3 - delay respawning the player
-- strike 4 - kick
for _,barrier:Part in pairs(barriers:GetChildren()) do
barrier.Touched:Connect(function(...)
local insideWall = workspace:GetPartBoundsInBox(barrier.CFrame,barrier.Size) -- reduced it slightly so that, the barrier will naturally block the player without triggering this hack detection
for _,part in pairs(insideWall) do
if(part.Name == "HumanoidRootPart") then -- if the HRP is inside the wall - they're definitely exploiting. We also don't want to activate this if only the arm is in the wall - that could be accidental.
local hum = part.Parent:FindFirstChildOfClass("Humanoid")
local player:Player = game.Players:GetPlayerFromCharacter(hum.Parent)
if (player and hum.Health > 0) then -- don't add strikes if they're dead.
playerStrikes[player.Name] = (playerStrikes[player.Name] or 0) + 1 -- add one strike
local strikes = playerStrikes[player.Name]
print("player",player,"strikes",strikes)
if (strikes > 3) then
player:Kick("You have been kicked for exploiting")
elseif(strikes > 1) then
player.Character:Destroy()
wait(5 + strikes)
player:LoadCharacter()
else
hum:TakeDamage(math.huge)
end
end
end
end
end)
end
I didn’t understand the barriers:Part u made, can u explain?
Presuming you’re one of builders for this project…
In the Explorer Window - create a folder in Workspace called ‘Barriers’ and place the “invisible barriers” @secretajnz made into that folder.
The script will recognise this folder and block anyone trying to pass through them through physical glitches.
Also. @secretajnz If I or anyone else has solved your problem here - mark that response as the “Solution” - it helps to clean up the dev froum and helps anyone else who needs to search for a similar issue.
I see, but in the script, why did you put
for _,barrier:Part in pairs(barriers:GetChildren()) do
you could put only
for _,barrier in pairs(barriers:GetChildren()) do
Ah, I see what you mean! My apologies.
The reason is to tell the program what type of object it is dealing with - I’m defining “barrier” 's class or type.
This especially helps when it comes to Roblox’s Intellisense, because by default ‘barrier’ would have a type of any - which isn’t very useful.
But defining the type as a Part lets the program know I’m dealing with only parts - and to show only intelli-sense references related to Part objects, such as the event Touched.
This is similar to other programming languages like C#, which require you to define most objects with specific types:
var string_list = new List<string>(); // a list of strings
var cars_list = new List<Models.Car>(); // a list of cars
(Oh and it also helps with some weird edge cases where Roblox Lua throws a bunch of red underlines under perfectly fine code :))
Hope that helps!
Good! I’ve never seen this before