• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Transformers Script, some issues with functions...

RazorBlade

Retired Snek
Joined
Nov 7, 2009
Messages
2,015
Solutions
3
Reaction score
629
Location
Canada
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:

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
If someone could help me with these issues, I can get back to making the rest of the script. Thanks in advance,
Razor <3
 
Sounds like you need to set combat conditions for it. So at the end of a combat condition, the second one starts to change it all back as normal. Also as far as only allowing one transformation at a time, you could try adding to the storage value such as +50, then on combat 2 remove +50.
 
I'm sort of a beginner in scripting... Any chance you could help me with scripting that?
 
Back
Top