So I have this script here... script.Parent.Text being a text box where a players name is located.
local Action = game.Players:GetPlayers("Players") for i = 1,#Action do Action[i].Chatted:connect(function(Message) if Action[i].Name == script.Parent.Text then if Message == ';command' then --command script here end -- ends if message statement end -- ends if Action[i] statement end) -- ends chatted function end -- ends for statement
works perfectly except when ever a new player joins the game this script won't recognize their chat. I have tried adding this above the script
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) Action = game.Players:GetPlayers("Players") end) end)
but this did not work sadly... been trying to figure this out for weeks lol