game.Players.PlayerAdded:Connect(function(player)
local skinInventoryFolder = player:WaitForChild("SkinInventory")
local trapInventoryFolder = player:WaitForChild("TrapInventory")
local skinInventory = skinInventoryFolder:GetChildren()
local trapInventory = trapInventoryFolder:GetChildren()
local allSkins = game.ReplicatedStorage:FindFirstChild("AllSkins")
-- Skin Variables --
local BlueBeast = allSkins["Blue Beast"]
local GreenBeast = allSkins["Green Beast"]
local MegaTheMagnificent = allSkins.MegaTheMagnificent
local Noob = allSkins.Noob
local OrangeBeast = allSkins["Orange Beast"]
local RedBeast = allSkins["Red Beast"]
local SmokyBeast = allSkins["Smoky Beast"]
local Summertime = allSkins.Summertime
local WooleyWool = allSkins.WooleyWool
while true do
if skinInventory:WaitForChild("Blue Beast") then
BlueBeast:Clone()
BlueBeast.Parent = skinInventoryFolder
end
wait(1)
end)
BlueBeast = skinInventory:WaitForChild("Blue Beast", 5)
-- since you already defined it as a variable above
-- now whatever you do here will run after 'Blue Beast' existed, because WaitForChild yields until the instance is found, otherwise times out with no other arguments provided after 5 seconds
-- there's no need to do 'if Blue Beast then' here unless anything called 'Blue Beast' is not bound to exist at all
-- clone here
What’s the use of the while loop here?
Unless you want to clone the object infinitely, remove the loop entirely.
On another note, Instance:Clone() is not being used appropriately,
when you clone the instance once, the cloned object’s parent will have been set to nil, and the BlueBeast's parent the skinInventoryFolder, so doing this for multiple players will just clone the object once more and swap the original object’s parent each time.
If you meant to clone the instance to the folder instead and leave the original object where it was, set the cloned object’s parent to the folder instead