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

[ANSWERED] Trying to morph into a Chicken upon spawning??? Help???

Asked by 5 years ago
Edited 5 years ago

Hey so I am somewhat of a newbie when it comes to advanced lua skills,so please keep that in mind when reading this.

So I'm making a game and I want the player to morph into a model of a chicken that I made myself upon joining. I successfully made a script where the body parts of the player are deleted when joining, and the parts of the chicken are moved into the player as well. The only problem is that the pieces just fall apart when I test it. I tried to anchor them but now I'm stuck in the air.

If any of you would like to see my insanely bad script, here it is.

game.Workspace.ChildAdded:connect(function(player)
    local name = player.Name
    local playername = game.Players:FindFirstChild(player.Name)
    if playername ~= nil then
        playername.CanLoadCharacterAppearance = false
        player.Head:Destroy()
        player.LeftUpperArm:Destroy()
        player.LeftLowerLeg:Destroy()
        player.LeftUpperLeg:Destroy()
        player.LeftLowerArm:Destroy()
        player.RightUpperArm:Destroy()
        player.RightLowerArm:Destroy()
        player.RightUpperLeg:Destroy()
        player.RightLowerLeg:Destroy()
        player.LeftFoot:Destroy()
        player.RightFoot:Destroy()
        player.UpperTorso:Destroy()
        player.LowerTorso:Destroy()
        player.LeftHand:Destroy()
        player.RightHand:Destroy()
        player.Pants:Destroy()
        player.Shirt:Destroy()
        player.HumanoidRootPart:Destroy()
        game.Lighting.Chicken.Torso:Clone().Parent = player
        game.Lighting.Chicken.LeftArm:Clone().Parent = player
        game.Lighting.Chicken.LeftLeg:Clone().Parent = player
        game.Lighting.Chicken.RightArm:Clone().Parent = player
        game.Lighting.Chicken.RightLeg:Clone().Parent = player
        game.Lighting.Chicken.LeftEye:Clone().Parent = player
        game.Lighting.Chicken.RightEye:Clone().Parent = player
        game.Lighting.Chicken.Tuff:Clone().Parent = player
        game.Lighting.Chicken.Beak:Clone().Parent = player
        game.Lighting.Chicken.HumanoidRootPart:Clone().Parent = player
    end
end)

If any of you would like to see anything else involving this problem, please reply and I'll send the code/image/whatever you wanted to see. Thank you in advance!

0
Some of the scripts in a humanoid / player look for certain body parts and use them ect ((Animation script) Now you may also have to connect them or something ((I have never made a new character body)) but that's all I can think of right now other than trying to use startercharacter happytimeroblox101 36 — 5y
0
use Instance.new("Weld") to weld the parts of the chicken to the player. Trew86 175 — 5y
0
If you only want them to be chickens you can also put a model named StarterCharacter containing the chicken inside StarterPlayer. Rheines 661 — 5y

Answer this question