All help greatly appreciated.
Forum
Scripts
Lua Request: After player dies 'x' times...
Lua Request: After player dies 'x' times...
5 replies
1

All help greatly appreciated.
1
2
3
2
3
if player(id,"deaths)>=x then -- ur code end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
deathc=0;
addhook("die","_die")
addhook("startround","resdeath")
function _die(id)
deathc=deathc+1
	if (deathc == x ) then -- change x to the number
	parse("trigger blahblah")
	end
end
function resdeath()
deathc=0
end
1
2
3
4
5
6
7
2
3
4
5
6
7
limit = 10
addhook("die","_die")
function _die(id)
	if player(id,"deaths") == limit then
		parse("trigger nameoftrigger")
	end
end
Change 'limit' to how many deaths need to be completed before the trigger works. Mind that this will not reset deaths of a player so the next round when the player dies, he'll have 11 deaths and will no longer trigger. If you want it to work differently, use
1
parse("setdeaths "..id.." 0")
Rainoth posts: or with this statementif player(id,"deaths")%limit==0
EDIT: And thanks for letting me know,
Rainoth and
MikuAuahDark
1

Offline