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

Help with imagelabel?

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

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
9 years ago

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

Example 1

1if 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