This code is in a Local Script in a tool. It should create parts at the location of the mouse with the Object Hearts as a child of it. It creates the part with the child, but it spawns at 0,0,0. Any ideas?
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local function onActivate()
local character = tool.Parent
local hit = mouse.Hit.p
local part = Instance.new("Part", character)
local hearts = tool.Hearts:Clone()
part.Anchored = true
part.Size = Vector3.new(1, 1, 1)
part.CanCollide = false
part.Position = Vector3.new(hit)
hearts.Parent = part
end
tool.Activated:connect(onActivate)
