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

Poi blood

white91

New Member
Joined
Jun 4, 2008
Messages
136
Reaction score
0
As some of you already know you need an vial of blood to get down to the pits of inferno, and i'm not so skilled at lua scripts.
Can someone tell me what is wrong in this code? I will be grateful.
PHP:
local newpos = {x=398, y=1385, z=9}
local splash = {x=398, y=1386, z=8}

local stoneUID = 20201
local bloodId = 2016
local bloodType = 2

function onUse(cid, item, frompos, item2, topos)

local blood = getThingfromPos(splash)

        if item.uid == 20201 and item.itemid == 1409 and blood.itemid == 2016 and blood.type == 2 then
                doTeleportThing(cid, newpos)
                doSendMagicEffect(newpos, CONST_ME_TELEPORT)
         else
        end
end

actions.xml
PHP:
  <action uniqueid="10201" script="PitsOfInferno/blood.lua" />
 
Code:
	<action uniqueid="10201" [B][COLOR="Red"]event="script" value[/COLOR][/B]="PitsOfInferno/blood.lua"/>
Code:
local newpos = {x=398, y=1385, z=9}
local splash = {x=398, y=1386, z=8}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local blood = getTileItemById(splash, 2016)
	if blood.uid > 0 and blood.type == 2 then
		doSendMagicEffect(getThingPos(cid), CONST_ME_DRAWBLOOD)
		doTeleportThing(cid, newpos)
		doSendMagicEffect(newpos, CONST_ME_TELEPORT)
		return true
	end
end
 
Rep ++
Good job its work
can i have one more question ?
if i want that blood disappear when its used on gravestone what i must add to this script ?
 
Code:
local newpos = {x=398, y=1385, z=9}
local splash = {x=398, y=1386, z=8}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local blood = getTileItemById(splash, 2016)
	if blood.uid > 0 and blood.type == 2 then
		[B][COLOR="Red"]doRemoveItem(blood.uid)[/COLOR][/B]
		doSendMagicEffect(getThingPos(cid), CONST_ME_DRAWBLOOD)
		doTeleportThing(cid, newpos)
		doSendMagicEffect(newpos, CONST_ME_TELEPORT)
		return true
	end
end
 
Back
Top