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

why is this script not working?

no errors in the output Purpose: when :Teams is typed by an admin teams are created a blue an red team Problem: teams dont even pop up on the leaderboard

admins={"Threatboy101","vinothpizza555"}

	        
            function isAdmin(player)
	    for index, value in pairs(admins) do
		 print("level 2")
	        if player.Name:lower() == value:lower() then
		     print("level 3")
		         if string.sub(msg,1,6)==":Teams"then
	              print("level 4")
	              teams = game:GetService("Teams") -- A variable for teams
                  blue = Instance.new("Team", teams) -- The new team
                  blue.Name = "BLUE" -- The team's name is "Sup"
                  red = Instance.new("Team", teams)
                  red.Name="RED"
                  print("level 5")
	            return true
	        end
	    end
	end
          
 end
  game.Players.PlayerAdded:connect(function(player)    
player.Chatted:connect(isAdmin)
print("level 1")
	end)

2 comments

0

I don't see the purpose of the :lower() in line 6. Try putting a print after it to see where it stops.

0

ok i revised it but it only gets to level 1

1 answer

admins={"Threatboy101","vinothpizza555"}


function chat(msg, player)
	for index, value in pairs(admins) do
		if player.Name:lower() == value:lower() then
			if string.lower(msg)==":teams"then
			teams = game:GetService("Teams")
			blue = Instance.new("Team", teams)
			blue.Name = "BLUE"
			blue.TeamColor = BrickColor.new("Bright blue")
			red = Instance.new("Team", teams)
			red.Name="RED"
			red.TeamColor = BrickColor.new("Bright red")
		end
	end
end

game.Players.PlayerAdded:connect(function(player)    
	player.Chatted:connect(chat)
end)

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