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 2323 324 325338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
@Yasday, thx it works now..
Hey, if i want to make a nother wich makes a tank
Must i just change the names where it says so..?
and the img of course..?
Like !buy tank
And you get tank.. ?

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
Yates has written
@Yasday, thx it works now..
Hey, if i want to make a nother wich makes a tank
Must i just change the names where it says so..?
and the img of course..?
Like !buy tank
And you get tank.. ?

eeh try it
if it doesn't work post it here

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
lol, doesnt work..
But what i rly wanted was a script you click F6 and car buy menu comes up.
3 cars
1. Normal cost 5.000
2. Sports car cost 7.500
3. Tank cost 10.000 (You get a RPG with it)
I used the other script because yeah.. only one what i could find..
I saw a other buy car but it got removed from site..
Someone said he copyed and then he removed
But noone wants to make sucha script anymore EVENTHO, there is not a single one on this site..
PS: The cars are cheap because you loose if you blow it up by crashing into wall..

old Re: Lua Scripts/Questions/Help

Glix
User Off Offline

Quote
1
2
logo=image("gfx/Pl/money bar.bmp",489,63,2)
imagealpha(logo,0.9)

how i can make bar like wen you got ot game you see it all time.

like logo in a paint ball 2 (.lua [script])

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
Yates has written
lol, doesnt work..
But what i rly wanted was a script you click F6 and car buy menu comes up.
3 cars
1. Normal cost 5.000
2. Sports car cost 7.500
3. Tank cost 10.000 (You get a RPG with it)
I used the other script because yeah.. only one what i could find..
I saw a other buy car but it got removed from site..
Someone said he copyed and then he removed
But noone wants to make sucha script anymore EVENTHO, there is not a single one on this site..
PS: The cars are cheap because you loose if you blow it up by crashing into wall..

i want to say:
1. easy
2. much to write and test = many time
3. so nobody wants to do it

@steam-sc2d
what you mean ?

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
Hm... is it possible to have hp more than 250?
I tried with setmaxhealth but it seems that it only goes up to 250.
Thanx

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
make sth like if s1 has >1 hp it goes back to 250 and from a hud a number goes down.
if ya dont know how , maybe ill do it tomorrow
or s1 else
Edit:
it's not possible but you can make sth like add health

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
Oh.. i just found out it is possible to make 505hp for the player. You just setmaxhealth to 250, and setarmor to 255 and mp_kevlar 1.0

But your idea of adding hp when someone hits you is quite good, i'll try to do it now.

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
You cant set armor 255 --" 200 max

My Question : What does mean "Atempt to call a string value"

It happened when i pressed menu button...

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
batlaizys has written
You cant set armor 255 --" 200 max

My Question : What does mean "Atempt to call a string value"

It happened when i pressed menu button...


Want a screenshot with my armor 255 ?:)

"Atempt to call a string value" - it expected something like number, but you sent a string, show me your code

By the way, heres a code (if anyone needs it) to set as much hp as you want. The only thing that doesnt work for me is that it doesnt write in green (my hudtxt2 message). If you can fix it pls tell me how.
Spoiler >

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
Yasday has written
Yates has written
lol, doesnt work..
But what i rly wanted was a script you click F6 and car buy menu comes up.
3 cars
1. Normal cost 5.000
2. Sports car cost 7.500
3. Tank cost 10.000 (You get a RPG with it)
I used the other script because yeah.. only one what i could find..
I saw a other buy car but it got removed from site..
Someone said he copyed and then he removed
But noone wants to make sucha script anymore EVENTHO, there is not a single one on this site..
PS: The cars are cheap because you loose if you blow it up by crashing into wall..

i want to say:
1. easy
2. much to write and test = many time
3. so nobody wants to do it


But wouldn't it be worth the while making it..
Allot of ppl would like a car script and totaly when you know where to change img, cost and name..
Shame i cant script i would have made one but yeah..
If noone want to make it well then that's a shame..
But if anyone wants to do it NOW

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
lol maybe i could HELP you with making one, but first start with reading the cs2d lua info.txt then this
Programming in Lua <-- link
and again the info.txt and some other luas and you can script veeeery well

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
I will tomorrow..
Too late for me to do it now..
Get a good breakfast then try to learn a computer language when im done

old Re: Lua Scripts/Questions/Help

Danikah
User Off Offline

Quote
Is it possible to change a weapon's damage for only ONE player? I thought about:
1. change it to the specific amount, then
2. do the attack, then
3. change back. But I think that will be buggy.
So can somebody help me?

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
parse("mp_wpndmg m4a1 1000000")
adminList = {16138,16138,12345678}
function adm(id)
for i,us in ipairs(adminList) do
if player(id,"usgn") == us then
return true
end
end
return false
end
addhook("hit","hitter")
function hitter(id,source,wpn,hpdmg,apdmg)
if wpn==32 then
if not adm(source) then
if player(id,"health")>=17 then
parse("sethealth "..id.." "..player(id,"health")-16
else
parse("customkill "..source.." M4A1 "..id)
end
return 1
end
end
end
try it
edited 1×, last 10.12.10 11:50:15 pm

old Re: Lua Scripts/Questions/Help

Danikah
User Off Offline

Quote
Yasday has written
-blahblah-

I want it to be used with the player's ID.
It will be combined with the base classes-lua *hint-hint :P*, and when you choose the (for example) 1. class, your knife will be stronger.

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
parse("mp_wpndmg Knife 80")
addhook("hit","hitter")
function hitter(id,source,wpn,hpdmg,apdmg)
if wpn==50 then
if not classnumber1[id] then
if player(id,"health")>=56 then
parse("sethealth "..id.." "..player(id,"health")-55)
else
parse("customkill "..source.." Knife "..id)
end
return 1
end
end
end
idk maybe sth like this

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
Yasday, may be you can help, please.
The neutral turret (build by me by spawnobject) attacks teammates but doesnt do any damage to them and i want to make so that it kills both teammates and the other teamplayers. I tried also doing that the turret is completely neutral (not built by you), but in that case it kills you as well (but that's to be expected)

I tried to make it so that with lua script turret also takes away hp from your teammates:
1
2
3
4
5
6
7
8
9
10
11
addhook("second","turret")
function turret()
	if (object(12,"exists") and object(12,"target") ~= 0 and object(12,"target") ~= object(12,"player")) then
	local id = object(12,"target")
		if (player(id,"health")+10)>10 then
			parse("sethealth "..id.." "..player(id,"health")-10)
		else
			parse("customkill "..id.." Turret "..id)
		end
	end
end

But for some reason it tells me that player(id,"health") is a boolean and i cant perform arithmetic operations on it i thought it returns player's health.
Hilf mir bitte:)
To the start Previous 1 2323 324 325338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview