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 2306 307 308338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
Yates has written
Hey,
I want to know where i can find a healgun script..
I cant seem to find one anywhere
So what it does it you shoot someone he gains hp..
That's all, i have seen them on Rp servers but i cant find one myself..

Help ?

Thx..


Yasday has written
lol( not tabbed, on ipod)

1
2
3
4
5
6
7
8
addhook([[hit]],[[hitter]])
function hitter(victim,source,wpn,hpdmg,apdmg)
if wpn == 45 then --if laser then
heal = math.random(50,60) --randmon health(lolz randomseed wont work for me)
parse("sethealth "..victim.." "..heal) --give health
return 1 --don't make damage
end
end


Ehmm.. I tryed it but it desn't work ?

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
Lolz

1
2
3
4
5
6
7
addhook("hit","ilikepie") 
function ilikepie(id,source,weapon,hpdmg,apdmg) 
if(weapon == 78) then 
parse ("sethealth "..id.." "..player(id,"health")+15) 
return 1 
end 
end

old Re: Lua Scripts/Questions/Help

Kurumi
User Off Offline

Quote
kato999 has written
can anyone tell me how to make player skin to other file (ex Original is players/ct1.bmp how to change it to example gfx/hitman.bmp not editing the original)
answer it plz

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
batlaizys has written
Lolz

1
2
3
4
5
6
7
addhook("hit","ilikepie") 
function ilikepie(id,source,weapon,hpdmg,apdmg) 
if(weapon == 78) then 
parse ("sethealth "..id.." "..player(id,"health")+15) 
return 1 
end 
end


THX !
I tested it and when someone hits me i heal
But when i hit a bot with it he dies ?
Maybe because its a bot...
But i want to be sure..

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
kato999 has written
kato999 has written
can anyone tell me how to make player skin to other file (ex Original is players/ct1.bmp how to change it to example gfx/hitman.bmp not editing the original)
answer it plz


not possible, you can only cover teh orginal with lua but it will look crazy

image("gfx/player/hitman.bmp",1,1,200+id)

200+id = on player id

1 = Make it move in the player's rot otherwise 0

gfx/player...... = ur path(image path)

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
I don't like when people use those things.. Cars and wings It look so dumb when they walk around with a car on their head o.O

But thanks anyway. It can be very good for infoboxes about LUA mods and stuff. I'll keep that 1 in mind (:

old .YeaH.

FiiD
User Off Offline

Quote
Yasday has written
1
2
3
4
5
6
7
8
addhook([[walkover]],[[walkovers]])
function walkovers(id,iid,type,ain,a,mode)
	if type == 47 then
		return 1
	elseif type == 80 then
		return 1
	end
end

this wont let the players colect rpg or armor

I hope it dont want...I must check it out...thank you really much for the script...

Edit> Please can any explain me the difference between this hook> addhook("movetile","aimove")
and this hook> addhook([[walkover]],[[collect]])

Why this last hook have "[]"???

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
[[ is the same as " but its better f you use it like this [[ " lol "]] than this ' " " ' (for me)
and i really like the [[]] cuz in notepad++ its red

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
Yates has written
batlaizys has written
Lolz

1
2
3
4
5
6
7
addhook("hit","ilikepie") 
function ilikepie(id,source,weapon,hpdmg,apdmg) 
if(weapon == 78) then 
parse ("sethealth "..id.." "..player(id,"health")+15) 
return 1 
end 
end


THX !
I tested it and when someone hits me i heal
But when i hit a bot with it he dies ?
Maybe because its a bot...
But i want to be sure..


I think it should heal bots too. Or maybe not...

old Re: Lua Scripts/Questions/Help

Yates
Reviewer Off Offline

Quote
batlaizys has written
Yates has written
batlaizys has written
Lolz

1
2
3
4
5
6
7
addhook("hit","ilikepie") 
function ilikepie(id,source,weapon,hpdmg,apdmg) 
if(weapon == 78) then 
parse ("sethealth "..id.." "..player(id,"health")+15) 
return 1 
end 
end


THX !
I tested it and when someone hits me i heal
But when i hit a bot with it he dies ?
Maybe because its a bot...
But i want to be sure..


I think it should heal bots too. Or maybe not...


It doesnt matter about bots but i just wanted to know that i could heal everyone,,
I've done making my new HT for Fun-gaming.net
But yeah,, i need that script for (Medic) he heals ppl in battle..
So i just wanted to know that i could heal everyone

old Re: Lua Scripts/Questions/Help

DannyDeth
User Off Offline

Quote
@Yates:
The problem lies in this:
1
return 1
This is saying that when the weapon hits him carry on as normal. change it to 'return 0' inorder for it to work. I mean, how can you heal a dead person?

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
...Make the wrench(IID: 74) heal people (:
It's more realistic than using a claw

Maybe you want only admins to be able to get Claw? (:

old Re: Lua Scripts/Questions/Help

Fehu
User Off Offline

Quote
batlaizys has written
Ok i got bug here. When i start my script it says the hook is added but when i kill with knife i dont get more exp and credits obly regular kill creds...

Spoiler >


1
2
3
4
5
6
7
8
9
addhook("kill","humiliation")
function humiliation(id)
if player(id,"weaponid")==50 then 
credits[id]=credits[id]+15
exp[id]=exp[id]+60
parse("sv_msg2 "..id.." When Humiliating people you get more credits and experience !")
parse("sv_msg2 "..id.." ©132231312You Have Just Humiliated Someone!")
end
end

here you are...

old Re: Lua Scripts/Questions/Help

sebastiannielsen
User Off Offline

Quote
How I do to force a player to a team at join?

I tried with:

addhook("join", "dojoin")

function dojoin(id)
parse("maket "..id)
end


but the team select menu is still there and player is in spectate when he joins.

old Re: Lua Scripts/Questions/Help

FiiD
User Off Offline

Quote
Yasday has written
[[ is the same as " but its better f you use it like this [[ " lol "]] than this ' " " ' (for me)
and i really like the [[]] cuz in notepad++ its red

Thank you really much...I use the []...

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
sebastiannielsen has written
How I do to force a player to a team at join?

I tried with:

addhook("join", "dojoin")

function dojoin(id)
parse("maket "..id)
end


but the team select menu is still there and player is in spectate when he joins.


Do you want ALL players to join one team ? or you can join but others cant ?

old Re: Lua Scripts/Questions/Help

sebastiannielsen
User Off Offline

Quote
batlaizys:

That will be done with a if then, to autoselect team.
But I solved it:

timer(100, "parse", "maket "..id)

works perfectly. Seems like the system wont allow through a "maket" on a newly joined player before 100 milliseconds has elapsed since join.

old Re: Lua Scripts/Questions/Help

AbAeterno
User Off Offline

Quote
Um... I got a LUA error and i don't know how to fix it.

Here's the code:
1
2
3
4
5
addhook("objectkill","OK1")
 function OK1(id)
   ms.money[id]=ms.money[id]+15
   ms.moneyshow(id)
 end

Error:Attempt to perform arithmetic on field '?'(a nil value)

Can anyone help please?

old Re: Lua Scripts/Questions/Help

Chex
User Off Offline

Quote
1
2
3
4
5
addhook ("spawn","meleespawn")
	if (player(id,"exists")) then
		>return "x"
	end
end
and
1
2
3
4
5
6
addhook("say","portalequip")
	if (txt=="!portal") then
		parse ("equip ("id","88"))
		end
	end
end
And can you explain what you did? PLease?
If so, cookie for you.
To the start Previous 1 2306 307 308338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview