Então eu tinha esse script de carpet em transform_to a bastante tempo desde 2016, mais simples
Então então estou postando hoje
Vamos ao Assunto.
vai em data "datapack"/actions/scripts
Crie um arquivo chamado carpet.lua
coloque isso
local object_itemid = {
[CARPET FECHADO] = {transform_to = CARPET ABERTO, premium = false, useWith=true},
[CARPET ABERTO] = {transform_to = CARPET FECHADO, premium = false, useWith=false},
}
function onUse(cid, item, frompos, item2, topos)
local storage = 789561
local time = 1
local sendEffect = true -- true or false
local EffectId = 1
local item_from_table = object_itemid[item.itemid]
if exhaustion.check(cid, storage) then
return false
end
if item_from_table then
if item_from_table.premium and not isPremium(cid) then
return false and doPlayerSendCancel(cid, "Você não e vip.")
end
doRemoveItem(item.uid,1)
if item_from_table.useWith then
doCreateItem(item_from_table.transform_to,1,topos)
else
doCreateItem(item_from_table.transform_to,1,frompos)
end
if sendEffect then
doSendMagicEffect(getThingPos(cid), EffectId)
end
end
return true and exhaustion.set(cid,storage,time)
end
Volte na pasta actions
abra o actions.xml
Coloque
<action itemid="ID CARPET FECHADO;ID CARPET ABERTO" event="script" value="carpet.lua"/>
Carpet fechado
Carpet aberto
DONO: PokemonZbr ( Online )
DONO: OtPokemonTvZ ( Offline )
Links do meu jogo
https://pokemonzbr.com/ (Online)
http://otpokemontvz.com/ (Offline)
Eu sou:
Scripter: 5%
Mapper: 30%
Programador: 4%
Website : 50%