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

Lua Script that change outfit 8.54

krycha511

New Member
Joined
Dec 24, 2015
Messages
19
Reaction score
0
I'm looking for script that change outfit if u wear x item.
Example: If u put X item in ring placement it change your outfit, if u put it back (ex to bp) outfit reverts to previous.
@edit
Sorry for bad English.
 
data/movements.xml

look in there, figure out how the script ones works (those who mention to read an .lua file)
open the LUA file and check it out....

That will bring you closer to your answer.
 
OK, I found this: <movevent type="Equip" itemid="2170" slot="ring" event="function" value="onEquipItem"/>
Where I can find file "fuction" or what I have to do now?
 
Last edited:
I must rewrite it for my DB server, then I want to only change outfit.
I have new idea - after deequip ring player says "revert".
You know - if you equip ring its change outfit, when deequip player says "revert".
It is possible to do? I know is it, but is it hard? I'm weak at this.
Have you guide to make simple scripts?
Thanks for your all answers.
 
Last edited:
I must rewrite it for my DB server, then I want to only change outfit.
I have new idea - after deequip ring player says "revert".
You know - if you equip ring its change outfit, when deequip player says "revert".
It is possible to do? I know is it, but is it hard? I'm weak at this.
Have you guide to make simple scripts?
Thanks for your all answers.
Take some time off from "developing"/playing your server and learn the scripting language lua, we already gave you a script to work on, now the rest is up to you.
 
Probably last post here xd:
What you think about it (I found it recently)?:
It outfit change rune (for x time)
Make changeoutfitrune.lua :
Code:
function onUse(cid, item, fromPosition, item2, toPosition)
--by KanciaK
local outfit = {lookType=8,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}  --Outfit, w ktory bedziesz sie zmienial po uzyciu runy
local outfit_time = 300 --czas trwania efektu runy (w sek.)
local outfit_storage = 14010 --storageValue (koniecznie nieuzywany!)
    if item.itemid == 2298 then
        if item.type > 1 then
            if(os.time() > getPlayerStorageValue(cid, outfit_storage)
                doSetCreatureOutfit(cid, outfit, outfit_time)
                setPlayerStorageValue(cid, outfit_storage, os.time + outfit_time)
                doChangeTypeItem(item.uid, item.type - 1)
            elseif(os.time() < getPlayerStorageValue(cid, outfit_storage)
                doSendMagicEffect(cid,3)
                doPlayerSendTextMessage(cid,20,'You are exchaused.')
            end
        elseif item.type == 1 then
            if(os.time() > getPlayerStorageValue(cid, outfit_storage)
                doSetCreatureOutfit(cid, outfit, outfit_time)
                setPlayerStorageValue(cid, outfit_storage, os.time + outfit_time)
                doPlayerRemoveItem(item.uid)
            elseif(os.time() < getPlayerStorageValue(cid, outfit_storage)
                doSendMagicEffect(cid,3)
                doPlayerSendTextMessage(cid,20,'You are exchaused.')
            end
        end
    end
end

In actions.xml:
Code:
<action itemid="2298" script="changeoutfitrune.lua" />
 
Back
Top