Script detects WalkSpeed, if it is below or above the normal WalkSpeed value then it will kick them, and add them to a DataStore.
If someone is in the DataStore when they join then it will kick them.
This all works in studio but when I go in game nothing below the Humanoid.Running line works.
No errors whatsoever in game or in studio.
No ideas.
local Whitelisted = {}
local WhitelistedUser
local DataStoreService = game:GetService("DataStoreService")
local BanDataStore = DataStoreService:GetDataStore("BanDataStore")
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:FindFirstChild("Humanoid")
Humanoid.Running:Connect(function(Speed)
if Speed > Humanoid.WalkSpeed + 1 then
WhitelistedUser = false
if Whitelisted[Player.UserId] then
WhitelistedUser = true
end
if WhitelistedUser == false then
Player:Kick("You have been banned. (Developer Info: BDS, "..Player.Name..", "..Player.UserId..", E WS)")
local SuccessMessage, ErrorMessage = pcall(function()
BanDataStore:SetAsync(Player.UserId, true)
end)
end
end
end)
end)
end)
game.Players.PlayerAdded:Connect(function(PlayerB)
local Banned
local SuccessMessage1, ErrorMessage1 = pcall(function()
Banned = BanDataStore:GetAsync(PlayerB.UserId)
end)
if Banned == true then
PlayerB:Kick("You have been banned. (Developer Info: BDS, "..PlayerB.Name..", "..PlayerB.UserId..")")
end
end)
