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

How can i add an accessoy (backpack) to the character once he enters the game?

Asked by 4 years ago

So, juts like the title says i am trying to clone an accessory to the player's character once he enters the game with a server script


backpack = game.Workspace.StarterBackPack game.Players.PlayerAdded:Connect(function(player) backpack:Clone().Parent = player.Character end)

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

flip the mesh if it's backwards

backpack = game.Workspace.Accessory

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:connect(function(character)
        local torso = character:WaitForChild("Torso") --use UpperTorso if r15
        local clone = backpack:Clone()
        clone.Parent = character

        local weld = Instance.new("WeldConstraint")
        weld.Parent = workspace
        weld.Part0 = clone.Part
        weld.Part1 = torso
        clone.Part.CFrame = torso.CFrame

    end)
end)
0
umm no it is an accessory YahiaElramal_77 26 — 4y
0
which has a part in t YahiaElramal_77 26 — 4y
0
then change the parts cframe not the backpacks royaltoe 5144 — 4y
0
wait how arent you supposed to put the accessory in the players character? YahiaElramal_77 26 — 4y
View all comments (5 more)
0
oh nvm THANK YOU YahiaElramal_77 26 — 4y
0
yeah but that answer isn't going to work. my bad. i'll get a working answer in a sec. royaltoe 5144 — 4y
0
i accidently accepted it ol YahiaElramal_77 26 — 4y
0
edit royaltoe 5144 — 4y
0
You're going to have to use UpperTorso instead of HRP if you're using R15 though royaltoe 5144 — 4y
Ad

Answer this question