Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I find properties of Humanoid?

Asked by 8 years ago

I'm trying to make a security script to prevent exploits. I cannot seem to find players. Where are they located? This is what I have.

game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function() playerSpeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed if playerSpeed > 16 then kick() end end)

What I thought this would do is see if Humanoid changed in any way. Then it would find WalkSpeed and if it went over the default speed, 16, that it would kick you. What am I doing wrong? Thanks for your help!

1 answer

Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
8 years ago

kick() doesn't kick them, use

game.Players.LocalPlayer:Kick()

However, you should add a variable for the player, example;

local player = game.Players.LocalPlayer
player.Character.Humanoid.Changed:connect(function()
    if player.Character.Humanoid.WalkSpeed > 16 then
        player:Kick()
    end
end)

If this helped or answered your question, accept the answer, it gives us both rep!

Ad

Answer this question