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

Problem with adding a accessory to an NPC/Player?

Asked by 8 years ago

I am trying to add an accessory to a NPC/Player and it seems to not go on the head but to its original position. It goes on the head in normal play mode but not in a server.

I then tried adding a weld called "AccessoryWeld" and link the Part0 to Handle and then Part1 to Head. It goes on the head but not in the correct way.

Workspace > PlayerCustom > Player1 > Every thing a NPC would need

ReplicatedStorage > Character > Hats > HatName > Handle > HairAttachment TouchInterest Mesh

local playername = game.Players.LocalPlayer.Name
local hat = game.ReplicatedStorage.Character.Hats[hatname]:Clone()

local weld = Instance.new("Weld")
weld.Name = "AccessoryWeld"
weld.Parent = hat.Handle
weld.Part0 = hat.Handle
weld.Part1 = workspace.PlayerCustom[playername].Head 

hat.Parent = workspace.PlayerCustom[playername]

It successfuly adds the hat into the player, but not on the head.

It adds the weld without me doing it in play mode. But not in a server.

I have FE enabled

2 answers

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

I'd would link you to ROBLOX wiki. I think you've missed a lot.

http://wiki.roblox.com/index.php?title=API:Class/Accessory

ROBLOX scripts don't uses "hat" anymore, but "Accessory" now.

It was a suggestion. I hope it works! Try to sneek at ROBLOX wiki. They could help a bit.

See you later! Good luck on your project!

0
It is an accessory LittleBigDeveloper 245 — 8y
0
Take a look into: local hat = game.ReplicatedStorage.Character.Hats[hatname]:Clone() Difined_Person 61 — 8y
Ad
Log in to vote
0
Answered by 7 years ago

Welds seem to break when moving accessorys across in FE. I had fixed this by creating a weld and doing an offset for each variable (thanks Kingdom5). This is my solution until it gets fixed.

Answer this question