!MineCraft! Cs2d Server
Would you like to react to this message? Create an account in a few clicks or log in to continue.
!MineCraft! Cs2d Server

You are not connected. Please login or register

[Script] 10-second spawn protection

4 posters

Go down  Message [Page 1 of 1]

1[Script] 10-second spawn protection Empty [Script] 10-second spawn protection Sat Jan 18, 2014 10:38 am

Guest


Guest

Here's (my) our (Random and Raining Mammoths!) 10-second spawn protection script, it works in my computer, i hope it doesn't have conflicts with the server's script.

There's no msg commands like "You have spawn protection" etcetc, just plain script.

Code (fixed)

Code:

-- 10-second spawn protection script
-- by Random Troll and Raining Mammoths

function getAmount(value)
      local amt = {}
          for x = 1, value do
                amt[x] = 0
          end
      return amt
end


state = getAmount(32)
protect = getAmount(32)

addhook("spawn","protect_exec")
function protect_exec(id)
      protect[id] = 10
      if (protect[id] > 0) then
          state[id] = 1
    end
end

addhook("ms100","protection_check")
function protection_check()
    for x = 1,32 do
          if (state[x] == 1) then
              if (protect[x] == 0) or (protect[x] <= 0) then
                    state[x] = 0
              end
          end
    end
end

addhook("second","protection_time")
function protection_time(id)
      for x = 1,32 do
          if (state[x] == 1) and (protect[x] > 0) then
                protect[x] = protect[x] - 1
          end
      end
end

addhook("hit","protection_do")
function protection_do(id,source)
      if (state[id] == 1) or (state[source] == 1) then
        return 1
      else
          return 0
      end
end



Last edited by Random Troll on Thu Jan 23, 2014 1:55 am; edited 3 times in total

2[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Jan 18, 2014 4:03 pm

pirates killer

pirates killer
MC2D Moderator
MC2D Moderator

Very good Wink , You are best scripter and player i know xd .

3[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Jan 18, 2014 5:57 pm

Apfelbrot

Apfelbrot
Friend of Community

Apfelbrot likes this. Hopefully it will be added to teh server.

4[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sun Jan 19, 2014 2:26 am

Tricky Fox

Tricky Fox
Friend of Community

Tricky Fox was there

P.S. You should probably PM the owner? Try your destiny Try to.

https://mc2d.forumotion.net

5[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Mon Jan 20, 2014 11:42 am

Guest


Guest

Will update this in a few minutes.

6[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Thu Jan 23, 2014 1:58 am

Guest


Guest

updated, fixed, eh

7[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Feb 01, 2014 8:16 am

Guest


Guest

meh, bump it

8[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Feb 01, 2014 9:39 am

Hitman-ps

Hitman-ps
Despised

What if someone go to teleport and the 10 second didn't finish yet?

http://Pul9.co

9[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Feb 01, 2014 2:41 pm

Guest


Guest

He can't attack and he can't be attacked, i'm no pro scriptor but i'm working on things, i'm currently upgrading the script, if you get any items (m4a1 super armor etc), the spawn protection will be disabled (that's what i'm working at)

10[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Feb 01, 2014 2:45 pm

Hitman-ps

Hitman-ps
Despised

If you upgrade it , it will be awesome .

http://Pul9.co

11[Script] 10-second spawn protection Empty Re: [Script] 10-second spawn protection Sat Feb 01, 2014 2:45 pm

Guest


Guest

If and only if i can do it earlier.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum