Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make an object appear after a player dies?

I want to create a fireball-type part that shows on top of a body, once an NPC or a user dies. I am creating a game that is supposed to be like the anime series, Soul Eater, and I want every character to die on here as they do in the anime. Here is what it looks like on the anime: enter image description here The closest item I can get to a soul is a red fireball. How could I make the fireball appear on somebody's corpse? Thanks.

1 answer

You can go at it in two ways.

LocalPlayer.CharacterRemoving:Connect(function(Character)
	-- do 'fireball'
end)

LocalPlayer.Character.Humanoid.Died:Connect(function()
	-- do 'fireball'
end)

What I wrote above is what you can use to detect if the player has died.

For the fireball:

local Fireball = Instance.new('Part');
Fireball.Material = Enum.Material.ForceField;
Fireball.BrickColor = BrickColor.new('Crimson');
Fireball.Size = Vector3.new(1.3, 1.3, 1.3);
Fireball.Anchored = true;
Fireball.Shape = 'Ball';
Fireball.CFrame = LocalPlayer.Character.HumanoidRootPart.CFrame + Vector3.new(0, 5, 0);
Fireball.Parent = workspace;

This basically makes a ball, you can add emitters, do loops to make it look like it's floating.

Hope I helped.

2 comments

0

This may seem dumb, but where would I put first function?

0

Place them in a local script in either starterplayerscripts or startercharacterscripts, wouldn't really matter as far as I know.

This discussion is preserved as it was. New answers, comments, and votes are closed.