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

Lua I'm trying to make a tile...

mayel

New Member
Joined
Sep 11, 2009
Messages
174
Reaction score
2
Location
Stockholm, Sweden
Yes,

I'm trying to make a tile so that when a character walks on it and doesn't meet certain
circumstances, he will be teleported to x,y,z pos.
I.e:
He walks on a tile but hasn't the right vocation number, so he will be teleported.
If you want areas for only knights i.e.
I have made a tile in RME with uid 3222, and it's id is 451.
Please come with ideas...
Special thanks to JDB, for helping me out yesterday.
 
I'm not a great lua scripter, but I think this will work. Not sure though..

LUA:
local pos = {x=50,y=50,z=7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if item.actionid == 6666 then
		if not isKnight(cid) then
			doTeleportThing(cid, pos, TRUE)
		else
			doPlayerSendCancel(cid, "Sorry, You are not the right vocation.")
		end
	end
	return true
end
 
Last edited:
I'm not a great lua scripter, but I think this will work. Not sure though..

LUA:
local pos = {x=50,y=50,z=7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if item.actionid == 6666 then
		getPlayerVocation(cid)
	if isKnight(cid) then
		doTeleportThing(cid, pos, TRUE)
	else doPlayerSendCancel(cid, "Sorry, You are not the right vocation."
end

else try this

LUA:
local pos = {x=50,y=50,z=7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if item.actionid == 6666 and getPlayerVocation(cid, 4) then
		doTeleportThing(cid, pos, TRUE)
	else doPlayerSendCancel(cid, "Sorry, You are not the right vocation."
end


Didn't you forget ")" at;
else doPlayerSendCancel(cid, "Sorry, You are not the right vocation."

EDIT: I am not a good lua scripter too. i want to learn.
 
Back
Top