• 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 TFS 1.3 Addon and Mount NPC Seller Request

Marko999x

999x era
Premium User
Joined
Dec 14, 2017
Messages
2,816
Solutions
82
Reaction score
1,938
Location
Germany
Heyo
I would like to request a NPC who sells addons and mounts for 100cc as explain
Cant find any npc on otland thats why im requesting
thanks and have a great day
Im using TFS 1.3
 
Solution
I tried to write something to get an idea, hope it helps!

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)    npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                        npcHandler:onThink()    end

-- Storage IDs --
first addons = 22001
newaddon    = 'Here you are, enjoy your brand new addon!'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required...
I tried to write something to get an idea, hope it helps!

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)    npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                        npcHandler:onThink()    end

-- Storage IDs --
first addons = 22001
newaddon    = 'Here you are, enjoy your brand new addon!'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
already        = 'It seems you already have this addon, don\'t you try to mock me son!'
 
-- ADDONS START --
function AddonsFirst(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = player:getStorageValue(cid,first addons)
    if addon == -1 then
        if player:getItemCount(2160) >= 100 then
        if player:removeItem(2160,100) then
            selfSay(newaddon, cid)       
            player:addOutfitAddon(128, 1)
            player:addOutfitAddon(136, 1)  ------ here make a list of every addon....
            player:setStorageValue (first addons,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end
end

I attached the script where I get the reference to compare if you find any error, regards!
 

Attachments

Last edited:
Solution
Use the script that the guy fixed ... And to do something about mounts, just change the items, add new storages and put the keywordHandler.

To change the player to get a mount instead of the addon just change:
Lua:
player:addOutfitAddon(addon.ID)
Lua:
player:addMount(mount.ID)
 
Im dumb my fault
I was a bit confused
Post automatically merged:

I tried to write something to get an idea, hope it helps!

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)    npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                        npcHandler:onThink()    end

-- Storage IDs --
first addons = 22001
newaddon    = 'Here you are, enjoy your brand new addon!'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
already        = 'It seems you already have this addon, don\'t you try to mock me son!'

-- ADDONS START --
function AddonsFirst(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = player:getStorageValue(cid,first addons)
    if addon == -1 then
        if player:getItemCount(2160) >= 100 then
        if player:removeItem(2160,100) then
            selfSay(newaddon, cid)      
            player:addOutfitAddon(128, 1)
            player:addOutfitAddon(136, 1)  ------ here make a list of every addon....
            player:setStorageValue (first addons,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end
end

I attached the script where I get the reference to compare if you find any error, regards!

thanks
 
Back
Top