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

(REQUEST) Teleport!Rep++ PLEASE FAST AS POSSIBLE :(

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Tfs 0.3.6

If a player try enter a all the teleports in the game with id 5023 he will get kicked 2 sqm back and it will come a text please call back your summon. i want it itemid, becuase i dont want to put on everyteleport diffrent id

Or if someone enter no-pvp zone it will come a text please call back your summon

Rep++
 
Last edited:
If a player have a monster summoned and try to enter a teleport with itemid 5023, it will come a text you cant enter the teleport if you have a monster summoned.

Sorry for the bump but i want the script fast as possible.
 
Not Tested.

<movevent type="StepIn" itemid="5023" event="script" value="tp1.lua"/>

function onStepIn(cid, item, position, fromPosition)
if #getCreatureSummons(cid) >= 1 then
doPlayerSendTextMessage(cid,22,"Please call back you'r pokemon to enter the teleport.")
end

return true
end
 
Untested

LUA:
function onStepIn(cid, item, position, fromPosition)
----- Config setup -----
local config = {
		summons = getCreatureSummons(cid),
		message = "You currently have summons and can't enter this portal!",
		Remove = true -- Do you want the script to automatically remove summons when player goes in portal?
	}
----- End config setup -----

if(table.maxn(config.summons) <= 0) then 
		return true
	end

if config.Remove == true then
	if(table.maxn(config.summons) >= 1) then
		for _, pid in ipairs(config.summons) do
			doRemoveCreature(pid)
				return true	
		end
	end
end
if config.Remove == false then
	if(table.maxn(config.summons) >= 1) then
	doPlayerSendTextMessage(cid, config.message)
		return false
		end
	end
end
 
Untested

LUA:
function onStepIn(cid, item, position, fromPosition)
----- Config setup -----
local config = {
		summons = getCreatureSummons(cid),
		message = "You currently have summons and can't enter this portal!",
		Remove = true -- Do you want the script to automatically remove summons when player goes in portal?
	}
----- End config setup -----

if(table.maxn(config.summons) <= 0) then 
		return true
	end

if config.Remove == true then
	if(table.maxn(config.summons) >= 1) then
		for _, pid in ipairs(config.summons) do
			doRemoveCreature(pid)
				return true	
		end
	end
end
if config.Remove == false then
	if(table.maxn(config.summons) >= 1) then
	doPlayerSendTextMessage(cid, config.message)
		return false
		end
	end
end

Just a tip, if the condition you'll use is the same, don't put it as a second condition, but as the first, so you just have to call it once:
LUA:
if #config.summons >= 1 then
   if config.Remove then
      for _,pid in ipairs(config.summons) do
          doRemoveCreature(pid)
      end
   else
       doPlayerSendTextMessage(cid, config.message)
       doTeleportThing(cid, fromPosition, true)
   end
end
 
I get this error pelase help!

Code:
[13/11/2011 17:39:38] [Error - MoveEvents Interface] 
[13/11/2011 17:39:38] data/movements/scripts/portal.lua:onStepIn
[13/11/2011 17:39:38] Description: 
[13/11/2011 17:39:38] (luaDoPlayerSendTextMessage) Player not found
 
Back
Top