I have a script that creates a surface gui, then creates a scrollingframe, then creates this textlabel, I want the script to create a textlabel and add Udim2.new(0,0,0,50) to the position each time a player joins. So fair I have just received errors and I have not been able to solve them. I need to access the number of players and multiply that number maybe?
playernum = game.Players.numplayer function onPlayerRespawned(newPlayer) if newPlayer:IsInGroup(groupid) then local newentry = Instance.new("TextLabel") newentry.Size = UDim2.new(0,800,0,50) newentry.Parent = scroll if newentry.Position = UDim2.new(0,0,0,0) * playernum end newentry.BackgroundColor3 = Color3.new(255,255,255) newentry.BackgroundTransparency = 0.95 newentry.BorderColor3 = Color3.new(27,42,53) newentry.BorderSizePixel = 1 newentry.Font = "SourceSans" newentry.Text = ("["..newPlayer.Name.."]".." | "..newPlayer:GetRoleInGroup(groupid).." | "..newPlayer.AccountAge.." ] ") newentry.TextColor3 = Color3.new(255,255,255) newentry.TextSize = 50 end end game.Players.PlayerAdded:connect(onPlayerRespawned)
try this
playernum = game.Players.numplayer function onPlayerRespawned(newPlayer) if newPlayer:IsInGroup(groupid) then local newentry = Instance.new("TextLabel") newentry.Size = UDim2.new(0,800,0,50) newentry.Parent = scroll newentry.Position = UDim2.new(0,0,0,(50*playernum)-50) newentry.BackgroundColor3 = Color3.new(255,255,255) newentry.BackgroundTransparency = 0.95 newentry.BorderColor3 = Color3.new(27,42,53) newentry.BorderSizePixel = 1 newentry.Font = "SourceSans" newentry.Text = ("["..newPlayer.Name.."]".." | "..newPlayer:GetRoleInGroup(groupid).." | "..newPlayer.AccountAge.." ] ") newentry.TextColor3 = Color3.new(255,255,255) newentry.TextSize = 50 end end game.Players.PlayerAdded:connect(onPlayerRespawned)
(UDim2.new(0,0,0,0) * playernum) is always going to equal 0 because 0*anynumber = 0