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

MoveEvent Staff only teleport!

ghettobird

LUA newbie
Joined
Aug 17, 2013
Messages
679
Reaction score
132
Location
OTland
Hello Otlanders, if you remember i already released a script called "staff only door" well now i bring you a staff only teleport ;)


TO EXPERIENCED LUA SCRIPTERS: i tried to do this but i failed so maybe you guys can do it, when u go inside the teleport and it teleports u if you go on it again u get teleported back, what i wanted to do is if you are already inside and you go inside the teleport you are teleported outside :)
-----------------------------------------------------------------------------------------------------------
now back to business,

movements/scripts
Lua:
 function onStepIn(cid, item, position, fromPosition)
if(getPlayerGroupId(cid) >= 6) then
doTeleportThing(cid, {x=1000,y=998,z=4}, true)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "BOW TO THE OWNER")
else
doTeleportThing(cid, {x=1000,y=1000,z=4}, true)
doPlayerSendCancel(cid, "Sorry, only owner ghettobird passes from here.")
end
return true
end


I hope this helps you :peace:
 
This Looks Weird but

Weird Version

Lua:
doTeleportThing(cid, {x=1000,y=1000,z=4}, true)

Better Version

Lua:
doTeleportThing(cid, fromPosition, true)

Tetra20
 
This Looks Weird but

Lua:
doTeleportThing(cid, [COLOR="#FF0000"]{x=1000,y=1000,z=4}[/COLOR], true)

Correct Version

Lua:
doTeleportThing(cid, [COLOR="#FF0000"]fromPosition[/COLOR], true)

and you don't need that true in doTeleportThing

Tetra20

That "true" in doTeleportThing might be handy.
Lua:
doTeleportThing(cid, newpos[, pushmove])
 
anyone can do as i asked tho? also tetra i tested it and it works :)

25a4vx2.jpg
 
You Will Notice That using fromPosition is better than using x,y,z.
and try using some magic effects in your script
 
@tetra20: I need to figure out how to make it if I'm already inside i can go out then i can add the magic effects :p
 
If i understand right, you could do it with storage. That when they enter it set a storage and when they go into the tp again and it will check if the player has that storage so, he will be tped out and removed storage.

Lua:
function onStepIn(cid, item, position, fromPosition)
        if (not isPlayer(cid)) then return true end
	if(getPlayerGroupId(cid) < 6) then
		doTeleportThing(cid, fromPosition, true)
		doPlayerSendCancel(cid, "Sorry, only owner ghettobird passes from here.")
	return true
	end
	if (getPlayerStorageValue(cid, 1000) < 1) then
		doTeleportThing(cid, {x=1000,y=998,z=4}, true)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "BOW TO THE OWNER")
		setPlayerStorageValue(cid, 1000, 1)
	else
		doTeleportThing(cid, {x=1000,y=1000,z=4}, true)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Out")
		setPlayerStorageValue(cid, 1000, 0)
	end
	return true
end
 
Back
Top