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 2270 271 272338 339 Next To the start

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
Fehuziom has written
I have one question:

How to make image in x position and y position of player (This image cant move(Floor Image))?


1
2
3
4
local x,y = player(id,"x"),player(id,"y")
mode = 0 -- Floor Mode
path = "gfx/..." -- Dont remove the ""
image(path,x,y,mode)

@Time4Parteh

1
2
3
4
5
6
7
8
9
10
11
healing = 5 -- how mutch it should heal

addhook("second","lol") function lol()
	for id = 1,32 do
		if (player(id,"exists")) then
			if (player(id,"health")>0) then
				parse("sethealth "..id.." "..(player(id,"health") + healing))
			end
		end
	end
end

old Re: Lua Scripts/Questions/Help

senar
User Off Offline

Quote
what script check if player hits a player with elite or another weapon?

like this:

CODE HERE---- then
MY SCRIPT HERE----

old Re: Lua Scripts/Questions/Help

byengul
User Off Offline

Quote
byengul has written
hi i've loaded this mod to my server and i wanted to restart for activating mode but it does not restarting. i mean how can i apply this mod to my server? sorry for my bad english..

help please...

old Re: Lua Scripts/Questions/Help

MasterAsp
User Off Offline

Quote
@senar, Use the hit hook, a parameter for weapon type is passed, so you can recognize what it is, and then you can do something inside the hook if you so wanted to. E.G
1
2
3
4
5
6
7
8
addhook("hit","mHitTest")
function mHitTest(id,source,weapon,hpdmg,apdmg)
	if (player(source,"health") > 0) then
		if (weapon == 50) then --If player gets hit with knife
			--Do you code here
		end
	end
end

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
How I Make A Function That Checks The Player Armor Id ( When i mean id i meant like 83 super armor )
edited 1×, last 02.10.10 10:18:35 pm

old Re: Lua Scripts/Questions/Help

byengul
User Off Offline

Quote
hi i want to make an item like when you use it, it will give you 10 level.i've tried to make like that but not worked:
Spoiler >

old Re: Lua Scripts/Questions/Help

MasterAsp
User Off Offline

Quote
@Byengul
1
2
3
4
5
6
7
8
9
10
11
12
[1351] = {
          name = "leveling scroll +10",
          desc = "gives you 10 level. ",
          r = 255, g = 255, b = 255,
          action = "use",
          fimage = "gfx/weiwen/lvl scroll.png",
          eimage = "gfx/weiwen/lvl scroll.png",
          func = {use,function(id,itemslot,itemid)
						PLAYERS[id].Level = PLAYERS[id].Level + 10
					end},
          levelup = 10,
     }
This might work.

old Re: Lua Scripts/Questions/Help

byengul
User Off Offline

Quote
MasterAsp has written
@Byengul
1
2
3
4
5
6
7
8
9
10
11
12
[1351] = {
          name = "leveling scroll +10",
          desc = "gives you 10 level. ",
          r = 255, g = 255, b = 255,
          action = "use",
          fimage = "gfx/weiwen/lvl scroll.png",
          eimage = "gfx/weiwen/lvl scroll.png",
          func = {use,function(id,itemslot,itemid)
						PLAYERS[id].Level = PLAYERS[id].Level + 10
					end},
          levelup = 10,
     }

This might work.


not works

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
so try:
1
2
3
4
5
6
7
8
9
10
11
[1351] = {
name = "leveling scroll +10",
desc = "gives you 10 level. ",
r = 255, g = 255, b = 255,
action = "use",
fimage = "gfx/weiwen/lvl scroll.png",
eimage = "gfx/weiwen/lvl scroll.png",
func = {use,function(id,itemslot,itemid)
                              PLAYERS[id].Level = PLAYERS[id].Level + 10
                         end},
}
or
1
2
3
4
5
6
7
8
9
10
[1351] = {
name = "leveling scroll +10",
desc = "gives you 10 level. ",
r = 255, g = 255, b = 255,
action = "use",
fimage = "gfx/weiwen/lvl scroll.png",
eimage = "gfx/weiwen/lvl scroll.png",
func = {use,function(id,itemslot,itemid)
                              PLAYERS[id].Level = PLAYERS[id].Level + 10
                         end}

old npc

emrebyrm123
User Off Offline

Quote
1000 NPC good money when you come you killed

old .YeaH.

FiiD
User Off Offline

Quote
I got a question...can any help me to make a script...when the walls be shooted and they go on 50 or 20 health they change their picture...I wanna make some broken walls...and when they become 50 or 20 health their picture changes...

old Re: Lua Scripts/Questions/Help

ethand
User Off Offline

Quote
can somebody help me, i am trying to add a skin to select for my in-game menu. For example, if somebody went to the menu and clicked "tank" the skin of the tank would appear over the player and would cost them 500k.

i have an idea about how to make the script but not sure how to build the base of it, any help would be appreciated. thx

old Help me please!

pivot
User Off Offline

Quote
can someone create a script that gives all players 16,000 cash per second?

I tried making one, but it did not work

Thanks

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
pivot has written
can someone create a script that gives all players 16,000 cash per second?

I tried making one, but it did not work

Thanks


1
2
3
4
5
6
7
8
addhook("second","moneypersec")
function moneypersec()
	for i = 1,32 do
		if player(i,"exists") then
			parse("setmoney "..i.." 16000")
		end
	end
end

should give player 16000 money for each second.
To the start Previous 1 2270 271 272338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview