• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Teleport Scroll To Temple

tetra20

DD
Joined
Jan 17, 2009
Messages
1,315
Solutions
4
Reaction score
323
Location
Egypt
I Knew that There Is Many Posts About this .. I made it myself (i am a newbie Scripter)^_^
Code:
function onUse(cid, item, frompos, item2, topos)

if  (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
	doPlayerSendCancel(cid, "You Can't Teleport In Battle.")
	doSendMagicEffect(getPlayerPosition(cid), 2)
	else
if  (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
	doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	doPlayerSendTextMessage(cid, 4, "Welcome In Enigma Temple.")
	doSendMagicEffect(getPlayerPosition(cid), 31)
	end
	end
	end

Code:
<action itemid="6119" script="scroll.lua"/>
 
if you use the if, and then the else, you dont need to check again the same function cus you alrdy check if the functions is true, so the else will be false ("else" works like "not").
So you dont need this line: " if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then ".
Also, learn to tab :)
GJ bro.
 
Lua:
function onUse(cid, item, frompos, item2, topos)
	if getCreatureCondition(cid, CONDITION_INFIGHT) then
		doPlayerSendCancel(cid, "You Can't Teleport In Battle.")
		doSendMagicEffect(getPlayerPosition(cid), 2)
	else
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doPlayerSendTextMessage(cid, 4, "Welcome In Enigma Temple.")
		doSendMagicEffect(getPlayerPosition(cid), 31)
	end
return true
end

Here u are ^^
 
Back
Top