#how do I get this npc to drop coins

1 messages · Page 1 of 1 (latest)

gritty lance
#

that's quite a lot to ask especially considering we aren't supposed to write code for you

#

is the humanoid taking damage server sided?

#

anyway you'll want to use Humanoid.Died to trigger a function which clones the coin (keep it in serverstorage) and then moves the coin to the npc's head (or other part)

kind blade
#

yeah sorry lol I've worked on some scripts but I have a weird error. idk whats wrong tho it looks fine to me

finite field
#

on NPC humanoid's death, which is a remote event, just clone the coin, and teleport the coin or coin model to the position of the NPC's humanoidRootPart

#
local hum = script.Parent.Humanoid
local coin = something.Coin
local rootPart = script.Parent.HumanoidRootPart

hum.Dead:Connect(function()
  local clone = coin:Clone()
  --If it's a model then do,
  clone:MoveTo(rootPart.Position)
  --If it's a part then do,
  clone.Position = rootPart.Position
)

please inform me if this helped!

gritty lance