Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with imagelabel?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.