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

Teleport that is needed money to enter

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
I need a teleport that when you step in only teleports you if you have 3k in the backpack
How can I do that?
 
Lua:
function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		local new
		if doPlayerRemoveMoney(cid, 3000) then
			new = {x=100, y=100, z=7}
		else
			new = {x=100, y=100, z=7}
			doPlayerSendCancel(cid, 'You need 3k to enter!')
		end
		doTeleportThing(cid, new)
		if not hasCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) then
			doSendMagicEffect(pos, 10)
			doSendMagicEffect(new, 10)
		end
	end
end
 
I have a problem n the script because gives an error in my server (tfs 0.2.11)

Code:
[30/07/2011 11:36:02] Lua Script Error: [MoveEvents Interface] 
[30/07/2011 11:36:02] data/movements/scripts/payegiptos.lua:onStepIn
[30/07/2011 11:36:02] data/movements/scripts/payegiptos.lua:11: attempt to call global 'hasCondition' (a nil value)
[30/07/2011 11:36:02] stack traceback:
[30/07/2011 11:36:02] 	[C]: in function 'hasCondition'
[30/07/2011 11:36:02] 	data/movements/scripts/payegiptos.lua:11: in function <data/movements/scripts/payegiptos.lua:1>
 
Back
Top Bottom