I am trying to make a script that creates a folder who's name is the player's name. But it keeps giving me this error: "Attempt to index upvalue 'LocalPlayerName' (a nil value)" Is there a solution for it?
function GetPlayerName(player)
LocalPlayerName = player
end
game.Players.PlayerAdded:Connect(GetPlayerName)
function MakePlayerFolder()
local folder = Instance.new("Folder")
folder.Name = LocalPlayerName.Name
folder.Parent = game.Workspace.PlayerBuilds
end
MakePlayerFolder()
