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 2209 210 211338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Not very well

1
2
3
4
5
6
7
addhook("hit","laser_heal")
function laser_heal(id,source,wpn,hpdmg,apdmg)
	if wpn == 45 then
		parse("sethealth "..id.." "..player(id,"health")+30)
		return 1
	end
end

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
@Kenv
Spoiler >

This is probably bugged, but this is the general idea I think how on to do this.

And Question, Would this tid bit be a metatable?
1
2
3
tbl = {value = 23, tbl2 = {45,44}}
--or
tbl = {{value = 1},{value = 2}}
Or would none of those be examples of a metatable.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Homer has written
And Question, Would this tid bit be a metatable?
1
2
3
tbl = {value = 23, tbl2 = {45,44}}
--or
tbl = {{value = 1},{value = 2}}
Or would none of those be examples of a metatable.


No, those are just tables inside tables, not metatables.
http://www.lua.org/pil/13.html

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
Oh thanks
And one more question please, I've been baffled as to what these patterns are such as %s and %b. I see good stuff done with it, so I was curious as to what they are. Thanks
edited 1×, last 20.06.10 01:53:45 am

old Explosion gun

KenVo
User Off Offline

Quote
Can someone tell me how to make any gun to explode when it hit any player?
Well, i just know how to make exploding snowball

1
2
3
4
5
6
7
8
9
10
11
function explosion(x, y, size, damage)
     parse("explosion "..x.." "..y.." "..size.." "..damage)
end


addhook("projectile","my_projectile")
function my_projectile(id,weapon,x,y)
	if(weapon == 32) then --snowball
		explosion(x,y,300, 300) -- size + damage = 300
	end
end

old Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Quote
what wrong with this ?

1
2
3
4
5
6
addhook("hit","my_hit")
function my_hit(id,source,weapon,hpdmg,apdmg)
	if(weapon == 32) then --M4a1
		explosion(x,y,50, 45) -- size + damage = 30
	end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("hit","my_hit")
function my_hit(id,source,weapon,hpdmg,apdmg)
	if(weapon == 32) then --M4a1
		local x = player(id,"x")
		local y = player(id,"y")
		explosion(x,y,50, 45) -- size + damage = 30
	end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
He had a function in his script, he posted it above
1
2
3
function explosion(x, y, size, damage)
parse("explosion "..x.." "..y.." "..size.." "..damage)
end

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
Flacko has written
He had a function in his script, he posted it above
1
2
3
function explosion(x, y, size, damage)
parse("explosion "..x.." "..y.." "..size.." "..damage)
end


Oops... sorry, didn't mention

old GC Script help please

secritek
User Off Offline

Quote
hi, me and bully are making mod global conflict and we need someone who can make a script like Domination. If you die you can respawn but you must wait 6 seconds before respawning. And name before map (De_, Dom_, Dm_) must be gc_ . Please can anyone help and try it for us? I am not scripter :(. Thanks for anyone who will try it.
EDIT : i forgot something, if you will be done please write a message to me and i will give you e-mail thank you.

old Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Quote
Spoiler >


It's working but.......

IMG:https://img683.imageshack.us/img683/8757/zmstreet00000.jpg

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
addhook("hit","my_hit")
function my_hit(id,source,weapon,hpdmg,apdmg)
	if(weapon == 35) then
		local x = player(id,"x")
		local y = player(id,"y")
		parse("explosion "..x.." "..y.." 25 5000 "..source)
		return 1
	end
end

old Re: Lua Scripts/Questions/Help

Echo-Charlie
User Off Offline

Quote
Hi scripters. I have one Question:
It is possible to get player skin like player(p,"team")? I think it is not, but better it hear that from others.
To the start Previous 1 2209 210 211338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview