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

Lua Teleport for vocations.

Fare

Advanced OT User
Joined
Apr 3, 2008
Messages
2,387
Reaction score
151
Location
Ukraine
I tryed to make teleport, which will teleport only knights. Here is my script:
PHP:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE and item.actionid == 12555 then
	if GetPlayerVocation(cid) == 4 then
	doPlayerSendTextMessage(cid,22,"Feel free to train")
	doTeleportThing(cid, {x = getPlayerPosition(cid).x - 2, y = getPlayerPosition(cid).y, z = getPlayerPosition(cid).z }, 0)
	else 
	doTeleportThing(cid, frompos, 0)
	doPlayerSendTextMessage(cid,22,"Only warriors can go there.")
	end
	end
	return TRUE
end

I've get error in console:

Code:
[09/10/2008  17:39:04] Lua Script Error: [MoveEvents Interface] 
[09/10/2008  17:39:04] data/movements/scripts/citizen.lua:onStepIn

[09/10/2008  17:39:04] data/movements/scripts/citizen.lua:3: attempt to call global 'GetPlayerVocation' (a nil value)
[09/10/2008  17:39:04] stack traceback:
[09/10/2008  17:39:04] 	data/movements/scripts/citizen.lua:3: in function <data/movements/scripts/citizen.lua:1>


Whats wrong? =\
 
Back
Top