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 283 84 85338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Blazzingxx has written
@CmDark,
Don't start that, fact is that everyone wants to make scripts easiest way.

Ect, I see my scripts everywhere, without my credits >.>


i hate ppl who dont add credits

im making a l4d script and im going to add all of credits!


------------------------EDIT:

HEY help, with samples (more exactly: classes.lua) i have learnt to open a menu after select your team. My question is: can u make the same but opening a menu after select your player? e.g.:
First i select Terrorists, then if i select L337 Krew it opens:
L337 Krew Menu
1.L337 History
2.L337 Info
3.L337 Help

else if i select Guerrilla Warfare it opens:
Guerrilla Warfare Menu
1.Guerrilla Warfare History
2.Guerrilla Warfare Info
3.Guerrilla Warfare Help

IS THIS POSSIBLE?
edited 1×, last 07.11.09 09:59:52 pm

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
Spoiler >


Help with this code please?
edited 1×, last 08.11.09 09:11:42 pm

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
CmDark has written
Spoiler >


Help with this code please?


hi
first see the console and tell us what is (or are) the mistake...

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
when i try to use the function
which is text function = "# oid"
where oid is the object type(id)

line 4 Attempt to concentrate local 'otype' ( a table value)

except even without the table thing if i just put

local otype = 1,23

it Only spawns objecttype 1 (barricade) even if i input any other objecttype number

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
help
hey can help me with this

Quote
parse("mp_wpndmg claw 0")
function bf_hit(id,source,weapon,hpdmg,apdmg)
          if (weapon==78) then
          parse('sethealth "..id.." player(id,"health")+5')
     end
end


i want to make a weapon that give health to players.
edited 2×, last 08.11.09 01:06:47 pm

old Re: Lua Scripts/Questions/Help

HiddenSuprise
User Off Offline

Quote
I Don't know what next...
I Have Problem In Inventory But I do not know what to do next?


addhook("serveraction","pokemenu")
function pokemenu(id,action)
menu(id,"PokeMod Menu,Pokemons,Pokecenter,Pokemart,Inventory")
end
end

addhook("menu","seconmenu")
function seconmenu(id,xmenu,select)
if (xmenu=="Select Your Action") then
if (select == 1) then
menu(id,"Pokemons,Pikachu|Electric,Charmander|Fire,Squirtlle|Aqua") else
if (select == 2) then
menu(id,"Heal,The Cure|Cost : 500") else
if (select == 3) then
menu(id,"Buy Items,Potion|Cost: 100,Regen|Cost :700,Bomb|Cost :600") else
if (select == 4) then
menu(id,"Your Inventory,???") else
end
end
end
end

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
CmDark has written
Spoiler >


Help with this code please?


Im trying to make it so that when you say
# oid

oid= object id

it spawns the object 1 tile to your right bottom

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
Starkkz has written
help
hey can help me with this

Quote
parse("mp_wpndmg claw 0")
function bf_hit(id,source,weapon,hpdmg,apdmg)
          if (weapon==78) then
          parse('sethealth "..id.." player(id,"health")+5')
     end
end


i want to make a weapon that give health to players.

1
2
3
4
5
6
7
addhook("hit","Claw_heal") 
function Claw_heal(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

Flacko
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function spawnobject(otype,x,y,rot,mode,team,id)
	parse("spawnobject "..otype.." "..x.." "..y.." "..rot.." "..mode.." "..team.." "..id)
end

addhook("say","objectsp")
function objectsp(id,txt)
	tilex = player(id,"tilex")+1
	tiley = player(id,"tiley")+1
	if (string.sub(txt, 1, 1) == "#") then
		obj = tonumber(string.sub(txt, 2, string.len(txt)) )
		spawnobject(obj,tilex,tiley,0,0,player(id,"team"),id)
		return 1
	end
end

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
addhook("hit","Claw_heal")
function Claw_heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 78) then
parse ("sethealth "..id.." "..player(id,"health")+15)
return 1
end
end

Thanks Playa Slaya

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("hit","rdmhit")
function rdmhit(id,src,wpn,hpdmg,apdmg)

pname = player(id,"name")
         math.randomseed (os.time())
         rdm = math.random(0, 2) 
          if rdm == 0 then
		msg(" Critical hit made by : "..pname.." ! +8 dmg!")
parse ("sethealth "..id.." "..player(id,"health")-8) 
	 end
	 if rdm == 1 then
		return 0
	end
end
which means that if it gets 0 then (well you have to add the critical damage to that part) he gets critical hit

then if it is 1 then its a normal hit

oh btw the math.random(0, 2) thing
2 is the number after the max rdm == # (well its just like the text string function)

huh.. wierd i couldn't get it to do the function yet no error

NVM: IT WORKS(took forever to get to that critical hit)
edited 3×, last 10.11.09 05:29:15 am

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
math.randomseed creates a randomizer. But it's impossible to create a true random number with a pc, because a PC only can do on/off and you can't hope for the power to choose the way it wants to go.
So math.randomseed() creates a nearly random function from it's parameter. It's useful to use a parameter which changes everytime, so we use the current time (os.time is the time the operatingsystem tells you).
The randomizer is now doing some math with the time and in the end it can return you a (nearly) random number
To the start Previous 1 283 84 85338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview