Lua Scripts/Questions/Help
6,770 repliesFehuziom has written:
@Evool:
I dont test this
you must write only x and y position , usgn , and door name...
Code:
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("usebutton","use")
function use(id,x,y)
if (x==X POSITION) and (y==Y POSITION) then
if player(id,"usgn")==USGN PLAYER then
parse("trigger DOOR NAME")
end
end
end
function use(id,x,y)
if (x==X POSITION) and (y==Y POSITION) then
if player(id,"usgn")==USGN PLAYER then
parse("trigger DOOR NAME")
end
end
end
I dont test this

It doesnt work

Evool has written:
It doesnt work
What is bad? I tried all. Please help me, that script is very important for me and my clan.
Fehuziom has written:
@Evool:
I dont test this
you must write only x and y position , usgn , and door name...
Code:
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("usebutton","use")
function use(id,x,y)
if (x==X POSITION) and (y==Y POSITION) then
if player(id,"usgn")==USGN PLAYER then
parse("trigger DOOR NAME")
end
end
end
function use(id,x,y)
if (x==X POSITION) and (y==Y POSITION) then
if player(id,"usgn")==USGN PLAYER then
parse("trigger DOOR NAME")
end
end
end
I dont test this

It doesnt work

show me error, i in phone already...
Alright, got a new problem...
"attempt to index global 'agility' (a number value)".
Part of the code:
Please note that I am novice at Lua.
Thanks for the help in advance!
"attempt to index global 'agility' (a number value)".
Part of the code:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
if sample==nil then sample={} end
sample.sur={}
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
agility=initArray(1000)
health=initArray(1000)
crafting=initArray(1000)
agility = 0
health = 0
crafting = 0
addhook("serveraction","actions")
addhook("menu", "menus")
function actions(id,sact)
if(sact == 2) then
menu(id, "Skills Menu, +1 ROFLPWN, +1 Agility, +1 Health, +1 Crafting")
end
end
function menus(id, title, button)
if (title=="Skills Menu") then
if(button==1) then
end
if(button==2) then
if (points[id]>=1) then
agility[id]=agility[id]+1
points[id]=points[id]-1
else
msg2(id,"You don't have enough Skill Points!")
end
end
if(button==3) then
end
if(button==4) then
end
end
end
addhook("join","updatehud")
function updatehud(id)
for id=1,32 do
if player(id,"exists") then
parse('hudtxt2 '..id..' 1 "©255255255Skills Points: '..points[id]..'" 17 210')
end
end
end
addhook("spawn","start")
function start(id)
for id=1,32 do
if player(id,"exists") then
points[id]=points[id]+3
updatehud(id)
end
end
end
sample.sur={}
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
agility=initArray(1000)
health=initArray(1000)
crafting=initArray(1000)
agility = 0
health = 0
crafting = 0
addhook("serveraction","actions")
addhook("menu", "menus")
function actions(id,sact)
if(sact == 2) then
menu(id, "Skills Menu, +1 ROFLPWN, +1 Agility, +1 Health, +1 Crafting")
end
end
function menus(id, title, button)
if (title=="Skills Menu") then
if(button==1) then
end
if(button==2) then
if (points[id]>=1) then
agility[id]=agility[id]+1
points[id]=points[id]-1
else
msg2(id,"You don't have enough Skill Points!")
end
end
if(button==3) then
end
if(button==4) then
end
end
end
addhook("join","updatehud")
function updatehud(id)
for id=1,32 do
if player(id,"exists") then
parse('hudtxt2 '..id..' 1 "©255255255Skills Points: '..points[id]..'" 17 210')
end
end
end
addhook("spawn","start")
function start(id)
for id=1,32 do
if player(id,"exists") then
points[id]=points[id]+3
updatehud(id)
end
end
end
Please note that I am novice at Lua.
Thanks for the help in advance!
Nothing to see here, move along.
agility=initArray(1000)
health=initArray(1000)
crafting=initArray(1000)
agility = 0
health = 0
crafting = 0
all i'm saying..
health=initArray(1000)
crafting=initArray(1000)
agility = 0
health = 0
crafting = 0
all i'm saying..
Quote:
Please note that I am novice at Lua.
Haha, that didn't help a bit.
Nothing to see here, move along.
How to make it:
If i say words "lol" i have on me emoticon(file - gfx/emotes/lol.png") like in weiwen script.
If i say words "lol" i have on me emoticon(file - gfx/emotes/lol.png") like in weiwen script.

Fehuziom, sorry, script work! Its my bug...
Admin/mod comment:
pl removed. english and german only please. other languages are not tolerated in any way! /DC Hi all,
I want a lua script,just look the pictures i want point A,B,C and D.

Sorry for my bad English
I want a lua script,just look the pictures i want point A,B,C and D.


Sorry for my bad English
ok.
Dynwall name: bosskilled
npc name: bosscreate, don't spawn in the start
Dynwall name: bosskilled
npc name: bosscreate, don't spawn in the start
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("trigger","npccreated")
addhook("objectkill","npckilled")
function npccreated(name)
local ot
if name=="bosscreate" then
ot=object(0,"table")
bossid=#ot
end
end
function npckilled(id)
if id==bossid then
parse("trigger \"bosskilled\"")
end
end
addhook("objectkill","npckilled")
function npccreated(name)
local ot
if name=="bosscreate" then
ot=object(0,"table")
bossid=#ot
end
end
function npckilled(id)
if id==bossid then
parse("trigger \"bosskilled\"")
end
end
@beckerchen has written:
so you want that the player (if hes a medic / hotelowner ) gets telepotet to a point medics/hotelowners?
Then i need the xtile and the ytyle for the special places. MEDIC 456 346 HOTEL 784 235.
@beckerchen has written:
You Don't want a command !goshop ??
no , because have 6 shops , but shop owners , win 5k and one weapon if 5 , 5 min , and msg YOU WIN ONE WEAPON and shopowners , can drop armors , if txt !droparmor .
@beckerchen as written:
how long should a day go? ~5minutes?
YES
so you want that the player (if hes a medic / hotelowner ) gets telepotet to a point medics/hotelowners?
Then i need the xtile and the ytyle for the special places. MEDIC 456 346 HOTEL 784 235.
@beckerchen has written:
You Don't want a command !goshop ??
no , because have 6 shops , but shop owners , win 5k and one weapon if 5 , 5 min , and msg YOU WIN ONE WEAPON and shopowners , can drop armors , if txt !droparmor .
@beckerchen as written:
how long should a day go? ~5minutes?
YES
I have a question about Lua (without CS2D). What does # do at the beginning of a file?
We must secure the existence of our people and a future for white children. 14/88
No I know that, but I mean at the first line of a file it does something else.
We must secure the existence of our people and a future for white children. 14/88
hey there, I got a problem with this code, somehow it's not working, I can't understand it...
Would be great if someone could help me.
In fact, the Error is at line 3 - he doesn't expect "!"...
Code:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("say","say_commands")
function say_commands(id,txt)
if(!kick==string.sub(txt,1,5))then
tt=tonumber(string.sub(txt,6,7))
parse("kick "tt)
end
end
end
function say_commands(id,txt)
if(!kick==string.sub(txt,1,5))then
tt=tonumber(string.sub(txt,6,7))
parse("kick "tt)
end
end
end
Would be great if someone could help me.
In fact, the Error is at line 3 - he doesn't expect "!"...
edited 1×, last 27.08.10 12:52:50 pm
"A work of art is the unique result of a unique temperament." - Oscar Wilde