Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 283 84 85338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
Blazzingxx hat geschrieben
@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?
1× editiert, zuletzt 07.11.09 21:59:52

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
Spoiler >


Help with this code please?
1× editiert, zuletzt 08.11.09 21:11:42

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
CmDark hat geschrieben
Spoiler >


Help with this code please?


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

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Zitieren
help
hey can help me with this

Zitat
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.
2× editiert, zuletzt 08.11.09 13:06:47

alt Re: Lua Scripts/Questions/Help

HiddenSuprise
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
CmDark hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Zitieren
Starkkz hat geschrieben
help
hey can help me with this

Zitat
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

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
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)
3× editiert, zuletzt 10.11.09 05:29:15

alt Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 283 84 85338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht