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 220 21 22338 339 Next To the start

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
You could make it with a trigger_use and a timer...
then make a lua script with the trigger hook and make parse("setarmor "..id.." "..player(id, "armor") +10)

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
TheKilledDeath has written
You could make it with a trigger_use and a timer...
then make a lua script with the trigger hook and make parse("setarmor "..id.." "..player(id, "armor") +10)
1
2
3
4
addhook("trigger","hevcharger")
function hevcharger(id, armor)
  parse("setarmor "..id.." "..player(id, "armor") +10)
end
This is all I got so far...

Or do I need to do it like this?
1
2
3
4
addhook("use","trigger.hevcharger")
function trigger.hevcharger(id, trigger)
	parse(if trigger "entity" then "setarmor "..id.." "..player(id, "armor") +10)
end

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
LinuxGuy has written
alright, i will try to do it. i will need:

trigger name:

trigger x and y position

what it do when you use it?
Adds 10+ armor to player who use it. If armor is already 99 it should not add, or it should fill armor.

old Re: Lua Scripts/Questions/Help

Alpha Beta
User Off Offline

Quote
Admirdee has written
how to make script, if his/her score 10 ten then got 2% speed?


1
2
3
4
5
6
addhook("kill","killspeed")
function killspeed(killer,victim,weapon,x,y)
	if(player(killer,"score")==10) then
		parse("speedmod "..killer.." 2")
	end
end

Worx for me

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Heavy has written
Admirdee has written
how to make script, if his/her score 10 ten then got 2% speed?


1
2
3
4
5
6
addhook("kill","killspeed")
function killspeed(killer,victim,weapon,x,y)
	if(player(killer,"score")==10) then
		parse("speedmod "..killer.." 2")
	end
end

Worx for me


thanks.

EDIT: how about in classes. lol im newbie

EDIT2: nvm, I already got it
edited 2×, last 26.06.09 04:16:16 pm

old Re: Lua Scripts/Questions/Help

kikinep
User Off Offline

Quote
admins = {30844, 30575}
addhook("say","adm.classes.admin")
function adm.classes.admin(id, text)
i = 1
while (i <= #admins) do
i = i + 1
if (text = "!admin") then
if (player(id, "usgn") == admins[i]) then
msg("Player "..player(id, "name").." is admin!")
end
end
end
end

help this does not work

console msg:

LUA ERROR: sys/lua/server.lua:383: ')' expected near '='

help me plz

old Re: Lua Scripts/Questions/Help

Alpha Beta
User Off Offline

Quote
kikinep has written
i dont understand you

There is a "=" missing...
...The code must look like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
admins = {30844, 30575}
addhook("say","adm.classes.admin")
function adm.classes.admin(id, text)
	i = 1
	while (i <= #admins) do
	i = i + 1
	if (text == "!admin") then
		if (player(id, "usgn") == admins[i]) then
			msg("Player "..player(id, "name").." is admin!")
		end
	end
	end
end
"if (text = "!admin") then" = Wrong
"if (text == "!admin") then" = Right

old Suggest Zombies Mode !!!

phihung940
User Off Offline

Quote
I suggest like this:

There are 3 types of zombies, the players first choose sides zombies are zombies level 2, then every time through round other players will countdown 10 seconds to select zombies "Boss", the remaining players turn into zombies with the only zombies as usual.

Zombies lv1 (human changed zombies).
Damge: 20~27
Speed: 90%
HP: 100

Zombies lv2 (player choose)
Damge: 30~35
Speed: 110%
HP: 150

Zombies "BOSS" (Countdown)
Damge: 45~50
Speed: 105%
HP: 200

When zombies were attacked by marble it will be push back again , and when zombies boss death ! the game will be end.

this can be do with LUA ? so every one can help me ?

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
-Skull_ has written
Use the Suggestion Thread.
Which doesn't exist anymore? DC mentioned that he thinks about making a new system though.

By the way, have anyone got time to make a lua script that displays players USGN id's in a list? it's great for tracking down fakenickers.

old Re: Lua Scripts/Questions/Help

Mattman
User Off Offline

Quote
Um..... sorry if I sound kinda noobish but i've been wondering this but how do you activate lua scripts onto your servers? Please write step by step!

old Custom Kill

Bownok
User Off Offline

Quote
Does anyone know how to kill a person with custom kill? When I customkill someone using lua script, it would say Player Eat Player 2 and player would get the kill and stuff but player 2 would still be alive after the customkill.
To the start Previous 1 220 21 22338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview