#how do I get this npc to drop coins
1 messages · Page 1 of 1 (latest)
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)
yeah sorry lol I've worked on some scripts but I have a weird error. idk whats wrong tho it looks fine to me
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!
why do we have spawnCoin() inside of the spawnCoin() function