Action Use Lever, Change Looktype [Monster or Outfit]

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
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:

slawkens

Developer
Premium User
Joined
Aug 27, 2007
Messages
2,880
Best answers
62
Reaction score
392
Location
Germany
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
 
OP
JDB

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
@Up,

Thanks, I changed that.
 
OP
JDB

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
@Topic,

Script Updated and Tested.
It works 100%.
 
OP
JDB

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Bump.
 
OP
JDB

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Bump. :cool:
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Stop Bumping, <_<

Regards,
Shawak
 
OP
JDB

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Thats my first bump on this thread for days.
 

Flatlander57

Banned User
Joined
Aug 7, 2009
Messages
367
Best answers
0
Reaction score
2
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!
 

fatelord

New Member
Joined
Aug 7, 2007
Messages
56
Best answers
0
Reaction score
1
@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! ^^
 

Appzyt

New Member
Joined
Jun 1, 2008
Messages
92
Best answers
0
Reaction score
0
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!
 

Massiah

mApScripthoSt
Joined
Sep 10, 2008
Messages
38
Best answers
0
Reaction score
1
Location
U.S.A
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
 

Drogo

New Member
Joined
Feb 1, 2010
Messages
9
Best answers
0
Reaction score
0
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
 
OP
JDB

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
I updated some stuff, try again.
 
Top