• 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!

Pls Cyberm help me with this script help me!! rep+++

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,287
Location
Sweden?
if you want enter a teleport it will come out text and it says pls call back your pokemon to enter the teleport, if the player dont call back the pokemon then he cant enter the teleport.


please i need this scripts fast as possible! Rep++
 
Last edited:
2. hmm i think the script will contain this things:

function onStepIn(cid, item, position, fromPosition)

if #getCreatureSummons(cid) >= 1 then
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid,"Please call back your pokemon.")
end
return true
end
 
try this.

Lua:
function onStepIn(cid,item,frompos,topos)
local v = getThingPos(cid)
	if getCreatureSummons(cid) then
		doPlayerSendCancel(cid,'You have to call back your pokemon before entering.')
		doTeleportThing(cid,frompos)
		doSendMagicEffect(v,CONST_ME_POFF)
	end
	return true
end

FIX
 
Last edited:
I get this error

[09/01/2011 16:19:34] [Error - MoveEvents Interface]
[09/01/2011 16:19:34] data/movements/scripts/tp.lua:eek:nStepIn
[09/01/2011 16:19:34] Description:
[09/01/2011 16:19:34] data/movements/scripts/tp.lua:5: attempt to compare number with table
[09/01/2011 16:19:34] stack traceback:
[09/01/2011 16:19:34] data/movements/scripts/tp.lua:5: in function <data/movements/scripts/tp.lua:1>
 
Apply either an actionid or a uniqueid to the teleport, register it in movements.xml, also remove teleport coords in your map editor and edit the tpto local

Lua:
local tpto = {x=1512,y=1257,z=7}--edit
function onStepIn(cid,item,frompos,topos)
local v = getThingPos(cid)
	if getCreatureSummons(cid) then
		doPlayerSendCancel(cid,'You have to call back your pokemon before entering.')
		doTeleportThing(cid,frompos)
		doSendMagicEffect(v,CONST_ME_POFF)
	else
		doTeleportThing(cid,tpto)
		doSendMagicEffect(tpto,CONST_ME_TELEPORT)
	end
	return true
end
 
Shouldnt this:
Lua:
if getCreatureSummons(cid) then
Be:
Lua:
if getCreatureSummons(cid) > 0 then
??
 
No

Code:
getCreatureSummons(cid)
				Info
					This functions checks for creature summons list.

				Returns
					false if creature not found, otherwise table with creatures list (NOTE: Can be empty!)
 
cant add it on action and doesnt work on movement when you enter the tp you dont get tped
 
but you use this and your pokemon teleport to you

Code:
local tpto = {x=1512,y=1257,z=7}--edit
function onStepIn(cid,item,frompos,topos)
local v = getThingPos(cid)
local poke = getCreatureSummons(cid)
	if  #poke <= 0 then
		doTeleportThing(cid, tpto)
		doSendMagicEffect(tpto, CONST_ME_TELEPORT)
	else
		doTeleportThing(poke[1], tpto)
                doTeleportThing(cid, tpto)
		doSendMagicEffect(tpto,CONST_ME_TELEPORT)
	end
	return true
end
 
Last edited:
No

Code:
getCreatureSummons(cid)
				Info
					This functions checks for creature summons list.

				Returns
					false if creature not found, otherwise table with creatures list (NOTE: Can be empty!)
If creature not found means if cid (player) is not found, which can't happen here. Use > 0
 
where should i put 0

pls help cyko
 
Last edited by a moderator:
This is in doc/LUA_FUNCTIONS.
Code:
	local summons = getCreatureSummons(cid)
	if(table.maxn(summons) <= 0) then -- no summons
		doPlayerSendCalcel(cid, "You don't have any summons..")
		return false
	end

	-- remove all summons ;)
	for _, pid in ipairs(summons) do
		doRemoveCreature(pid)
	end
 
you know how the script is gone be? If a player have a summon and try to enter a teleport, its come a text and says please call back your summon to enter, if he call back then he can enter if he dont then he cant enter.
 
Back
Top