Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2271 272 273338 339 Next To the start

old Re: Lua Scripts/Questions/Help

pivot
User Off Offline

Quote
Arctic has written
1
2
3
4
5
6
7
8
addhook("second","moneypersec")
function moneypersec()
	for i = 1,32 do
		if player(i,"exists") then
			parse("setmoney "..i.." 16000")
		end
	end
end

should give player 16000 money for each second.


Thank you very much!

old Re: Lua Scripts/Questions/Help

Sparty
Reviewer Off Offline

Quote
hey can anyone help me because when i say "!Car" and then i do "!nocar", i don't turn back to normal and i always stay the same. can anyone help me pleeease?

old Re: Lua Scripts/Questions/Help

Sparty
Reviewer Off Offline

Quote
FN_Nemesis has written
@Sparten show the script for i can help u


OK


==========================================
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
39
40
41
42
addhook("say","spawn5")
function spawn5(id,txt) 
	if(txt=="!Scorpion") then
          freeimage(id)
          parse("speedmod "..id.." 5")
		parse("equip "..id.." "..47)
		parse("setmaxhealth "..id.." "..250)
		parse("setarmor "..id.." "..200)
		parse([[mp_wpndmg "RPG Launcher" 3000]] )
          id1=image("gfx/xzone/scorpion.bmp",1,1,200+id) 
          imagescale(id1,1,1) 
          imageblend(id1,0) 
          imagealpha(id1,1.0)
          if (player(id,"team") == 2) then 
               imagecolor(id1,255,255,255) 
                
          elseif (player(id,"team") == 1) then 
               imagecolor(id1,255,255,255) 
          end 
	end
end

addhook("say","spawn2") 
function spawn2(id,txt,p) 
	if(txt=="!Notank") then
	  parse("speedmod "..id.." 0")
		parse("strip "..id.." "..47)
		parse("setmaxhealth "..id.." "..100)
		parse("setarmor "..id.." "..0)
          freeimage(id) 
          id1=image("gfx/ct1.bmp",0,0,100+id) 
          imagescale(id1,1,1) 
          imageblend(id1,1) 
          imagealpha(id1,0.7) 
          if (player(id,"team") == 2) then 
               imagecolor(id1,0,0,0) 
                
          elseif (player(id,"team") == 1) then 
               imagecolor(id1,0,0,0) 
          end 
	end
end
========================================
Its a Scorpion Tank lua, custom made by me and I'm stuck here obviously. Any use of how to fix it?

NO OTHER PEOPLE BETTER TAKE MY SCRIPT OR I WILL %&^*%(%#$!! (Sorry because I don't like that happening

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
First it`s not ur script it`s form xherox
this is the problem
1
id1=image("gfx/ct1.bmp",0,0,100+id)

replace that with this

1
id1=image("gfx/id1=image("gfx/sprites/flare2.bmp",0,0,100+id)

old Re: Lua Scripts/Questions/Help

Sparty
Reviewer Off Offline

Quote
FN_Nemesis has written
First it`s not ur script it`s form xherox
this is the problem
1
id1=image("gfx/ct1.bmp",0,0,100+id)

replace that with this

1
id1=image("gfx/id1=image("gfx/sprites/flare2.bmp",0,0,100+id)


Sorry I forgot to mention his name. But some was modified.
I tried your fix, still doesn't work. Still look like a tank. Any other fixes?

old Re: Lua Scripts/Questions/Help

Tajifun
User Off Offline

Quote
Tajifun has written
Hey there.
could someone give me an example
for the timer function.
Coz i dont know how to use it. :S

thanks.


Pls.. i need help. :S

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
@Tajifun:
1
2
3
4
5
6
7
8
tmr = 0

addhook("second","timer")
function timer()
	tmr=tmr+1
		parse("hudtxt 37 "©000100255Timer: '..tmr..'" 13 129")
	end
end

old Re: Lua Scripts/Questions/Help

Tajifun
User Off Offline

Quote
RyceR has written
tmr = 0

addhook("second","timer")
function timer()
tmr=tmr+1
parse("hudtxt 37 "©000100255Timer: '..tmr..'" 13 129")
end
end


oh sorry.
didn't mention that.

I thought of this timer:

1
2
3
4
5
6
7
8
9
10
[TIMERS]
- timer(time,"func",["p"],[c])
Create a timer which will call the Lua function "func" after a
certain time in milliseconds (time).
Moreover it can pass a string parameter (p) to this function.
The timer calls the function once by default. However you can call
it several times by entering a count value (c). Using 0 or lower count values will make the timer call the function infinite times.

- freetimer(["func"],["p"])	
Remove timers which call a certain function with a certain param. Call this function without parameters or with empty strings as parameters to remove ALL timers.


Edit:
I know how :b
edited 1×, last 03.10.10 06:19:42 pm

old Re: Lua Scripts/Questions/Help

byengul
User Off Offline

Quote
byengul has written
hi i want to make an item like when you use it, it will give you 10 level.i've tried to make like that but not worked:
Spoiler >


help please

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
I want to play with bots on my Fun-Games mode...
this script work, but spaming me with errors, why?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("ms100","random_get")
function random_get()
if stopsearch==0 then
first = math.random(1,#player(0,'table'))
if (player(first,"exists")) then
if (player(first,"team")>0) and (player(first,"health")>0) then
if (player(first,"bot")) then
return 1
else
msg("©000255000"..player(first,"name").." Is choosing the game!")
                         menu(first,"Fun-Games Menu,Games 1-8,Games 9-16,Games 17-24")
                         stopsearch=1
                         checkifchoose=0
                    end
               end
          end
     end
end

EDIT: Fixed

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Two things:
You should tab your code
You should tell us what error you're getting...

I think this could work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("ms100","random_get")
function random_get()
	if stopsearch==0 then
		local t = player(0,"tableliving")
		first = t[math.random(1,#t)]
		if (player(first,"team")>0) then
			if not (player(first,"bot")) then
				msg("©000255000"..player(first,"name").." Is choosing the game!")
				menu(first,"Fun-Games Menu,Games 1-8,Games 9-16,Games 17-24")
				stopsearch=1
				checkifchoose=0
			end
		end
	end
end

old Rp Money System

Pwn4fun
User Off Offline

Quote
Can someone help me get a script like the blocker city
money and drop

old Re: Lua Scripts/Questions/Help

pivot
User Off Offline

Quote
hello, I'm with a problem in the "say functions" script:

1
2
3
4
5
addhook("say","sample.sayfuncs.say")
function sample.sayfuncs.say(p,txt)

	-- Admin equip A
	if (txt=="!a12345") then parse("speedmod "..p.." 20"); return 1; end

the "return 1;" does not work in the game, the text insists on appearing in-game chat!
I was wondering how to put the return 1 correctly

Thanks!

old Re: Lua Scripts/Questions/Help

Tajifun
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("say","Adminsay")
function Adminsay(id,txt)
	-- Admin equip A
	if (txt=="!a12345") then
		parse("speedmod "..id.." 20")
		return 1
	end
end

That should work.

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
use it:
1
2
3
4
5
6
7
addhook("say","sample_say")
function sample_say(p,txt)
	-- Admin equip A
	if (txt=="!a12345") then
		parse("speedmod "..p.." 20")
	end
end

P.S: Tajifun, the same time?!

old Server script

Glix
User Off Offline

Quote
can us help me on server script ??

money drop

lisence (teleport,building and drop an item)

lvl 0-99 (exp)

shop (like you click f2 and open your own shop)

insta equip

car mod (enter to car and out of a car)

admin team script
To the start Previous 1 2271 272 273338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview