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 258 59 60338 339 Next To the start

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
playa slaya has written
well i still have not fixed it and do not see the problem please help

i also need to know how to make a dir
to make multiple scripts work together
That's easy just put this in your actual script:

1
dofile("sys/lua/<your folder for example "My Script">/<your lua script>.lua")
It works, with a little bit of logic of course.
I hope this was what you ment. Otherwise I'm sorry. (EDIT)
edited 1×, last 26.09.09 11:09:11 pm

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
The save feature works perfect but the load does not work what is the problem
the script saves data to 'sys/lua/RPG_data/'

Spoiler >

old Re: Lua Scripts/Questions/Help

Newgen
User Off Offline

Quote
How can I get the ID for the current weapon a player is using?

1
2
3
4
5
6
7
addhook("attack", "noreload")

function noreload(id, weapon)
	wpn[id] = WEAPON
	parse("equip "..id.." "..wpn[id])
	parse("setweapon "..id.." "..wpn[id])
end

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
so you can get the weapon.
1
2
3
4
5
addhook ("attack","an")
function an(id)
wpn = player(id,"weapontype");
parse ("equip "..id.." "..wpn)
end

ahh no reload

old WTF...

mafia_man
User Off Offline

Quote
1
i finded

LUA ERROR: attempt to call a nil value

Can someones help me ?
edited 1×, last 27.09.09 04:58:36 pm

old Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Quote
you want to everyone players have weapon on spawn

if true :
1
2
3
4
5
6
7
8
9
10
function equip(id,wpn)
	parse('equip '..id..' '..wpn)
end

addhook("spawn","myspawn")
function myspawn(id)
	if (id>0) then
		equip(id,45)
	end
end

player start with laser and knife

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
redefinder has written
can anyone tell me how to make unlimited weapons spawn on players for example to have unlimited he grenades?


1
2
3
4
5
6
7
8
addhook ("second", "he_gren")
function he_gren()
	for i = 1, 32 do
		if (player(i,"exists")) then
			parse('equip '..i..' 51')
		end
	end
end

old Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Quote
Blazzingxx has written
redefinder has written:
can anyone tell me how to make unlimited weapons spawn on players for example to have unlimited he grenades?


Code:
addhook ("second", "he_gren")
function he_gren()
for i = 1, 32 do
if (player(i,"exists")) then
parse('equip '..i..' 51')
end
end
end


not better always ?

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
yes but i need to make he to spawn unlimited only on a special class for example only he man class has he grenade.And can you tell me how to make unlimited snowball for ice man,and unlimited mine for mine man class?

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
mafia_man has written
not better always ?

No, better second.

@redifinder, I know that you learnt lua. So you can make it self.

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
redefinder has written
yeah but pls help about unlimited weapons spawn on classes

Why unlimited weapons instead infinitive ammo?
Or you mean mines? It same code as I write before 20 minutes.

old Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Quote
nobody write for you 100% script because when he make it for you he is a owner of script not you
edited 1×, last 27.09.09 06:29:26 pm

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
redefinder has written
i only asked for help....if you don`t like to help don`t insult people....NOOB

Be carefull with "noob" becouse you can get violation...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- This is idea how it should work
addhook ("second", "he_gren")
function he_gren()
	for i = 1, 32 do
		if (player(i,"exists")) then
			if (playerclass[id] = 1) then
				parse('equip '..i..' 51')
			end
			if (playerclass[id] = 2) then
				parse('equip '..i..' 77')
			end
		end
	end
end
To the start Previous 1 258 59 60338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview