Lua Roblox反攻击WalkSpeed脚本

Lua Roblox反攻击WalkSpeed脚本,lua,roblox,Lua,Roblox,我正在制作一个游戏,在不同的部分有不同的行走速度,但我不希望人们用黑客改变他们自己的行走速度。我的解决方案是制作一个部件并拉伸它以适应整个区域,使其不可见+禁用CanCollide,然后使用子脚本杀死你,如果你的行走速度不符合要求: script.Parent.Touched:connect(function(WSChecker) if not WSChecker.Parent then return end local humanoid = WSChecker.Parent:

我正在制作一个游戏,在不同的部分有不同的行走速度,但我不希望人们用黑客改变他们自己的行走速度。我的解决方案是制作一个部件并拉伸它以适应整个区域,使其不可见+禁用CanCollide,然后使用子脚本杀死你,如果你的行走速度不符合要求:

script.Parent.Touched:connect(function(WSChecker)
    if not WSChecker.Parent then return end

    local humanoid = WSChecker.Parent:FindFirstChild("Humanoid")
    if not humanoid then return end

    if (humanoid.WalkSpeed ~= 25) then
        humanoid.Health = 0
    end
end)

问题是,它不能在同一时间与多个玩家合作,我想让它踢玩家,而不是杀死他们。有办法解决这些问题吗?它必须只在部件内检查它们的ws,我不知道如何让它踢改变了ws的人,而不是杀死他们。

我建议将你的功能连接到每个玩家的人形,然后使用

人形。跑步可以提供他们当前跑步的速度,这意味着你可以检查速度是否超过某个阈值,如果超过了,就惩罚他们

代码示例:

player.Character.Humanoid.Running:Connect(函数)(速度)
打印(播放器“正在以速度运行”,速度)
(完)
至于踢,您要使用player:Kick()

(完)

希望这是一个更好的解决方案

if (humanoid.WalkSpeed ~= 25) then
    game.Players.LocalPlayer:Kick()
end

那应该可以了…

我想我能帮上忙。对我有效的解决方案是:

local player = game.Players.LocalPlayer --Make sure it's a local script.
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local hum2 = char.Humanoid
script.Parent = game.StarterPlayer.StarterPlayerScripts
if hum.WalkSpeed >16 then
   player:Kick('You have been kicked for possible speed hacks.')
end
if hum2.WalkSpeed >16 then
   player:Kick('You have been kicked for possible speed hacks.')
end

您当然可以执行上述操作,但作为上述每个人所说的内容的补充,检查walkspeed值是否处于所需值是很容易绕过的。
开发者将获得游戏的原始元表和hook __索引,以返回WalkSpeed的正常值。也无法检测到元表,因为大多数现代漏洞利用都使用C闭包而不是Lua。你最好的机会是看到角色移动的速度有多快,如果玩家移动的太快(比如被动的反重力),你可以将他们传送回来。

谢谢你,这帮了大忙。:)感谢您提供这段代码片段,它可能会提供一些有限的、即时的帮助。A通过展示为什么这是一个很好的解决问题的方法,并将使它对未来有其他类似问题的读者更有用。请编辑您的答案,添加一些解释,包括您所做的假设。
local player = game.Players.LocalPlayer --Make sure it's a local script.
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local hum2 = char.Humanoid
script.Parent = game.StarterPlayer.StarterPlayerScripts
if hum.WalkSpeed >16 then
   player:Kick('You have been kicked for possible speed hacks.')
end
if hum2.WalkSpeed >16 then
   player:Kick('You have been kicked for possible speed hacks.')
end