Forum

> > CS2D > Scripts > Need script to respawn
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need script to respawn

17 replies
To the start Previous 1 Next To the start

old Need script to respawn

_Yank
User Off Offline

Quote
Hello people, here im asking if can you make me a script.
What i want is, when a player spawn, he gets invencible by 10 seconds. This means the player will not take any damage by enemy after 10 seconds after his respawn. Can you help me ?
Anyway thanks

old Re: Need script to respawn

limonata
User Off Offline

Quote
Okay wait

Here you are:



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
god = 0
addhook("hit","godhit")
function godhit(id,h)
	if god == 1 then
		return 1
	else
		return 0
	end
end


addhook("spawn","hmm")
function hmm()
	god = 1
	timer(10000,"reGod")
end

function reGod()
	god = 0
end
edited 1×, last 13.06.13 01:19:55 pm

old Re: Need script to respawn

_Yank
User Off Offline

Quote
Thx will test it
Oh, see how im noob i dindnt remember i can do that
return values are really helpful

EDIT: It didn't worked
edited 1×, last 13.06.13 02:21:00 pm

old Re: Need script to respawn

_Yank
User Off Offline

Quote
user limonata has written
I tested it again. Works. If you are using it with another script, same hooks might be caused the error.

Thats true, there is more one function with "hit" hook (Lag Compensation script by Flood 2.2). That function has 1000 priority, if i set your script priority to 10 it will fix ?
Sorry for ma english

Please help, thats what i need to finish the script of my server
edited 1×, last 13.06.13 04:34:31 pm

old Re: Need script to respawn

limonata
User Off Offline

Quote
I can't fix it without your script. I need your full script. If you want to this add me in skype: limonata13
Otherwise i cant help you.

old Re: Need script to respawn

Avo
User Off Offline

Quote
Do you want something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
GodMode = {}
for i = 1, 32 do
	GodMode[i] = -1
end

addhook("spawn", "OnSpawn")
OnSpawn = function(id)
	GodMode[id] = 0
end

addhook("second", "EverySecond")
EverySecond = function()
	local T = player(0, "tableliving")
	for _, id in pairs(T) do
		if GodMode[id] >= 0 and GodMode[id] < 10 then
			GodMode[id] = GodMode[id] + 1
		elseif GodMode[id] >= 10 then
			GodMode[id] = -1
		end
	end
end

addhook("hit", "OnHit")
OnHit = function(id)
	if GodMode[id] >= 0 then
		return 1
	end
end
?

old Re: Need script to respawn

_Yank
User Off Offline

Quote
Its to complex to i try to understand it only reading. I will go test it.

IM REALLY SORRY, i will not use that script, because i found a better way to my server. Can you make the same but with safe zones : http://unrealsoftware.de/files_show.php?file=12950 ? Please

Also sorry again for making you loose your time. Please help me thats the last thing i need to do to complete my server.
edited 2×, last 15.06.13 11:20:56 am

old Re: Need script to respawn

_Yank
User Off Offline

Quote
user _Yank has written
Its to complex to i try to understand it only reading. I will go test it.

IM REALLY SORRY, i will not use that script, because i found a better way to my server. Can you make the same but with safe zones : http://unrealsoftware.de/files_show.php?file=12950 ? Please

Also sorry again for making you loose your time. Please help me thats the last thing i need to do to complete my server.

No, it didn't but i give up from that script, what i want is with that safezones script.
Please help me.
edited 3×, last 16.06.13 05:43:23 pm

old Re: Need script to respawn

_Yank
User Off Offline

Quote
I already have a safezone script what i want is a safe zone script which works with Lua Lag compensation script v 2.2 by flood

old Re: Need script to respawn

_Yank
User Off Offline

Quote
The problem is not the hook... Lua lag compensation simulates an attack then what we need to return is not the hit hook but the lua lag compensation script.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview