It wont team the person to team SWAT if they have the gamepass. I'm needing it to reset the player when they change team if they have the gamepass.
player = script.Parent.Parent.Parent.Parent.Parent
id = 164948636
script.Parent.MouseButton1Click:connect(function()
if Game:GetService("GamePassService"):PlayerHasPass(player, id) then
player.TeamColor = game.Teams['SWAT'].TeamColor
player.Character:breakJoints()
end
end)

3 comments
Have you tried putting this in local script and change player = script.Parent.Parent.Parent.Parent.Parent to player = game.Players.LocalPlayer Stuff like this you should make a model and put a link to it. Best we know player(Variable) Could mean a nil value the best we know.
I'l try, thanks.
:PlayerHasPass will not work in LocalScripts.