Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with imagelabel?

Asked by 8 years ago
function PlacePictures()
    local num = 0.05
    local num2 = 50 -- +200
    local picture = game.Lighting.Picture
    local players = game.Players:GetChildren()
    for i,v in pairs (players) do
        local pictureclone = picture:clone()
        pictureclone.Parent = game.Workspace.MemoryWall.Part.SurfaceGui
        pictureclone.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=420&y=420&username="..game.Players.LocalPlayer.Name
        pictureclone.Position = UDim2.new(0, num2, num, 0)
        num = num +0.25
    end
end

Okay, so I made this code so that a wall would have 100x100 size picture's of everyone on the server. How would i make it so that for every four pictures(pictureclones), num2 would increase by 200? So that the pictures would be in rows of 4

1 answer

Log in to vote
0
Answered by
Phenite 20
8 years ago

The 'i' variable in the 'for i,v in ipairs() do' is the count of the player. Check for this:

Example 1

if i ~= 0 and i%4 == 0 then

This checks if I isn't 0 and that the remainder of i/4 is 0. Then, num2 = num2 + 200.

the more u know

Ad

Answer this question