• 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
still one small problem
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray({SKULL_WHITE, SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) then 
		doPlayerSendCancel(cid, "You cannot teleport because you are skulled.")
	elseif isPlayerPzLocked(cid) then
		doPlayerSendCancel(cid, "You cannot teleport while in a fight.")
	else
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), CONST_ME_ENERGYAREA)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported.")
	end
	return true
end
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
return true,
	isInArray({SKULL_WHITE, SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) and doPlayerSendCancel(cid, "You cannot teleport because you are skulled.") or
	(isPlayerPzLocked(cid)) and doPlayerSendCancel(cid, "You cannot teleport while in a fight.") or
	doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) and doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), CONST_ME_ENERGYAREA) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported.")
end
 
reverted to a more readable version,
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray({SKULL_WHITE, SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) then 
		doPlayerSendCancel(cid, "You cannot teleport because you are skulled.")
	elseif isPlayerPzLocked(cid) then
		doPlayerSendCancel(cid, "You cannot teleport while in a fight.")
	else
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), CONST_ME_ENERGYAREA)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported.")
	end
	return true
end
 
Well, this is the most basic thing to do with a script, edit it. You can learn some lua scripting in the tutorial section. The first thing to learn would be how to start a script and how to end it, and always look how all scripts are set up :).
 
scoll isnt right i can use if i been attacked by a person ;/ i want it usable if you been attacked by a monsters but not a person. is that possible?
 
reverted to a more readable version,
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray({SKULL_WHITE, SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) then 
		doPlayerSendCancel(cid, "You cannot teleport because you are skulled.")
	elseif isPlayerPzLocked(cid) then
		doPlayerSendCancel(cid, "You cannot teleport while in a fight.")
	else
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), CONST_ME_ENERGYAREA)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported.")
	end
	return true
end

i want that he can be tped to the temple even if he have fight or have a ws= white skull!!
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doTeleportThing(cid, getPlayerMasterPos(cid))
	doSendMagicEffect(getThingPos(cid), CONST_ME_ENERGYAREA)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have been teleported.')
	doRemoveItem(item.uid)
	return true
end
 
Back
Top