VictorOtInfinit
Member
- 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.
TFS 1x+ should work.
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
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...
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
Oh, i mean 100 permanent HP not 100 mana/life potions, the player say !buymana them he get 100 + manabase.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.
i think he means doPlayerAddMana(cid, getPlayerMaxMana)Should the extra mana stay forever?
i think he means doPlayerAddMana(cid, getPlayerMaxMana)
I did that, was this:so manarune just as command?
im confused
i would like to help him but i cant if he cant explain it well..
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
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
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
Ty, this is better ^^Yes its working
I edited it a bit so the command appears only when u bought it
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