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

how can i make a script that spawns loot bags when you kill an npc?

Asked by 2 years ago

i want to create a script which clones the loot bags from replicated storage when an npc dies. im not sure how the bags can only appear on whoever killed the npc because im small brain

0
You could fire an remote event from the server to whoever killed the Npc KochbananemitGuave 15 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

A good way to do that is to make a script that copies an item from server storage or something. after that, you can make a script that indicates when the health is >= 0.

I don't know your exact setup, but you can do something like this:

If script.parent.Humanoid.Health >= 0 then

game.serverstorage.item:Clone() game.serverstorage.item.parent = workspace game.workspace.item.Position = game.workspace.NPC.HumanoidRootPart.Position

end

0
i mean i want it to be only shown by who killed the npc AvocadoM678 17 — 2y
Ad

Answer this question