• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Reset System

I remade the script to a reborn script. you get promotion when u use it but i have 1 problem. when you downgrade to lvl 8 you have the same health and mana. like you have 1000 health and 1000 mana and do a reborn u still have 1000 health and 1000 mana. i want it to be health 185 and mana 35.

i use this code
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid)-getCreatureMana(cid))

can someone tell me whats wrong with it. i use tfs 3.6pl1

sorry for my bad english.
 
Last edited:
try this
Lua:
local t = {
	skull = "yes",
	red = "yes",
	prot = "yes",
	bat = "yes",
	exp = 4200,
	lvl = 8,
	level = 450
}
t.skulls = getBooleanFromString(t.skulls)
t.red = getBooleanFromString(t.red)
t.prot = getBooleanFromString(t.prot)
t.bat = getBooleanFromString(t.bat)
function onSay(cid, words, param, channel)
	reset = 0
	c = {}
	for _, v in ipairs(getPlayersOnline()) do
		if #v > 0 and not t.skulls and not t.red and not t.prot and not t.bat and not getCreatureSkullType(v) >= 0 and getTilePzInfo(getThingPos(v)).protection and getPlayerLevel(cid) >= t.level and not getCreatureCondition(v, CONDITION_INFIGHT) then
			db.executeQuery("UPDATE `players` SET `level` = " .. t.lvl .. ", `experience` = " .. t.exp .." WHERE `id` = " .. getPlayerGUID(v))
			setmetatable(c, {__index = _G})
			setfenv(0, c)
			_G.v = _G.v
			_G.reset = _G.reset + 1
		else
			doPlayerSendTextMessage(cid, 27, "Theres no players online.")
			break
		end
	end
	return true
end
 
whel that is for all player online right? here is mine
Lua:
function onSay(cid, words, param)
config = {
level=10, -- level necessary to reborn.
nLvl=8, -- that level will be after reborn.
skull="yes", -- players with white skull can reborn? ("yes" or "no").
redskull="yes", -- players with red skull can reborn? ("yes" or "no").
prot="yes", -- players need to be in protection zone to reborn? ("yes" or "no").
bat="yes", --Players must be no fight to reborn ("yes" or "no").
storage=1030, -- storage for reborn.
reborntimes=2 -- times to be reborn.
}

function getResets(cid)
reset = getPlayerStorageValue(cid,config.storage)
if reset < 0 then
reset = 0
end
return reset
end

if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"only players without white skull can reset.")
return TRUE
end

if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"only player without red skull can reset.")
return TRUE
end

if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"you need stay in PZ to reset.")
return TRUE
end

if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"players without battle can reset.")
return TRUE
end

if getPlayerStorageValue(cid, config.storage) == config.reborntimes then
doPlayerSendTextMessage(cid,22,"You can't reborn more then "..config.reborntimes.." times.")
return TRUE
end

if getPlayerLevel(cid) >= config.level then
doPlayerAddExp(cid, getExperienceForLevel(config.nLvl)-(getPlayerExperience(cid)))
setPlayerStorageValue(cid,config.storage,getResets(cid)+1)
doPlayerSetNameDescription(cid, " Have reborn "..getResets(cid).." times.")
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "you have reborn "..getResets(cid).." times now and got better")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid)-getCreatureMana(cid))
doPlayerSetVocation(cid,getPlayerVocation(cid)+4)

else
doPlayerSendCancel(cid, "You need to have level "..config.level.." or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end


return TRUE
end
this is what i meant, a reborn system for 1 player and when use it u go down to lvl 8 and get promotion.
but its like i said its a health and mana problem.
cant get it working right. can you fix it so the player get 185 healt and 35 mana in lvl insted of what is have berofe use the reborn. maxhealt/mana works.
 
@hakeee
With config:
PHP:
config = {
hp = 185,
mp = 35
}

setCreatureMaxHealth(cid, config.hp)
setCreatureMaxMana(cid, config.mp)

And what is this:
PHP:
doPlayerSetVocation(cid,getPlayerVocation(cid)+4)
U mean -4 but if player don't have promotion what then? ;D
 
I didn't mean that but thx for trying. I already got maxhealth and maxmana working and the promotion after reborn work.
idk how to explain it but i will try again.
a player has full health and mana before he/she say !reborn.
he/she's health is 1000 of 1000 before.
after health is 1000 of 185.
i wanted to fix so after health is 185 of 185.

sorry for bad my english.
 
Nicely done but my problem is that I want a player to reborn at lvl 500 and I want them to have the same health and mana at level 10(starter lvl) as they did at lvl 500. Also I want them to have their items, house, money. I want their skills to be reset and when they reborn I want them to say like this:- 12:56 You see Player (Level 10). He is a 1st Reborn sorcerer.
 
Soo guys, it's very nice idea for reborn system, but can you make script like: if player get ex. 400 lvl, he can reborn - BUT! he have to be logged off and he can just reborn on website. Hp + mana will reset to 185 - hp and 35 mana, but skills and magic lvl will not reset. After reset we can choose some combination of 2 promotions like EK + ED, or RP + MS, or RP + EK etc
 
Reset System meet Attribute System!
I have a Basic Attribute System that will go hand by hand with this Reset
(Reborn) System, link is on my signature!
PS
Awesome script man!
 
Back
Top