So I made this pole at the spawn and I would like that if you click it you change to the job(team) if you have the gamepass. But if you don't have the gamepass you will be prompted to purchase it.
Script //////
function onClicked(playerWhoClicked)
game.Players.PlayerAdded:connect(function(player)
if Game:GetService("GamePassService"):PlayerHasPass(player, 553074879) then
player.Team = game.Teams.VMS)
else
game.Players.PlayerAdded:connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player, 553074879)
end
end)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

3 comments
So I checked the script today and it doesn't work. When I check the output it gives nothing. I have an image of the explorer + script. http://imgur.com/a/EopT1
Nevermind. Checked the script analysis tool in the roblox studio forgot an ")" so thanks :D U made my day
ur welcome. also, i fixed the code above as well lol, silly me! :)