Forum

> > CS2D > General > Lua scripting
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Lua scripting

31 replies
Page
To the start Previous 1 2 Next To the start

old closed Lua scripting

wolfteam32
User Off Offline

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

old Re: Lua scripting

SQ
Moderator Off Offline

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

old Re: Lua scripting

wups
User Off Offline

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

old Re: Lua scripting

wolfteam32
User Off Offline

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

old Re: Lua scripting

SQ
Moderator Off Offline

Quote
wolfteam32 has written
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

old Re: Lua scripting

SQ
Moderator Off Offline

Quote
wolfteam32 has written
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

old Re: Lua scripting

Alpha Beta
User Off Offline

Quote
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
edited 1×, last 02.07.09 10:41:22 am

old Re: Lua scripting

SQ
Moderator Off Offline

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

old Re: Lua scripting

Admir
User Off Offline

Quote
wolfteam32 has written
there is nothing error......


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

old Re: Lua scripting

ohaz
User Off Offline

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

old Re: Lua scripting

Somaz
User Off Offline

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

old Re: Lua scripting

wolfteam32
User Off Offline

Quote
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 ??
edited 1×, last 02.07.09 01:57:16 pm

old Re: Lua scripting

wups
User Off Offline

Quote
Somaz, nothing is wrong with the code.

You can use ; end

wolfthread, paste the server.lua at www.pastebin.com.
And not upload it.
edited 1×, last 02.07.09 02:08:53 pm

old Re: Lua scripting

SQ
Moderator Off Offline

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

× lua.lua
× Do you have that sound?
To the start Previous 1 2 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview