Remote Event Handler not working

Hello, so I am just going to get to the subject and I am trying to make a remote event that when trigerred by a tool it places a health ring in the center of the player and it sticks to them, and even if they move the ring still is on them and the problem is that the code prints test but does not work. Please someone help or guide me how to do this properly if its done wrong.

-- // Variables
local Events = game.ReplicatedStorage

-- // Events
HealRadius.OnServerEvent:Connect(function(Player, CFrame)
	local Hitbox = workspace.HealHitbox
	local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
	local Weld = Instance.new("Weld")
	
	print("test")
	Weld.Parent = Hitbox:Clone()
	Weld.Part0 = Hitbox
	Weld.Part1 = HumanoidRootPart
	Weld.C0 = HumanoidRootPart.CFrame - HumanoidRootPart.CFrame.p - Vector3.new(0, -3.1, -0.2)
	--Weld.Orientation = Vector3.new(0, 0, 90)
end)

It’s probably due to how you’re handling your Offset property perhaps? Try doing

Weld.C0 = HumanoidRootPart.CFrame - Vector3.new(0, -3,1, -0.2)
1 Like

If “test” was printed then the remote event is working fine, your are most likely doing the math somewhat wrong. Try going step by step, firstly doing:

Weld.C0 = HumanoidRootPart.CFrame

If it works and the ring is indeed welded to the player, then you can start messing with Cframe.new() and CFrame.Angles() perhaps to get to your desirable result

1 Like

So long story short it didn’t work, even tho its printing test its not doing absolutely anything, and I dont know if its the math that I got wrong or other aspect.

I just noticed the Hitbox is being cloned, but not parented anywhere, perhaps that is your problem? A clone has to be parented to where you want to be, such as:

local Weapon = game.ServerStorage.M16:Clone()
Weapon.Parent = workspace

Without setting it’s parent, I think the clone’s parent is nil