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 2210 211 212338 339 Next To the start

old Re: Lua Scripts/Questions/Help

palomino
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
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.

old fun_fight

texnonikWP
User Off Offline

Quote
HELP ME
why dont working?
Please repair

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

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
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...

old Re: Lua Scripts/Questions/Help

texnonikWP
User Off Offline

Quote
Here need to if ID:1 hit ID:2 then ID:2 get back once
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.

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

old Re: Lua Scripts/Questions/Help

Echo-Charlie
User Off Offline

Quote
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?

old CS2D Tibia - RPG

RyceR
User Off Offline

Quote
Who can give me mod for map rpg_mapb_4.1?
Thank you in advance!

old Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Quote
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)

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Hello all!
Here I have two scripts, the first one:
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:
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.

old Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Quote
redefinder has written
Hello all!
Here I have two scripts, the first one:
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:
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:

1
a = "hello ".."world"

so..

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:

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.

old Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Quote
I used the car script of weiwen:

Spoiler >


My question is how to add more car with simple steps?

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
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


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

old Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
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
To the start Previous 1 2210 211 212338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview