• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Close Theard

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?
Closed!
 
Last edited:
Entering the spawn script:
LUA:
local t = {
	a = 2000,
	b = 180, --time to wait (facc)
	c = 60, --time to wait (pacc)
	d = {x=x, y=y, z=z}
	}
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) then
		if isPremium(cid) then
			if getPlayerStorageValue(cid, t.a) <= 0 then
				doTeleportThing(cid, t.d)
			else
				doTeleportThing(cid, fromPosition)
				doPlayerSendTextMessage(cid, 21, "You have to wait "..c.." minutes to get inside again!.")
			end
		end
			if getPlayerStorageValue(cid, t.a) <= 0 then
				doTeleportThing(cid, t.d)
			else
				doTeleportThing(cid, fromPosition)
				doPlayerSendTextMessage(cid, 21, "You have to wait "..b.." minutes to get inside again!.")
			end
	end
end
leaving the spawn script:
LUA:
local t = {
	a = 2000, -- free storage
	b = 180, --time to wait (facc)
	c = 160, --time to wait (pacc)
	d = {x=x, y=y, z=z} -- out of the spawn pos
	}
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) then
		if isPremium(cid) then
			exhaustion.set(cid, t.a, t.c)
			doTeleportThing(cid, t.d)
		end
			exhaustion.set(cid, t.a, t.b)
			doTeleportThing(cid, t.d)
	end
end
 
Last edited:
Bogart i get this error :(

Code:
[04/02/2012 09:08:55] [Error - LuaScriptInterface::loadFile] data/movements/scripts/entertp.lua:20: 'end' expected (to close 'function' at line 8) near '='
[04/02/2012 09:08:55] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/entertp.lua)
[04/02/2012 09:08:55] data/movements/scripts/entertp.lua:20: 'end' expected (to close 'function' at line 8) near '='
[04/02/2012 09:08:55] [Error - LuaScriptInterface::loadFile] data/movements/scripts/leavetp.lua:15: 'end' expected (to close 'function' at line 8) near '='
[04/02/2012 09:08:55] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/leavetp.lua)
[04/02/2012 09:08:55] data/movements/scripts/leavetp.lua:15: 'end' expected (to close 'function' at line 8) near '='
 
Bogart nothing happens, no time, no errors :( if i added right?

Code:
	<movevent type="StepIn" actionid="3000" event="script" value="entertp.lua" />
	<movevent type="StepIn" actionid="3001" event="script" value="leavetp.lua" />

Then i added 3000 and 3001 on enter tp and leave tp in the map!
 
Bogart tp back working now, but still i can enter tp and leave tp how many times i want without waiting :(
 
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid, 9992) then
		doTeleportThing(cid, lastPosition, false)
	else
	setPlayerStorageValue = 9991
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Once you exit you have to wait 180 seconds before you can enter again.")
	end
end


LUA:
local seconds, premiumseconds = [180], [60]
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid, 9991) and isPremium(cid) then
		setPlayerStorageValue = 9992
		exhaustion.set(cid, 9992, premiumseconds)
		doPlayerSendCancel(cid, "You have left the area, you now have to wait for " ..exhaustion.get(cid, 9992).. " before you can enter again.")
	elseif getPlayerStorageValue(cid, 9991) and not isPremium(cid) then
		setPlayerStorageValue = 9992
		exhaustion.set(cid, 9992, seconds)
		doPlayerSendCancel(cid, "You have left the area, you now have to wait for " ..exhaustion.get(cid, 9992).. " before you can enter again.")
	end
end
 
Last edited:
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid, 9992) then
		doTeleportThing(cid, lastPosition, true)
	else
	setPlayerStorageValue = 9991
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Once you exit you have to wait 180 seconds before you can enter again.")
end

LUA:
local seconds = [180]
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid, 9991) then
		setPlayerStorageValue = 9992
		exhaustion.set(cid, 9992, seconds)
		doPlayerSendCancel(cid, "You have left the area, you now have to wait for " ..exhaustion.get(cid, 9992).. " before you can enter again.")
	end
end

wat about premium and facc difference ._.
 
Bogart it didnt work no text, and leave tp doesnt work :(
Code:
[04/02/2012 23:30:30] [Error - MoveEvents Interface] 
[04/02/2012 23:30:30] data/movements/scripts/leavetp.lua:onStepIn
[04/02/2012 23:30:30] Description: 
[04/02/2012 23:30:30] data/lib/034-exhaustion.lua:144: attempt to perform arithmetic on local 'mytempo' (a nil value)
[04/02/2012 23:30:30] stack traceback:
[04/02/2012 23:30:30] 	data/lib/034-exhaustion.lua:144: in function 'set'
[04/02/2012 23:30:30] 	data/movements/scripts/leavetp.lua:10: in function <data/movements/scripts/leavetp.lua:7>

Troll your script got errors and no premium time :(

Code:
[04/02/2012 23:28:29] [Error - LuaScriptInterface::loadFile] data/movements/scripts/entertp.lua:7: 'end' expected (to close 'function' at line 1) near '<eof>'
[04/02/2012 23:28:29] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/entertp.lua)
[04/02/2012 23:28:29] data/movements/scripts/entertp.lua:7: 'end' expected (to close 'function' at line 1) near '<eof>'
[04/02/2012 23:28:29] [Error - LuaScriptInterface::loadFile] data/movements/scripts/leavetp.lua:1: unexpected symbol near '['
[04/02/2012 23:28:29] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/leavetp.lua)
[04/02/2012 23:28:29] data/movements/scripts/leavetp.lua:1: unexpected symbol near '['
 
Now the leave tp works and enter tp with no errors, but still i can enter how many times i want :(
 
Bogart I tested no text only error on enter tp :(

Code:
[05/02/2012 00:00:07] [Error - MoveEvents Interface] 
[05/02/2012 00:00:07] data/movements/scripts/entertp.lua:onStepIn
[05/02/2012 00:00:07] Description: 
[05/02/2012 00:00:07] data/movements/scripts/entertp.lua:14: attempt to concatenate global 'c' (a nil value)
[05/02/2012 00:00:07] stack traceback:
[05/02/2012 00:00:07] 	data/movements/scripts/entertp.lua:14: in function <data/movements/scripts/entertp.lua:7>

Troll error on leave tp:
Code:
[05/02/2012 00:03:23] [Error - LuaScriptInterface::loadFile] data/movements/scripts/leavetp.lua:1: unexpected symbol near '['
[05/02/2012 00:03:23] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/leavetp.lua)
[05/02/2012 00:03:23] data/movements/scripts/leavetp.lua:1: unexpected symbol near '['
 
Back
Top