Coin System value exploit

I have a coin system and purchase menu in my game but exploiters can easily change their value by using exploits and use an explorer script to change their Coins value. How would I go about preventing this to happen?

Can you please elaborate more how the purchase works etc.?

1 Like

In every player theres a number value which If you buy coins then this number will go up in the player values

Yes I know but you purchase these coins by developer products or how?

The purchase is made through Developer Products.

This is the script that gives the currency and makes it go up. When they purchase it will + 100 currency into there value which is in player.PlayerGui.CFGame.CoinValue. (CoinVal) is what I named the number currency.

player.PlayerGui.CFGame.CoinVal.Value = player.PlayerGui.CFGame.CoinVal.Value + 100

And how Exploiter can exploit this?

Exploits has scripts that can get the explorer in-game and change values of things.

Only thing they can do if you dont have ServerSide backdoor is inserting local scripts.

1 Like

Manage your crucial systems in server side scripts, those can’t be hacked unless something goes horribly wrong. That’s pretty much never.

https://gyazo.com/94689298bf4a518ab581d25202f85270

Would they be able to change this value in there player?

Oh no! You need to give the Coin Value in server when player joins.

I’m not a scripter so I don’t understand what that means. What would I have to do for that to work?

Can you provide the script? We can help you fix it.

What script do you want me to provide? Theres a lot of them

Okay so here you go:

local Players = game:GetService("Players") --Players Service

Players.PlayerAdded:Connect(function(player) 
local ls = Instance.new("Folder", player) --creating folder for the Coins Value
ls.Name = "leaderstats"

local Coins = Instance.new("NumberValue", ls) --creating the Coins
Coins.Name = "Coins"
end)

The one that is handling the purchase.

local mps = game:GetService("MarketplaceService")

mps.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 1168252318 then
		local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
		player.PlayerGui.CFGame.CoinVal.Value = player.PlayerGui.CFGame.CoinVal.Value + 100
		print(player.Name.." bought 100 coins!")
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

They can, but only on the client. Due to filtering enabled, exploiters making changes won’t replicate to the server, the server won’t see the changes made by the client.

The game is a one player game so if they could change that but no one else could see that would still effect the gameplay as its a single person game

You would also need to use DataStore, I would recommend you something from youtube but @SilentsReplacement have a great one too :wink:.