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

How can I copy a model/object and insert it into a player?

Asked by 7 years ago

I'm a bit confused with all the new accessory parts.

I've made my hats already, they're all welded up, and, when I walk over them, join up to the character's head. Basically, they're fully functional.

My next issue is that whenever I copy the hat, then paste it into my player in-studio, the hat just falls through the ground, obviously not making any attachments to the character despite the fact that when I do paste them in, they are in the correct place before they fall.

However, I've found out that when I duplicate the accessory in the workspace, then Drag the hat from the workspace into my character, it stays on the head, in the correct position, the HatAttachments working fine.

All I need to do now is to create a few lines of script that insert the hat from Lighting/ServerStorage/ReplicatedStorage. I need to be able to put these lines into a larger script that finds the rank of the player in my group (the latter of which I know how to do).

Thank you for reading, A very confused Hollowalexs

0
When you apply pressure to a weld, it brakes . farrizbb 465 — 7y
0
No pressure to a weld breaks the joint except for explosions. I would say create an individual weld from your head to the main part of the attachment. laughablehaha 494 — 7y

1 answer

Log in to vote
0
Answered by
4jne 18
7 years ago

Basically this Script (not LocalScript) waits for player to load in and then inserts a Hat from ServerStorage into the Player Model in Workspace:

game.Players.PlayerAdded:Connect(function(Player)--Player joins.
Player.CharacterAdded:Connect(function(Character)--Waits for Player to load in.
game.ServerStorage.Hat:Clone().Parent=Character--Inserts the Hat.
end)
end)

Idk if that's what you were asking... I wrote this on mobile so there might be something wrong.

0
So for this I'd only need to change the 'Hat' part to whatever my hat's called? HollowAurelius 10 — 7y
0
The script works, but the HatAttachment rotation always resets itself to 0,0,0; even though the hat in ServerStorage is at 90,0,0 HollowAurelius 10 — 7y
0
Character.Hat.Rotation=Vector3.new(90,0,0) 4jne 18 — 7y
Ad

Answer this question