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 219 20 21338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Quote
guys. What's wrong here?

1
2
3
4
5
6
7
8
9
10
11
addhook("die","killed")

function killed(n)
parse("sv_msg2 " ..n.. " You got killed! Wait in the cage for a rescue!@C")

if (player(n,"team")=="2") then
parse("spawnplayer " ..n.." 1000 1200")
else
parse("spawnplayer " ..n.. " 1000 1000")
end
end
It spawns me only at 1000x1000 position. Whatever team i have.

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
maybe because if you put something in " " its thinks its a text. Try without quotes
ooops, i didn't say where you need to remove quotes:

in line:
if (player(n,"team")=="2") then

remove quotes at 2

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
wups has written
I think im dumb or it's something wrong with my function.


What is really wrong in this code?
It can find x and y.
But it can't check if x is 1, and y is 4.

1
2
3
4
5
6
7
8
addhook("use","omg")
function omg(p,e,d,x,y)
	msg(" "..x.." "..y)
	if (x==1) and (y==4) then
		msg(doh)
		parse("equip "..p.." 30") 
	end
end

Heavy, nothing is impossible.
Sockets or a file with ips to many locations.

umm, wrong? whats that (doh) doing? isn't it supposed to be msg("doh"), or im just being stupid?

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
Whats the problem? you don't get the item?

EDIT: Can someone please help me make a menu under a menu. Im having trouble with when i select a button on a menu, i want it open a new menu.
edited 1×, last 24.06.09 10:39:20 pm

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
LinuxGuy has written
Whats the problem? you don't get the item?


The problem is that wups designed a test-for-failure and lua completely skipped over the conditional loop in the scope of the test. The intended result is to have cs2d return an error, it obviously does not thus constituting as a logical error

@wups: Try add a

1
else print(x.." "..y) end

and then go to the same spot and see if anything's wrong with the coordinates.

old Re: Lua Scripts/Questions/Help

wups
User Off Offline

Quote
Sorry, i'm to stupid.. I got the gun, but i have never looked for it in the 1 menu. What a idiot i'm :p.
edited 1×, last 25.06.09 11:50:12 am

old Re: Lua Scripts/Questions/Help

wups
User Off Offline

Quote
@LinuxGuy

Nice work, never thinked to create like that before.
Can be it's to hot here. :p

Hmm, seems not that it decrease the money for me.

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
Where is the script to return a players position/coordinates while playing on a map? I think someone had a script like that, Hitsugaya if I remember correctly.

I need that script. It's pretty useful. You could say "@position" and it would print my exact location. Pretty cool script.

I wanna ask if someone has a script like that?

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
1
2
3
4
5
6
addhook("say", "positions")
function positions(id,txt)
	if (txt == "positions") then
		msg2(id, "X: "..player(id, "x").." Y: "..player(id,"y").." TileX: "..player(id, "tilex").." TileY: "..player(id, "tiley").." !")
	end
end

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
TheKilledDeath has written
1
2
3
4
5
6
addhook("say", "positions")
function positions(id,txt)
	if (txt == "positions") then
		msg2(id, "X: "..player(id, "x").." Y: "..player(id,"y").." TileX: "..player(id, "tilex").." TileY: "..player(id, "tiley").." !")
	end
end
How can I add text color to that without ruining everything?

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
KimKat has written
How can I add text color to that without ruining everything?

1
2
3
4
5
6
addhook("say", "positions")
function positions(id,txt)
	if (txt == "positions") then
		msg2(id, "©000000000X: "..player(id, "x").." Y: "..player(id,"y").." TileX: "..player(id, "tilex").." TileY: "..player(id, "tiley").." !")
	end
end

put your number in 000000000 (delete 0's)

old Re: Lua Scripts/Questions/Help

wups
User Off Offline

Quote
Quote
© before the numbers.

R     G     B
000 000 000

000000000 = Black
134134134 = Grey
255255255 = White

255000000 = Red
000255000 = Green
000000255 = Blue

255255000 = Yellow
255000255 = purple
000255255 = Lightblue


leeago created a good script to only use rgb(0,0,0) instead of ©000000000. But don't know where it is now :p

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
I know how to add colors already, that's like the easy part in lua. And still no one has replied on how to make a HEV suit recharger in lua.

The one who makes that will be officially the master of lua in the whole unrealsoftware forum.

Anyone up for the challenge? read my post one page back!
To the start Previous 1 219 20 21338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview