Game pass in-game purchase prompt is failing to come up?
Asked by
7 years ago Edited 7 years ago
I have a script that gives a player a tool immediately after buying a game pass in-game.
Here is what I have
02 | local Gamepass = game:GetService( "GamePassService" ) |
04 | script.Parent.ClickDetector.MouseClick:connect( function (plr) |
05 | game:GetService( "MarketplaceService" ):PromptPurchase(plr, Id) |
06 | if Gamepass:PlayerHasPass(plr, Id) then |
07 | game.Lighting.Sabre:clone().Parent = plr.Backpack |
08 | game.Lighting.Sabre:clone().Parent = plr.StarterGear |
It should work, however, I'm getting the error
"game passes can only be queried by a script running on a roblox game server"
Also, is this script looped? I.e will it give the player the tool again after dying?
Help would be much appreciated