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 2320 321 322338 339 Next To the start

old Re: Lua Scripts/Questions/Help

_Ultimate_
User Off Offline

Quote
Can i have a full scipt of many servers commands like

@say
@ban
@kick
@slap
@teleportoffmap
@lockt
@lockct
@unlockall

etc and can i have a command whit who i can make other players use these commands

old Re: Lua Scripts/Questions/Help

_Ultimate_
User Off Offline

Quote
Wriggle has written
_Ultimate_ has written
Can i have a full scipt of many servers commands like

@say
@ban
@kick
@slap
@teleportoffmap
@lockt
@lockct
@unlockall

etc and can i have a command whit who i can make other players use these commands


http://www.cs2d.com/help.php?cat=all


i want scripts like EviL LaG TGV servers not rcon

guys i really need a scipt to make others users to have ranks i alreadyhave ranks like vip admin moderator member but its really boring to put ID AND RESTART SERVER is tehre a script for that work ?
edited 1×, last 03.12.10 05:21:19 am

old Re: Lua Scripts/Questions/Help

kalis
User Off Offline

Quote
I need script for my server Role Play ...
script to pick up money no sound
pick a time and more money can be picked up 16 000


sr bad english use translate

old Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Quote
HELP!
LUA ERROR: Attempt to call a nil value WHEN KILL!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function array(m)
	local array = {}
	for i = 1, m do
		array[i] = 0
	end
return array
end

kills=array(32)


for i = 1, 32 do
	kills[i]=0
end

addhook("kill","score")
function score(id)
	kills[id]=kills[id]+2
	parse('hudtxt2 '..id..' 1 "©000255000 Score: '..kills[id]..'" 10 410 0') 
end

addhook("spawn","viewscore")
function viewscore(id)
	parse('hudtxt2 '..id..' 1 "©000255000 Scores: '..kills[id]..'" 10 410 0') 
end

old whats wrong ?

Jake-rus
User Off Offline

Quote
1
2
3
4
5
6
7
8
40|addhook("second","nostucksec")
41|function nostucksec()
42|for id = 1, #player(0,"tableliving") do
43|if not tile(player(id,"tilex"),player(id,"tiley"),"walkable") then
44|parse("setpos "..id.." "..za_xx[id].." "..za_yy[id].."")
45|end
46|end
47|end

-->×LUA ERROR: sys/lua/Z-A/added.lua:43: bad argument #1 to 'tile' (number expected,got boolean)

---
1
2
3
4
5
6
7
8
9
192|addhook("second","onmove")
193|function onmove()
194|for id = 1, #player(0,"tableliving") do
195|if tile(player(id,"tilex"),player(id,"tiley"),"walkable") then
196|za_xx[id] = player(id,"x")
197|za_yy[id] = player(id,"y")
198|end
199|end
200|end

-->×LUA ERROR: sys/lua/Z-A/server-mod.lua:195: bad argument #1 to 'tile' (number expected, got boolean)

---
>WHATS WRONG ???

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
You're just using the table index, not the player id.
1
2
3
4
5
6
7
8
9
10
addhook("second","onmove")
function onmove()
	local t = player(0,"tableliving")
	for id = 1, #t do
		if tile(player(t[id],"tilex"),player(t[id],"tiley"),"walkable") then
			za_xx[id] = player(t[id],"x")
			za_yy[id] = player(t[id],"y")
		end
	end
end

old Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Quote
HELP!
LUA ERROR: Attempt to call a nil value WHEN KILL!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function array(m)
     local array = {}
     for i = 1, m do
          array[i] = 0
     end
return array
end

kills=array(32)


for i = 1, 32 do
     kills[i]=0
end

addhook("kill","score")
function score(id)
     kills[id]=kills[id]+2
     parse('hudtxt2 '..id..' 1 "©000255000 Score: '..kills[id]..'" 10 410 0')
end

addhook("spawn","viewscore")
function viewscore(id)
     parse('hudtxt2 '..id..' 1 "©000255000 Scores: '..kills[id]..'" 10 410 0')
end

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
I tried to fix the code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
level=initArray(32)
exp=initArray(32)
credits=initArray(32)
points=initArray(32)
streak=initArray(32)
hacker=initArray(32)
medikit=initArray(32)

function string.split(text,b)
local cmd = {}
if b then
b = b
else
b = "%s"
end
b = "[^"..b.."]+"
for o in string.gmatch(text,b) do
table.insert(cmd,o)
end
return cmd
end

if hacker==nil then hacker={} end
hacker={}

addhook("second","hack")
function hack()
for p = 1,32 do
if (hacker[p]==1) then
credits[id]=credits[id]+15
	end
end
end

addhook("spawn","class")
function class(id)
parse("equip "..id.." 56") -- Equips Ct's with defuse kit.
hacker[id] = 1 -- The Hacker Special is on
	parse("strip "..id)

But i get error every second and when i press "Buy Credits"
Screenshots

old Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Quote
1
2
3
function atom_pro(id,w,x,y)
		parse("effect \"colorsmoke\" "..x.." "..y.." 1 5 0 0 0")
end

A normal projectile hook. The addhook is added. Well, it should work properly, but somehow, I can't see the smoke -.-'

Edit: Ah, I see, it's working on a HE grenade somehow. How to make it work on normal bullets?

