Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the script put the union in the character?

Asked by 3 years ago
Edited 3 years ago

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

1 answer

Log in to vote
0
Answered by 3 years ago

Wait I realize the problem. I put myself in the map and the pet goes to it. I can easily fix this now.

0
put [Fixed] in ur title if u made it work Pitched_mobile 191 — 3y
Ad

Answer this question