Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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....

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. cherrythetree 130 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

0
Lua and Roblox Lua are still the same but Roblox Lua is a modified version of Lua. cherrythetree 130 — 5y
0
Yeah, but understanding basic Lua is the first step. davidgingerich 603 — 5y
Ad

Answer this question