I need a way to change team and position after a pressing a button and makes sure you bought a game pass.
I've tried this :
local pla = game.Players.LocalPlayer game.Players.PlayerAdded:Connect (function(player) player.CharacterAdded:Connect (function(character) if game.MarketplaceService:PlayerOwnsAsset(player,1288405181) then script.Parent.MouseButton1Click:connect(function() local Plteam = game.Teams.Criminals script.Parent.MouseButton1Click:connect(function() pla.Team = Plteam end) end) end end) end)
I have connected this to a button connect to a frame connected to a starter gui in the starter gui folder
Try switching the game.MarketplaceService
if statement with the script.Parent.MouseButton1Click:connect(function()
. This may be your problem.
local pla = game.Players.LocalPlayer local Plteam = game.Teams.Criminals game.Players.PlayerAdded:Connect (function(player) player.CharacterAdded:Connect (function(character) if game.MarketplaceService:PlayerOwnsAsset(player,1288405181) then script.Parent.MouseButton1Click:connect(function() script.Parent.MouseButton1Click:connect(function() pla.Team = Plteam end) end) end end) end)