Call Me saul
New Member
there's script when you click on chest or statue give you mount or outfit?
local outfitConfig = {
[1000] = {outfitMale = 10, outfitFemale = 12, storage = 10000},
[1001] = {outfitMale = 11, outfitFemale = 13, storage = 10001},
}
local action = Action()
function action.onUse(player, item, fromPos, target, toPos, isHotkey)
local outfitScript = outfitConfig[item:getActionId()]
if not outfitScript then
return true
end
if player:getStorageValue(outfitScript.storage) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue.')
return true
end
player:addOutfit(outfitScript.outfitMale)
player:addOutfit(outfitScript.outfitFemale)
player:addOutfitAddon(outfitScript.outfitMale addon)...
local outfitConfig = {
[1000] = {outfitMale = 10, outfitFemale = 12, storage = 10000},
[1001] = {outfitMale = 11, outfitFemale = 13, storage = 10001},
}
local action = Action()
function action.onUse(player, item, fromPos, target, toPos, isHotkey)
local outfitScript = outfitConfig[item:getActionId()]
if not outfitScript then
return true
end
if player:getStorageValue(outfitScript.storage) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue.')
return true
end
player:addOutfit(outfitScript.outfitMale)
player:addOutfit(outfitScript.outfitFemale)
player:addOutfitAddon(outfitScript.outfitMale addon)
player:addOutfitAddon(outfitScript.outfitFemale, addon)
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new outfit.')
player:setStorageValue(outfitScript.storage, 1)
return true
end
for k, v in pairs(outfitConfig) do
action:aid(k)
end
action:register()
------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------
local mountConfig = {
[2000] = {mountId = 10, storage = 20000},
[2001] = {mountId = 10, storage = 20001},
}
local action = Action()
function action.onUse(player, item, fromPos, target, toPos, isHotkey)
local mountScript = mountConfig[item:getActionId()]
if not mountScript then
return true
end
if player:getStorageValue(mountScript.storage) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue.')
return true
end
player:addMount(mountScript.mountId)
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new mount.')
player:setStorageValue(mountScript.storage, 1)
return true
end
for k, v in pairs(mountConfig) do
action:aid(k)
end
action:register()
ty i'll try but where i will put this file can you explainnot tested but try
Lua:local outfitConfig = [ [1000] = {outfitMale = 10, outfitFemale = 12, storage = 10000}, [1001] = {outfitMale = 11, outfitFemale = 13, storage 10001}, ] local action = Action() function action.onUse(player, item, fromPos, target, toPos, isHotkey) local outfitScript = outfitConfig[item:getActionId()] if not outfitScript then return true end if player:getStorageValue(outfitScript.storage) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue'.) return true end player:addOutfit(outfitScript.outfitMale, 3) player:addOutfit(outfitScript.outfitFemale, 3) player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new outfit') player:setStorageValue(outfitScript.storage, 1) return true end for k, v in pairs(config) do action:aid(k) end action:register() ------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------ local mountConfig = [ [2000] = {mountId = 10, storage = 20000}, [2001] = {mountId = 10, storage = 20001}, ] local action = Action() function action.onUse(player, item, fromPos, target, toPos, isHotkey) local mountScript = mountConfig[item:getActionId()] if not mountScript then return true end if player:getStorageValue(mountScript.storage) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy used that statue'.) return true end player:addMount(mountScript.mountId) player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received a new mount') player:setStorageValue(mountScript.storage, 1) return true end for k, v in pairs(config) do action:aid(k) end action:register()
1000 is actionid, change it to your actionId you want and OutfitId and MountId says everything
i did it but its saying 23:08 You alredy used that statue. and i didnt click on itupdated my script btw it has some bugs
storage must be always a different
storage has been used to check if player has used the statue alredy
outfitMale = male outfit ID
outfitFemale = female outfit ID
mountId = Mount ID
View attachment 79500
this is actionId
edited my script, try againi did it but its saying 23:08 You alredy used that statue. and i didnt click on it
Any errors?
player:addOutfit(outfitScript.outfitMale, 3)
player:addOutfit(outfitScript.outfitFemale, 3)
player:addOutfit(outfitScript.outfitMale)
player:addOutfit(outfitScript.outfitFemale)
player:addOutfitAddon(lookType, addon)
i tried a lot of outfitsMaybe the outfit is either only for premium or not enabled in outfits.xml
And are you sure your account is premium?i tried a lot of outfits
<outfit type="0" looktype="148" name="Druid" premium="yes" unlocked="yes" enabled="yes" />
Maybe the outfit is either only for premium or not enabled in outfits.xml
And I'm pretty sure player:addOutfit() only takes one argument (lookType), so you can change:
To:Lua:player:addOutfit(outfitScript.outfitMale, 3) player:addOutfit(outfitScript.outfitFemale, 3)
Lua:player:addOutfit(outfitScript.outfitMale) player:addOutfit(outfitScript.outfitFemale)
And if you want to add addons aswell, you can use:
Lua:player:addOutfitAddon(lookType, addon)
now worked thanks a lotoh forgot that outfitAddon function exists
Yesis this a rev script?