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 2291 292 293338 339 Next To the start

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
@iDios
change
1
parse("restart")
to
1
parse("restart 10")

@CmDark
He means do it like that:

1
2
3
4
5
6
7
8
9
10
11
istriggered=0
addhook("say","triggidy")
function triggidy(id,txt)
if istriggered==0 then
if txt=="hello" or txt=="Hello" or txt=="hi" or txt=="Hi" or txt=="Hia" or txt=="hia" then
parse("trigger dynwall")
parse("sv_sound \"sfx/sound.wav\"")
istriggered=1
end
end
end

old Re: Lua Scripts/Questions/Help

The Camo
User Off Offline

Quote
I figured out what's the problem:

math.max(level[player(0,"team1")[players]])
math.max(level[player(0,"team1")])

Anyhow, it says "Number expected got nil"

But I don't see any other way to calculate all players levels..


I tried scaling it a bit, after I get this thing done, then I'll place debuggers..

1
2
3
4
5
6
7
8
9
10
11
12
addhook("team","team")
function team(id,team)
	if player(id,"team") == 1 and level[id] == math.max(level[player(0,"team1")]) then
		msg("©255075000"..player(id,"name").." has became Commander in "..player(id,"team").." team!")
		msg2(id,"©000255000 You are now Commander of "..player(id,"team").." team!@C") 
	elseif player(id,"team") == 2 and level[id] == math.max(level[player(0,"team2")]) then
		msg("©255075000"..player(id,"name").." has became Commander in "..player(id,"team").." team!")
		msg2(id,"©000255000 You are now Commander of "..player(id,"team").." team!@C") 
	else
		msg2(id,"©000255000 Script doesn't work @C")
	end
end

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
Now I have a problem.

My initArray that is supposed to create 32 arrays for each player acts strangely. When I set e.g. 1 for player ID 1, it sets 1 for ID 1, but also for IDs 2-32. What's up with it? The initArray looks like that:

1
tf2.craft.weaponstack=initArray2(32,{0,0})

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
GlockPwner has written
Now I have a problem.

My initArray that is supposed to create 32 arrays for each player acts strangely. When I set e.g. 1 for player ID 1, it sets 1 for ID 1, but also for IDs 2-32. What's up with it? The initArray looks like that:

1
tf2.craft.weaponstack=initArray2(32,{0,0})

find function and post here maybe is it

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
Hi guys I have seen some images with white background and in map the white background doesn't show up and only the real picture shows up.

Now I tried to make a image like that but if I try the white background shows up too.

What I did wrong?

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
Snake_Eater has written
Hi guys I have seen some images with white background and in map the white background doesn't show up and only the real picture shows up.

Now I tried to make a image like that but if I try the white background shows up too.

What I did wrong?

1 idea is to go to Map Editor and Look at the maps so called "sprite/img"

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
But there i see the white background if I made img

For example in weiwen folder the pokemon with the white background will show up only the pokemon and no white background

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
In weiwen folder all pokemon have no background - they're transparent PNGs. If you see the background as white in your image viewer, it's probably transparent. View it in Photoshop or at least Paint.NET.

@TDShuft
Fixed it, just had to add one more argument to my function. Sorry for false alarm.

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
minute = 0

addhook ("minute","minutencount")
function minutencount()
minute = minute + 1
if minute==60 then
minute = 0
parse ("restart")
end
end

old Re: Lua Scripts/Questions/Help

Glix
User Off Offline

Quote
what is wrong on this script


1
2
3
4
5
addhook("minute", "msg")
  function minute 
    minute==1 the parse msg=("created by me")
   end
end

help please

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
1) After the function you write the name you gave at your point its msg
2) Idk what are you trying to do where minute==1.
3) The correct should be
1
2
3
4
5
addhook("minute","msg")
function msg()
parse("msg Created by - steam-cs2d")
parse("msg I like Pie...")
end

I didnt test it but you get the point ? Look at info.txt in your lua folder.

old Re: Lua Scripts/Questions/Help

Banaan
User Off Offline

Quote
steam-cs2d has written
what is wrong on this script


1
2
3
4
5
addhook("minute", "msg")
  function minute 
    minute==1 the parse msg=("created by me")
   end
end

help please


1
2
3
4
5
6
7
8
addhook("minute","msg")
minute = 0
function minute()
	minute = minute + 1
	if minute==1 then
		parse msg("created by me")
	end
end

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Banaan has written
steam-cs2d has written
what is wrong on this script


1
2
3
4
5
addhook("minute", "msg")
  function minute 
    minute==1 the parse msg=("created by me")
   end
end

help please


1
2
3
4
5
6
7
8
addhook("minute","msg")
minute = 0
function minute()
	minute = minute + 1
	if minute==1 then
		parse msg("created by me")
	end
end


No, this is wrong, why did you used the parse function?,
it isn't necessary. Just use:
1
msg("Created by me")
To the start Previous 1 2291 292 293338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview