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

Lua Convert to TFS 1.X

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
425
Solutions
1
Reaction score
44
Hello!
Who can change this script for me to TFS 1.X (1.4.2)? I have problem with itemDescription.

Lua:
local t = {
    [8925] = {8925, 1},
    [8931] = {8931, 1},
    [8927] = {8927, 1},
    [2523] = {2523, 1},
    [12679] = {12681, 1},
    [12318] = {12318, 1}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local v, storage, outfitId = t[item.uid], 89255, 1
    if v then       
        if (getPlayerStorageValue(cid, storage) == -1) then
            doPlayerAddItem(cid, v[1], v[2])
            doPlayerSendTextMessage(cid, 22, "You have found " .. getItemDescriptionsById(v[1]).name .. ".")
            setPlayerStorageValue(cid, storage, 1)
        else
            doPlayerSendTextMessage(cid, 22, "You have already taken your reward.")
            end
        end
    return true
end
 
try this:
Lua:
local t = {
    [8925] = {8925, 1},
    [8931] = {8931, 1},
    [8927] = {8927, 1},
    [2523] = {2523, 1},
    [12679] = {12681, 1},
    [12318] = {12318, 1}
}
 
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local v, storage = t[item.uid], 89255
    if v then       
        if player:getStorageValue(storage) == -1 then
            player:addItem(v[1], v[2])
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(v[1]):getName() .. ".")
            player:setStorageValue(storage, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have already taken your reward.")
            end
        end
    return true
end
 
Back
Top