English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 143 144 145 ... 338 339 Next To the start
22.01.10 01:09:08 am
Up
memo
COMMUNITY BANNED
Offline Off
Yea thanks Flacko i will learn it and help you to answer the newbie who ask here ... i will become a nerd just like you

EDIT: i am good at English but dose there any Lua manual on Arabic ??
Call Of Duty - World At War [Work on progress] | official CoD scripts site
22.01.10 01:29:21 am
Up
Zanahoria
User
Offline Off
Can somebody fix my problem?
22.01.10 01:42:19 am
Up
Homer
User
Offline Off
I wouldn't bet on it memo. Thanks Flacko for everything.
I detest that man who hides one thing in the depths of his heart, and speaks for another.
22.01.10 01:58:00 am
Up
Flacko
User
Offline Off
It seems like it's only in english, spanish, portuguese, russian and hungarian.

Edit:
Zanahoria has written:
Can somebody fix my problem?

Yes, the best person to fix your problem is yourself, so read your stuff instead of copying it, because you are completely unable to make an if statement.
And, as I said, read the fucking manual
http://www.lua.org/manual/5.1/
edited 2×, last 22.01.10 04:03:39 am
22.01.10 04:07:13 am
Up
Zanahoria
User
Offline Off
I dont copy and paste, i see the problem to dont make it again
I just wanna know, why is my lua not workin!
edited 1×, last 22.01.10 04:23:17 am
22.01.10 04:36:14 am
Up
Homer
User
Offline Off
Zana, It's not that you just copy and paste, Just don't paste your script and ask them to fix it People seem to like it better when you ask how to do something and they can tell you. Not that I'm the best by far, but it might help :D. And a Question, How can you find a value in a table, like I didn't find a table.find and so, I was curious on how to do this. Like this.
table={1,2,3,4}
addhook("say","Random")
function Random(txt,id)
if (txt == "!Ran") then
table.insert(table,id)
Randomint = table[i = id] No Idea how to do this.
if (Randomint == 5) then
Bla bla bla. Help? I don't know really what to do, could you use the string.find? I don't really know if you can even do this.
I detest that man who hides one thing in the depths of his heart, and speaks for another.
22.01.10 05:34:05 am
Up
Flacko
User
Offline Off
uhm... I don't really understand what you are trying to do but you can use this:
Code:
1
2
3
4
5
6
7
8
function table.find(t,v) --t is the table you want to search and v is the value
     for i,value in ipairs(t) do --loop through the table
          if value == v then --check if the value is the one whe are looking for
               return i --return the index where we found the value
          end
     end
     return nil --the value hasn't been found, so we return nil
end

It will return the index where it has been found.
Note that it will return when it has been found for first time.
edited 1×, last 22.01.10 05:47:57 am
22.01.10 01:07:23 pm
Up
TicTac
BANNED
Offline Off
Some one script for me hudtext score. when i kill 1 it shows score: 1
^.^ all
22.01.10 01:11:49 pm
Up
Redefinder
User
Offline Off
memo has written:
Yea thanks Flacko i will learn it and help you to answer the newbie who ask here ... i will become a nerd just like you

