Hi there! In a few games I play, including my own, I have seen players using this bug with the /e dance2 emote to clip through walls. I made a little anti-cheat here that will prevent that with R6 avatars!
Just insert the model into ServerScriptService and edit the configuration at the top of the file however you want!
Features
-Customizable settings
-Custom log function
-Custom sound delays
-Bypass list
Configuration
PlaySound (bool) - Will a sound play when the player is teleported? Soundid (int) - If a sound plays, what’s it’s it? ConsoleLogs (bool) - Are teleport and player bypasses logged in the Developer Console? Bypass (list) - A list of userid’s who bypass the anti-clip CustomLogFunction (function) - A function in which you can write code that will run every time a teleport is made. This is useful for logging it to an admin system
How to suggest/report bugs and issues
Just privately message me! My username is claym1x, I will try to respond as soon as I can.
If for some reason you can’t, feel free to reply to this post!
Forking, editing, or re-making
I don’t mind if you fork or do anything with it’s source code. Use it however you wish, I ask that you don’t claim you made it however.
How it works (for nerds)
The source code functions on the server by waiting for a player to start doing /e dance2. Once that happens it will save their position. Once they stop doing /e dance2, it will wait a pre-determined amount of time. After it waits, it will make a raycast between the old position and the player’s current position. If it intersects a wall, it will teleport them back to where they were + an offset so they don’t just teleport back into the wall
If a player was dancing on a moving vehicle for example, would they get teleported back if the ray cast doesn’t return? Unless you needed “/e dance2” for some function in your game, I would just disable it or remake it through the animation script so there are no edge cases.
The ray cast has to return a part to make a player get teleported. So it would probably try to teleport you back if you are on a moving vehicle and can somehow keep the animation for long enough. I can test this in a little bit and work in a fix, along with some more stuff I have planned
Update to this: Trying to currently work in a system that will detect if the player is moving or has moved during the dance, and will factor that in when using the raycast
would it be possible to make it only work for certain parts? for example being in a radius of a part with a value that allows dance clipping will let you clip through it but if the part doesn’t have the specified value it won’t let you clip through the wall? say like a 5-8 stud radius [for good measures] to detect the dance clip.