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

need fix teleport script, ore wagons

pippo

New Member
Joined
May 3, 2011
Messages
46
Reaction score
0
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

  if item.itemid == 7132 then
    return 
	elseif(item.actionid == 53232) and getPlayerStorageValue(cid, 35974) <= 1 then
       doTeleportThing(getTopCreature({x=33167,y=31639,z=7}).uid, {x=33110,y=31589,z=12})
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")
	elseif (item.actionid == 53233) and getPlayerStorageValue(cid, 35974) <= 1 then
		doTeleportThing(getTopCreature({x=33107,y=31590,z=12}).uid, {x=33167,y=31639,z=7})
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")
	elseif (item.actionid == 53234) and getPlayerStorageValue(cid, 35974) <= 1 then
		doTeleportThing(getTopCreature({x=33109,y=31588,z=12}).uid, {x=33187,y=31697,z=13})
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")	
	elseif (item.actionid == 53235) and getPlayerStorageValue(cid, 35974) <= 1 then
		doTeleportThing(getTopCreature({x=33187,y=31697,z=13}).uid, {x=33110,y=31589,z=12})
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")	
	end
	return true
end

can someone tell me whats wrong with this script? , and i need to set doplayersetcancel. ?

thanks in advance (^_^)
 
it must teleport if have correct storage value (^_^)

cause its not working, could you perhaps customize this script so it should work?

and this is for ore wagons, it shows no error and i cannot teleport
 
Teleport who? Why are you using getTopCreature and why are you checking for itemid 7132 and then return? If the itemid is 7132 it shouldn't work? So only with other ids?
 
ive tried to remove getTopcreature.. however errors are coming up i need to optimize this code for me to get it to work, could you perhaps give an example how this code would work? xD
 
Im kinda new at script's But try this. Tell me if it works.
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.itemid == 7132 then
    return
	elseif(item.actionid == 53232) and getPlayerStorageValue(cid, 35974) >= 1 then	
		doTeleportThing(cid, x=xxx, y=xxx, z=xxx)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")
		
	elseif (item.actionid == 53233) and getPlayerStorageValue(cid, 35974) >= 1 then
		doTeleportThing(cid, x=xxx, y=xxx, z=xxx)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")
		
	elseif (item.actionid == 53234) and getPlayerStorageValue(cid, 35974) >= 1 then
		doTeleportThing(cid, x=xxx, y=xxx, z=xxx)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")	
		
	elseif (item.actionid == 53235) and getPlayerStorageValue(cid, 35974) >= 1 then
		doTeleportThing(cid, x=xxx, y=xxx, z=xxx)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported.")	
	end
	return true
end
 
Last edited:
Back
Top