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

RevScripts Tfs 1.3 random addon to new players

Solution
data/scripts/randomOutfitAddon.lua
Lua:
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")

function randOutfit.onLogin(player)
    if player:getLastLoginSaved() <= 0 then
        local outfit = outfits[math.random(1, #outfits)]
        local addon = math.random(1, 2)
        player:addOutfitAddon(outfit[1], addon)
        player:addOutfitAddon(outfit[2], addon)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    end
    return true
end

randOutfit:register()
data/scripts/randomOutfitAddon.lua
Lua:
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")

function randOutfit.onLogin(player)
    if player:getLastLoginSaved() <= 0 then
        local outfit = outfits[math.random(1, #outfits)]
        local addon = math.random(1, 2)
        player:addOutfitAddon(outfit[1], addon)
        player:addOutfitAddon(outfit[2], addon)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    end
    return true
end

randOutfit:register()
 
Solution
data/scripts/randomOutfitAddon.lua
Lua:
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")

function randOutfit.onLogin(player)
    if player:getLastLoginSaved() <= 0 then
        local outfit = outfits[math.random(1, #outfits)]
        local addon = math.random(1, 2)
        player:addOutfitAddon(outfit[1], addon)
        player:addOutfitAddon(outfit[2], addon)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    end
    return true
end

randOutfit:register()
Thank you @Sarah Wesker 😍😍😍😍
 
try this
change:
Lua:
local addon = math.random(1, 2)

to:
Lua:
local addon = 3
I havent tried ur code, But i want it to be an addon doll. So I need an item id to be putted in from the doll, and

Lua:
local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")

function randOutfit.onLogin(player)
    if player:getLastLoginSaved() <= 0 then
This most be wrong? i want anyone to be able to use it
 
I havent tried ur code, But i want it to be an addon doll. So I need an item id to be putted in from the doll, and

Lua:
local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")

function randOutfit.onLogin(player)
    if player:getLastLoginSaved() <= 0 then
This most be wrong? i want anyone to be able to use it

then create a new thread about your request
then we'll help you for sure :D
 
data/scripts/randomOutfitAddon.lua
Lua:
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")

function randOutfit.onLogin(player)
    if player:getLastLoginSaved() <= 0 then
        local outfit = outfits[math.random(1, #outfits)]
        local addon = math.random(1, 2)
        player:addOutfitAddon(outfit[1], addon)
        player:addOutfitAddon(outfit[2], addon)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    end
    return true
end

randOutfit:register()
Hello, there is something similar to this, but what is it when using an item? , that is, you use the item, the item disappears and gives you a permanent flutter skin
 
I barrow ur threat.
If i want it to give full outfit/addon from a doll
How to change this script?
Hello, there is something similar to this, but what is it when using an item? , that is, you use the item, the item disappears and gives you a permanent flutter skin
with actionID and itemId:
You only have to choose which one to use, you can use both if you wish, just uncomment the commented code.
Lua:
--local actionId = 8000
local itemDollId = 8985
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = Action("RandomOutfitForNewPlayers")

function randOutfit.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local outfit = outfits[math.random(1, #outfits)]
    local addon = math.random(1, 2)
    if player:hasOutfit(outfit[1], addon) and player:hasOutfit(outfit[2], addon) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have this outfit.")
        return true
    end

    player:addOutfitAddon(outfit[1], addon)
    player:addOutfitAddon(outfit[2], addon)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    item:remove(1)
    return true
end

randOutfit:id(itemDollId)
--randOutfit:aid(actionId)
randOutfit:register()
 
Last edited:
with actionID and itemId:
You only have to choose which one to use, you can use both if you wish, just uncomment the commented code.
Lua:
--local actionId = 8000
local itemDollId = 8985
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = Action("RandomOutfitForNewPlayers")

function randOutfit.onUse(player)
    local outfit = outfits[math.random(1, #outfits)]
    local addon = math.random(1, 2)
    if player:hasOutfit(outfit[1], addon) and player:hasOutfit(outfit[2], addon) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have this outfit.")
        return true
    end

    player:addOutfitAddon(outfit[1], addon)
    player:addOutfitAddon(outfit[2], addon)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    return true
end

randOutfit:id(itemDollId)
--randOutfit:aid(actionId)
randOutfit:register()
I'm trying to get the item that is used to be removed but I can't do it
Post automatically merged:

I'm trying to get the item that is used to be removed but I can't do it
Lua:
--local actionId = 8000 --- palanca o estatua
local itemDollId = 13480  ---- item
local outfits = { --- skins
    {484, 484, "Pegasus"},
    {424, 424, "Konan"},
    {428, 428, "Asta"},
    {454, 454, "Thyplosion"},
    {463, 463, "Yoshi"},
    {432, 432, "Monspeet"},
    {438, 438, "Pamela Jiles"},
    {384, 384, "Tanjiro"}
}

local randOutfit = Action("RandomOutfitForNewPlayers")

function randOutfit.onUse(player)
    if player:getLevel() < 390000 then -- must be higher than level 200 to use
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Necesitas ser nivel 390000 para usar el Objeto.")
        return true
    end
    local outfit = outfits[math.random(1, #outfits)]
    local addon = math.random(1, 2)
    if player:hasOutfit(outfit[1], addon) and player:hasOutfit(outfit[2], addon) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ya tienes este Skin.")
        return true
    end

    player:addOutfitAddon(outfit[1], addon)
    player:addOutfitAddon(outfit[2], addon)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Tu Conseguiste %s Skin.", outfit[3], addon))
    item:remove()
    player:getPosition():sendMagicEffect(40)
    return true
end

randOutfit:id(itemDollId)
--randOutfit:aid(actionId)
randOutfit:register()
 
I'm trying to get the item that is used to be removed but I can't do it
Post automatically merged:


Lua:
--local actionId = 8000 --- palanca o estatua
local itemDollId = 13480  ---- item
local outfits = { --- skins
    {484, 484, "Pegasus"},
    {424, 424, "Konan"},
    {428, 428, "Asta"},
    {454, 454, "Thyplosion"},
    {463, 463, "Yoshi"},
    {432, 432, "Monspeet"},
    {438, 438, "Pamela Jiles"},
    {384, 384, "Tanjiro"}
}

local randOutfit = Action("RandomOutfitForNewPlayers")

function randOutfit.onUse(player)
    if player:getLevel() < 390000 then -- must be higher than level 200 to use
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Necesitas ser nivel 390000 para usar el Objeto.")
        return true
    end
    local outfit = outfits[math.random(1, #outfits)]
    local addon = math.random(1, 2)
    if player:hasOutfit(outfit[1], addon) and player:hasOutfit(outfit[2], addon) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ya tienes este Skin.")
        return true
    end

    player:addOutfitAddon(outfit[1], addon)
    player:addOutfitAddon(outfit[2], addon)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Tu Conseguiste %s Skin.", outfit[3], addon))
    item:remove()
    player:getPosition():sendMagicEffect(40)
    return true
end

randOutfit:id(itemDollId)
--randOutfit:aid(actionId)
randOutfit:register()
check my post again and update the code: HERE
 
with actionID and itemId:
You only have to choose which one to use, you can use both if you wish, just uncomment the commented code.
Lua:
--local actionId = 8000
local itemDollId = 8985
local outfits = {
    {136, 128, "Citizen"},
    {137, 129, "Hunter"},
    {138, 130, "Mage"},
    {139, 131, "Knight"}
}

local randOutfit = Action("RandomOutfitForNewPlayers")

function randOutfit.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local outfit = outfits[math.random(1, #outfits)]
    local addon = math.random(1, 2)
    if player:hasOutfit(outfit[1], addon) and player:hasOutfit(outfit[2], addon) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have this outfit.")
        return true
    end

    player:addOutfitAddon(outfit[1], addon)
    player:addOutfitAddon(outfit[2], addon)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
    item:remove(1)
    return true
end

randOutfit:id(itemDollId)
--randOutfit:aid(actionId)
randOutfit:register()
How can I install it? Can u explain it to me please? Action? Talkaction? Movements?
 
Back
Top