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

Help with a teleportation script I made

watkins577

As3, lua, xml scripter
Joined
Sep 20, 2008
Messages
130
Reaction score
0
Ok I made a script that if someone steps on a tile, they get teleported to an island. After 50 seconds you get a warning and after 10 more seconds you get teleported off the island back to just before the tile you step on. However... If someone else goes through after you, only the other person will get the warning and get teleported.

Heres my script...
Code:
function onStepIn(cid, item, pos)
	ppos = {x=248, y=225, z=7}
	doTeleportThing(cid, ppos, TRUE)
	doPlayerSendTextMessage(cid, 25, "You seem to be on a new island!")
	addEvent(warn, 1*50*1000, cid)
	addEvent(reset, 1*60*1000, cid)
	return TRUE
end
function warn(cid)
	doPlayerSendTextMessage(cid, 25, "You feel yourself waking up...")
	return TRUE
end
function reset(cid)
	ppos2 = {x=209, y=246, z=7}
	doTeleportThing(cid, ppos2, TRUE)
	doPlayerSendTextMessage(cid, 25, "You wake up in a daze, with a banging headache!")
	return TRUE
end

Can anyone help?
 
do you get any error?

try:

Lua:
local config = {Pos = {x=248, y=225, z=7}, Ppos = {x=209, y=246, z=7}}

function warn()
	doPlayerSendTextMessage(cid, 25, "You feel yourself waking up...")
	return TRUE
end

function reset()
	doTeleportThing(cid, config.Ppos)
	doPlayerSendTextMessage(cid, 25, "You wake up in a daze, with a banging headache!")
	return TRUE
end

function onStepIn(cid, item, position, fromPosition)
    doTeleportThing(cid, config.Pos)
	doPlayerSendTextMessage(cid, 25, "You seem to be on a new island!")
	addEvent(warn, 50000)
	addEvent(reset, 60000)
	return TRUE
end
 
Last edited:
Well it give the last player the warning twice(or how ever many are on the island) and teleports him twice(Same as warning lol).

And your script wont work because cid is not a global variable and is defined where it says onStepIn(cid etc..)

EDIT: I just added cid to the params and it worked! THANKS!
 
Last edited:
Back
Top