• 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!

Lua TFS 0.3.6 - [TALKACTIONS] - How can I create this magic in an area? Can anyone give me an answer?

samuel157

/root
Joined
Mar 19, 2010
Messages
518
Solutions
3
Reaction score
71
Location
São Paulo, Brazil
GitHub
Samuel10M
Code:
function onSay(player, message, channel)
    -- Check if the player has 300 resets in storage 59976
    local resets = getPlayerStorageValue(player, 59976)
    if resets == -1 or resets < 300 then
        doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "You need 300 resets to use this command!")
        return true
    end

    -- Make sure the player has a valid target
    local target = getCreatureTarget(player)

    if target and isCreature(target) then
        -- Apply massive damage to the target to ensure death
        doCreatureAddHealth(target, -1000000000)  -- Intentionally absurd damage value

        -- Send a message indicating the target was killed
        doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "You dealt massive damage to the target, killing it!")
    else
        -- If there is no valid target
        doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "No valid target found.")
    end

    return true
end

EXAMPLE

{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},

EFFECT CONST_ME_MAGIC_GREEN = 14
 
Back
Top