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

Why is this CharacterAdded function not working?

Asked by 9 years ago

I have this LocalScript inside of the StarterGui. It's supposed to put you in a body within the script in Workspace then merge your character with it so that you have control over it. What actually happens is my Player spawns and there's a body behind me with no humanoid (which means my character DID merge with it, but I have two characters...) I don't know what's going on and I'm relatively new to these functions. Output says nothing. Here's the basic code:

if game.Players.LocalPlayer then
    game.Players.LocalPlayer.CharacterAdded:connect(function(a)
            local b=script.Body:clone()
                b.Name=a.Name
                b.Parent=workspace
                b:MakeJoints()
                b:MoveTo(a.Torso.Position)
                a=b
    end)
end

1 answer

Log in to vote
1
Answered by 9 years ago

Try ChildAdded

0
What object should I attach the method to? SirloinBurgers 50 — 9y
Ad

Answer this question