#Script not working

6 messages · Page 1 of 1 (latest)

hearty geode
#

i want to make a player list but it doesnt work, there is nothing in output.
The script:

`local Players = game:GetService("Players")
local gui = script.Parent

local scrollingFrame = gui.ScrollingFrame
local frameTemplate = scrollingFrame.FrameTemplate

local function createPlayerFrame(player)
local frameClone = frameTemplate:Clone()
frameClone.Parent = scrollingFrame
frameClone.Visible = true

frameClone.NameLabel.Text = "Player: " .. player.Name
print("hi")

scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, scrollingFrame.CanvasSize.Y.Offset + frameTemplate.Size.Y.Offset)

local playerRemovingConn
playerRemovingConn = player.Removing:Connect(function()
    frameClone:Destroy()
    scrollingFrame.CanvasSize = scrollingFrame.CanvasSize - UDim2.new(0, 0, 0, frameTemplate.Size.Y.Offset)
    playerRemovingConn:Disconnect()
end)

end

local function playerEntered(player)
createPlayerFrame(player)
end`

pulsar turtleBOT
#

studio** You are now Level 1! **studio

hearty geode
gusty zodiac
#

u aint calling any func

crystal lark
#

yeah connect playEntered to Players.PlayerAdded

#

and you can use Players.PlayerRemoving instead of connecting multiple removing events