How do I make an NPC drop an Item?

Currently making a survival game with NPCS. One thing that needs to be done is hunger. I am using models for NPCS. Such as this one, I am currently planning out scripts before I start making this.

On one model, it is an npc that drops meat. I know where the meat goes and it is going in Game.playerStatys.StarterGui.Hunger.Value = +6

On this script however, I’m not exactly sure if this is planned out correctly.

Game.ServerScriptService.LocalScript = Value

valuePts.addValue = DodoMeat

DodoMeat.Value = 6

game.Player.LocalPlayer.Hunger.valuePts(function(DodoMeatValue)

when game.ReplicatedStorage.Folder.NPC.Dodo = Killed do

game.ReplicatedStorage.Folder.NPC.Dodo.Killed:FireAllClients

game.GetService(Event)

Event.Name = DodoKilled

when DodoKilled = true then

game.ReplicatedStorage.Folder.NPC.Dodo(function(drop)

drop(function(Killed)

game.ReplicatedStorage.Folder.NPC.Dodo.Killed = Event

when DodoKilled = true then do


game.ReplicatedStorage.Folder.Items.DodoMeat.Parent = Game.Players.Inventory
1 Like
local NPC = script.Parent
local Tool = NPC:FindFirstChildWhichIsA("Tool")

Tool.Parent = workspace
1 Like

maybe put the tool in the server storage and clone it to the workspace if the npc died ?

1 Like

when is not what your supposed to use. When doesn’t event exist. Do you mean if?

1 Like

Same thing that’s happening here.

1 Like

If the DodoKilled is a bool value, you should be writing DodoKilled.Value = true
Otherwise, we need more context as to what “DodoKilled” is.
Is it a BoolValue object? Is it a variable?

2 Likes

variable, the thing is variable

1 Like