local players = {"Alex", "Mila", "Tom"}
for i, name in ipairs(players) do
print("Игрок №" .. i .. ": " .. name)
endlocal numbers = {10, 20, 30, 40}
for index, value in ipairs (numbers) do
print (index, value)
endlocal data = {Health = 100, Speed = 16}
for key, value in pairs(data) do
print(key, value)
endlocal ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local tools = {"Sword", "Flashlight", "Apple"}
Players.PlayerAdded:Connect(function(player)
for _, toolName in ipairs(tools) do
local tool = ServerStorage:FindFirstChild(toolName)
if tool then
tool:Clone().Parent = player.Backpack
end
end
end)local t = { [1] = "A", [3] = "C" }
-- ipairs() пройдёт только "A"