What do you want to achieve?
Speed too fast will be permanently banned
What is the issue?
kicked but not permanently banned
StarterPlayer StarterPlayerScript’s localscirpt
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
repeat wait() until LocalPlayer.Character
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local localplayeruid = LocalPlayer.UserId
while true do
wait()
if LocalPlayer.Character.Humanoid.WalkSpeed >= game.StarterPlayer.CharacterWalkSpeed+1 then
bandatabase:FireServer(LocalPlayer)
LocalPlayer:Kick("you are banned")
wait(10)
end
end
ServerScriptService’s scirpt
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local datastoreservervice = game:GetService("DataStoreService")
local bandatastore = datastoreservervice:GetDataStore("bandatastore")
local Player = game:GetService("Players")
bandatabase.OnServerEvent:Connect(function()
local success, errormessage = pcall(function()
bandatastore:SetAsync(Player.UserId, true)
end)
end)
ServerScriptService’s scirpt
local datastoreservervice = game:GetService("DataStoreService")
local bandatastore = datastoreservervice:GetDataStore("bandatastore")
game.Players.PlayerAdded:Connect(function(player)
local playerUserId = player.UserId
local banned
local success, errormessage = pcall(function()
banned = bandatastore:GetAsync(playerUserId)
end)
if banned == true then
player:Kick("(ID:C1)\n\nYou have been banned if this is a bug please report it to the Staff")
end
end)
local Player = game:GetService("Players")
local LocalPlayer = Player.LocalPlayer
repeat wait() until LocalPlayer.Character
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local localplayeruid = LocalPlayer.UserId
while true do
wait()
if LocalPlayer.Character.Humanoid.WalkSpeed >= game.StarterPlayer.CharacterWalkSpeed+1 then
bandatabase:FireServer()
LocalPlayer:Kick("you are banned")
wait(10)
end
end
I think the problem is here But I tried for hours and still didn’t solve the problem
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local datastoreservervice = game:GetService("DataStoreService")
local bandatastore = datastoreservervice:GetDataStore("bandatastore")
local Player = game:GetService("Players")
bandatabase.OnServerEvent:Connect(function(Player)
local success, errormessage = pcall(function()
bandatastore:SetAsync(Player.UserId, true)
end)
end)
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local datastoreservervice = game:GetService("DataStoreService")
local bandatastore = datastoreservervice:GetDataStore("bandatastore")
local Players = game:GetService("Players")
bandatabase.OnServerEvent:Connect(function(Player)
local success, errormessage = pcall(function()
bandatastore:SetAsync(Player.UserId, true)
end)
end)
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
repeat wait() until LocalPlayer.Character
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local localplayeruid = LocalPlayer.UserId
while true do
wait()
if LocalPlayer.Character.Humanoid.WalkSpeed >= game.StarterPlayer.CharacterWalkSpeed+1 then
bandatabase:FireServer()
LocalPlayer:Kick("you are banned")
wait(10)
end
end
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
repeat wait() until LocalPlayer.Character
local replicatedstorage = game:GetService("ReplicatedStorage")
local bandatabase = replicatedstorage:WaitForChild("CheatBan")
local localplayeruid = LocalPlayer.UserId
while true do
wait()
if LocalPlayer.Character.Humanoid.WalkSpeed >= game.StarterPlayer.CharacterWalkSpeed+1 then
bandatabase:FireServer()
LocalPlayer:Kick("you are banned")
wait(10)
end
end
I am using RemoteEvent I’ll try to replace it with RemoteFunction later
--LOCAL
local starterPlayer = game:GetService("StarterPlayer")
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local replicated = game:GetService("ReplicatedStorage")
local remote = replicated:WaitForChild("RemoteEvent")
humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
if humanoid.WalkSpeed > starterPlayer.CharacterWalkSpeed then
remote:FireServer()
end
end)
--SERVER
local replicated = game:GetService("ReplicatedStorage")
local remote = replicated.RemoteEvent
remote.OnServerEvent:Connect(function(player)
player:Kick()
end)
This is working on my end, a single RemoteEvent instance is used and has been placed inside the ReplicatedStorage container.