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 2126 127 128338 339 Next To the start

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
YellowBanana has written
-WiLSoN- has written
-WiLSoN- has written
it seems the command isn't working (i tried it on my server and it didn't work,tried with different items)


Yeah use it in the spawn hook
1
2
3
4
5
6
7
8
9
10
math.randomseed(os.time)
class[id] = array(32)

addhook("spawn","my_spawn")
function my_spawn(id)
	if (player(id,"bot")) then     		
     		local rnd = math.random(1,X) -- X = total classes
     		class[id] = rnd
	end
end

that's something totally different script -.-

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Here:
1
If ([b]player(p,"usgn")[/b] [b]==[/b] 29595) then
edited 1×, last 30.12.09 09:13:22 pm

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
ok here it is...
1
2
3
4
5
addhook("spawn","superadmin")
if(usgn = 29595) then
parse("equip "..id.." 83")
parse("setmaxhealth "..id.." 250")
end

EDIT:
Blazzingxx has written
Here:
Code:
If (player(p,"usgn") == 25959) then

thanks
edited 1×, last 30.12.09 09:14:52 pm

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
That's full function, that's how it should work...
1
2
3
4
5
6
7
addhook("spawn","superadmin")
function superadmin(id)
	if (player(id,"usgn") == 29595) then
		parse("equip "..id.." 83")
		parse("setmaxhealth "..id.." 250")
	end
end

old Re: Lua Scripts/Questions/Help

Noxic
User Off Offline

Quote
@My Issue with the break hook;

It works now in a new script, my last one was a real mess. The function and hook adding still looks exactly the same, so if this counts as a bug I can send the whole script in an email to someone (It's shredded by now though, rewrote it and messed with it during that time)

However, the "usebutton" hook always returns a player ID of 0. This is bothering me.

old Re: Lua Scripts/Questions/Help

Balto
User Off Offline

Quote
leegao has written
Balto has written
Yes, but what i want is that the team names change (DEVGRU, GIGN, SAS, ARTIC AVENGERS, ETC...)


It's not possible to physically change the text on the join menu.


And no are other form to change that?

old Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Quote
Hello,I have been working on a mod that is called WW2D. I started a new server to test it but when ever someone (also bots too) joins a team the server crashed! So i when through a few more testes to see what is causing it but all i found is that the classes have been crashing the server and i don't know to how to fix it.Also the rest of the mod works fine. I think .

CT Classes:

Spoiler >


T Classes

Spoiler >

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
Hi Guys i just want to know its impossible to put on the gameplay on player :like blood on screen if the player HP >>-30
i mean just like flash light on Blazzingxx zombie script
but a blood on the screen
Any help here !!
edited 1×, last 31.12.09 09:28:29 am

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
Thanks WiLSoN i will give it a try !
[EDIT] i have this script i make it to give all players+4 hp per second if they get hurt , but i don't know what i did wrong
with it so it now give's only who have (ID 1) +4 hp can you tell me a way to fix it to give all players +4hp if they get hurt ?
Spoiler >

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("second","blazz_heal")
function blazz_heal()
	local i, health
	for i = 1, 32 do
		health = player(i,"health")
		if (player(i,"exists") and health < 100) then
			parse("sethealth "..i.." "..(health + 4))
		end
	end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("second","cod4.sec")
	function cod4.sec()
		local i = 1,32 do
		if (player(1,"exists")) then
			parse("sethealth "..i.." "..player(i,"health")+4)
		end
	end
end

Lol, failed loop attempt

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
lol i have a funny one !
this msg must go with out player"name" ....blablabla
it must say (BLACK_J93 sheds FIRST BLOOD BLazzingxx ) ..
but why it put the player"name" and player"victem" idk ?!
Spoiler >


∗[EDIT]Guys the script you gave me work but only for the player who have the ID 1 - i need it for all players !

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
1
msg ('©190255050 '..player(killer,"name")..' sheds FIRST BLOOD by killing '..player(victim,"name")..'!@C')

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
memo has written
∗[EDIT]Guys the script you gave me work but only for the player who have the ID 1 - i need it for all players !

Use DC's UT sample... Even thought you are using it now

old Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Quote
Flacko has written
Is that exactly your script?
What you put on server.lua?


I have it the "dofile" already done and other stuff in the mod but the classes lua didn't work i have dofile them right though.I still thing there is something wrong in the classes lua i posted before (pg.127)
To the start Previous 1 2126 127 128338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview