English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 270 271 272 ... 338 339 Next To the start
02.10.10 10:22:35 am
Up
HaRe
User
Offline Off
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))?


Code:
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

Code:
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
w0w im so eXotiK
02.10.10 11:29:50 am
Up
senar
User
Offline Off
what script check if player hits a player with elite or another weapon?

like this:

CODE HERE---- then
MY SCRIPT HERE----
02.10.10 04:31:25 pm
Up
byengul
User
Offline Off
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...
After 2 years i'm back to cs2d. cookie for everyone
02.10.10 04:39:54 pm
Up
MasterAsp
User
Offline Off
@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
Code:
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
02.10.10 06:20:01 pm
Up
TDShuft
User
Offline Off
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
Sorry , I can't be Perfect !
02.10.10 08:27:47 pm
Up
martis67
User
Offline Off
im new at lua but what wrong ?

Code:
1
2
3
addhookfunction sethealth(id,health)
     parse("sethealth "..50.." "..health)
end
Learning lua
02.10.10 08:41:37 pm
Up
Cure Pikachu
User
Offline Off
This is obvious, id cannot be 50 (max is 32)
And what is this addhookfunction?
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
02.10.10 08:43:21 pm
Up
RyceR
User
Offline Off
use it:
Code:
1
2
3
4
addhook("spawn","___spawn")
function ___spawn(id)
     parse("setmaxhealth "..id.." 50")
end
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
02.10.10 08:47:52 pm
Up
martis67
User
Offline Off
@rycer

thanks it works
Learning lua
02.10.10 08:53:21 pm
Up
byengul
User
Offline Off
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 >
After 2 years i'm back to cs2d. cookie for everyone
02.10.10 10:04:50 pm
Up
MasterAsp
User
Offline Off
@Byengul
Code:
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.
02.10.10 10:26:48 pm
Up
byengul
User
Offline Off
MasterAsp has written:
@Byengul
Code:
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
After 2 years i'm back to cs2d. cookie for everyone
02.10.10 11:07:32 pm
Up
RyceR
User
Offline Off
so try:
Code:
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
Code:
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}
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
02.10.10 11:18:05 pm
Up
byengul
User
Offline Off
not works
After 2 years i'm back to cs2d. cookie for everyone
02.10.10 11:44:45 pm
Up
Tajifun
User
Offline Off
Hey there.
could someone give me an example
for the timer function.
Coz i dont know how to use it. :S

thanks.
Tajifun yay.
02.10.10 11:53:14 pm
Up
emrebyrm123
User
Offline Off
1000 NPC good money when you come you killed
03.10.10 12:10:15 am
Up
FiiD
User
Offline Off
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...
03.10.10 01:57:52 am
Up
ethand
User
Offline Off
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
03.10.10 02:55:59 am
Up
pivot
User
Offline Off
can someone create a script that gives all players 16,000 cash per second?

I tried making one, but it did not work

Thanks
03.10.10 02:57:32 am
Up
Admir
User
Offline Off
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


Code:
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.
My curse will sail against the wind and enrage the earth.
To the start Previous 1 2 ... 270 271 272 ... 338 339 Next To the start