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

[use lever to get a new town id ]

The above is the standard at which these "RL MAP" people work.

Heck, they can't even find the right forum or even use the Search function without someone having to explain it to them...
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local towns = {
		[COLOR="red"][1001][/COLOR] = { -- [COLOR="red"]Lever Action ID[/COLOR]
			town = 1
		},
		[1002] = {
			town = 2
		},
		[1003] = {
			town = 3
		}
	}
	local v = towns[item.actionid]
	return doPlayerSetTown(cid, v.town) and doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
 
Code:
<action actionid="[COLOR="red"]1001;1002;1003[/COLOR]" event="script" value="[COLOR="red"]script.lua[/COLOR]"/>
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local towns = {
		[1001] = { -- Lever Action ID
			town = 1
		},
		[1002] = {
			town = 2
		},
		[1003] = {
			town = 3
		}
	}
	local v = towns[item.actionid]
	return doPlayerSetTown(cid, v.town) and doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) and doPlayerSendTextMessage(cid,22,"You are now Chitzen of ".. getTownName(getPlayerTown(cid)) ..".")
end
or should it be like this??
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local towns = {
		[1001] = { -- Lever Action ID
			town = 1
		},
		[1002] = {
			town = 2
		},
		[1003] = {
			town = 3
		}
	}
	local v = towns[item.actionid]
	return doPlayerSetTown(cid, v.town) and doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) and doPlayerSendTextMessage(cid,22,"You are now Chitzen of ".. getTownName(v.town) ..".")
end
 
Back
Top