Recently, I Saw a video in roblox forsaken, of a system they made to prevent inappropriate W S antics, and I was inspired
So. I decided to make a script. That prevents you from “doing the wiggle dance” on another robloxian.
Here is a video showcasing my creation
You can use it simply by adding a LocalScript to game.StarterPlayer.StarterPlayerScripts, and entering this code:
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local taps = {}
local lastPressTime = 0
RunService.PostSimulation:Connect(function()
local now = tick()
while #taps > 0 and now - taps[1].time > 1 do
table.remove(taps, 1)
end
end)
local function near()
for _, player in game.Players:GetPlayers() do
if player == game.Players.LocalPlayer and player.Character and player.CharacterAppearanceLoaded then continue end
if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude <= 7 then
return true
end
end
return false
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S then
local now = tick()
if not near() then return end
table.insert(taps, {key = input.KeyCode, time = now})
if #taps >= 5 then
local valid = true
for i = 2, #taps do
if taps[i].key == taps[i-1].key then
valid = false
break
end
end
if valid and (taps[#taps].time - taps[1].time) <= 1.5 then
game.Players.LocalPlayer:Kick("Really?")
taps = {}
end
end
end
end)
I hope this code helps you prevent such shenanigans from happening in your game.
This does not account for other kinds of movement made without the use of the W and S keys, namely the arrow keys, but most importantly, players playing on other platforms. A better solution would be to measure objectspace displacement or by distance to see if it changes in a consistent wave-like manner. Furthermore, this should be on the server, not the client.
A better solution would to just not have this system because it is unfortunately very unnecessary. You’re stopping something that really doesn’t affect the environment of your game.
To my knowledge, there has never been a game that implemented a system like this because it is just so unnecessary.
The community doesn’t do anything bad with it, it has always been apart of Roblox unfortunately.
(Unless the video is fake, I never bothered to check)
I agree with you on the basis that its impact is subjective. But the argument is that if people do it for trolling, then trolling them back in the form of punishments is warranted. Another opinion is that it’s a toxic behavior that does indeed ruin the atmosphere of games because player engagements has been degenerated into what’s essentially harassment.
I agree that this could be very useless in some cases. But as NOVEIGMA, stated it’s an option for the developer to chooose to add it or not.
If the creator behind it truly wants to keep it up and usable. Then they will try their best to fix any false positives or bugs that the detection has.