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

My character customization script wont work?

Asked by 4 years ago
Edited 4 years ago

So I made a GUI when you press it the GUI would put a model on the player's character. But every time I would click the button the model wouldn't get on the player and also there is no error in the output.

Here is my script, I don't seem to notice what I am doing wrong.

button = script.Parent.TextButton
local vc = game.ReplicatedStorage["Rig BP"]


button.MouseButton1Down:connect(function()
    game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("UpperTorso")

        local Clonedvc = vc:Clone()
        Clonedvc.Parent = character

        Clonedvc:SetPrimaryPartCFrame(character:WaitForChild("UpperTorso").CFrame)

        Clonedvc:SetPrimaryPartCFrame(Clonedvc:GetPrimaryPartCFrame() * CFrame.new(0,-.84,.02) * CFrame.Angles(6.28,3.14,0))
        local Weld = Instance.new("WeldConstraint")
        Weld.Part0 = Clonedvc.Main
        Weld.Part1 = character:WaitForChild("UpperTorso")
        Weld.Parent = character:WaitForChild("UpperTorso")

    end)
end)
end)

Answer this question