— how do I make it print a purchase of the player doesn’t own a game pass? Idk how to do it
local MarketplaceService = game:GetService(“MarketplaceService”)
local Player = script.Parent.Parent.Parentlocal GamePassId = 162872866
local HasPass = false
local success, message = pcall(function()
HasPass = MarketplaceService:UserOwnsGamePassAsync(Player.UserId,GamePassId)
print(HasPass)
end)
if HasPass == true then
Player.Team = game.Teams.Imam
end
local Opened = false
local Teams = game:GetService(“Teams”)
script.Parent.Team.MouseButton1Click:Connect(function()
if Opened == false then
script.Parent.Frame:TweenPosition(UDim2.new(0.236, 0,0.266, 0))
Opened = true
else
script.Parent.Frame:TweenPosition(UDim2.new(0.236, 0,-0.9, 0))
Opened = false
end
end)
script.Parent.Frame.Imam.MouseButton1Click:Connect(function()
if HasPass == true then
script.Parent.Parent.Parent.Team = Teams.Imam
script.Parent.Parent.Parent.Team.TeamColor = Teams.Imam.TeamColor
wait()
script.Parent.Parent.Parent:LoadCharacter()
end
end)
script.Parent.Frame.Normal.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.Team = Teams.Normal
script.Parent.Parent.Parent.Team.TeamColor = Teams.Normal.TeamColor
wait()
script.Parent.Parent.Parent:LoadCharacter()
end)
If the player can only be spawned in as Imam(team) if the player changes his team to Normal he can not change it back. How do I fix this? MODEL ID:13132641394