• 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][lua]Drinking blood?

vejin

I'm not an expert.
Joined
May 6, 2010
Messages
54
Reaction score
2
Location
Ultima
Hello, I need a script for drinking blood, it may be spell, it may be action or even talkaction,
how should it work?
When i say something, e.g. 'blood' i want the pool of blood to dissapear, just it.
I have a problem because in TFS 1.0 there is hard to find how to put it in syntax:

PHP:
pos = getPlayerPosition(cid)
   if getThingfromPos(pos).itemid == 2016 then
   doRemoveThing(pos, 2016, 2)

does anyone know how to put it to work?

@EDIT, problem solved. Limos gave the instruction.
 
Last edited:
Code:
local blood = pushThing(Tile(player:getPosition()):getItemById(2016))
if blood then
   blood:remove()
end
 
Last edited:
@UP this thing? ;D
PHP:
if CONDITION_PARAM_HIV then
msg(cid, "You have got HIV")

Limos: it doesn't work as a spell, remove - nil value, player was nil too but i changed it to cid. Do you think it will work as talkaction? I'm asking instead of checking because it's still not so easy to me using vim through ssh :>

@EDIT the other thing is that itemid 2016 with value 1 is water, 2016 with value 2 is blood, so it is not so easy as you posted
 
Code:
local blood = pushThing(Tile(creature:getPosition()):getItemById(2016, 2)).uid
if blood > 0 then
     Item(blood):remove()
end

The first parameter of function onCastSpell is creature userdata, so you can do it like this.
For other scripts make a variable for player.
Code:
local player = Player(cid)
 

Similar threads

Back
Top