• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Creating a teleport when two bosses are killed.

00:28 You see Dominique.
Health: [10000000 / 10000000].
Position: [X: 1457] [Y: 825] [Z: 2].
00:28 You see Skylar.
Health: [10000000 / 10000000].
Position: [X: 1458] [Y: 825] [Z: 2].

I guess not.

Where do I change the location the tp spawns, Its spawning in the wrong area.
 
Code:
brothers = {
["Dominique"] = {pos = {x=1457, y=852, z=2}, aid = 13050, brother = "Dominique"},
["Skylar"] = {pos = {x=1458, y=852, z=2}, aid = 13050, brother = "Skylar"},

Where you see "pos =" is the position where the teleport will be created.
 
Code:
brothers = {
["Dominique"] = {pos = {x=1457, y=852, z=2}, aid = 13050, brother = "Dominique"},
["Skylar"] = {pos = {x=1458, y=852, z=2}, aid = 13050, brother = "Skylar"},

Where you see "pos =" is the position where the teleport will be created.

No wonder it was spawning under Skylar.

Thanks a ton guys, you really helped me out here, and I sure learned a lot!
 
Nice that it works now ! xD

If you have any further questions ask away ^^!
Well, I've been trying to make an npc that heals players on low health but I cant get it to work, I get this:

Code:
[23/10/2013 00:30:35] [Error - Npc interface]
[23/10/2013 00:30:35] data/npc/scripts/guide.lua
[23/10/2013 00:30:35] Description:
[23/10/2013 00:30:35] data/npc/lib/npc.lua:53: attempt to index local 'message' (a nil value)
[23/10/2013 00:30:35] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/guide.lua

and this is the script:

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local random_texts = {'Welcome to our humble temple.', 'If you are hurt ask me, I\'ll heal you.', 'Praise our God. He has power to revive adventurers whose adventure is not over yet!'}
local random_texts_chance = 40 -- percent
local random_texts_interval = 7 -- seconds
local talkState = {}

    if msgcontains(msg, "heal") then
        if getCreatureCondition(cid, CONDITION_FIRE) == TRUE then
            npcHandler:say("You are burning. I will use water on you.", cid)
            doRemoveCondition(cid, CONDITION_FIRE)
            doSendMagicEffect(getCreaturePosition(cid), 14)
        elseif getCreatureCondition(cid, CONDITION_POISON) == TRUE then
            npcHandler:say("You are poisoned. I will cure you.", cid)
            doRemoveCondition(cid, CONDITION_POISON)
            doSendMagicEffect(getCreaturePosition(cid), 13)
        elseif getCreatureCondition(cid, CONDITION_ENERGY) == TRUE then
            npcHandler:say("You are electrificed. I will help you.", cid)
            doRemoveCondition(cid, CONDITION_ENERGY)
            doSendMagicEffect(getCreaturePosition(cid), 12)
        elseif getCreatureCondition(cid, CONDITION_PARALYZE) == TRUE then
            npcHandler:say("You are paralyzed. I will cure you.", cid)
            doRemoveCondition(cid, CONDITION_PARALYZE)
            doSendMagicEffect(getCreaturePosition(cid), 14)
        elseif getCreatureCondition(cid, CONDITION_DROWN) == TRUE then
            npcHandler:say("You are drowing. I will help you.", cid)
            doRemoveCondition(cid, CONDITION_DROWN)
            doSendMagicEffect(getCreaturePosition(cid), 12)
        elseif getCreatureCondition(cid, CONDITION_FREEZING) == TRUE then
            npcHandler:say("You are cold! I will burn you.", cid)
            doRemoveCondition(cid, CONDITION_FREEZING)
            doSendMagicEffect(getCreaturePosition(cid), 15)
        elseif getCreatureCondition(cid, CONDITION_DAZZLED) == TRUE then
            npcHandler:say("You are dazzled! Do not mess with holy creatures anymore!", cid)
            doRemoveCondition(cid, CONDITION_DAZZLED)
            doSendMagicEffect(getCreaturePosition(cid), 47)
        elseif getCreatureCondition(cid, CONDITION_CURSED) == TRUE then
            npcHandler:say("You are cursed! I will remove it.", cid)
            doRemoveCondition(cid, CONDITION_CURSED)
            doSendMagicEffect(getCreaturePosition(cid), 47)
        elseif getCreatureHealth(cid) < 200 then
            npcHandler:say("You are looking really bad. Let me heal your wounds.", cid)
            doCreatureAddHealth(cid, 65 - getCreatureHealth(cid))
            doSendMagicEffect(getCreaturePosition(cid), 12)
        elseif getCreatureHealth(cid) < 2000 then
            npcHandler:say("I did my best to fix your wounds.", cid)
            doCreatureAddHealth(cid, 2000 - getCreatureHealth(cid))
            doSendMagicEffect(getCreaturePosition(cid), 12)
        else
            local msgheal = {
                "You aren't looking really bad, " .. getCreatureName(cid) .. ". I only help in cases of real emergencies. Raise your health simply by eating food.",
                "Seriously? It's just a scratch",
                "Don't be a child. You don't need any help with your health.",
                "I'm not an expert. If you need help find a medic.",
                "Don't even waste my time, I have bigger problems than your scratched armor."
            }
            npcHandler:say("" .. msgheal[math.random(1, #msgheal)] .. "", cid)
        end
    end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
the error is in line 53
Code:
[23/10/2013 00:30:35] data/npc/lib/npc.lua:53: attempt to index local 'message' (a nil value)

You can try it with this maybe you should remove ,

PHP:
            local msgheal = {
                "You aren't looking really bad, " .. getCreatureName(cid) .. ". I only help in cases of real emergencies. Raise your health simply by eating food."
                "Seriously? It's just a scratch"
                "Don't be a child. You don't need any help with your health."
                "I'm not an expert. If you need help find a medic."
                "Don't even waste my time, I have bigger problems than your scratched armor."
            }
            npcHandler:say("" .. msgheal[math.random(1, #msgheal)] .. "", cid)
        end
    end
 
Well, I've been trying to make an npc that heals players on low health but I cant get it to work, I get this:

Code:
[23/10/2013 00:30:35] [Error - Npc interface]
[23/10/2013 00:30:35] data/npc/scripts/guide.lua
[23/10/2013 00:30:35] Description:
[23/10/2013 00:30:35] data/npc/lib/npc.lua:53: attempt to index local 'message' (a nil value)
[23/10/2013 00:30:35] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/guide.lua

Try this: http://pastebin.com/3C1STbK9
 
This is my default script:

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

npcHandler:addModule(FocusModule:new())

Modules.lua: http://pastebin.com/GtuSi82S
npchandler.lua: http://pastebin.com/KhCaFmAm
npcsystem.lua: http://pastebin.com/ERkhxPuZ
 
Back
Top