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 28 9 10338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Quote
FIXED.
Now need a reset also at round start.
@edit
i need also a script which gives invisible armor when i say "!camo on" and it takes when i say "!camo off"
edited 2×, last 26.05.09 06:33:21 pm

old Re: Lua Scripts/Questions/Help

Zune5
COMMUNITY BANNED Off Offline

Quote
Does anyone know how to make it so 1 team has the Stealth Suit and the other has a M3, I tried it myself (Like a hide and seek mod) but I can't seem to pull it off.

old Re: Lua Scripts/Questions/Help

REVOLUTiON
User Off Offline

Quote
Hai guys! i need help! could u work this Lua for me?

All i need is = Buying script i mean,
Im working on a RPG map and for example u use it and u lose Money like trigger_cost, T_T and also for exmaple if u breakable u give for example 1000$ to the player, is that even possible?

old Re: Lua Scripts/Questions/Help

Killahamsta
User Off Offline

Quote
I would like to learn how to script a simple admin system

I am planning to assign people their "jobs" for an RPG game..

eg:
mr. bob wants to be a shopkeeper, so I assigned him to be one by: "!assignshopkeeper bob" once a shopkeeper, he may use a set of commands like "!givegalil alex", etc. I know how to trigger stuff, so I only need the admin system

PLEASE HELP ME....

old Re: Lua Scripts/Questions/Help

Zune5
COMMUNITY BANNED Off Offline

Quote
Killahamsta has written
I would like to learn how to script a simple admin system

I am planning to assign people their "jobs" for an RPG game..

eg:
mr. bob wants to be a shopkeeper, so I assigned him to be one by: "!assignshopkeeper bob" once a shopkeeper, he may use a set of commands like "!givegalil alex", etc. I know how to trigger stuff, so I only need the admin system

PLEASE HELP ME....


Someone help this guy lol
Yeah wups, I saw that on the forum. Thanks. I'll make a few changes to it.

old Re: Lua Scripts/Questions/Help

BlackDeath
User Off Offline

Quote
I don't know if I can't request here or not >_> but here goes, Looking for script with the following commands round start with Kevlar+Helm and a deagle. Buying allowed. makes it easier for me when my friends aren't ready.

old Re: Lua Scripts/Questions/Help

Killahamsta
User Off Offline

Quote
I think I need to change my latter statement's request..

The class system seems to give the admin less hassle onto assigning roles for players, I ask you guys again if it is possible to give a certain class command privileges like !openshopdoor..

Yes people I know how to trigger entities so I just need a code for...maybe I should give an example to explain this in depth:

Mr. Bob got into the game,
he chose to be a shopkeeper,
he then is shown all the commands available for his role:
     !openshopdoor --triggers a dynwall to open.
     !sell galil --triggers the item on the ground infront of a
table     
!barricade --triggers a series of dynwalls to cover his position.

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
this is really basic and simple scripting. all you need is a simple if-condition where you check if the player has the right class and therefore the permission to execute the command.

old Re: Lua Scripts/Questions/Help

lol93
User Off Offline

Quote
i was loking for it to... can you put it on this site when you are done

Edit: i try it out myself is it somting like this:
if (sample.superhero.class[id]<=1) (txt=="!m3") then parse("equip "..p.." 10"); end

and if this is good how can i let:
bob say !openshopdoor --triggers a dynwall to open.

Edit: i dont know how to use tirrger on lua
edited 2×, last 30.05.09 12:31:15 pm

old Re: Lua Scripts/Questions/Help

Silent_Control
User Off Offline

Quote
I don't understand some things.
> 1st: What program u use to program in Lua? Can you use notepad? (Well, i bet you need something to compile the code)
> 2nd: Lua is like Basic?
> 3rd: After you make your Lua Script how do you implement it in CS2D? Does it generates an .exe which you put in the CS2D folder?

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
1st: you can use notepad, you don't need anything to compile, it's a scripting language, it runs just using cs2d
2nd: I don't know, I never wrote in Basic
3rd: just put the *.lua file in /sys/lua and add the following line to server.lua
1
dofile("sys/lua/NAMEOFYOURFILE.lua")

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
Silent_Control has written
> 2nd: Lua is like Basic?


In some ways it is. Lua is a mix between functional and linear language. Basic is just a linear language. It's not a difficult jump going from Basic to Lua however, since both have relatively verbose block delimiters (You'll understand once you start working with Lua). Comparatively, I might even say that Lua is a bit easier to learn and use.

old Re: Lua Scripts/Questions/Help

lol93
User Off Offline

Quote
new prob i did this:
if (jb.superhero.class[id]<=1) then
          parse (txt=="!hotel") ("tigger hotel"); end
as u can see i wane make a hotelmannager (no one els) open the hotel door.
can anybody help me
edited 1×, last 31.05.09 05:49:57 pm

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
1
parse (txt=="!hotel") ("tigger hotel")
that doesn't make much sense. you have to think when you script! otherwise it is not going to work! why do you use a parse in front of a condition?
and why is there just a "trigger hotel" in brackets without any command? that would be the right place for the parse...

it should look like this:
1
2
3
if (txt=="!hotel") then
	parse("tigger hotel")
end

to make things more clear:

your script does that:
• let cs2d parse txt=="!hotel" (which doesn't make sense)
• do ??? (no command!?) with "tigger hotel" (which is totally pointless)

my script does that:
• if txt is "!hotel" then do the following:
• let cs2d parse "tigger hotel" (which means: trigger all entities with the name hotel)

I hope this helps to write scripts which make sense in future
To the start Previous 1 28 9 10338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview