Forum

> > CS2D > Scripts > Need script to respawn
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Need script to respawn

17 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Need script to respawn

_Yank
User Off Offline

Zitieren
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

alt Re: Need script to respawn

limonata
User Off Offline

Zitieren
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
1× editiert, zuletzt 13.06.13 13:19:55

alt Re: Need script to respawn

_Yank
User Off Offline

Zitieren
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
1× editiert, zuletzt 13.06.13 14:21:00

alt Re: Need script to respawn

_Yank
User Off Offline

Zitieren
user limonata hat geschrieben
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
1× editiert, zuletzt 13.06.13 16:34:31

alt Re: Need script to respawn

limonata
User Off Offline

Zitieren
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.

alt Re: Need script to respawn

Avo
User Off Offline

Zitieren
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
?

alt Re: Need script to respawn

_Yank
User Off Offline

Zitieren
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.
2× editiert, zuletzt 15.06.13 11:20:56

alt Re: Need script to respawn

_Yank
User Off Offline

Zitieren
user _Yank hat geschrieben
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.
3× editiert, zuletzt 16.06.13 17:43:23

alt Re: Need script to respawn

_Yank
User Off Offline

Zitieren
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

alt Re: Need script to respawn

_Yank
User Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht