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

JumpPower Anti Exploit LocalScript only working in studio?

This is a common question but I have not found a working solution. My game is FilterEnabled and this script will kick players who change their JumpPower, but it only works in the studio:

local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
    character = player.CharacterAdded:wait()
end

local char = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

while wait() do
	if char.JumpPower ~= 50 then
		player:Kick("Jumping to the moon is not allowed")
	end
end

It is a LocalScript and I placed it in StarterCharacterScripts

5 comments

0

Since this is in an LS, you'd probably want to do server invokes, but if I were you I would just run this entirely on the server.

0

Also, you'd probably want to check if the JumpPower would be >= 50.

0

Localscripts shouldn't be used for anti exploits. The exploiter can easily delete this.

0

I used to use local scripts for anti exploits but I set it to where it would require another script which if any were deleted it kicked for suspected exploit

0

if your interested in roblox anti exploit feel free to join this server discord server :) its helpfull https://discord.gg/Yhb8m29 it has advance anti fly and noclip and more!!

3 answers

✓ Accepted answer

Try more efficient ways that won't distract your game resources:

local player = game.Players.LocalPlayer

local onJumpPowerChanged = function()
	player:Kick("Jumping to the moon is not allowed")
end
local onCharacterAdded = function(char)
	char.Humanoid:GetPropertyChangedSignal("JumpPower"):Connect(onJumpPowerChanged)
end

player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
	onCharacterAdded(player.Character)
end

2 comments

0

Where should I put this? I tried in StarterCharacterScripts and StarterGui but it only works on the studio in both

0

Make sure it's a LocalScript that's in StarterPlayerScripts, not StarterCharacterScripts. And check the name of the Players service, maybe you've renamed it to something else. (Same goes for the Humanoid in the player's character.)

local player = game.Players.LocalPlayer
local character = player.Character

local char = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") 
while wait() do
    if char.JumpPower ~= 50 then
        player:Kick("Jumping to the moon is not allowed")
    end
end

Try that one, it worked for me. If it works accept my answer. Also add that to StarterGui.

6 comments

0

I tried it in both StarterGui and StarterCharacterScripts but it still only works on the server

0

Naming the Humanoid object char is sort of confusing and conflicts with the already-existing character var.

0

Yes that is true I just editted hkmag's script a bit, and for me it worked even in studio and even in game.

0

Weird, I'm assuming filtering was enabled when you were testing, right?

0

I tried even with FE off and FE on.

0

I don't understand why it doesn't work for me. I even tried putting it in StarterGui, StarterCharacterScripts, AND StarterPlayerScripts at the same time but it doesn't do anything in game.

Hkmag3, Having this type of anti-exploit script may not be the best idea. The local script is being processed by the HACKER'S COMPUTER, not Roblox Servers. This will make it MUCH easier for the hacker to prevent getting kicked.

1 comment

0

if your interested in roblox anti exploit feel free to join this server discord server :) its helpfull https://discord.gg/Yhb8m29 it has advance anti fly and noclip and more!!

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