For I Loop Error

I’m not sure how to exactly print the player.Name from this without using for i,v loops.

Here is my current script:

game.ReplicatedStorage.KillAll.OnServerEvent:Connect(function(plr)
    if plr.Name == 'Tyyuiss_RBLX' then
        for i = 1, #game.Players:GetPlayers() do
            print(i)
        end        
    end
end)

Hello, are you trying to print every player’s name in the game? or just the player name of ‘plr’

If you want to print every player’s name try this instead:

for I = 1, #game.Players:GetChildren() do

You have to put line 3 in brackets like this

for i = [1, #game.Players:GetChildren()] do

Or you could also do

for Game, players in pairs(game.Workspace:GetChildren() do
    if players.Name == 'Tyyuiss_RBLX' then
        print(players.Name)

I’m guessing this is what you want.
I hope you understand the notes I have provided for you.

local Players = game:GetService("Players")

game:GetActor("ReplicatedStorage"):WaitForChild("KillAll").OnServerEvent:Connect(function(caller)
	if caller.UserId ~= 2528554414 then -- UserId > Username in case of username changes.
		for _, player in pairs(Players:GetPlayers()) do
			if player ~= caller then -- Remove this if you'd like to kill the player that called this event, too.
				local character = player.Character
				if typeof(character) == 'Instance' then
					local humanoid = character:FindFirstChildWhichIsA("Humanoid")
					if typeof(humanoid) == 'Instance' then
						return humanoid:TakeDamage(humanoid.MaxHealth) -- Kill the player.
					end
					return character:BreakJoints() -- Break joints as a final result.
				end
			end
		end
	end
end)

Is that new LuaU syntax or is this something I never knew about??

You don’t have too.

Instead of printing i, do this:
print(game.Players:GetPlayers()[i])

Smart man, thank you! I appreciate your help