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

Editing Script

Lucenzo

The Way You Move :)
Joined
Jan 29, 2011
Messages
363
Reaction score
14
Location
UK
LUA:
function onUse(cid, item, fromPosition, itemEx, topos)
local newPosition = {x = 32604, y = 31340, z = 11}
	if item.uid == 2000 and item.itemid == 7131 then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doTeleportThing(cid, newPosition, TRUE)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	end
end

LUA:
function onUse(cid, item, fromPosition, itemEx, topos)
local newPosition = {x = 32601, y = 31504, z = 13}
	if item.uid == 3000 and item.itemid == 7131 then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doTeleportThing(cid, newPosition, TRUE)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	end
end


These 2 scripts are suppose to be for Beregar mines carts, but i think it would be better to have 1 script rather than 2.

So if someone could put this into one script, that'd be great :)

Thanks in Advance x x
 
LUA:
function onUse(cid, item, fromPosition, itemEx, topos)
local newPositiona = {x = 32604, y = 31340, z = 11}
local newPositionb = {x = 32601, y = 31504, z = 13}
	if item.uid == 2000 and item.itemid == 7131 then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doTeleportThing(cid, newPositiona, TRUE)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
		elseif item.uid == 3000 and item.itemid == 7131 then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doTeleportThing(cid, newPositionb, TRUE)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
		end
	return TRUE	
end
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local n, f = item.uid == 2000 and {x=32604, y=31340, z=11} or {x=32601, y=31504, z=13}, getThingPos(cid)
	doTeleportThing(cid, n)
	doSendMagicEffect(f, CONST_ME_TELEPORT)
	doSendMagicEffect(n, CONST_ME_TELEPORT)
	return true
end
 
@Cykotitan Thanks

I don't understand that script haha :S confusing... How does it check for uid 2k/3k o can 2k be used for several things? Since there are 2 carts :p

@Bogart, Thanks

Understand everything :P
 
I don't understand that script haha :S confusing...
it's called efficient scripting. nothing to understand there
How does it check for uid 2k/3k o can 2k be used for several things? Since there are 2 carts :p
it can't be used for several things, unique ids are unique
if unique id isn't 2000, the 2nd pos is used
 
Back
Top