Action Outfit Changer (Switch)

XRobin

Beginner Mapper/Spriter
Joined
Nov 13, 2008
Messages
99
Best answers
0
Reaction score
0
Idea from : http://otland.net/f81/outfit-changer-35234/



Lua:
-- 90 % By Shawak / 10 % By XRobin --
local effects = {1, 2, 3, 4, 5, 6, 7}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i = 1, #effects do
	        doSendMagicEffect(getCreaturePosition(cid), effects[i])
	end
	doCreatureChangeOutfit(cid, {lookType = math.random(2, 134), lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
	doSendAnimatedText(getPlayerPosition(cid),"Changed!", math.random(01,255))
return TRUE
end
Maby :
 
Last edited:

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Give ME credits for MY SCRIPTS!
Helping you don't mean posting the scripts on otland.
 
OP
XRobin

XRobin

Beginner Mapper/Spriter
Joined
Nov 13, 2008
Messages
99
Best answers
0
Reaction score
0
@Shawak
Done :S
 
OP
XRobin

XRobin

Beginner Mapper/Spriter
Joined
Nov 13, 2008
Messages
99
Best answers
0
Reaction score
0
Added : Outfit Time.
Lua:
-- 75 % By Shawak / 25 % By XRobin--
local effects = {1, 2, 3, 4, 5, 6, 7}
local time = 5*10000  

function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i = 1, #effects do
	        doSendMagicEffect(getCreaturePosition(cid), effects[i])
	end
	doSetCreatureOutfit(cid, {lookType = math.random(2, 134), lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}, time)
	doSendAnimatedText(getPlayerPosition(cid),"Changed!", math.random(01,255))
return TRUE
end
-.-
 

SnowFox

New Member
Joined
May 18, 2008
Messages
264
Best answers
0
Reaction score
0
can you make it cost 1k as well each turn?
 

klekSu

Stroke my ego.
Joined
Nov 4, 2008
Messages
1,285
Best answers
0
Reaction score
18
It's debugging whole server :eek:
 

Azi

Banned User
Joined
Aug 12, 2007
Messages
1,167
Best answers
0
Reaction score
51
Location
Włocławek
use "_time" veriable without "time" it's function key in lua... it can debuging.

PHP:
local cfg = {
	effects = {1,7}, -- effect from x to y ({1,7} = 1,2,3,4,5,6,7)
	_time = 300 -- in seconds outfit condition (300=5mins)
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local _pos = getPlayerPosition(cid)
	for i=cfg.effects[1],cfg.effects[2] do doSendMagicEffect(_pos, [i]) end
	local out = getCreatureOutfit(cid) out.lookType = math.random(2, 134)
	doSetCreatureOutfit(cid, out, cfg._time) doSendAnimatedText(_pos,"Changed!", math.random(1,255))
	return TRUE
end
My version.
 
Last edited:

JuanC

New Member
Joined
Sep 24, 2009
Messages
220
Best answers
0
Reaction score
2
I tried add a cost, but only get debugs :S
Code:
local effects = {1, 2, 3, 4, 5, 6, 7}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerMoney(cid) < 25 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Need more platinums...")
	doCreatureSay(cid, "Go go kill ;)", TALKTYPE_GREEN_1, cid)
return false
end

	for i = 1, #effects do
	        doSendMagicEffect(getCreaturePosition(cid), effects[i])
	end
	doCreatureChangeOutfit(cid, {lookType = math.random(2, 134), lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
	doPlayerRemoveMoney(cid, 25)
	doSendAnimatedText(getPlayerPosition(cid),"Changed!", math.random(01,255))
return TRUE
end
 

JuanC

New Member
Joined
Sep 24, 2009
Messages
220
Best answers
0
Reaction score
2
Thanks... I change Green to Orange. Only can use this color?
 

Fady

Anderion.net
Joined
Aug 13, 2009
Messages
572
Best answers
0
Reaction score
17
Location
Egypt
I like this script :)
how can i make it 100 charges only then it finishes?
 
Top