Hello fellow scripters! I have been working on a pet system for a few days, and i have almost finished it. The only problem is, i need a script to create a folder before another script calls on the folder. I have tried many things to make this work, but nothing has. Any help would be appreciated!
Part of the Script calling on the folder:
Players.PlayerAdded:Connect(function(player)
local ActionValues = player.ActionValues
local PPs = Instance.new("Folder")
PPs.Parent = ActionValues
PPs.Name = "PlayerPets"
local folder = Instance.new("Folder")
folder.Parent = PPs
folder.Name = player.Name
end)
Part of the Script creating the folder:
game:GetService("Players").PlayerAdded:Connect(function(PlayerWhoAdded)
local ValuesFolder = Instance.new("Folder")
ValuesFolder.Name = "ActionValues"
ValuesFolder.Parent = PlayerWhoAdded
If you need anything else, just let me know.