Npc Death

hacuna

New Member
Joined
Sep 24, 2010
Messages
12
Best answers
0
Likes
0
#1
Is it possible to create a npc "Death", when a player pays an amount and speaks a name, npc kills the chosen player?
 

Xikini

I whore myself out for likes
Joined
Nov 17, 2010
Messages
3,881
Best answers
124
Likes
2,011
#3
Yes, it's possible.
Lua:
if msgcontains(msg, "kill") and talkState[talkUser] == 0 then
    selfSay("Please tell me the name of the person you want to kill.", cid)
    talkState[talkUser] = 1

elseif talkState[talkUser] == 1 then
    for _, pid in ipairs(getPlayersOnline()) do
        if msg:lower() == getCreatureName(pid):lower() then
            doCreatureAddHealth(pid, -(getCreatureHealth(pid)))
            selfSay("Player " .. msg:lower() .. " has been killed.", cid)
            talkState[talkUser] = 2
            break
        end
    end
    if talkState[talkUser] == 1 then
        selfSay("Player " .. msg:lower() .. " cannot be found.", cid)
    end
    talkState[talkUser] = 0

end
 
Top