RazorBlade
Retired Snek
Hey there everyone. I've decided to come up with a new script... It's a talkaction that is based on storage values. If you have a certain storage value and say "Transform!" It'll change your outfit temporarily, also giving you things like extra damage, extra speed, health/mana, anything I can add really. But there's an issue.
I've reached a point where transforming works, and it adds the extra bit of max health to you... The issue is that when transforming back after the time has run out, the max health/mana whatever, doesn't go back to normal. Also, you are able to transform as much as you want as fast as you want. Eventually I will set it to remove some soul, or a special item that you can collect, but as of this point I really need some assistance with making sure you cannot transform until the time has run out and your outfit changes back. I also need to make sure that when you transform back, all raised stats go back to normal. The script as I have it now is incomplete (Not all outfits I chose have been planned out, they're just there so I can add later), but it runs and the parts I set up already work properly and are tested. I just need help with the above issues. The script is as follows:
If someone could help me with these issues, I can get back to making the rest of the script. Thanks in advance,
Razor <3
I've reached a point where transforming works, and it adds the extra bit of max health to you... The issue is that when transforming back after the time has run out, the max health/mana whatever, doesn't go back to normal. Also, you are able to transform as much as you want as fast as you want. Eventually I will set it to remove some soul, or a special item that you can collect, but as of this point I really need some assistance with making sure you cannot transform until the time has run out and your outfit changes back. I also need to make sure that when you transform back, all raised stats go back to normal. The script as I have it now is incomplete (Not all outfits I chose have been planned out, they're just there so I can add later), but it runs and the parts I set up already work properly and are tested. I just need help with the above issues. The script is as follows:
Code:
function onSay(cid, words, param, channel)
local myOutfit = getCreatureOutfit(cid)
local archdemon =
{
lookType = (12),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local demon =
{
lookType = (35),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local dragon =
{
lookType = (34),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local dragonlord =
{
lookType = (40),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local frostdragon =
{
lookType = (248),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local nightmare =
{
lookType = (245),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local hellhound =
{
lookType = (240),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local hydra =
{
lookType = (121),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local yeti =
{
lookType = (110),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local bat =
{
lookType = (307),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local war =
{
lookType = (326),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local worker =
{
lookType = (304),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local hellfire =
{
lookType = (243),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local ghastly =
{
lookType = (351),
lookHead = (myOutfit.lookHead),
lookBody = (myOutfit.lookBody),
lookLegs = (myOutfit.lookLegs),
lookFeet = (myOutfit.lookFeet),
lookAddons = (myOutfit.lookAddons)
}
local maxhealth = getCreatureMaxHealth(cid)
local maxmana = getCreatureMaxMana(cid)
local currenthealth = getCreatureHealth(cid)
local currentmana = getCreatureMana(cid)
if getPlayerStorageValue(cid,50000) == 1 then
doSetCreatureOutfit(cid, archdemon, 2000)
setCreatureMaxHealth(cid, (maxhealth) + 1000)
setCreatureMaxMana(cid, (maxmana) + 1000)
elseif getPlayerStorageValue(cid,50000) == 2 then
doSetCreatureOutfit(cid, demon, 20000)
setCreatureMaxHealth(cid, (maxhealth) + 1000)
doCreatureAddHealth(cid, 1000, true)
elseif getPlayerStorageValue(cid,50000) == 3 then
doSetCreatureOutfit(cid, dragon, 2000)
elseif getPlayerStorageValue(cid,50000) == 4 then
doSetCreatureOutfit(cid, dragonlord, 2000)
elseif getPlayerStorageValue(cid,50000) == 5 then
doSetCreatureOutfit(cid, frostdragon, 2000)
elseif getPlayerStorageValue(cid,50000) == 6 then
doSetCreatureOutfit(cid, nightmare, 2000)
elseif getPlayerStorageValue(cid,50000) == 7 then
doSetCreatureOutfit(cid, hellhound, 2000)
elseif getPlayerStorageValue(cid,50000) == 8 then
doSetCreatureOutfit(cid, hydra, 2000)
elseif getPlayerStorageValue(cid,50000) == 9 then
doSetCreatureOutfit(cid, yeti, 2000)
elseif getPlayerStorageValue(cid,50000) == 10 then
doSetCreatureOutfit(cid, bat, 2000)
elseif getPlayerStorageValue(cid,50000) == 11 then
doSetCreatureOutfit(cid, war, 2000)
elseif getPlayerStorageValue(cid,50000) == 12 then
doSetCreatureOutfit(cid, worker, 2000)
elseif getPlayerStorageValue(cid,50000) == 13 then
doSetCreatureOutfit(cid, hellfire, 2000)
elseif getPlayerStorageValue(cid,50000) == 14 then
doSetCreatureOutfit(cid, ghastly, 2000)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You cannot transform.")
end
return TRUE
end
Razor <3