old Re: Lua Scripts/Questions/Help

Jaso
BANNED Off Offline

Quote
I need a script that does this:
Only 3 people can join survivor the others will join spectator and no one can join zombie.
If all the 3 survivors die the script needs to get some new ramdom people that will become survivor.

Is this to hard to make or can some one create this?

old Re: Lua Scripts/Questions/Help

Casper-
User Off Offline

Quote
how could i make that when somebody bought a primary weapon and loses the other primary weapon which he had.

this is what i have done but it just drops the weapon down and it can be picked up again. i dont want it to be picked up.
Spoiler >

old Re: Lua Scripts/Questions/Help

Kurumi
User Off Offline

Quote
Tobey has written
GeNeSiS_MaSoN has written
Thanks tobey but if this file is in the folder what i should do?


you already have to go out from the folder where your CS2D.exe starts.

so if it's in sfx you need to do:
1
sfx/name.wav
No matter where it is.
tobey, give me full script if the sound is in the
1
cod_breathing/cod_breathing.ogg
thanks

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
BureX has written
how could i make that when somebody bought a primary weapon and loses the other primary weapon which he had.

this is what i have done but it just drops the weapon down and it can be picked up again. i dont want it to be picked up.
Spoiler >


Why do you need to make something like this if there is already such thing if you buy another primary gun u will lose past one...

-------------------------------------------------------
I tried to fix the code but it dont work,screenshots.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
level=initArray(32)
exp=initArray(32)
credits=initArray(32)
points=initArray(32)
streak=initArray(32)
hacker=initArray(32)
medikit=initArray(32)

function string.split(text,b)
local cmd = {}
if b then
b = b
else
b = "%s"
end
b = "[^"..b.."]+"
for o in string.gmatch(text,b) do
table.insert(cmd,o)
end
return cmd
end

if hacker==nil then hacker={} end
hacker={}

addhook("second","hack")
function hack()
for p = 1,32 do
if (hacker[p]==1) then
credits[id]=credits[id]+15
	end
end
end

addhook("spawn","class")
function class(id)
parse("equip "..id.." 56") -- Equips Ct's with defuse kit.
hacker[id] = 1 -- The Hacker Special is on
	parse("strip "..id)

But i get error every second and when i press "Buy Credits"
Screenshots

edited 1×, last 04.12.10 08:15:36 pm

old Re: Lua Scripts/Questions/Help

Casper-
User Off Offline

Quote
@batlaizys
it is not normal buying ... urgh its hard to explain

I'm creating CoD5 Nazi zombies .lua and I have created guns on the wall (The guns on the wall which have a shape of a weapon which needs to be bought). So I made use trigger to each weapon that is on a wall and when I press that button, menu opens and .lua does this :
1
parse("weapon m3; drop; weapon mp5; drop; weapon scout; drop; weapon sg550; drop; weapon ak47; drop; weapon sg552; drop; weapon rpg; drop; weapon flamethrower; drop; weapon m249; drop; weapon p90; drop")
So what I want is that I don't want guns to be dropped (Or that weapon fades out so quickly it cannot be picked up)

And btw ...
Will this work ? This is just EXAMPLE
1
2
3
4
5
6
7
8
9
addhook("spawn", "nachtderuntoten")
function nachtderuntoten(id)
if player(id,"team") == 1 then
parse("speedmod "..id.." -5")
local c=math.random(1,2)
if c==1 then
ai_goto(id,5,6)
if c==2 then
ai_goto(id,6,5)

old Re: Lua Scripts/Questions/Help

wjcf1290
User Off Offline

Quote
BureX has written
@batlaizys
it is not normal buying ... urgh its hard to explain

I'm creating CoD5 Nazi zombies .lua and I have created guns on the wall (The guns on the wall which have a shape of a weapon which needs to be bought). So I made use trigger to each weapon that is on a wall and when I press that button, menu opens and .lua does this :
1
parse("weapon m3; drop; weapon mp5; drop; weapon scout; drop; weapon sg550; drop; weapon ak47; drop; weapon sg552; drop; weapon rpg; drop; weapon flamethrower; drop; weapon m249; drop; weapon p90; drop")
So what I want is that I don't want guns to be dropped (Or that weapon fades out so quickly it cannot be picked up)


1
2
3
4
5
6
7
8
9
10
11
12
function tequip(i,w)
	local pwList,rmList = playerweapons(i),{}
	for _,l in ipairs(pwList) do
		if itemtype(w,"slot") == itemtype(l,"slot") and itemtype(w,"slot") ~= (3 or 4) then
			table.insert(rmList,l)
		end
	end
	for _,w in ipairs(rmList) do
		parse('strip '..i..' '..w)
	end
	parse('equip '..i..' '..w..';setweapon '..i..' '..w)
end

try it.
edited 1×, last 06.12.10 02:36:02 pm

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
Spoiler >


You could use striping function...

old Re: Lua Scripts/Questions/Help

Kurumi
User Off Offline

Quote
Hi. Give me those scripts please:
1. How to rename weapons and teams?
2.Hide HP and Armor hud?
3.if the player has less than 45 hp play sound until it restocks to 45hp. Name:
1
sfx/cod_breathing.ogg
thanks
To the start Previous 1 2320 321 322338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview