function onUse(cid, item, fromPosition, itemEx, toPosition)
tepos = {x=, y=, z=}
if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendCancel(cid, "Lose your battle sign first.")
else
doTeleportThing(cid, tpos)
doSendMagicEffect(tpos, 10)
end
end
tepos = {x=1000, y=1000, z=7}
<action itemid="9141" script="teleport.lua"/>
Here you are
Rep++ me
go to data/actions/scripts and create teleport.lua and paste the folowing
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) tepos = {x=, y=, z=} if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendCancel(cid, "Lose your battle sign first.") else doTeleportThing(cid, tpos) doSendMagicEffect(tpos, 10) end end
dont forget to put your right place Coordinates here
this is an example
Code:tepos = {x=1000, y=1000, z=7}
Then put in data/actions.xml
Code:<action itemid="9141" script="teleport.lua"/>
That's not checking if the player has a skull
function onUse(cid, item, fromPosition, itemEx, toPosition)
tepos = {x=, y=, z=}
playerSkull = getCreatureSkullType(cid)
if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE or playerSkull == SKULL_RED or playerSkull == SKULL_BLACK then
doPlayerSendCancel(cid, "Either you have battle sign or you have a skull that prevent you from teleporting.")
else
doTeleportThing(cid, tpos)
doSendMagicEffect(tpos, 10)
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
tepos = {x=, y=, z=}
playerSkull = getCreatureSkullType(cid)
if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE or playerSkull == SKULL_RED or playerSkull == SKULL_BLACK or playerSkull == SKULL_WHITE then
doPlayerSendCancel(cid, "Either you have battle sign or you have a skull that prevent you from teleporting.")
else
doTeleportThing(cid, tpos)
doSendMagicEffect(tpos, 10)
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local ppos = { x=100, y=100, z=7 }
local skull = getCreatureSkullType(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == false) then
if (skull == SKULL_NONE) then
doTeleportThing(cid, ppos)
doCreatureSay(cid, "Teleported!", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are skulled and cannot use this.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are currently in a fight.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return true
end
actions/scripts/script.lua
LUA:function onUse(cid, item, fromPosition, itemEx, toPosition) local ppos = { x=100, y=100, z=7 } local skull = getCreatureSkullType(cid) if (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then if (skull == SKULL_WHITE) or (skull == SKULL_RED) or (skull == SKULL_BLACK) then doTeleportThing(cid, ppos) doCreatureSay(cid, "Teleported!", TALKTYPE_ORANGE_1) doSendMagicEffect(toPosition, CONST_ME_TELEPORT) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are skulled and cannot use this.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are currently in a fight.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end return true end
Now it will work, sorry about that...
function onUse(cid, item, fromPosition, itemEx, toPosition)
local ppos = { x=100, y=100, z=7 }
local skull = getCreatureSkullType(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == false) and if (skull == SKULL_WHITE) or (skull == SKULL_RED) or (skull == SKULL_BLACK) == false then
doTeleportThing(cid, ppos)
doCreatureSay(cid, "Teleported!", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Players who are skulled or are in a battle may not use this.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
return true
end
Updated my post, on the first page.
Now, try it![]()
Works good now!
Thanks for the script!
+rep
edit: need to spread some before you get some :F