Forum

> > CS2D > General > Lua scripting
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Lua scripting

31 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt geschlossen Lua scripting

wolfteam32
User Off Offline

Zitieren
How to made easy script ?? What program i need to use ?? sryy for bad english im from poland

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
1. Use DC samples (Cs2d/sys/lua/samples)
2. Notepad (Enough this program)

alt Re: Lua scripting

wups
User Off Offline

Zitieren
Notepad++ is good when coding in lua, that have syntax highlight. But its more text editor out there that have syntax highlighting.

alt Re: Lua scripting

wolfteam32
User Off Offline

Zitieren
How to do a sound when im write a text !double . What to do for the sound will be played ?

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
wolfteam32 hat geschrieben
How to do a sound when im write a text !double .

Try this :
1
2
3
4
addhook("say","sayfuncs")
function sayfuncs(p,txt)
	if (txt=="double") then parse("sv_sound \"env/mystery.wav\""); end
end

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
wolfteam32 hat geschrieben
Thx U sooo match

Edit: That doesnt work!!!

I made not !double but double.
without >!<
Its working for me.

Just edit one simbol

1
2
3
4
addhook("say","sayfuncs")
function sayfuncs(p,txt)
	if (txt=="!double") then parse("sv_sound \"env/mystery.wav\""); end
end

alt Re: Lua scripting

Alpha Beta
User Off Offline

Zitieren
Try that:

1
2
3
4
5
6
addhook("say","sayfuncs")
function sayfuncs(p,txt)
	if (txt=="!double") then 
		parse("sv_sound \"env/mystery.wav\"")
	end
end

edit://
slow
1× editiert, zuletzt 02.07.09 10:41:22

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
Just make server.lua empty as hell and type only this...
1
2
3
4
addhook("say","sayfuncs")
function sayfuncs(p,txt)
	if (txt=="!double") then parse("sv_sound \"env/mystery.wav\""); end
end
What your console write then? some error?

alt Re: Lua scripting

Admir
User Off Offline

Zitieren
wolfteam32 hat geschrieben
there is nothing error......


it's work for me, just paste your script here.. we see what the problem

alt Re: Lua scripting

ohaz
User Off Offline

Zitieren
of course you need to change the soundfile which is in "sv_sound \"env/mystery.wav\" to what you want to have!

alt Re: Lua scripting

Somaz
User Off Offline

Zitieren
I don't get it.

First of all the text is rigged. How can it work for anyone?

if (txt=="!double") then parse("sv_sound \"env/mystery.wav\""); end

First of all, what is ; doing in there? Did you mistake it with pascal or something?

Second is the parse...

Okay let's see it as a text. It's "sv_sound \" as a text. Then you just write env/mystery.wav\ without the ..'s, I don't know why, and then you just put useless "" tags that open/close instantly. Am I not getting something here?

alt Re: Lua scripting

wolfteam32
User Off Offline

Zitieren
Here is the link:
1
http://rapidshare.com/files/250970959/server.lua.lua.html
Edit: Dam error is with the localisation of the file...... Im type correct location what happens ??
1× editiert, zuletzt 02.07.09 13:57:16

alt Re: Lua scripting

wups
User Off Offline

Zitieren
Somaz, nothing is wrong with the code.

You can use ; end

wolfthread, paste the server.lua at www.pastebin.com.
And not upload it.
1× editiert, zuletzt 02.07.09 14:08:53

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
Useless...
Why file name is "server.lua.lua"

× lua.lua
× Do you have that sound?
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht