You could use Motor6D for attaching the object to the player
local m6d = Instance.new("Motor6D")
m6d.Parent = --character's torso (depends on which type of character you're using [r6 or r15])
m6d.Part0 = --character's torso (depends on which type of character you're using [r6 or r15])
m6d.Part1 = -- object
Example for when the player joins to automatically add the object to the player’s character:
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local m6d = Instance.new("Motor6D")
local object = Instance.new("Part")
object.Shape = Enum.PartType.Ball
object.Size = Vector3.new(1.5,1.5,1.5)
m6d.Parent = object
m6d.Part0 = character.Torso -- MAKE SURE THAT IF YOU USE R6, USE TORSO AND IF YOU USE R15 USE UPPER TORSO
m6d.Part1 = object
object.Parent = character
end)
end)