Forum

> > CS2D > General > Flashlight script
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Flashlight script

14 replies
To the start Previous 1 Next To the start

old Flashlight script

joelol
User Off Offline

Quote
I need some help.
There's been a problem.Every single server i visited haves this flashlight script,and i can't find it.Where is it?
Can you please help me?

old Re: Flashlight script

leoska
User Off Offline

Quote
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
29
30
31
32
33
34
35
36
37
38
function array(s,v) 
     local t = {}
     for i = 1, s do 
          t[i]=v 
     end 
     return t
end 

map_objects = 0 
flashlight_is_on = array(32,false) 
function player_flashlight() 
     for i=1,32,1 do 
          id=image("gfx/sprites/flashlight.png",1,1,200+i) 
          if i == 1 then map_objects = id - 1 end 
          imagecolor(id,255,255,255) 
          imageblend(id,1) 
          imagealpha(id,0.5) 
          imagescale(id,1,1) 
          flashlight_is_on[id] = false 
     end 
end 

player_flashlight() 

addhook("startround","player_flashlight") 

addhook("serveraction","server_serveraction") 
function server_serveraction(id,button) 
     if (button==1) then 
          flashlight_is_on[id] = not flashlight_is_on[id] 
          if flashlight_is_on[id] then 
               imagealpha(map_objects+id,0.5) 
          else 
               imagealpha(map_objects+id,0.0) 
          end 
          parse([[sv_sound "flashlight.wav"]]) 
     end 
end

old Re: Flashlight script

KimKat
GAME BANNED Off Offline

Quote
You'll need graphic and sound for the lua script as it requires those files otherwise you won't be able to see the flashlight nor will you be able to hear the flashlight.

Spoiler >


You can turn it on/off by either writing serveraction1 in console if you have F2 binded to another key. Otherwise simply press (F2) key by default. I already made different kind of flashlights.

old Re: Flashlight script

leoska
User Off Offline

Quote
Quote
What are you talking about?
That's MY script, you have no rights over it, so stfu.
http://www.unrealsoftware.d...tart=2300#post161971

original script was, I just asked my help to finish it then that you did and you, too, special thanks

the more your script was a error
you script
Spoiler >

my script, not have errors
Spoiler >

old Re: Flashlight script

Flacko
User Off Offline

Quote
It didn't have a single error. Don't try to pretend that you know lua when you obviously don't.

old Re: Flashlight script

leoska
User Off Offline

Quote
as if you know the whole Lua. So my idea was, and part of the script so I do not want to fight and beg DC or one of the moderators close this topic.

old Re: Flashlight script

simonkilleR2
User Off Offline

Quote
as u know leo olready put the right script..
say thnx [at last] if u miss it somehow... so:
Spoiler >
have fun

old Re: Flashlight script

Starkkz
Moderator Off Offline

Quote
i not copy it, i make it myself but i copy the idea.

Spoiler >

it works with F2.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview