• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua !buylife and !buymana script for tfs 1.3

Joined
Mar 14, 2020
Messages
139
Solutions
3
Reaction score
11
I want a script that gives the player 100hp when he say !buylife and 100 mana when he say !buymana

TFS 1x+ should work.
 
Solution
I did that, was this:
LUA:
function onSay(cid, words, param)
local player = Player(cid)
local money = 100000
local hpExtra = 100
    if player:getItemCount(2160) >= 100 then
        local hpAtual = player:getMaxHealth()
        player:setMaxHealth(hpExtra+hpAtual)
        doPlayerRemoveItem(player, 2160, 100)
    else
        doPlayerSendCancel(cid, "Voce nao tem 1kk. Voce precisa ter 100 crystal coins.")
    end
return true
end

Yes its working
I edited it a bit so the command appears only when u bought it :p

LUA:
function onSay(cid, words, param)

local player = Player(cid)
local money = 100000
local hpExtra = 100
local hpAtual = player:getMaxHealth()

    if player:getItemCount(2160) <= 100 then...
LUA:
local price_mr = 1 --cost in gold

function onSay(player, words, param)
    
    if player:getMoney() >= price_mr then
        player:removeMoney(price_mr)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        player:addItem(7620, 100)    --7620 = mana potion change to the id of your mana
    else
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        player:sendCancelMessage("You dont have enought money.")
    end
    
end

same for uh just change the id
 
LUA:
local price_mr = 1 --cost in gold

function onSay(player, words, param)
   
    if player:getMoney() >= price_mr then
        player:removeMoney(price_mr)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        player:addItem(7620, 100)    --7620 = mana potion change to the id of your mana
    else
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        player:sendCancelMessage("You dont have enought money.")
    end
   
end

same for uh just change the id
Oh, i mean 100 permanent HP not 100 mana/life potions, the player say !buymana them he get 100 + manabase.
 
so manarune just as command?
im confused
i would like to help him but i cant if he cant explain it well..
I did that, was this:
LUA:
function onSay(cid, words, param)
local player = Player(cid)
local money = 100000
local hpExtra = 100
    if player:getItemCount(2160) >= 100 then
        local hpAtual = player:getMaxHealth()
        player:setMaxHealth(hpExtra+hpAtual)
        doPlayerRemoveItem(player, 2160, 100)
    else
        doPlayerSendCancel(cid, "Voce nao tem 1kk. Voce precisa ter 100 crystal coins.")
    end
return true
end
 
I did that, was this:
LUA:
function onSay(cid, words, param)
local player = Player(cid)
local money = 100000
local hpExtra = 100
    if player:getItemCount(2160) >= 100 then
        local hpAtual = player:getMaxHealth()
        player:setMaxHealth(hpExtra+hpAtual)
        doPlayerRemoveItem(player, 2160, 100)
    else
        doPlayerSendCancel(cid, "Voce nao tem 1kk. Voce precisa ter 100 crystal coins.")
    end
return true
end

Yes its working
I edited it a bit so the command appears only when u bought it :p

LUA:
function onSay(cid, words, param)

local player = Player(cid)
local money = 100000
local hpExtra = 100
local hpAtual = player:getMaxHealth()

    if player:getItemCount(2160) <= 100 then
        doPlayerSendCancel(cid, "Voce nao tem 1kk. Voce precisa ter 100 crystal coins.")
    return false
    else
        player:setMaxHealth(hpExtra+hpAtual)
        doPlayerRemoveItem(player, 2160, 100)
        doPlayerSendCancel(cid, "HP Received.")
    end
    return true
end

or this

LUA:
function onSay(player, words, param)
    if player:removeMoney(1000000) then
        player:setMaxHealth(player:getMaxHealth() + 100)
        player:sendCancelMessage("HP Recieved")
        return true
    else
        player:sendCancelMessage("You need 100k to do this.")
        return false
    end
end
 
Last edited:
Solution
Yes its working
I edited it a bit so the command appears only when u bought it :p

LUA:
function onSay(cid, words, param)

local player = Player(cid)
local money = 100000
local hpExtra = 100
local hpAtual = player:getMaxHealth()

    if player:getItemCount(2160) <= 100 then
        doPlayerSendCancel(cid, "Voce nao tem 1kk. Voce precisa ter 100 crystal coins.")
    return false
    else
        player:setMaxHealth(hpExtra+hpAtual)
        doPlayerRemoveItem(player, 2160, 100)
        doPlayerSendCancel(cid, "HP Received.")
    end
    return true
end
Ty, this is better ^^
 
Back
Top