Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Any way To Make a Game Pass that changes Team/position?

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

3 comments

0

Is this a local script or a script? Have you got Filtering Enabled?

0

Script,And no idea (i tried it but i do not know if it worked)

0

ok yes it is filtered

1 answer

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)

2 comments

0

Sorry but it did not work...

0

But if you want to know how im using it so you can figure out what im trying to do: https://www.roblox.com/games/1292630992/Prison

This discussion is preserved as it was. New answers, comments, and votes are closed.