March 8, 2021, 8:20am
You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I Want To Make The NPC Drop 5 Coins When It Dies.
What is the issue? Include screenshots / videos if possible!
The Script Is Inside The Dummy’s Humanoid And The Coin Is In Lightning Because It was instructed in the video to put it in lightning
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve Tried Watching Youtube But The Script Did Not Work.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Drop = game.Lighting("Coin"):Clone()
Drop.Parent = game.Workspace
^ That is the script that was used on the video I watched and it doesn’t work for me
Edit: Its My First Time Posting On Forum
There are few errors here. This should work:
local function onDied()
local Drop = game:GetService("Lighting"):WaitForChild("Coin"):Clone()
Drop.Parent = game:GetService("Workspace")
--I believe you want to destroy character here:
for i, v in pairs(Character:GetChildren()) do --Replace Character with your character (it is probably script.Parent.Parent).
if v:IsA("Part") or v:IsA("MeshPart") then
Humanoid.Died:Connect(onDied) --Replace Humanoid with your Humanoid.
March 8, 2021, 8:24am
Oh , Thank You Very Much! Ill Try The Script In A Bit
March 8, 2021, 8:32am
You can also set Drop’s position Drop.Position = script.Parent.Parent.HumanoidRootPart.Position. (if its part ofc)
@Jermartynojm said, try to use in pairs to destroy every part in the character
March 8, 2021, 8:35am
Oh Okay Thank You For The Help Too!
March 8, 2021, 12:08pm
On a different note here,
Lighting is not a canonical storage of objects. Consider either
March 8, 2021, 12:18pm
Oh , Thanks For The Little Info!