Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2218 219 220338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

DRoNe
User Off Offline

Zitieren
batlaizys hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Zitieren
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)

alt Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Zitieren
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.

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
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?

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
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??

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
Dark Byte hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
@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)

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
@MSek
Homer hat geschrieben
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:
Mehr >

It is a menu that goes on for infinity in either direction.
1× editiert, zuletzt 10.07.10 21:40:58

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
Dark Byte hat geschrieben
@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"

alt problem

henrik1
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
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
1× editiert, zuletzt 12.07.10 15:14:46

alt Re: Lua Scripts/Questions/Help

StirlizZ-Fapicon
Super User Off Offline

Zitieren
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?

alt Re: Lua Scripts/Questions/Help

martis67
User Off Offline

Zitieren
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?
Zum Anfang Vorherige 1 2218 219 220338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht