I’m just in the beginning stages of testing out some ideas/working on understanding some basics…
For this one I’m trying to figure out how to add a basic accessory using a Local Script, via a Tool (Essentially using a Tool to house the script to add the accessory). I see the hat show up in front of my character and ultimately fall out of the world when testing with the Tool…
If I run a test and just drop the hat onto my character manually (drag from ReplicatedStorage) it works just fine…
local PlayersService = game:GetService("Players")
local LocalPlayer = PlayersService.LocalPlayer
local Character = ((LocalPlayer.Character and LocalPlayer.Character.Parent) and LocalPlayer.Character) or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Tool = LocalPlayer.Backpack:FindFirstChild("HatTestTool")
local hat
Tool.Equipped:Connect(function(mouse)
hat = game.ReplicatedStorage.HatTest:Clone()
print("After hat declaration, hat is: ",hat)
Humanoid:AddAccessory(hat)
end)
probably because you are equipping it on the client and not on the server which would mean the server doesnt handle the physics and welding of the hat to the character. Trying using a remote event that equips it on the server. This may not work but try it out.
I have an idea! First try to parent it to the player’s character and see what happens:
Tool.Equipped:Connect(function()
hat = game.ReplicatedStorage.HatTest:Clone()
hat.Parent = LocalPlayer.Character
print("After hat declaration, hat is: ",hat)
Humanoid:AddAccessory(hat)
end)