dropz
Member
- Joined
- May 4, 2022
- Messages
- 46
- Reaction score
- 24
hello!
how can i deal with this script to it get just the initial parameter of the local config that i declared in the begin of script?
what im trying is use just a one script that grabs the infos from local config and use it to manipulate witch type of outfit i want set.
here's my script:
the idea is the script verify if your storageValue is valid, if yes after use a command setting the specific outfit it will deal with the parameters of "local config" to change for the chosen one.
the point is im just trying to avoid use more than one script for this command of outfits, but im not getting success in how to deal with the variables and set them.
thanks in advance.
solved, thanks anyway.
how can i deal with this script to it get just the initial parameter of the local config that i declared in the begin of script?
what im trying is use just a one script that grabs the infos from local config and use it to manipulate witch type of outfit i want set.
here's my script:
Lua:
local config = {
outfits = {
["slayer"] = {looktype_m = 137, looktype_f = 149},
["archer"] = {looktype_m = 138, looktype_f = 150},
["wizzard"] = {looktype_m = 139, looktype_f = 151}
},
storage = {652000, 652001, 652002}
}
function onSay(player, words, param)
if player:getStorageValue(config.storage) < 1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You dont have a permission to use this command.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
local lookType = tostring(param)
if lookType == config.outfits then
if (player:getSex() == PLAYERSEX_FEMALE) then
local playerOutfit = player:getOutfit(config.outfits.looktype_f)
playerOutfit.lookType = config.outfits.looktype_f
player:setOutfit(playerOutfit)
player:addOutfit(playerOutfit)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You've weared a " .. config.outfits .." outfit.")
else
local playerOutfit = player:getOutfit(config.outfits.looktype_m)
playerOutfit.lookType = config.outfits.looktype_m
player:setOutfit(playerOutfit)
player:addOutfit(playerOutfit)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You've weared a " .. config.outfits .." outfit.")
end
else
player:sendCancelMessage("This outfit does not exist.")
end
return false
end
the idea is the script verify if your storageValue is valid, if yes after use a command setting the specific outfit it will deal with the parameters of "local config" to change for the chosen one.
the point is im just trying to avoid use more than one script for this command of outfits, but im not getting success in how to deal with the variables and set them.
thanks in advance.
Post automatically merged:
solved, thanks anyway.
Last edited: