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)

2 comments
It is a problem with ROBLOX that has been going on for a while now; You probably have to wait until ROBLOX fixes this, sorry for the inconvenience. :/
Alright :/