Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help... level.value.381203 = ajfoiao1239-:connect?

Sorry for the title lol, don't know what it should be. This is a Local Script inside of the Starter GUI. When I test this out, it only changed the player back to Level 500, not kicking the player.

local Plr = game.Players.LocalPlayer
while wait() do
	wait(3)
if game.Players.LocalPlayer.leaderstats.Level.Value>=508 then
game.Players.LocalPlayer.leaderstats.Level.Value=500
end
end
if game.Players.LocalPlayer.leaderstats.Level.Value>510 then
	Plr:kick("Exploit detected.")
end

I tried elseif but it didn't work neither.

1 comment

0

Make your title better like what the issue your having, like "Problems with :Kick()" or something.

2 answers

✓ Accepted answer

You put the check to kick them outside of the while loop, which means the check would never run. You'll also need to use 'elseif' like so:

local Plr = game.Players.LocalPlayer
while wait() do
    wait(3)
    if Plr.leaderstats.Level.Value>510 then
        Plr:Kick("Exploit detected.")
    elseif Plr.leaderstats.Level.Value>=508 then
        Plr.leaderstats.Level.Value=500
    end
end

1 comment

0

Thanks dude!

Lua is case sensitive. You used :kick("Exploit detected.") instead of :Kick("Exploit detected"). Do

Plr:Kick("Exploit detected,")

Your first letter of kick was lowercase.

This discussion is preserved as it was. New answers, comments, and votes are closed.