Don`t think you know lua scripting more than me,you are just a newbie at lua scripting as I am.
Flacko has written:
@Redefinder: (I'm mad)
It's always the same shit here.
You guys don't even bother at looking at your own piece of code, just "let the nerds solve this shit". I wouldn't be surprised if most of you haven't read the manual.

Yes I haven`t read the tutorial,it`s a difficult tutorial ,but now I will read it and try very hard to understand it.
22.01.10 01:52:54 pm
Up
wups
User
Offline Off
I think i sucks at this timers.
What do i wrong?

The timer should free the image that is inside fad[p] after 8 seconds. And the readme is too hard too understand about the timers too.
Code:
1
timer(8000,"",freeimage(fad[p])
22.01.10 01:58:16 pm
Up
SQ
Moderator
Offline Off
@redefinder
Everyday, people asks same questions.
Everyday, people wants us to fix same their bugs!

Why? Why the h**l they can't learn it?
Lua - easiest scripting/programming language ever!

Like you, redefinder.
I think you are asking questions for about two months... (or even more)
Why are you still asking same things?

@wups,
Hmm, I think "freeimage" function shouldn't be on ["p"] string parameter at all...

I checked...
Yes, you are using it completely wrong.
That's example of use:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
counts = 5
milisecs = 1000 -- (1 second)

timer(milisecs,"CS2D_TIME",0,counts)

function CS2D_TIME()
     counts = counts - 1
     if (counts > 0) then
          print("Timer working - It's going to be removed after "..counts.." times!")
     else
          print("Timer is removed!")
     end
end


I suggest to make own image removing functions, so it's easier to use them on timers.

Output Screenshot:
http://img121.imageshack.us/img121/3506/59134530.png
edited 4×, last 22.01.10 02:24:29 pm
22.01.10 02:24:54 pm
Up
wups
User
Offline Off
@blazzingxx
Yeh i fixed it. And now something is really weird with the code. I fixed so the timer starts, but that doesn't end. So i put own function too stop the timer. And now the timer doesn't work after that little fix.

And when i put "1" after the code, it didn't stop the timer at all.

Like this: timer(2000,"timer2",fad[p],1)


And here is the example of you code.
If you write hi one time, its works exactly like you have write.

But if we add "p" to the timer, that i should take the player. And use one time, it works perfectly.

But if we use it again, you will get 4 message about removing.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("say","tst")
function tst(p,t)
     if t == "hi" then 
     counts = 4
          timer(1000,"CS2D_TIME",p,counts)
     end
end

function CS2D_TIME(p)
     counts = counts - 1
     if (counts > 0) then
          print("Timer working - It's going to be removed after "..counts.." times! "..p)
     else
          print("Timer is removed!")
     end
end






But here is the code. And i don't know how i can fix it.

The code highlighted
http://pastebin.com/m36aa9310

The code
Spoiler >
edited 1×, last 22.01.10 03:07:51 pm
22.01.10 06:20:51 pm
Up
TicTac
BANNED
Offline Off
Help me plz. i su*k at lua

Code:
1
2
3
4
5
6
7
8
9
10
function updatescore(id)
parse('hudtxt2 ')
end

addhook("kill","get_score")
function get_score(id)
updatehud(id)
end 

parse('hudtxt2 '..id..' 1 "©000255000Score: '..player(id,"score")..'" 150 10')


what i do wrong?
^.^ all
22.01.10 06:28:52 pm
Up
Starkkz
Moderator
Offline Off
Code:
1
2
3
4
5
6
7
8
function updatescore(id) 
parse('hudtxt2 '..id..' 1 "©000255000Score: '..player(id,"score")..'" 150 10')
end 

addhook("kill","get_score") 
function get_score(id) 
updatehud(id) 
end
lol
22.01.10 06:41:55 pm
Up
memo
COMMUNITY BANNED
Offline Off
Hi,i am still reading the Lua 5.0 Reference Manual.

i am making D-H again so i start to make the class script i do it all right , it work with Cs2d all thing add on console then
this massage appears :
Code:
1
LUA ERROR :attempt to call a nil value


but on LuaEdit program it tells me
Code:
1
attempt to call global 'addhook' (a nil value)


what the hill this 2 massages mean .

the wrong is on this line :
Spoiler >


Any help
edited 2×, last 22.01.10 07:21:59 pm
Call Of Duty - World At War [Work on progress] | official CoD scripts site
22.01.10 08:07:59 pm
Up
Redefinder
User
Offline Off
Blazzingxx has written:
@redefinder
Everyday, people asks same questions.
Everyday, people wants us to fix same their bugs!

Why? Why the h**l they can't learn it?
Lua - easiest scripting/programming language ever!

Like you, redefinder.
I think you are asking questions for about two months... (or even more)
Why are you still asking same things?

I don`t think so,that manual is hard and I hardly understand anything that is written there,I read leegao`s and TKD`s tutorials and believe me they`re WAY EASIER!.And I`m not really asking the same questions,I`m getting better at lua
22.01.10 08:12:17 pm
Up
Vectarrio
User
Offline Off
memo has written:
Hi,i am still reading the Lua 5.0 Reference Manual.

i am making D-H again so i start to make the class script i do it all right , it work with Cs2d all thing add on console then
this massage appears :
Code:
1
LUA ERROR :attempt to call a nil value


but on LuaEdit program it tells me
Code:
1
attempt to call global 'addhook' (a nil value)


what the hill this 2 massages mean .

the wrong is on this line :
Spoiler >


Any help

Did you write smth like:
Code:
1
if (dh4==nil) then dh4={} end
?
Because if dh4=nil, all of dh4.smth will be nil too.
I prefer "_" instead of "." in my scripts
22.01.10 08:22:03 pm
Up
memo
COMMUNITY BANNED
Offline Off
@Vectar666
thanks for help but i know what the problem its not with the Nil value it with some line on the first script i add it by wrong thanks very much any way for help me .
Call Of Duty - World At War [Work on progress] | official CoD scripts site
22.01.10 09:21:17 pm
Up
Redefinder
User
Offline Off
memo has written:
Any help

I don`t get what you want to do with this line:
Code:
1
if (team>0) then

but if you are trying to select which team will get the menu then it should be:
Code:
1
2
3
4
5
6
addhook("team","dh4.team")
function dh4.team(id,team)
     if (player(id,"team") == [b]1[/b]) then
          dh4.classmenu(id)
     end
end

Spoiler >

and if you want menu on spawn:
Code:
1
2
3
4
5
addhook("spawn","dh4.team")
function dh4.team(id,team)
          dh4.classmenu(id)
     end
end
22.01.10 10:00:49 pm
Up
memo
COMMUNITY BANNED
Offline Off
yes thanks i already fix the problem , thanks any way :D.


∗ EDIT : -

what this massage means ??
Code:
1
LUA ERROR: attempt to concatenate field "?" a nil value
edited 1×, last 22.01.10 10:52:35 pm
Call Of Duty - World At War [Work on progress] | official CoD scripts site
To the start Previous 1 2 ... 143 144 145 ... 338 339 Next To the start