• 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!

Solved Stupid gravestone!!!

Dejm

Oh hun...
Joined
Nov 29, 2008
Messages
120
Reaction score
4
Location
United Kingdom
Hey,

I have problem with gravestone script. It DOES NOT teleport me to reward room. I have tried nearly everything and still doesn't work. Can anyone help me here?

demonOakGravestone.lua
Code:
  function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x=32713, y=32394, z=8} -- reward room
        if getPlayerStorageValue(cid, 55100) == 1 then
                doTeleportThing(cid, position)
                doSendMagicEffect(position, CONST_ME_TELEPORT)
        else
                return false
        end
        return true
end
actions.xml
Code:
    <action uniqueid="55100" event="script" value="demonOakGravestone.lua" />
TFS I am using

Console error
 
Last edited:
delete from actions.xml line where word contains to gravestone.lua becouse your file name is demonOakGravestone.lua might be you have 2 files with same script just named other. and demonOakGravestone.lua is fine.
 
It still not working. It doesn't teleport me.
Here is my NPC script, maybe it's something wrong with NPC:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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 creatureSayCallback(cid, type, msg)

        if(not npcHandler:isFocused(cid)) then
                return false
        end

        local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
        if msgcontains(msg, 'hallowed axe') then
                selfSay('Do you want to buy a Hallowed Axe from me?', cid)
                talkState[talkUser] = 1
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
                local price = 1000
                if getPlayerItemCount(cid, 2386) >= 1 and getPlayerMoney(cid) >= price then
                        if doPlayerRemoveMoney(cid, price) then
                                selfSay('Here you are. You can now defeat the demon oak with this axe.', cid)
                                doPlayerRemoveItem(cid, 2386, 1)
                                doPlayerAddItem(cid, 8293, 1)
                                talkState[talkUser] = 0
                        end
                else
                        selfSay('I need an axe and ' .. price .. ' gold coins to make you a {hallowed axe}.', cid)
                        talkState[talkUser] = 0
                end
        elseif msgcontains(msg, 'demon oak') then
                selfSay('Did you defeat the demon oak?', cid)
                talkState[talkUser] = 2
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
                if getPlayerStorageValue(cid, 35700) == 1 then
                        selfSay('Good job!', cid)
                        doPlayerSetStorageValue(cid, 35700, 2)
                        talkState[talkUser] = 0
                else
                        selfSay('Go defeat the demon oak first.', cid)
                        talkState[talkUser] = 0
                end
        elseif msgcontains(msg, 'no') and (talkState[talkUser] >= 1 and talkState[talkUser] <= 3) then
                selfSay('Ok thanks.', cid)
                talkState[talkUser] = 0
        end
        return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
i recomend for you to use sreach function and replace old scripts to other created demon oak scripts. might be you dont have required storage to be teleported i dont know then.
 
This will working:)

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local newPosition = {x=32713, y=32394, z=8}
        if(item.itemid == 8059 and getPlayerStorageValue(cid, 35700) > 0) then
                doTeleportThing(cid, newPosition, TRUE)
                doSendMagicEffect(newPosition, CONST_ME_TELEPORT)
                doSendMagicEffect(fromPosition, CONST_ME_POFF)
                setPlayerStorageValue(cid, 35700, -1)
        end
        return TRUE
end
 
try adding ,true in this:
Code:
doTeleportThing(cid, position, [b]true[/b])
stop being such a derp, 3rd arg is pushmove
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, 35700) == 2 then
		doCreatureSetStorage(cid, 35700, 3)
		local p = getThingPos(cid)
		doTeleportThing(cid, {x=32713, y=32394, z=8})
		doSendMagicEffect(p, CONST_ME_POFF)
		doSendMagicEffect({x=32713, y=32394, z=8}, CONST_ME_TELEPORT)
		return true
	end
end
 
This will working:)

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local newPosition = {x=32713, y=32394, z=8}
        if(item.itemid == 8059 and getPlayerStorageValue(cid, 35700) > 0) then
                doTeleportThing(cid, newPosition, TRUE)
                doSendMagicEffect(newPosition, CONST_ME_TELEPORT)
                doSendMagicEffect(fromPosition, CONST_ME_POFF)
                setPlayerStorageValue(cid, 35700, -1)
        end
        return TRUE
end

Thank YOU!!! It's working!
 
Back
Top