I'm asking cause I don't know how to script vary well. But here's what I got.
local gamepassID = 8852294 script.Parent.MouseButton1Click:connect(function (playerWhoClicked) local player = game.Players.LocalPlayer local gps = game:GetService("GamePassService") local playerHasPass = gps:PlayerHasPass(player, gamepassID) if playerHasPass then player.Team.Name = Site Adminastrator else gps:PromptPurchase(player, gamepassID) end end)
First of all, use MarketplaceService:UserOwnsGamepassAsync. Second of all, don’t set the name of team they're currently on, do something like player.Team = game.Teams[“Site Administrator”]
. I think you need to run it on the server side, so use a remote event instead because changing the team won’t replicate anyways and MarketplaceService should be done on the server.