Tycoon Issue with Leaderstats

Im using Zednov’s tycoon kit just saying if this helps. So Im trying to add coins to my user through a script like this:
player.leaderstats.Coins.Value = 5
but then when I try to buy a thing in the tycoon, it doesn’t work. But if I collect money from the cash register, it resets to the amount before I tried adding + the amount collected. Please help!

Im no scripter or builder butttt, I wouldn’t use free models and ask for help here!

This is more than likely due to client/server replication

If you’re adding the Coins through a LocalScript, the changes would not be made across the server

Attempting to purchase something that’s from the server-side will not detect the Coins being added (When you added the coins local-sided) which is why it keeps resetting, you have to reference adding the Coins in a ServerScript instead

Its in a server script not a local.

Could we at least see the script then? It’d help to figure out where the issue may lie

if ownsgamepass(plr.UserId,17829241) == true then
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 250

Hello! I am not a master in scripting but I know that there is no function ownsgamepass() unless you defined it. Instead, try UserOwnsGamePassAsync.

Test this script
local MarketplaceService = game:GetService("MarketplaceService")

if MarketplaceService:UserOwnsGamePassAsync(plr.UserId,17829241) then
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 250

Also if you can please state all errors you get and if you know what is maybe a problem. Also, a bit more script would be good.
I hope this is helpful!

1 Like

He might no have shown the script of the variable “owngamepass”