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

Why does my teaming system with chat show no errors and doesn't work?

I am trying to create a teaming system where if you say "join/OPFOR" it will team you OPFOR.

game.Players.PlayerAdded:Connect(function(plr) 
	plr.Chatted:Connect(function(msg) -- grabs plr message
		if string.lower(msg) == 'join/OPFOR' then
			plr.Team = game.Teams.OPFOR
		end
	end)
end)

1 answer

In line 3 string.lower() lowers all uppercase letters, example: "join/oPFoR" will be changed to "join/opfor"

That means you need to change it to:

if string.lower(msg) == 'join/opfor' then

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