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

How do i Attach a Model To a Player?

Asked by 4 years ago

so i am helping a Guy with hes anime game and We're Making effect. The thing is that its a model and has Many Parts in it. And we want to attach it to the player. We dont know how

Please help.

3 answers

Log in to vote
2
Answered by
orcazate 170
4 years ago

In order to weld a model to a player I would anchor the model add a QPerfectionWeld script which can be found at this link.

Once you have inserted this script and anchored the model you then need to get the main part of the model from a script and create a weld. I don't know how you're using these effects so I will create something from a little remote event.

Client script for my example:

script.Parent.MouseButton1Click:Connect(function()
    local modelName = "Gaming Headset"
    game.ReplicatedStorage.PutHeadSetOn:FireServer(modelName)
end)

Server script for my example:

game.ReplicatedStorage.PutHeadSetOn.OnServerEvent:Connect(function(player, modelName)
    local hat = game.ServerStorage.modelName:Clone()
    hat.Parent = player.Character
    local weld = Instance.new("Weld")
    weld.Part0 = hat.Middle
    weld.Part1 = player.Character.Head
end)

Hope this can assist you. :D

0
Make sure to set the weld's parent to be "hat" I forgot this. orcazate 170 — 4y
Ad
Log in to vote
3
Answered by
iOwn_You 543 Moderation Voter
4 years ago

You put the item inside the player character, position it and then weld it;

Welding constraint

Log in to vote
0
Answered by 4 years ago

Store the model somewhere, set the PrimaryPart of the model and inside that part put a "WeldConstraint" with part0 = to the Primary part. Use :Clone() to clone it and parent it to the character (I tend to parent it to HumanoidRootPart). Once its there, set part of the WeldConstraint to part of the character its inside.

cloned.Position = character.HumanoidRootPart.Position + Vector3.new(0,-2.7,0) Is useful because the WeldConstraint works as an offset from a part :)

Good luck!

0
let me try HKprogram 48 — 4y

Answer this question