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

Remove Teleport (REQUEST)

homarwh

Just a Milan fan.
Joined
Dec 29, 2012
Messages
93
Reaction score
3
Location
Mexico
Hello everyone.

1 - i need a script that makes when an X amount of players enter in a teleport this dissapear or if you can't do that, when just 1 player enter dissapear.

2 - when teleport dissapear, send a broadcast like "X players enter in teleport at time" or something like that.

3 - Im using TFS 0.3.6


Thank in advice :)
 
give this a try
LUA:
local t = {
minPlayers = 3,
storage = 45600,
pos = {x= ,y= ,z= }, -- where they get teleported to
tpPos = {x= ,y= ,z= }, -- where the tp is
tp = 1387,
}
function onStepIn(cid, item, position, fromPosition)
if getGlobalStorageValue(cid, t.storage) < 0 then
setGlobalStorageValue(cid, t.storage, 0)
end
if getGlobalStorageValue(cid, t.storage) < t.minPlayers then
	setGlobalStorageValue(cid, t.storage, (getGlobalStorageValue(cid, t.storage)+1))
	doTeleportThing(cid, t.pos)
		if getGlobalStorageValue(cid, t.storage) >= t.minPlayers then
			doRemoveItem(getTileItemById(t.tpPos,t.tp).uid)
			doBroadcastMessage(getGlobalStorageValue(cid, t.storage).." joined the event!")
		end
end
return true
end
 
Last edited:
[27/06/2013 11:05:35] [Error - MoveEvents Interface]
[27/06/2013 11:05:35] data/movements/scripts/teleport.lua:onStepIn
[27/06/2013 11:05:35] Description:
[27/06/2013 11:05:35] (luaDoRemoveItem) Item not found
[27/06/2013 11:05:35] > Broadcasted message: "-1 joined the event!".
 
edited, try it now. make sure the TP on the map doesnt have a destination and that its just configured in the script.
then set the tile underneath the tp with a uniqueid that will run this script
 
Send this error at startup :S

[27/06/2013 11:25:38] [Error - LuaScriptInterface::loadFile] data/movements/scripts/teleport.lua:6: '}' expected (to close '{' at line 1) near 'tp'
[27/06/2013 11:25:38] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/teleport.lua)
[27/06/2013 11:25:38] data/movements/scripts/teleport.lua:6: '}' expected (to close '{' at line 1) near 'tp'
 
LUA:
local t = {
minPlayers = 3,
storage = 45600,
pos = {x= ,y= ,z= }, -- where they get teleported to
tpPos = {x= ,y= ,z= }, -- where the tp is
tp = 1387
}
function onStepIn(cid, item, position, fromPosition)
if getGlobalStorageValue(cid, t.storage) < 0 then
setGlobalStorageValue(cid, t.storage, 0)
end
if getGlobalStorageValue(cid, t.storage) < t.minPlayers then
	setGlobalStorageValue(cid, t.storage, (getGlobalStorageValue(cid, t.storage)+1))
	doTeleportThing(cid, t.pos)
		if getGlobalStorageValue(cid, t.storage) >= t.minPlayers then
			doRemoveItem(getTileItemById(t.tpPos,t.tp).uid)
			doBroadcastMessage(getGlobalStorageValue(cid, t.storage).." joined the event!")
		end
end
return true
end

- - - Updated - - -

there was an extra {,}
 
Not send errors on startup but doesn't work and no errors on console, i didn't did that part of uniqueid, can you tell me how is that?

edited, try it now. make sure the TP on the map doesnt have a destination and that its just configured in the script.
then set the tile underneath the tp with a uniqueid that will run this script
 
make a teleport on remere map and put unique id = 50002
don't edit destination------edit destination in script and add this to movement.xml
LUA:
<movevent type="StepIn" actionid="50002" event="script" value="teleporter.lua"/>
 
Back
Top