how i can implement this script ? thankslocal cfg = {}
cfg.refuel = 1 * 60 * 1000
if getPlayerSoul(cid) == 200 then
doPlayerAddSoul(cid, -200)
doPlayerSetStamina(cid, cfg.refuel)
else
doPlayerSendCancel(cid, "You must have a soul point .")
ur script will be like this
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
function onCastSpell(cid, var)
local cfg = {
refuel = 1 * 60 * 1000,
amount_of_soul = 200
}
if getPlayerSoul(cid) == cfg.amount_of_soul then
doPlayerAddSoul(cid, -cfg.amount_of_soul)
doPlayerSetStamina(cid, cfg.refuel)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
return doCombat(cid, combat, var) and true
end
return doPlayerSendCancel(cid, "You must have ".. cfg.amount_of_soul .." soul points to refuel your stamina."), doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) and true
end
Works perfect thanks @GarQetCode:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(cid, var) local cfg = { refuel = 1 * 60 * 1000, amount_of_soul = 200 } if getPlayerSoul(cid) == cfg.amount_of_soul then doPlayerAddSoul(cid, -cfg.amount_of_soul) doPlayerSetStamina(cid, cfg.refuel) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) return doCombat(cid, combat, var) and true end return doPlayerSendCancel(cid, "You must have ".. cfg.amount_of_soul .." soul points to refuel your stamina."), doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) and true end