服务端:
local Banned = {"Banned_1", "Banned_2"} -- 添加黑名单,也就是player.Name
game:GetService("Players").PlayerAdded:Connect(function(player)
for index, value in next, Banned do
if (player.Name == value) then
player:Kick("You have been banned from the game.")
end
end
end)
客户端:
local Player = game.Players.LocalPlayer
local Humanoid = nil
while wait() do
if Player.Character and Player.Character:FindFirstChildOfClass("Humanoid") then
Humanoid = Player.Character:FindFirstChild("Humanoid")
break
end
end
local Max_J = 50 --最大跳跃力
local Max_W = 14 --最大速度
Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
if (Humanoid.WalkSpeed > Max_W) then
Player:Kick("Increased walkspeed.")
end
end)
Humanoid:GetPropertyChangedSignal("JumpPower"):Connect(function()
if (Humanoid.JumpPower > Max_J) then
Player:Kick("Increased jumppower.")
end
end)
这是两个简易的反外挂脚本。服务端是用来判定外挂黑名单,可以随意拓展黑名单脚本,比如用存储将黑名单存起来,做成动态黑名单等等。