Forum

> > CS2D > Scripts > 5 script quеstions
Forums overviewCS2D overview Scripts overviewLog in to reply

English 5 script quеstions

7 replies
To the start Previous 1 Next To the start

old 5 script quеstions

scriptmen
User Off Offline

Quote
Hello! I am not very experienced lua-scripter and I want to ask for some help.

1) how could I write a message (in game) that no one would see? for example I say "!config" and only I see it

2) I know that you can give weapons to player through parse ("equip"....), but how I can UNequip some weapons? not drop. unequip.

3) how can I bind something in lua script? if there are such hooks like "keypress" or something like that?

4) what is bot waypoint and how can I make some for my map?

5) how can I protect my script from editing and stealing? maybe a password or a program or something like that? would cs2d be able to read it if it would be protected?

Hope you would answer my questions soon and help me

old Re: 5 script quеstions

3RROR
User Off Offline

Quote
1) You can use cs2d lua cmd msg2
2) Parse it with cs2d cmd strip
1
parse("strip <playerid> <itemidyouwant>")
3) The only bindable hooks in lua is cs2d lua hook serveraction (F1,F2 and F3)
4) You can try using the editor instead.
5) I don't see it's possible.
edited 1×, last 26.07.12 12:13:31 am

old Re: 5 script quеstions

Avo
User Off Offline

Quote
1.
1
2
3
4
5
6
7
addhook("say","OnSay")
function OnSay(id,txt)
	if txt=="!config" then
		msg2(id,"Your msg here")
		return 1
	end
end

2. There isn't thing that you call "unequip". Its name is "strip": cs2d cmd strip

3. No. You can only bind keys for say command and work with it. There are also serveraction keys.

4. Way point? Do you need BotNode ?

5. No, you can't protect it. If you don't want somebody to steal your script, do not upload it. Easy rule of the Internet.

old Re: 5 script quеstions

Apache uwu
User Off Offline

Quote
To clarify on some.

3. You can use the hooks below to detect some extra key presses:

     cs2d lua hook drop -> G
     cs2d lua hook move -> Shift (While moving, parameter 3=true)
     cs2d lua hook use -> E
     cs2d lua hook spray -> Y
     cs2d lua hook reload -> R (parameter 2=1)

4. Bot Node, notice that bots just randomly wander here, they don't actually like use this like a path to walk.
     If you have a maze and you use this, they probably won't escape.

5. file File does not exist (10636), though you can still rip the map tile by tile on the server via spectator. With that in mind you can set cs2d cmd sv_specmode to 2.
sv_specmode 2

old Re: 5 script quеstions

DC
Admin Off Offline

Quote
4. CS2D doesn't have waypoints anymore. Bots will work automatically with every map unless portals/dynamic objects are used for important paths. Bot nodes are just optional entities to mark "interesting" points for bots.

5. There is no reason to protect Lua scripts with encryption because people will never see them unless you upload them to the file archive. Lua scripts run on the server only and clients do not download them from your server.
edited 1×, last 26.07.12 03:30:55 am

old Re: 5 script quеstions

Flacko
User Off Offline

Quote
Get the lua compiler and precompile your script.
Nobody can read or edit your script now, not even yourself.
hooray.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview