Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i Attach a Model To a Player?

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

✓ Accepted answer

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

1 comment

0

Make sure to set the weld's parent to be "hat" I forgot this.

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!

1 comment

0

let me try

This discussion is preserved as it was. New answers, comments, and votes are closed.