English Need script to respawn

17 replies
Goto Page
To the start Previous 1 Next To the start
13.06.13 12:33:41 pm
Up
_Yank
User
Offline Off
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
13.06.13 01:09:14 pm
Up
limonata
User
Offline Off
Okay wait

Here you are:



Code:
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
13.06.13 02:09:37 pm
Up
_Yank
User
Offline Off
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
13.06.13 03:19:55 pm
Up
limonata
User
Offline Off
I tested it again. Works. If you are using it with another script, same hooks might be caused the error.
13.06.13 03:39:12 pm
Up
VADemon
User
Offline Off
Quote:
god = 0

After respawn everybody is invincible.
13.06.13 04:02:05 pm
Up
_Yank
User
Offline Off
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
13.06.13 04:59:42 pm
Up
limonata
User
Offline Off
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.
14.06.13 10:03:31 pm
Up
_Yank
User
Offline Off
The script works fine withouth my other script.
And no, is not a conflict, it is because my other script is the "Lua Lag Compensation Script 2.2 By FlooD" and it simulates an attack. At least that i what i think.

Please help !

PS:there is the lag compensation script link : https://raw.github.com/FloooD/C_lag_comp/master/llc.lua
14.06.13 10:17:21 pm
Up
Avo
User
Offline Off
Do you want something like this:
Code:
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

?
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
14.06.13 10:18:41 pm
Up
_Yank
User
Offline Off
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
15.06.13 01:13:14 pm
Up
limonata
User
Offline Off
@user _Yank: I fixed it and i send it to you ? Didnt work?
15.06.13 02:27:00 pm
Up
_Yank
User
Offline Off
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
16.06.13 05:52:14 pm
Up
ReVoltage
User
Offline Off
So you want a safe zone script?
16.06.13 06:00:17 pm
Up
_Yank
User
Offline Off
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
16.06.13 06:12:33 pm
Up
ReVoltage
User
Offline Off
As far i know, safe zone script have Hit Hook.
Try combine the Hit Hook so you only have 1 Hit Hook
16.06.13 06:34:09 pm
Up
_Yank
User
Offline Off
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.
16.06.13 06:36:13 pm
Up
ReVoltage
User
Offline Off
Sorry then, i cant help you
To the start Previous 1 Next To the start