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 2260 261 262338 339 Next To the start

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
FiiD has written
You can put just -X for the env_Hurt...so than heal it...

HaRe...I maked a new script!!!
Its simple but its my first script so it needs to be simple...:

1
2
3
4
5
6
addhook("die","death")
function death(x,y)				
if death then
	msg("Good Job@C")
     end
end

I never could make it without you HaRe...thanks...and I have maked a more simple script from yours...

1
2
3
4
5
6
addhook("break","breakt")
function breakt(x,y) 
     if x==x and y==y then
          msg("Good Job@C") 
     end
end

this is the script from you and now comes my script:

1
2
3
4
5
6
addhook("break","breaked")
function breaked(x,y)
	if 12+7 then
		msg("Good Job@C")	
        end
end

So see...I just set 12+7 or just set x+y for all breakable entities that it shows the message...



well as you see the functions on the death is wrong

1
function death(x,y)
You can find the functions on the info.txt in your sys/lua folder

1
function death(victim,killer,weapon,x,y)

Also
1
if death then
dosent exists, You are just going to leave it without if death then like this
1
2
3
4
addhook("die","death")
function death(victim,killer,weapon,x,y)
	msg("Good Job@C")
end

also ive never tested to do the x+y, i dont think it works so just do it like ive tould ya

old .YeaH.

FiiD
User Off Offline

Quote
Thank You one more time HaRe...but really the x+y works and I know how the functions go but I dont needed all the functions: victim,killer,weapon...why I just use x,y so I thinked it doesnt wanna work when there be victim,killer,weapon...so why I know that it wanna work I use then the full functions...thank You HaRe...

old Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Quote
Code:
addhook("leave","RPsave")
function RPsave(id)
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
rp_cr[id] = 0
end

addhook("join","RPload")
function RPload(id)
if (player(id,"usgn") > 0) then
msg2(id,'Seu U.S.G.N. ID é : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end

addhook("say","SaySaveLoad")
function SaySaveLoad(id,txt)
if (txt=="!save") then
if (player(id,"usgn") > 0) then
msg2(id,'Salvando U.S.G.N. : '..player(id,"usgn")..'@C')
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
end
if (txt=="!load") then
if (player(id,"usgn") > 0) then
msg2(id,'Carregando U.S.G.N. : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
end

function RPTransition(id,f:read("*all"))
rp_cr[id] = f
msg2(id,'Save carregado com sucesso!@C')
parse('hudtxt2 '..id..' 3 "©000000255Dinheiro : R$ '..rp_cr[id]..'" 17 430')
end

What's wrong ?

and , can make !givemoney <id> <amount> whit this script

old Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Quote
batlaizys has written
@deatherr.

Try this :

Spoiler >


Think looks same as yours ? Find the mistake


I want to make gas Gut Bomb heal lol i don't think that would work for it though

old Re: Lua Scripts/Questions/Help

firedrakeer
User Off Offline

Quote
I'm trying to upload a map, but when I click the button it ALWAYS goes to the "Cannot find webpage" page, or something like that.
Halp! I'm confused!

old Re: Lua Scripts/Questions/Help

Surplus
User Off Offline

Quote
batlaizys has written
You mean when some1 kills you with knife, you will drop weapons you said ?


if you kill some1 and he has in hand machete,rpg,medic, but he will only drop the machete, or any other meele weapon he has.

no long rage weapons or armors will be dropped if (s)he has them.
only meele weapons that he has

old Re: Lua Scripts/Questions/Help

Surplus
User Off Offline

Quote
Could any1 make me a script that if my id joins it sayed A Ancient has arrived.

and if i leave then The Ancient has left.
edited 1×, last 17.09.10 03:25:42 pm

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
Make it with spawned turrets (not explosion) with attack, plz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook([[attack]],[[rp_attack]])
function rp_attack(id)
	local w = player(id,[[weapontype]])
	if w == 69 then
		rot = player(id,[[rot]])
		if rot < -90 then rot = rot + 360 end
		local angle = math.rad(math.abs(rot + 90)) - math.pi
		local x = player(id,[[x]]) + math.cos(angle) * itemtype(w,[[dmg]]) / 2
		local y = player(id,[[y]]) + math.sin(angle) * itemtype(w,[[dmg]]) / 2
		if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
			parse([[explosion ]]..x..[[ ]]..y..[[ 32 10000000 ]]..id)
		end
	end
end

old Need help with is

Jaso
BANNED Off Offline

Quote
I need a script like:
A npc is closing a breakable if the npc comes to close to the breakable the breakable will destroy its self

old Re: Lua Scripts/Questions/Help

Surplus
User Off Offline

Quote
Flacko has written
tiiger87 has written
tiiger87 has written
well.. i will try to script mahself 1 script now


I FAILED!

Try again

FAILED AGAIN!
To the start Previous 1 2260 261 262338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview