I want to make it so when a player joins a part is attached into them.
I tried a way of welding , but I heard that this one method of accessories is better.
I tried it and it doesn’t work.
game.Players.PlayerAdded:Connect(function(Player)
player.CharacterAdded:Connect(function(Character)
local sword = game.ServerStorage.Sword
local hum = Char:FindFirstChild("humanoid")
hum:AddAccessory(sword:Clone())
end)
end)
Try this instead, and let me know if there are any errors in the output window:
game.Players.ChildAdded:Connect(function(player)
local sword = game.ServerStorage.Sword
local swordClone = sword:Clone()
local swordClone.Parent = game.ServerStorage
local hum = player.Character:WaitForChild("Humanoid")
hum:AddAccessory(swordClone)
end)
Sorry, I am not so experienced with the forum , haha
This works I just happened to have a spelling mistake.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local sword = game.ServerStorage.Sword `-- location of Accessory (added my twist to it in my original script)`
local swordClone = sword:Clone()
swordClone.Parent = game.ServerStorage
local hum = player.Character:WaitForChild("Humanoid")
hum:AddAccessory(swordClone)
end)
end)
i am trying to add sword too but i want to do it from scratch, i tried looking on youtube but all i see is how to post accessories in the marketplace how do i add the sword. Or if you recommend some tutorials i can watch a tutorial