Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make my Gamepass script work?

Asked by 10 years ago

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!

0
Can you please help me with my question too? its about gamepasses. Operation_Meme 890 — 10y

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

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.

Ad

Answer this question