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

Best way to prevent hackers from getting money?

At first I thought why not just create another hidden value that’s the real cash and the leaderstats only reflect that value but then I wanted something else.

How can I have a script that evey time the leaderstats change checks if a server event was fired? If it wasn’t reset the leaderstats if it was do nothing.

game.Players.PlayerAdded:Connect(function(player)
    player.leaderstats.Money.Changed:Connect(function()
    
    end)
end)

Is this a good start? How else would I complete my goal?

3 comments

0

The method you're describing was useful for experimental mode games, however when you have Filtering Enabled turned on, the hacker won't be able to change their leaderstats. In other words it'll only show up for them and not the server, they can't buy anything with it.

0

yes

0

1 answer

✓ Accepted answer

Try studying the ways that you see on youtube and finding a fix/patch for it.

You can also make a variable under the player that has the and player's money and another that changes for a few seconds whenever you purchase/earn some money.

Here is some code that you can use:

game.Players.PlayerAdded:Connect(function(player)

	local HonestEarn = Instance.new(BoolValue, player)
	HonestEarn.Name = "HonestEarn"
	local money = player.leaderstats.Money
	local OldMoney = Instance.new(IntValue, player)
	OldMoney.Name = "OldMoney"
	OldMoney.Value = player.leaderstats.Money.Value

	money.Changed:Connect(function()
		if HonestEarn.Value = false then
			money = OldMoney
			player:Kick("You hacked your money. NO MERCY TO THE HACKERS!!!")
		elseif HonestEarn.Value = true then
			HonestEarn = false
			OldMoney.Value = money
		end
	end)
end)

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