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

Action Use Lever, Change Looktype [Monster or Outfit]

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
115
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.outfit = { lookType = 35, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0 }
	cfg.storage = 10101
	cfg.time = 5 -- Minutes
	if(exhaustion.get(cid, cfg.storage) == true) then
		doPlayerSendCancel(cid, "You can only use this once every " .. cfg.time .. " minutes.")
		return true
	end
	if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
		doSendAnimatedText(getCreaturePosition(cid), 'GiRl', TEXTCOLOR_GOLD)
	elseif(getPlayerSex(cid) == PLAYERSEX_MALE) then
		doSendAnimatedText(getCreaturePosition(cid), 'MaLe', TEXTCOLOR_GOLD)
	end
	doSetCreatureOutfit(cid, cfg.outfit, cfg.time * 60 * 1000)
	exhaustion.set(cid, cfg.storage, cfg.time * 60 * 1000)
	return true
end
 
Last edited:
if(getPlayerStorageValue(cid, config.storage ~= TRUE) then

to

if(getPlayerStorageValue(cid, config.storage) ~= 1) then

for compatibility ;)

and I'm not sure if it will work:
if(getCreatureOutfit(cid) ~= config.outfit) then
 
@Up,

Thanks, I changed that.
 
@Topic,

Script Updated and Tested.
It works 100%.
 
Thats my first bump on this thread for days.
 
Works good its cool for a war server.

Is there a way to make it say there are too many players of this race please choose another for a team balance?

Message me back!
 
@Flatlander
Just configure some globalstorage to sum, and then check [too lazy to script]

It's not hard. Just read the files in the DOCS folder [open with wordpad]. Most of the things I've scripted its by trying and getting strange super other-dimensional errors XD

Go for it! ^^
 
Quick question. Is it possible to make this like real Tibia, pull lever and you got the looktype in Set Outsift and only when you pull this lever? Thanx!
 
nice script, ill deff use it, Rep++ for JDB
@shawak, do you have beef with the poster or do you think you run otland? ive seen you flame him a couple times over bs ;P
 

srry, emm the server no report errors, not work,
don't change the outfit, and when a player stay
with me, send debug error and close my tibia,
but I deleted this action xD i don't know what
happens xd and my english is very bad D: kjakja
 
I updated some stuff, try again.
 
Back
Top