I am trying to create a pet equip system for my new game. For some reason, it doesn't put the union or "pet" inside the character. Everything else works fine but this is the only problem. There is also no error log so I don't know what's going on. Here is the broken part of the script:
if script.Parent.Parent.PetName.Text == "Name: Dog" then local char = game.Workspace:WaitForChild(player.Name) local petfolder = game.ReplicatedStorage.Pets:WaitForChild("1") local pet = petfolder.PetModel:Clone() local petcheck = char:FindFirstChild("PetModel") if petcheck then petcheck:Destroy() end pet.Parent = char local stat = petfolder.Stats.Value player.PetBoost.Value = stat player.PetEquipped.Value = 1 end
Wait I realize the problem. I put myself in the map and the pet goes to it. I can easily fix this now.