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 2113 114 115338 339 Next To the start

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
Yeah, I was to lazy to finish it. I have a version on my harddrive where I started the "Making a little menu" part, but I had much to do with school and it also didn't make fun anymore. Perhaps I'll finish it sometimes, but I don't know when this will be.

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
Deatherr has written
How do you make a bank lua?So you can deposit and withdraw money? ( also to have more than 16000)
MiroslavR is working on stuff like that, and no 16000 is the limit of the $ currency, with LUA you can create your own currency.

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
you have to do an array for that like:
1
2
3
4
5
6
7
8
9
function array(m)
	local array = {}
	for i = 1, m do
		array[i] = 0
	end
	return array
end
money = array(32) -- you can also set a maxplayers value and use that value instead of 32
bank_money = array(32)
you'll also have to do ways of getting money... obviously.
and the bank... it should be a menu with deposit and withdraw options, you choose the values.
Spoiler >

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Here is.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function initArray(m) 
     local array = {} 
     for i = 1, m do 
          array[i] = 0 
     end 
     return array 
end 

money = initArray(32)

addhook("kill","max_mn")
function max_mn(id,victim,x,y,wpn)
	money[id] = money[id]+300
end

this part is for kill. next need buy menu with f2, or doesn't work the buy menu.

old Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Quote
-WiLSoN- has written
you have to do an array for that like:
1
2
3
4
5
6
7
8
9
function array(m)
	local array = {}
	for i = 1, m do
		array[i] = 0
	end
	return array
end
money = array(32) -- you can also set a maxplayers value and use that value instead of 32
bank_money = array(32)
you'll also have to do ways of getting money... obviously.
and the bank... it should be a menu with deposit and withdraw options, you choose the values.
Spoiler >


Is that the whole script for the bank? ... i Don't see in the script that you can open the bank menu ...(no offense)
edited 1×, last 11.12.09 03:24:17 am

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
Deatherr has written
Is that the whole script for the bank? ... i Don't see in the script that you can open the bank menu ...(no offense)

Obviously it isn't the whole script, if you are going to make a map for the script then you can use the "usebutton" or "trigger" hook, to open the bank menu, also you can do it with serveractions and etc,also you have to do ways of winning money, can be by killing,building and etc
Good Luck

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
Hi guys i just want to make a Fun Game Mod
can you please help me the script must give you s weapon every round i make the No drop and No buy script but this msg show's when i enter the map on console :
LUA ERROR : attempt to call a nil value

the Script is :
Spoiler >


please Help me

old Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Quote
Lol, you want to make the same script like me. It works with random..I post it here.

But then please notice me in the Credits
edited 1×, last 11.12.09 04:23:15 pm

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
memo has written
Hi guys i just want to make a Fun Game Mod
can you please help me the script must give you s weapon every round i make the No drop and No buy script but this msg show's when i enter the map on console :
LUA ERROR : attempt to call a nil value

the Script is :
Spoiler >


please Help me


try restart CS2D, this problem fixed after I restart CS2D
if work.

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
so you know why the random script didnot work and what the mean of that msg ??

@Admirdee
same same nothing happen the msg still go on console every time i play on script
edited 1×, last 11.12.09 04:24:49 pm

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Hmm, no just restart CS2D (Admirdee, that's hook nil):
1
2
addhook("startround","[b]FunGame[/b]")
function [b]Fun[/b](id)
Does Startround hook have ID parameter? Answer - No.

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Blazzingxx has written
Hmm, no just restart CS2D (Admirdee, that's hook nil):
1
2
addhook("startround","[b]FunGame[/b]")
function [b]Fun[/b](id)
Does Startround hook have ID parameter? Answer - No.


lol. I don't see the hook and function x_x
and yes, startround only have mode parameter

@memo

1
2
addhook("startround","FunGame")
function FunGame()

have you try this?

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
its not work ether with make FunGame()

but the confuse thing that no drop script and no buy script work ?!


thanks Blazzingxx very much its my first script and i am so confuse !

and by the way what the function to add a msg every (time)
same same the one you put on your script like
Gun Game Mod By Blazzingxx
....
can you edit to it to .

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Ok, that's my script.
In this system you can simple add 10 weapons for each level.
Just edit weapons table:
1
weapons_table[b][round][weapon][/b]
That's enough for you?

Random Weapon Rounds By Blazzingxx
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
addhook("startround","fun_startround")
addhook("buy","fun_buy")
addhook("drop","fun_drop")

weapons_table = {{38,21},{11},{24,5},{30,51},{32,51},{34,35},{87,88},{10,47}} -- [Round][Weapons]
speed_table = {0,0,0,0,0,0,0,0,0} -- Table Of Speed For Each Level

function fun_startround()
	local i
	local m
	local msg_wpn = ""
	local items = math.random(1,#weapons_table)
	for i = 1,32,1 do		
		for m = 1,#weapons_table[items],1 do
			parse("equip "..i.." "..weapons_table[items][m])
		end
		if (speed_table[items] == true) then
			parse('speedmod '..i..' '..speed_table[items])
		end
	end
	for i = 1, #weapons_table[items] do
		if (i > 1) then
			msg_wpn = msg_wpn.." + "
		end
		msg_wpn = msg_wpn..""..itemtype(weapons_table[items][i],"name")
	end
	msg("©000255000"..msg_wpn.." Round!@C")
end

function fun_buy()
	return 1
end

function fun_drop()
	return 1
end
edited 3×, last 11.12.09 05:04:01 pm

old Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Quote
-WiLSoN- has written
Deatherr has written
Is that the whole script for the bank? ... i Don't see in the script that you can open the bank menu ...(no offense)

Obviously it isn't the whole script, if you are going to make a map for the script then you can use the "usebutton" or "trigger" hook, to open the bank menu, also you can do it with serveractions and etc,also you have to do ways of winning money, can be by killing,building and etc
Good Luck


I'm going to mess up the bank lua so bad XD...
To the start Previous 1 2113 114 115338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview