I have asked this before, but Got an answer that Only got rid of a error, Now this just doesnt work, Help.
Script:
game.Players.PlayerAdded:connect(function() for i,v in pairs(game.Players:GetChildren()) do v.Chatted:connect(function(msg) if msg:lower():sub(1,5) == "math " then m = Instance.new("Message") elseif v.Chatted == "math 0 + 1 = " then m.Parent = game.Workspace m.Text = ("1") end end) end end)
game.Players.PlayerAdded:connect(function() for i,v in pairs(game.Players:GetChildren()) do v.Chatted:connect(function(msg) if msg:lower():sub(1,5) == "math " then m = Instance.new("Message") elseif v.Chatted == "math 0 + 1 = " then m.Parent = game.Workspace m.Text = "1" end end) end end)
game.Players.PlayerAdded:connect(function(newPlayer) newPlayer.Chatted:connect(function(msg) if msg:lower():sub(1,5) == "math " then m = Instance.new("Message") elseif newPlayer.Chatted == "math 0 + 1 = " then m.Parent = game.Workspace m.Text = "1" end end) end)
msg
not newPlayer.Chatted
. The Chatted
event is an event, not a string so your check for == "match 0 + 1 = "
will always fail. Use msg
like you did previously. Also, if we're using a lowercase version always, just do that in the beginning:game.Players.PlayerAdded:connect(function(newPlayer) newPlayer.Chatted:connect( function(msg) local msg, originalMsg = msg:lower(), msg; if msg:sub(1,5) == "math " then m = Instance.new("Message") if msg == "math 0 + 1 = " then m.Parent = game.Workspace m.Text = "1" end end end ) end)