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 2100 101 102338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Lord_CTF
User Off Offline

Quote
no one yet helped me... find my post in the 100 page and PLEASE help me
EDIT:
Spoiler >

There is a LOAD of mistakes here. Probably the whole code is a MISTAKE. Thats why i need help...
edited 1×, last 25.11.09 10:43:49 am

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
addhook("say","deagle")
function deagle(id,txt)
if (txt == "deagle") then
if (player(id,"money")>=750) then
parse('equip '..id..' 3')
parse("setmoney "..id.." "..player(id,"money")-750);
elseif(player(id,"money")<750) then
parse('sv_msg2 ..id.. "You dont have enough money!"')
end
end
end

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Spoiler >


why bombplant hook does not exist ?

ps: at changelog
ADDED
Lua Hook bombplant (when planting bomb)

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
gandalf has written
it doesnt work


tell us what you did so we can debug it, just saying "it doesn't work" doesn't give us anything to help you with...

Post everything that you did and what you expect to happen.

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
Admirdee has written
1
2
3
4
5
6
7
8
addhook("startround","rstart")
function rstart()
	for i = 1,32 do
		if (player(i,"exists")) then
			parse("strip "..i.." 0")
		end
	end
end

long code for it

I need it just for secondary and primary and need the value of the weapon the person owned...

old Re: Lua Scripts/Questions/Help

Flacko
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
39
40
41
42
43
44
45
46
47
48
function array(size,value)
	local asd = {}
	for i=1, size do
		asd[i] = value
	end
	return asd --LOL
end

function getslotweps(id,slot)
	local myweapons = playerweapons(id)
	local rt = {}
	for i,v in ipairs(myweapons)
		if itemtype(v,"slot") == slot then
			table.insert(rt,v)
		end
	end
	return rt
end 

--Global table to save what weapons did each player have
a_table = array(
	32,
	{
		prim={},
		sec={},
		melee={}, --We won't use this
		nades={} --neither this
	}
)

addhook("startround","omg")
function omg()
	for i=1,32 do
		if(player(i,"exists")) then
			if(player(i,"team")>=1) then
				a_table[i].prim=getslotweps(i,1))
				for a=1,#a_table[i].prim do
					parse("strip "..i.." "..a)
				end	
				a_table[i].sec=getslotweps(i,2))
				for m=1,#a_table[i].sec do
					parse("strip "..i.." "..m)
				end
				fo
			end
		end
	end
end

Try that, so you can make yourself an idea...
edited 3×, last 25.11.09 06:18:17 pm

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
tried it.
got this:

LUA ERROR: dir: attempt to call global 'nades' (a nil value)

line was this
1
nades{} --neither this
:S
also that "fo" after the secondary wep thing doesn't go there (right ?)

old Re: Lua Scripts/Questions/Help

Lord_CTF
User Off Offline

Quote
Quote
gandalf has written:
it doesnt work


tell us what you did so we can debug it, just saying "it doesn't work" doesn't give us anything to help you with...

Post everything that you did and what you expect to happen.

ive writed what i did just look some posts up
TKD has fixed the code, but it still didnt work.

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
now i've got this

LUA ERROR: dir: attempt to global index 'a_table' ( a nil value)

line is this:
1
a_table[i].prim=getslotweps(i,1)
may be it will happen on this other too
1
a_table[i].sec=getslotweps(i,2)
sorry of all my questions :S

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
gandalf has written
ive writed what i did just look some posts up
TKD has fixed the code, but it still didnt work.


... What did you press and type in in-game, what did you expect the script to do, what actually happened, is there any error messages - that's what you "do". Once again, telling us that "it still didn't work" doesn't give us anything to work on. Do you really expect us to magically read your mind?

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
if you want us to help you, you should tell us exactly what do you wanna do.
this vampire class sucks hp ?
recovers when killing ?
tell us all the information
(maxhp,speed,weapons,additionals like hp suck)
and then we can help you

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
LOL.
Stupid error
1
2
3
4
5
6
7
function array(size,value)
	local asd = {}
	for i=1, size do
		asd[i] = value
	end
	return asd -->dammit
end

old Re: Lua Scripts/Questions/Help

h4uja2
User Off Offline

Quote
Parametres of vampir class
setmaxhealth 250
sethealth 100
setarmor 100
speedmod 0
equip 39
When vampir attacks anemy he gets 1 hp and when he kills him he gets 20 hp. Thats all

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
h4uja2 has written
Im making vampire class, but it doesnt work. Help me pls with this class


Ok, show us what do u have until now...

old Re: Lua Scripts/Questions/Help

h4uja2
User Off Offline

Quote
Its working perfect
Spoiler >


but i cant make sucking HP
something from Heal Claws script and Battle Field 2D Mod Machete (pack munition)

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
here's just the hp sucking:
Spoiler >

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
@-WiLSoN-,
1
player(id,"health")+[b]1..[/b]
You cant place number like valuable.
1
[b]([/b]player(id,"health")+1[b])[/b]..

Nvm, whole line is wrong there.
1
parse("sethealth "..at..[b]""[/b]..player(at,"health")+1..)
To the start Previous 1 2100 101 102338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview