English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 210 211 212 ... 338 339 Next To the start
20.06.10 09:18:22 pm
Up
Echo-Charlie
User
Offline Off
i will try it
20.06.10 10:39:22 pm
Up
SkullFace
User
Offline Off
Guys i need help i want to make in lua script da surprise box from cod5 nazi zombie and i dont know how to do it. Anyone help ?
IMG:https://i.imgur.com/kZBVkjM.gif
21.06.10 01:48:43 am
Up
Homer
User
Offline Off
Could you please elaborate as to what you are trying to do Burex?
I detest that man who hides one thing in the depths of his heart, and speaks for another.
21.06.10 01:51:24 am
Up
YellowBanana
BANNED
Offline Off
Can't you read english?
He obviously wants to nazi zombies to play jack-in-the-box, oh, and do it with lua!
21.06.10 10:00:29 am
Up
palomino
User
Offline Off
YellowBanana has written:
Can't you read english?
He obviously wants to nazi zombies to play jack-in-the-box, oh, and do it with lua!

No, he is trying to get nazi zombies to script stuff while sitting in the box
zugcxdxtczgvhioj
21.06.10 02:22:11 pm
Up
EngiN33R
Moderator
Offline Off
Hello, me again. I want so that on sayfunc "!exit" sprite will be created at player's position, and when player gets back under the sprite and says another sayfunc like "!enter" he will achieve the sprite that was lying/standing/whatever. How is it possible anyways? Thanks in advance.
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
21.06.10 07:20:14 pm
Up
texnonikWP
User
Offline Off
HELP ME
why dont working?
Please repair

Code:
1
2
3
4
5
6
addhook("spawn","sample.fast.spawn")
function sample.fast.spawn(p)
     if (hit == 1) then 
     parse("enny_knock = 4")
     end
end
21.06.10 07:27:00 pm
Up
TimeQuesT
User
Offline Off
parse("enny_knock = 4")

enny_knock ?
no known command...

and why is this in a spawn hook!?

you know you have to put this in a "hit hook"...

" if (hit == 1) then "

hit?
undefined variable...
Muh
21.06.10 08:12:48 pm
Up
texnonikWP
User
Offline Off
Here need to if ID:1 hit ID:2 then ID:2 get back once
Code:
1
2
3
4
5
6
addhook("hit","sample.fast.spawn")
     function hit.fast.spawn(p)
     if (hit == 1) then 
     parse("enny_knock = 4")
     end
end


Here need play random sounds in 2 teams.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("endround","sample.ut.ending")
function sample.ut.ending()
     if (player(id,"team") == 1) then 
     parse("sv_sound \"WarP0rTal/quake/winsounds/rt"..math.random(1,14)..".wav\"")
     sample.ut.fblood=0
end

addhook("endround","sample.ut.ending")
function sample.ut.ending()
     if (player(id,"team") == 2) then 
     parse("sv_sound \"WarP0rTal/quake/winsounds/rct"..math.random(1,14)..".wav\"")
     sample.ut.fblood=0
end
21.06.10 09:55:12 pm
Up
Echo-Charlie
User
Offline Off
There is a Famas with 25bullets in a clip and i want change bullets to 20 with lua script. IF IT IS POSSIBLE, how can I do that in lua script?
21.06.10 11:02:31 pm
Up
Cure Pikachu
User
Offline Off
Not possible. The only thing you can change for weapons is the damage it can deal.
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
22.06.10 12:59:27 pm
Up
RyceR
User
Offline Off
Who can give me mod for map rpg_mapb_4.1?
Thank you in advance!
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
22.06.10 10:58:39 pm
Up
SkullFace
User
Offline Off
Sunny Autumn has written:
YellowBanana has written:
Can't you read english?
He obviously wants to nazi zombies to play jack-in-the-box, oh, and do it with lua!

No, he is trying to get nazi zombies to script stuff while sitting in the box

yeah but i want to make all 4 maps. that zombie verruckt , shi no numa , der riese and nacht der untoten maps i did already guns with lua
mostly i think there is supposed to be just like from the bet from tibia mod(if u know what i mean xDD)
IMG:https://i.imgur.com/kZBVkjM.gif
23.06.10 09:18:40 am
Up
Redefinder
User
Offline Off
Hello all!
Here I have two scripts, the first one:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
weapons={1, 2, 3, 4, 5}
addhook("say","adminsay")
function adminsay(id,txt)
     if (txt=="!equipall" "..id") and 
      player(id,"usgn") == 29595 then
          if _table.weapons then
for index_of_weapon,wpn in ipairs(_table.weapons) do
parse("equip "..id.." "..wpn)
          end
     end
end
end

Second one:
Code:
1
2
3
4
5
6
function adminsay(id,txt)
     if (txt=="!tele" "..id")
     and player(id,"usgn") == 29595 then
parse("setpos "..id.." "..x.." "..y.." ")
     end
end

Now I'll start explaining them.

1.The first one: I need it to when the admin says !equipall <id>, he gives a player(or himself) all the weapons.

2.The second one: Well, what can I say about this? Isn't finished yet. But it's purpose is to teleport a player on the admin's position.

Please help.

PS: Sorry for the messy script, I couldn't get the usgn part in one line.
23.06.10 10:52:49 am
Up
YellowBanana
BANNED
Offline Off
redefinder has written:
Hello all!
Here I have two scripts, the first one:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
weapons={1, 2, 3, 4, 5}
addhook("say","adminsay")
function adminsay(id,txt)
     if (txt=="!equipall" "..id") and 
      player(id,"usgn") == 29595 then
          if _table.weapons then
for index_of_weapon,wpn in ipairs(_table.weapons) do
parse("equip "..id.." "..wpn)
          end
     end
end
end

Second one:
Code:
1
2
3
4
5
6
function adminsay(id,txt)
     if (txt=="!tele" "..id")
     and player(id,"usgn") == 29595 then
parse("setpos "..id.." "..x.." "..y.." ")
     end
end

Now I'll start explaining them.

1.The first one: I need it to when the admin says !equipall <id>, he gives a player(or himself) all the weapons.

2.The second one: Well, what can I say about this? Isn't finished yet. But it's purpose is to teleport a player on the admin's position.

Please help.

PS: Sorry for the messy script, I couldn't get the usgn part in one line.


I'm baffled with all the errors in the script...


this is how to concatenate strings:

Code:
1
a = "hello ".."world"


so..

Code:
1
2
3
4
5
function adminsay(id,txt)
     if(txt=="!tele" and player(id,"usgn")==29595) then
                 parse(string.format("setpos %i %i %i",id,x,y))
        end
end


and the second one:

Code:
1
2
3
4
5
6
7
8
9
weapons={1, 2, 3, 4, 5}
addhook("say","adminsay")
function adminsay(id,txt)
     if (txt=="!equipall" and player(id,"usgn") == 29595) then
        for i,wpn in ipairs(weapons) do
               parse("equip "..id.." "..wpn)
        end
     end
end


This is just for giving himself stuff tho..
If you wanna catch the id from the txt, u'll have to use some kind of substring function, or the string libraries by leegao.
23.06.10 11:12:51 am
Up
Redefinder
User
Offline Off
@YellowBanana, Hmph, it doesn't seem to be working, I don't get any error messages though.
24.06.10 01:49:15 am
Up
KenVo
User
Offline Off
I used the car script of weiwen:

Spoiler >


My question is how to add more car with simple steps?
24.06.10 10:28:58 am
Up
HaRe
User
Offline Off
Ok, Im trying to do when you throw an Smoke it freeze's the one's it hit.

But i cant get it to work


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--Weapons--
addhook("projectile","hnsteam_smokecus")
function hnsteam_smokecus(id,weapon,x,y)
  if (weapon==53) then
               parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 128')
               parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 128')
          return 1
     end
end

addhook("hit","hnsteam_smokefreeze")
function hnsteam_freeze(target,weapon)
  if (weapon==53) then
          parse("speedmod "..target.." -100")
          return 1
     end
end
w0w im so eXotiK
24.06.10 11:54:34 am
Up
RAVENOUS
BANNED
Offline Off
Could someone make me a fast menu example, for how to work with menus? I don't understand DC's sample at all. Just a little menu which gives out a message if you choose Button1, Button2, etc.

Thanks
"A work of art is the unique result of a unique temperament." - Oscar Wilde
24.06.10 01:45:08 pm
Up
TimeQuesT
User
Offline Off
addhook ("say","sages")
function sages(id,txt)
if txt=="menu" then
menu (id,"hallo,hello,moin,huhu")
end
end

this creates a simple menu...

addhook ("menu","meno")
function meno(id,menu,sel)
if menu=="hallo" then
if sel==1 then
msg ("yeah sel1!")
elseif sel==2 then
msg ("yeah sel2!")
elseif sel>=3 and sel<=9 then
msg ("between 3 and 9!")
end


end
end
Muh
To the start Previous 1 2 ... 210 211 212 ... 338 339 Next To the start