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 2218 219 220338 339 Next To the start

old Re: Lua Scripts/Questions/Help

DRoNe
User Off Offline

Quote
batlaizys has written
I would like to get such a script...

when u say !hide a wall 3 or wall 2 etc. appears.

Its good for construction mod when u can hide between buildings

I managed to make 1 ,but when i say it a supply appears on ALL of players... Idk how to make this code thingy...

i would write it...

parse("mp_building_health supply 10000")

addhook("say","build")
function build(id,txt)
for id=1,32 do
if (txt=="!hide") then
parse("spawnobject 9 "..player(id,"tilex").." "..player(id,"tiley").." 1 1 1 1")
end
end
end

plz help...


1
2
3
4
5
6
addhook("say","hidesay")
function hidesay(id,txt)
	if txt == "!hide" then
		parse ("spawnobject "..math.random(3,4).." "..player(id,"tilex").." "..player(id,"tiley"))
	end
end

this work :
if player say "!hide" then in his position will appear wall1 or wall2 ...

and please can some1 help me with one problem?, read my older answer.

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
I have small question: how to make this:

If I press button in menu, there is next menu in game
(Name of menu1: ms.menu menu2: ms.pistol.menu)

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function ms.menu(p)
	menu(p, titlename1.." random,Next")--etc..You know the menu function
end
function ms.pistol.menu(p)
	menu(p, titlename2..", Button name number 1,Back")--Like above
end
addhook("menu","ms.menu.hook")
function ms.menu.hook(id,title,button)
if string.sub(title, 1, #titlename1) == titlename1 then
	if button == 2 then
		ms.pistol.menu(id)
	end
elseif string.sub(title, 1, #titlename2) == titlename2 then
	if button == 2 then
		ms.menu(id)
	end
end
end
This won't work, but it's the general idea on how to do it.

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
I have a few questions:
What is the diff between a chunk & block.
What exactly is a package and how to create one
Is it possible to detect the ammo in a weapon and a weapon used by a player?

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
Hi all
Does anybody know how to write "unequal" in a lua script?

I have tried it so...

~=

1
2
3
4
5
6
addhook ("say","text")
function text(p,t)
if player(p,"name")~="Snake" and t=="Hi" then
msg ("©255000255"..player(p,"name").." said HI!@C")
end
end

Will it function??

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Dark Byte has written
I have a few questions:
What is the diff between a chunk & block.
What exactly is a package and how to create one
Is it possible to detect the ammo in a weapon and a weapon used by a player?


Even though old this might help
http://www.lua.org/manual/2.5/manual.html

If you're talking about the package table that appears in the documentation i would suggest you not to mess around with it because it stores data about require'd files.

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
@Flacko
I mean a package that stores Lua code or modules that are loaded with require.

I think I know the difference:
Chunk: A single line of execution
Block: list of statements that are executed (optional semicolon)

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
@MSek
Homer has written
This won't work, but it's the general idea on how to do it.

He said it would not work, but a few pages back I posted a menu as an example that works.

Edit:
Here I found:
More >

It is a menu that goes on for infinity in either direction.
edited 1×, last 10.07.10 09:40:58 pm

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Dark Byte has written
@Flacko
I mean a package that stores Lua code or modules that are loaded with require.


Nothing special, it's just a .lua file or a .dll that you call with require "yourfilewithNOextension"

old problem

henrik1
User Off Offline

Quote
i have cs2d but i can join the map who is only usng users.

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
I need a script when you press like a button called hm1
then a menu shows up

and a script when you walk over X 1000 and Y 1000
edited 1×, last 12.07.10 03:14:46 pm

old Re: Lua Scripts/Questions/Help

StirlizZ-Fapicon
Super User Off Offline

Quote
Could somebody get me a small script:
If number of Ts at server = 0, then script make message (T noobs) and restarting, elseif number of playing CTs on the server = 0 - then script make message (CT noobs) and restarting. But it all working only when 20 secs have passed.

thx.




P.S. somebody there said about "Random Map Generator" for cs2d, its real?

old Re: Lua Scripts/Questions/Help

martis67
User Off Offline

Quote
hi all,


im making gungame lua script 50 % done but when im upgrading to 11lvl all to me are canceled im getting usp and he granade and then i shooting and not leveling up wtf is hapen?
To the start Previous 1 2218 219 220338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview