Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Creating a NPC Script that will both fight and drop loot after its dead?

So, this may get deleted. Im creating a Text Based Space Strategy game. (example: www.SEInfinium.net)

I am wanting to create NPCs that go to different sectors by them selves. They need to auto attack anyone with certain reputation points. If they die I need the to drop loot.

Can anyone point me in the right direction or other articles I can read up on to learn? I have no clue....

1 comment

0

I have an example, make the NPC(s) have an auto-target in a local script, then a code in that script have the event script.Parent.Humanoid.Died:Connect(function(), then destroy the NPC and loot drops.

1 answer

Read the first two chapters of this:https://www.lua.org/pil/contents.html After reading (and understanding) that, you should have an idea of how to do it.

2 comments

0

Lua and Roblox Lua are still the same but Roblox Lua is a modified version of Lua.

0

Yeah, but understanding basic Lua is the first step.

This discussion is preserved as it was. New answers, comments, and votes are closed.