Help with welding a part onto player when they die?

Hey guys! Im trying to recreate the “Deepwoken” bell effect(I wanna practice) but when my player dies, it doesnt show up and I can’t seem to figure out what the problem is.

The main issue im running is that when my player “Dies” (gets below 10 health) the bell effect doesnt show up. The bell effect I have right now is a part that rotates, with a image on it. It shows up in my player, but doesnt actually Show. This is done with a weld to the players head.

Gyazo link showing bell not working

image
as you can see the bell part IS in my player

So far i’ve tried unanchoring the part, didnt fix it. I changed around the part to see if it was just not me seeing the image or not.

Any help is appreciated!

This script is in ServerScriptService

local replicatedstorage = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(player)

	player.CharacterAdded:Connect(function(character)
		local bell = replicatedstorage.TheBell:Clone()
		local humanoid = character:WaitForChild("Humanoid")
		
		while true do
			
			wait(0.3)
			if humanoid.Health < 10 then
				bell.Parent = player
				local Weld = Instance.new("Weld", bell)
				Weld.Name = "Weld"
				Weld.Part0 = bell
				Weld.Part1 = character.Head
				wait(0.5)
				print("Bell..")
				humanoid.Health += 100
				
			end
		end
	end)
end)
	
1 Like

You may need to do this from the client side, since you’re attaching to something owned by the client (the player character)

1 Like

Before welding it, try setting the bell’s CFrame to where you want it to be. Such as

bell.CFrame = character.Head.CFrame + Vector3.new(0,5,0)

1 Like

if im understanding correctly then. if you put the bell inside the player when they die wouldnt that just delete it??

Also you should use

Character.Humanoid.HealthChanged:Connect(function(currentHealth)
      if currentHealth < 10 then
      end
end)
1 Like

As said above, the player doesnt die.

oh ok i guess i didnt read it right

To do this from the client side, where would the script have to be located?

Nowadays you can set any normal Script to run as Local, which makes it client side. If your script already contains stuff that needs to be server side, then you should put anything client side in its own script and activate it via a remote event.

1 Like

Tried this and still didnt work, I think it might have something to do with it not being attached to the workspace player. instead it’s on the players player

Read what I said above to Benn, do you think this could be a solution?

Its a common enough error that I’m suspicious that may be the cause. You also don’t set C0 or C1 of the weld.

Before welding it, try setting the bell’s CFrame to where you want it to be. Such as

This would work if it were a WeldConstraint, not a Weld. I don’t like WeldConstraint as it creates this exact scenario where you have to hope the physics have placed it correctly before it takes effect.

1 Like

ohh make the bell’s parent player.Character

1 Like

YOU DID IT!!
Now I just need to follow what azqjanna said about the welds, since the weld is broken
(doesnt weld to me at all)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.