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 257 58 59338 339 Next To the start

old Re: Lua Scripts/Questions/Help

mortyr22
User Off Offline

Quote
how to create lua where you cant drop any armor?
how to create lua where if you press button with 5000 money you will have laser?

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
mortyr22 has written
how to create lua where you cant drop any armor?
how to create lua where if you press button with 5000 money you will have laser?

this is for laser
1
2
3
4
5
6
7
8
9
addhook('serveraction','equip')
function equip(id,action)
	if (action==1) then
		if (player(id,'money')>=5000) then
			parse('equip '..id..' 45')
			parse('setmoney '..id..'  '..(player(id,'money')-4500'))		
		end
	end
end

think that will work

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
@mortyr22
to make armor undroppable,

addhook("drop","no_drop")
function no_drop(id,iid,type)
     if (type>=79 and type<=84) then
return 1
end
return 0
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Admirdee has written
@playa slaya

1
parse('setmoney '..id..' '..(player(id,'money')-4500'))

I think not "-4500" it should be +5000


Nope it should be -5000 to substract the money from the player.

old My say command won't work!! WHY????

Toa Hero 92
User Off Offline

Quote
I want these 2 to work but they won't!...

WHY?

i put them in the say functions script.

--LIES
if (txt=="cake") then
parse("customkill 0 Lies"..p); end

--cheese
if (txt=="cheese me") then
parse("customkill 0 Cheese"..p); end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Toa Hero 92 has written
I want these 2 to work but they won't!...

WHY?

i put them in the say functions script.

--LIES
if (txt=="cake") then
parse("customkill 0 Lies"..p); end

--cheese
if (txt=="cheese me") then
parse("customkill 0 Cheese"..p); end


You have to put a space between the Lies and the quote, otherwise your command would look like this:
customkill 0 Lies1

But if your code is like this:
1
2
3
4
5
6
7
--LIES
                if (txt=="cake") then
                parse("customkill 0 Lies "..p); end

               --cheese
            if (txt=="cheese me") then
           parse("customkill 0 Cheese "..p); end
Your command will look like:
customkill 0 Lies 1

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Toa Hero 92 has written
I want these 2 to work but they won't!...

1
2
3
4
5
6
7
if (txt=='cake') then
	parse('customkill '..p..' Lies '..p)
end

if (txt == 'cheese') then
	parse('customkill '..p..' Cheese '..p)
end

Now works?

Edit: WOW, I was so slow... I guess Im too sleepy.

old thanks

Toa Hero 92
User Off Offline

Quote
i will try both

THEY BOTH WORK THANK YOU SO MUCH!... now... i need a script that if i connect to me dedicated server i want to be rcon admin automatically i tried this code

--addhook("join","isrconadmin")
--function isrconadmin(id)

--ToaAdmin

--toahero = 15435

--if (id>0)then
--if (player(id, "usgn") == toahero) then
--parse("rcon_pw myrconpw")
--end
--end
--end


but it didn't work... can some one help?

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
i think i am blind the only thing wrong with my athletcs is...
Spoiler >

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
Toa Hero 92 has written
i will try both

THEY BOTH WORK THANK YOU SO MUCH!... now... i need a script that if i connect to me dedicated server i want to be rcon admin automatically i tried this code

--addhook("join","isrconadmin")
--function isrconadmin(id)

--ToaAdmin

--toahero = 15435

--if (id>0)then
--if (player(id, "usgn") == toahero) then
--parse("rcon_pw myrconpw")
--end
--end
--end


but it didn't work... can some one help?
Lua scripts are not parsed at the person who joins, they are parsed at the server. So the server tool just got rcon rights in your script.

old Awwww Maaannnn...

Toa Hero 92
User Off Offline

Quote
OK thanks for your help. I was just asking because I don't like the so called "admin" scripts that have limited functionality.
so i guess I can't have anything like it huh?

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
what is the problem?
ERROR"Line 123:attempt to call a globle value got nill 'open menu
Spoiler >

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
I have a question, with super hero scripts and other custom made things.. how do you do that configuration making the variables and etc..

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Homer has written
I have a question, with super hero scripts and other custom made things.. how do you do that configuration making the variables and etc..

1. You mean how to make configuration for mod?
2. Or how to use it in super hero?

Yea, it takes some time , but its not hard.
Configuration is just some valuables.

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
playa slaya has written
what is the problem?
ERROR"Line 123:attempt to call a globle value got nill 'open menu
Spoiler >


well i still have not fixed it and do not see the problem please help

i also need to know how to make a dir
to make multiple scripts work together
edited 1×, last 26.09.09 12:12:26 am
To the start Previous 1 257 58 59338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview