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 2325 326 327338 339 Next To the start

old @Fonduta

Rainoth
Moderator Off Offline

Quote
Look in cs2d file archive. If you did not find it then PM me.

old Re: Lua Scripts/Questions/Help

Casper-
User Off Offline

Quote
BureX has written
Help please.

Is it possible for multiple "ai_goto" ?

Like every single bot goes to single "ai_goto".

P.S. Can somebody explain me how to use "ai_goto" ? (Not necessary)


Please ?

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
BureX has written
BureX has written
Help please.

Is it possible for multiple "ai_goto" ?

Like every single bot goes to single "ai_goto".

P.S. Can somebody explain me how to use "ai_goto" ? (Not necessary)


Please ?


Read info.txt about bot functions. In case you didnt find it, here's a quote from the file:
info.txt has written
- ai_goto(id,x,y,[walk])     Bot goes to tile (x|y). Set walk to 1 to let it walk (silent)
                    Returns 0 when failed to find path, 1 when target is reached or
                    2 when bot is still on its way.


First you have to check whether the player is bot or not, you can do it by player(id,"bot") command. Then if this person is a bot you can put ai_goto(id,x,y) where x and y - position of the tile to go to. Depending on id different bot can go to different position.

old Re: Lua Scripts/Questions/Help

Smuckie
User Off Offline

Quote
batlaizys has written
Look in cs2d file archive. If you did not find it then PM me.


I found it. I want to use it with another LUA script. Do I make a folder, put them both in, and type in the name in options?

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
no just put them in cs2d/sys/lua then look a file called server.lua the write there the following line :
1
dofile("sys/lua/NAME OF THE FILE.lua")

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
BureX meant that he wants multiple bots to be hooked to one ai_goto. Stop appointing everybody to info.txt.

It can be done with a for expression, but only if you select few bots with ids like 1,2,3,4,5 in this very order:
1
2
3
for id=1,5 do
	ai_goto(id,lolwut,lolwut)
end
Lolwut as coordinates.
It will be more complicated if the server has mixed bots and players.

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
Glock Pwner that doesnt work that easy you have to edit the bot script to make all bots got there otherwise they will ignore ai_goto because the have a other note to go

old Re: Lua Scripts/Questions/Help

PAlllUCH
User Off Offline

Quote
Hi,
I have a small reques.
When Ct Player dies, he goes to the TT and can't go back to the CT, And when the number of Ct will be 0, the game will be restart, and after restart everybody go to CT, but bots are in TT.

old Re: Lua Scripts/Questions/Help

Kurumi
User Off Offline

Quote
PAlllUCH has written
Hi,
I have a small reques.
When Ct Player dies, he goes to the TT and can't go back to the CT, And when the number of Ct will be 0, the game will be restart, and after restart everybody go to CT, but bots are in TT.
search in zombie plague

old Re: Lua Scripts/Questions/Help

iii
User Off Offline

Quote
I have 2 ideas.
First: when you drop your weopon you can't be wounded (for chat etc.) If you take your weapon again you can attack again and after 15 sec you get your weapon so or per lua.
Second: If you press a key you see a list with all now playing players and their US nick, ther rank and maybe language or country where they play.
If someone made this he can public it here and i think many would be happy

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
PAlllUCH has written
Hi,
I have a small reques.
When Ct Player dies, he goes to the TT and can't go back to the CT, And when the number of Ct will be 0, the game will be restart, and after restart everybody go to CT, but bots are in TT.


This is from a rough version. You gotta test it and write me a PM if there are any bugs (i'll fix them). I didnt test it with many players, but it should work(add this to "server.lua" file):
Spoiler >

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
Hi everyone i like to know if its necessary to add a hook to the scripts? because i have seen script without hooks here is an example :
1
2
3
4
5
6
7
8
function main(id)
msg2 (id,"©000255255you sniffed a nose of cocaine")
timer(100,"flash",id,20)
end

function flash(id)
parse ("flashplayer "..id.." 5")
end

P.D: Script is not mine so dont copy/ or use this code!
edited 1×, last 13.12.10 11:55:43 pm

old Re: Lua Scripts/Questions/Help

Chex
User Off Offline

Quote
Those are mostly functions to be called upon in other functions, either with a timer or just straight up. It conserves space and makes the code run smoother.

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
FN_Nemesis has written
Hi everyone i like to know if its necessary to add a hook to the scripts? because i have seen script without hooks here is an example :
1
2
3
4
5
6
7
8
function main(id)
msg2 (id,"©000255255you sniffed a nose of cocaine")
timer(100,"flash",id,20)
end

function flash(id)
parse ("flashplayer "..id.." 5")
end

P.D: Script is not mine so dont copy/ or use this code!


When do you want these functions to be called? When player joins/every minute/when player says something. You need a hook(-s) anyway...

You dont need a hook when you want something to be done when server starts, for example parse("mp_friendlyfire 0") to disable friendly fire - for that you dont need a hook.
J.

old Re: Lua Scripts/Questions/Help

Jake-rus
User Off Offline

Quote
why bots with my lua are freeze ??? this is OMG
1
2
LUA ERROR (ai_update_living): bots/includes/collect.lua:16: attempt to call global 'item' (a table value)
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!

old Re: Lua Scripts/Questions/Help

Surplus
User Off Offline

Quote
Jake-rus has written
1
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!


mhm... its so hard to write "bot_freeze 0" in console like it sayed

old Re: Lua Scripts/Questions/Help

welerson001
BANNED Off Offline

Quote
Jake-rus has written
why bots with my lua are freeze ??? this is OMG
1
2
LUA ERROR (ai_update_living): bots/includes/collect.lua:16: attempt to call global 'item' (a table value)
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!

old Re: Lua Scripts/Questions/Help

J3sse
User Off Offline

Quote
Noob question: Is it OK to use a lua script in the first page that gives you 16k on respawn? If it is, where should i put it? :S
To the start Previous 1 2325 326 327338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview