Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
itsLSJ 0
5 years ago

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

Log in to vote
0
Answered by
wall6 1
5 years ago
Edited 5 years ago

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.

0
This may seem dumb, but where would I put first function? itsLSJ 0 — 5y
0
Place them in a local script in either starterplayerscripts or startercharacterscripts, wouldn't really matter as far as I know. ThePolite 26 — 5y
Ad

Answer this question