create_item.lua

main 82 lines · 2.4 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1function onSay(player, words, param)
2 if player:getGroup():getId() < 3 then
3 return false
4 end
5 --[[ /i 1001, true, 1, 2, 3]]--
6 --[[ [01] = ItemID
7 [02] = Definir status do item manualmente ou deixar zerado (false/true)
8 [03] = Quantidade
9
10
11 ]]--
12 local split = param:splitTrimmed(" ")
13 if _ITEMS[tonumber(split[01])] then
14 local default = false
15 if split[02] ~= nil then
16 default = true
17 end
18
19 local iid = tonumber(split[01])
20 local slo = _ITEMS[iid].SLOT_EQUIP
21 local rar = 00
22 local sta = 00
23 local qnt = 01
24 local ext = 00
25
26 if default then
27 if split[03] ~= nil then
28 if isNumber(split[03]) then
29 qnt = tonumber(split[03])
30 else
31 qnt = 01
32 end
33 else
34 qnt = 01
35 end
36 if split[04] ~= nil then
37 if isNumber(split[04]) then
38 rar = tonumber(split[04])
39 end
40 end
41 if split[05] ~= nil then
42 if isNumber(split[05]) then
43 sta = tonumber(split[05])
44 end
45 end
46 end
47
48 if slo > 9 or slo == 0 then slo = 3 end
49 if iid == 3218 then
50 PlayerVipCoins(player, 02, qnt)
51 player:sendCancelMessage("@LootMSG 3218 3 0 " ..qnt)
52 doBackpack(player, 11)
53 return false
54 end
55 if doBackpack(player, 00, slo, ext, 01) then
56 if slo == 3 then
57 doBackpack(player, 03, slo, ext, 01, iid) -- Procurar
58 if doBackpack(player, 01, slo, ext, 0, iid, rar, sta, qnt) then
59
60 player:getPosition():sendMagicEffect(14)
61 end
62 else
63 if doBackpack(player, 01, slo, ext, 0, iid, rar, sta) then
64
65 player:getPosition():sendMagicEffect(14)
66 end
67 end
68 else
69 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack esta cheia.")
70 player:getPosition():sendMagicEffect(03)
71 return false
72 end
73 --else
74
75 -- return false
76 --end
77 else
78
79 return false
80 end
81end
82
Top