Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2291 292 293338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Zitieren
@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

alt Re: Lua Scripts/Questions/Help

The Camo
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Zitieren
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})

alt Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Zitieren
GlockPwner hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
Snake_Eater hat geschrieben
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"

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

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

alt Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Zitieren
minute = 0

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

alt Re: Lua Scripts/Questions/Help

Glix
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

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

alt Re: Lua Scripts/Questions/Help

Banaan
User Off Offline

Zitieren
steam-cs2d hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Zitieren
Banaan hat geschrieben
steam-cs2d hat geschrieben
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")
Zum Anfang Vorherige 1 2291 292 293338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht