TomBartezz
Member
- Joined
- May 29, 2016
- Messages
- 159
- Reaction score
- 17
This is my code but I would like to add rebirth to players (rebirth storage id 1958) (TFS 0.3.6)
I also tried to make my own
Code:
function setPlayerFromToStorageValues(cid, Reborn, 1)
for k,v in pairs(storage) do
if (isNumber(k) and isNumber(v)) == TRUE then
if k < v then
if k > 0 then
if v > 0 then
for a = k,v do
setPlayerStorageValue(cid, Reborn, 200)
end
else
error("Table value has to be higher then 0")
end
else
error("Table key has to be higher then 0")
end
else
error("Table key has to be lower then Table value")
end
else
error("Table value and key have to be numbers")
end
end
return TRUE
end
Code:
local storage = 1958
function onUse (cid, item, fromPosition, itemEx, toPosition)
doPlayerAddStorage (cid, 4500)
return true
end