Alright, my question here is that when you buy a gamepass from my game, it doesn't give it to you unless you join another server. Many people have gotten pissed off, because of this. I made a script which it buys gamepass in-game, but thats the problem In which why doesnt my localscript work when you buy the gamepass it gives you the gun directly there in-game. This is the localscript that has a boolvalue of "Act" for it to work on when you click the gui/button.
function hasPass(p,n) return game.GamePassService:PlayerHasPass(p,n) end function boughtPass(p,n) return game:GetService("MarketplaceService"):PromptPurchase(p,n) end script.Parent.MouseButton1Down:connect(function() if script.Parent.Act.Value == true then game:GetService("TeleportService"):Teleport(223301477) else if hasPass(game.Players.LocalPlayer,223931418) then script.Parent.Act.Value = true game:GetService("TeleportService"):Teleport(223301477) else boughtPass(game.Players.LocalPlayer,223931418) game:GetService("MarketplaceService").PromptPurchaseFinished:connect(function(player,ID,b) if b and ID == 223931418 then if player == game.Players.LocalPlayer then script.Parent.Act.Value = true game:GetService("TeleportService"):Teleport(223301477) end end end) end end end)
I have no idea if it would work or not but you could try using the BadgeService after they have bought a gamepass. Using the BadgeService you could use :UserHasBadge(userid, assetid). As far as I know, this little trick can be used to figure out whether or not a user has something with an id, not just badges.