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

temple scroll

Quickshot

Member
Joined
Nov 8, 2008
Messages
595
Reaction score
8
just like the title says i need a temple scroll which only works if you are not skulled red ++ to whoever helps me
 
Code:
local skulls = {
                white = SKULL_WHITE,
		red = SKULL_RED,
		black = SKULL_BLACK
	}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local pos = getTownTemplePosition(getPlayerTown(cid))
	if(not isInArray(skulls, getCreatureSkullType(cid))) then
		if(not isPlayerPzLocked(cid)) then
			doTeleportThing(cid, pos)
			doSendMagicEffect(pos, CONST_ME_ENERGYAREA)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported.")
                        doRemoveItem(item.uid, 1)
		else
			doPlayerSendCancel(cid, "You cannot teleport while in a fight.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, "You cannot teleport because you are skulled.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return true
end

*This won't allow the player to use it if he is in a fight or if he has a red/black skull.
 
Last edited:
Goto your data/actions/actions.xml
<action itemid="SCROLL_ID_HERE" event="script" value="SCRIPT_NAME.lua"/>

I changed something in the script, copy it again.
 
Do the scroll Dissapere when you use it?
Want something like this but a amulet.
And i want so you can use it how many times you want. But when you use it you cant use it again in 20 min so you cant spam tp to tempel.
 
LUA:
  local skulls = {
				white = SKULL_WHITE,
                                red = SKULL_RED,
                                black = SKULL_BLACK
                           }
                           
function onUse(cid, item, fromPosition, itemEx, toPosition)

        local compareTime =  20*60 --20 minutes
        local currentValue = getPlayerStorageValue(cid, 30000)
        local pos = getTownTemplePosition(getPlayerTown(cid))
              
        if(not isInArray(skulls, getCreatureSkullType(cid))) then
                if(not getCreatureCondition(cid, 1024)) then
		    if(os.time() - currentValue) >= compareTime then
			currentValue = os.time()
                        doTeleportThing(cid, pos)
                        doSendMagicEffect(pos, CONST_ME_ENERGYAREA)
                        setPlayerStorageValue(cid, 30000, os.time())
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported.\nYou can teleport again in 20 minutes.")
					elseif (os.time() - currentValue) < compareTime then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't teleport right now, be patient!")
					end
				else 
					doPlayerSendCancel(cid, "You cannot teleport while in a fight.")
					doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
				end
				
		else
		 doPlayerSendCancel(cid, "You cannot teleport because you are skulled.")
                 doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            
        end
    return true
end

modified JDBs script, 100% working!

set the correct ID for the amulet like JDB wrote in the post above.

Report any bugs
 
Last edited:
Back
Top