I am using this script to add money when someone has a gamepass:
gps = game:GetService("GamePassService"); id = script:WaitForChild("GamePassID"); game.Players.PlayerAdded:connect(function(Player) Player:WaitForDataReady() if gps:PlayerHasPass(Player , id.Value) then stats=Player:WaitForChild("leaderstats") if stats~=nil then currency = stats:WaitForChild(script:WaitForChild("Currency").Value) if currency~=nil then bonus=script:WaitForChild("AdminCash") currency.Value = currency.Value+bonus.Value end end end end)
Inside that script is Values called AdminCash, Currency, and GamePassID. The gamepass works fine when I join it shows that there is the money but it just appears that way, you cant spend it and when you collect money, say 2 dollars it says that you only have 2 dollars. It may be the fact that the MoneyStorage is located in ServerStorage as a class name of Smoke because I am using berezaa's tycoon kit. Please help if you can!
There's nothing wrong with that script except maybe efficiency. Your problems lie outside the script, where your index points are. If you don't know the layout of your own game then there's nothing we can do to help you, sir.