miguelshta
Member
Hello I need a script that gives a 1 random addon to new players
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()
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 Weskerdata/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()
I barrow ur threat.
If i want it to give full outfit/addon from a doll
How to change this script?
local addon = math.random(1, 2)
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, andtry this
change:
Lua:local addon = math.random(1, 2)
to:
Lua:local addon = 3
local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")
function randOutfit.onLogin(player)
if player:getLastLoginSaved() <= 0 then
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
This most be wrong? i want anyone to be able to use itLua:local randOutfit = CreatureEvent("RandomOutfitForNewPlayers") function randOutfit.onLogin(player) if player:getLastLoginSaved() <= 0 then
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 skindata/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()
I barrow ur threat.
If i want it to give full outfit/addon from a doll
How to change this script?
with actionID and itemId: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
--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()
I'm trying to get the item that is used to be removed but I can't do itwith 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
--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: HEREI'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()
thanks workcheck my post again and update the code: HERE
How can I install it? Can u explain it to me please? Action? Talkaction? Movements?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()
It’s TFS 1.3+ revscript that you need to put into /data/scripts/actions directory and it registers itselfHow can I install it? Can u explain it to me please? Action? Talkaction? Movements?
Thanks a lotIt’s TFS 1.3+ revscript that you need to put into /data/scripts/actions directory and it registers itself