arthuraio
Member
- Joined
- Apr 9, 2015
- Messages
- 123
- Reaction score
- 13
Hello OtLanders,
I wrote a script that make an item teleport the user to his/her town temple and it worked, BUT not like I wanted!!
1 - I want the MagicEffect to happen where the user was standing before using the item, but it never happens, already tried alot of function, I only got it to work when the user uses the item out of his/her inventory, but that is also something that I don't want! (DONE)
2 - I also want that the user get drunk, but not working.... (DONE)
here is my script. P.S: I'm new at scripting.
I wrote a script that make an item teleport the user to his/her town temple and it worked, BUT not like I wanted!!
1 - I want the MagicEffect to happen where the user was standing before using the item, but it never happens, already tried alot of function, I only got it to work when the user uses the item out of his/her inventory, but that is also something that I don't want! (DONE)
2 - I also want that the user get drunk, but not working.... (DONE)
here is my script. P.S: I'm new at scripting.
Code:
local drunk12 = createConditionObject(2048)
setConditionParam(drunk12, 2, 40000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE or isPlayerPzLocked(cid) == TRUE then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can't use it right now.")
else
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ENERGYHIT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ENERGYHIT)
doRemoveItem(itemEx.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You feel... Wrong.")
doAddCondition(cid, drunk12)
end
return true
end
Last edited: