Setting values on the client wont kick the player

so i will make a local script to make that function kick the player from the client? if they ever change values from the client

1 Like

Yep! This will stop other exploiters that do not have much scripting knowledge but for the other exploiters you may need to do magnitude checks and other exploiting prevention methods :slight_smile:

This isn’t the best method as client side anti-exploit can be bypassed although it work better than currently and will catch out basic exploiters. Look to the method I stated before with comparing positions on the server for better results but for a start, client side anti-exploit would do the trick!

its a module and i will watch them if they remove the local script and the module script and if they remove it ill simply do something about it

Any other methods?

1 Like

that is not how modules work
you’ll need to send the client’s walkspeed to the server via a remote event for it to actually recognize it
other than that, having it in a seperate script is pretty much useless, i suggest nesting it in game-requiring scripts

thats a bad method bc they can fake it by firing an event of 16 as an argument

1 Like

This can be spoofed by a client that is exploiting and should not be used.

1 Like

any other methods that i can use to replicate it to the server?

Just run magnitude checks on a server script to compare the distances that the character has travelled. Here is a basic example:

local LastData = {}
while wait(1) do
	for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
		if Player.Character then
			if Player.Character:FindFirstChildOfClass("Humanoid") and Player.Character:FindFirstChild("HumanoidRootPart") then
				if Player.Character:FindFirstChildOfClass("Humanoid").FloorMaterial then
					if not LastData[Player.UserId] then
						LastData[Player.UserId] = {
							Position = Player.Character.HumanoidRootPart.Position,
							Tick = tick(),
						}
					end
					if (LastData[Player.UserId].Position - Player.Character.HumanoidRootPart.Position).Magnitude > Player.Character:FindFirstChildOfClass("Humanoid").WalkSpeed + 1 * (tick() - LastData[Player.UserId].Tick) then
						Player:Kick("Moving too fast!")
					else
						LastData[Player.UserId] = {
							Position = Player.Character.HumanoidRootPart.Position,
							Tick = tick(),
						}
					end
				end
			end
		end
	end
end

Note that changes may need to be made to that code to account for players moving faster than the walkspeed for gameplay reasons or whatever.

The only replicated property you can rely on is the Position value of their body parts.

1 Like

on all this mess can my method like this work:

fire a remote function to the client
and the client returns info to the server
check if the value is more then the client what had returned

is that a good method?

1 Like

This can be spoofed by the client as the exploiter can return whatever information they like and remove the original script or modify it.

Better off doing distance checks on the server using something like the method I provided.

1 Like

how would i check it on the other side like jump power? add another if statement?

1 Like

I’m not sure how you would check if the player has changed the jump power but feel free to experiment with the code and make another thread asking for help on how to achieve that!

how would i calculate the jumpheight of the player jump power

I’m not sure but feel free to look around the dev forum and the internet, I’m sure someone has probably asked.

1 Like

@FerbZides
I’d make it so that there’s a ValueObject inside the humanoid that is created on the server whenever you change the WalkSpeed. Delete it after you check for it. This would prevent the client spoofing the WalkSpeed since instances created on the client doesn’t replicate.

@FracturedSoftware
FloorMaterial doesn’t return as nil when the player isn’t on the ground, it returns as Air.

if Player.Character:FindFirstChildOfClass("Humanoid").FloorMaterial ~= Enum.FloorMaterial.Air then

Also, don’t kick for something like this. Think about players with slow connections, just make them rubberband which seems to be the optimal solution. Most games do stuff like this to counteract teleportation with slow connections.

Player.Character:FindFirstChildWhichIsA("Humanoid").RootPart.CFrame = CFrame.new(LastData[Player.UserId].Position)

@FerbZides
Here’s the optimal script:

local LastData = {}
while wait(1) do
    for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
        if Player.Character then
            if Player.Character:FindFirstChildOfClass("Humanoid") and Player.Character:FindFirstChild("HumanoidRootPart") then
                if not LastData[Player.UserId] then
                    LastData[Player.UserId] = {
                        CFrame = Player.Character.HumanoidRootPart.CFrame,
                        Tick = tick(),
                    }
                end
                if (LastData[Player.UserId].Position - Player.Character.HumanoidRootPart.Position).Magnitude > Player.Character:FindFirstChildOfClass("Humanoid").WalkSpeed + 1 * (tick() - LastData[Player.UserId].Tick) then
                    Player.Character:FindFirstChildWhichIsA("Humanoid").RootPart.CFrame = LastData[Player.UserId].CFrame
                else
                    LastData[Player.UserId] = {
                        CFrame = Player.Character.HumanoidRootPart.CFrame,
                        Tick = tick(),
                    }
                end
            end
        end
    end
end

It prevents, JumpPower, Flying and WalkSpeed.

Any exploiter could easily delete the Anti-Exploit Script since it is on the Client.

@EpicVault

False, his anti-exploit is serversided, therefore there is no way for them to delete it. Even if they deleted the ModuleScript, it would still exist on the server because it wouldn’t replicate.

Anything in StarterCharacterScripts can be deleted by the client since they’ll be descendants of the character which the player has full control of.