• 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!

doAddCondition onLogin

scorpionfight

New Member
Joined
Sep 21, 2008
Messages
111
Reaction score
1
Location
Brazil
Hello, I trying to make an creaturescript that onLogin gives you an condition with max HP..

Code:
function onLogin(cid)
local hp_config = 100

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, hp_config)
setConditionParam(condition, CONDITION_PARAM_BUFF, 1)

if isPlayer(cid) then
	return doAddCondition(cid, condition)
	else
	return true
end
end

But, it gives me poison condition, why?
 
Try this:

Lua:
function onLogin(cid)
	local cyko_health = 100

	if isPlayer(cid) then
		doCreatureAddHealth(cid, cyko_health)
		return true
	end
end
 
It need be a condition, because thats only base of the script.. later it will have storage values, that will change the formula of max_hp depending of an storage value. =S
 
try, if doesnt work look on the console and post the prints:
Lua:
function onLogin(cid)
	local hp_config = 100

	local condition = createConditionObject(CONDITION_ATTRIBUTES)
		setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
		setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, hp_config)
		setConditionParam(condition, CONDITION_PARAM_BUFF, 1)

	if isPlayer(cid) then
		doAddCondition(cid, condition)
                print("Works")
	else
                 print("Repot to cyko")
		end
	return true
end
 
No errors, say "Works" on console.. I have buff status, BUT:
15:36 You lose 5 hitpoints.
15:36 You lose 4 hitpoints.
15:36 You lose 3 hitpoints.
Poison, rrsrs.
And no HP. =S
 
I need only, when a player login, do a condition with max hp, for example:
Player with 100HP/100MP login, then do addCondition, and the player have now 200HP/100MP.
With a condition, because onLogout/PrepareDeath will remove his condition..
But thats not working, only when login the player takes poison. '-'
 
Back
Top