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 2137 138 139338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flacko has written
I didn't test it, but you can tell me about any errors you get.

It has this strange error:
LUA ERROR: sys/lua/rank.lua:8: attempt to call global 'weapons' (a nil value)

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
redefinder has written
It has this strange error:
LUA ERROR: sys/lua/rank.lua:8: attempt to call global 'weapons' (a nil value)

Change eight line with this:
1
RANK.ADVANCED = {weapons[b]=[/b]{10},29569,29570,29571,29572,29573}

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
ok to make classes for T as own
and CT as own .i must do that
1
2
3
4
5
if (player(id,"team") == 2) then
[...]

elseif (player(id,"team") == 1) then
[...]

i put it on the script but still donot work i end it too ?

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
Eh, This little tid bit of code got me confused, since I don't see anything that resembles closely to that I don't know what to make of it.
Spoiler >

Eh, It didn't add the tabs.. -.-

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
YEA! THANKS!
Eh, your little _ before all your variables got me confused, made me think that it was some sort of a calling thing in lua Thanks,

Eh, I applied what you told me, And coincedences of coincedences, I'm doing almost the exact same script as redefinder, but, It's for a RPG server. Heres the script, and It's annoying me. Just need help with calling a specific variable/I don't know in a table. I took what you did.. Here it is
1
2
3
for index,id in ipairs(player(0,"table")) do
		for i,_Usgn in ipair(ADMIN.SuperAdmin2) do
	if player(id,"usgn") == _Usgn then
Alright what does this do, specificly the loop. Thanks
edited 1×, last 15.01.10 01:07:49 am

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
@Homer,
Check this out:
http://lua-users.org/wiki/TablesTutorial

Tutorial has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
t[4] = "three"
t[6] = "eight"
t[2] = { "apple", "pear", "banana" }
for i,v in ipairs(t) do print(i,v) end

---
1       1
2       table: 0035DFE8
3       2
4       three
5       5
6       eight
7       13
8       21


In short, this should mean that:

"For i,value in ipairs(table) do"

i - current loop number. (Key)
value - value (table[])
in ipair() - let's say it's like "For each"
table - table...

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
When the key you put between brackets ([]) is a number, it's called an index, and that's why we use the i for loops

@Homer: What the script does is making a loop inside another loop.
1
for index,id in ipairs(player(0,"table")) do
Here we are transversing through all the players (We won't need the index variable, but id holds the id of the player)

1
for i,_Usgn in ipairs(ADMIN.SuperAdmin2) do
Here we loop through the usgns table, and once again, i is useless, but we will ned _Usgn

1
if player(id,"usgn") == _Usgn then
And here we compare the player's usgn with the usgn stored in our table.

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Homer has written
I'm doing almost the exact same script as redefinder, but, It's for a RPG server.

ugh I better release this before someone steals it ........

Btw I made the script better,now there are two files:
1.configs.txt -- players can easily configurate ranks from this file
2.rank.lua

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
redefinder has written
Homer has written
I'm doing almost the exact same script as redefinder, but, It's for a RPG server.

ugh I better release this before someone steals it ........

Who's going to steal it?

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flacko has written
Ok, whatever, but don't forget that almost 65% of your script is written by me

yes I know

when I upload it,I will add credits

Script Authors:
Flacko
Blazzingxx
redefinder

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
I don't care about credits. I just want you to not to behave like a fag, because I think you didn't do good when you quoted Homer.

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flacko has written
I don't care about credits. I just want you to not to behave like a fag, because I think you didn't do good when you quoted Homer.

Nah I didn`t post that to offend him -.-

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
redefinder has written
Script Authors:
Flacko
Blazzingxx
redefinder


Lol? I shouldn't be there, I only fixed a small mistake...

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Blazzingxx has written
Lol? I shouldn't be there, I only fixed a small mistake...

you still helped.....and you didn`t just fix a bug you also helped me with several other things
edited 1×, last 15.01.10 11:39:46 pm
To the start Previous 1 2137 138 139338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview