English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 254 255 256 ... 338 339 Next To the start
09.09.10 01:03:30 pm
Up
RAVENOUS
BANNED
Offline Off
Thank you.

Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
"A work of art is the unique result of a unique temperament." - Oscar Wilde
09.09.10 01:04:31 pm
Up
HaRe
User
Offline Off
Skipper has written:
Thank you.

Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.


w00t, Explain better i understand NADA
w0w im so eXotiK
09.09.10 01:19:59 pm
Up
RAVENOUS
BANNED
Offline Off
HaRe has written:
Skipper has written:
Thank you.

Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.


w00t, Explain better i understand NADA


look, for example, I want that you say !random and then you have to wait 5 seconds and you get a random weapon. that !random and the random weapon are not the problem, the wait time is my problem.
"A work of art is the unique result of a unique temperament." - Oscar Wilde
09.09.10 02:14:27 pm
Up
OlaFPhp
User
Offline Off
DC you said i can ask a lua about when i kill npc it will add $300 how
IMG:http://media.moddb.com/images/mods/1/18/17025/topname.1.gif
IMG:http://img706.imageshack.us/img706/9166/bannerorf.png
09.09.10 02:51:55 pm
Up
HaRe
User
Offline Off
Skipper has written:
HaRe has written:
Skipper has written:
Thank you.

Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.


w00t, Explain better i understand NADA


look, for example, I want that you say !random and then you have to wait 5 seconds and you get a random weapon. that !random and the random weapon are not the problem, the wait time is my problem.



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
function Array(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

timeplayer = Array(32)

addhook("say","sayrandom")
function sayrandom(id,)
     if t=="!random" then
          if (timeplayer[id]>5) then
               timeplayer[id]=0
               parse("equip "..id.." math.random(1,3)")
               return 1
          else
               msg2(id,"You cant type it yet")
               return 1
          end
     end
end

addhook("second","randomsec")
function randomsec()
     for id = 1,32 do
          if (player(id,"exists")) then
               timeplayer[id]=timeplayer[id]+1
          end
     end
end
w0w im so eXotiK
09.09.10 03:41:32 pm
Up
KaTiL
User
Offline Off
@HaRe. Very thanks I made a very quick script. There may be a few errors.
09.09.10 06:14:48 pm
Up
CeLiL_CaN
User
Offline Off
What is zombie, headcrap and snark object type?
09.09.10 06:14:50 pm
Up
murilo12
User
Offline Off
can make script to me ?? example ,

Money : 2000

!givemoney 1 200

later

Money 1800
09.09.10 07:49:45 pm
Up
Snake_Eater
User
Offline Off
Does anybody know:

Code:
1
2
3
.....
parse ("setpos "..id.." "..math.random(1,2000).." "..math.random(1,2000))
.....


I want if the first math.random is 1345 that the second math.random is 1345 too.

How to make??
[Death Note]
09.09.10 07:53:13 pm
Up
head600
BANNED
Offline Off
addhook("hit","ssss")
function ssss (id,src,wpn)
if wpn==1 then
      if (sample.classes.class[id]==1) then
      if (sample.classes.class[src]==5) then
parse("setpos "..id.." 10 10")
msg2( id, " "..player(source,"name").." Tarafindan Hapse Tikildin...")


end
end
end
end


whats wrong??
09.09.10 08:12:42 pm
Up
Cure Pikachu
User
Offline Off
@Snake_Eater
Code:
1
2
local var=math.random(1,2000)
parse ("setpos "..id.." "..var.." "..var)
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
09.09.10 08:53:04 pm
Up
Snake_Eater
User
Offline Off
Really thx I give you a cookie
[Death Note]
09.09.10 09:30:22 pm
Up
Loooser
User
Offline Off
@ head600
You cant use the vaule src and later source ,only one is possible

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("hit","ssss")
function ssss (id,src,wpn)                <-- here you use src
if wpn==1 then
      if (sample.classes.class[id]==1) then
      if (sample.classes.class[src]==5) then
parse("setpos "..id.." 10 10")
msg2( id, " "..player(source,"name").." Tarafindan Hapse Tikildin...")                <-- here you use source


end
end
end
end
IMG:http://i45.tinypic.com/saus1e.jpg
10.09.10 04:07:03 am
Up
murilog
User
Offline Off
Code:

addhook("leave","RPsave")
function RPsave(id)
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
rp_cr[id] = 0
end

addhook("join","RPload")
function RPload(id)
if (player(id,"usgn") > 0) then
msg2(id,'Seu U.S.G.N. ID é : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end

addhook("say","SaySaveLoad")
function SaySaveLoad(id,txt)
if (txt=="!save") then
if (player(id,"usgn") > 0) then
msg2(id,'Salvando U.S.G.N. : '..player(id,"usgn")..'@C')
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
end
if (txt=="!load") then
if (player(id,"usgn") > 0) then
msg2(id,'Carregando U.S.G.N. : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
end

function RPTransition(id,f:read("*all"))
rp_cr[id] = f
msg2(id,'Save carregado com sucesso!@C')
parse('hudtxt2 '..id..' 3 "©000000255Dinheiro : R$ '..rp_cr[id]..'" 17 430')
end

What's wrong ?

and , can make !givemoney <id> whit this script
10.09.10 11:58:37 am
Up
CeLiL_CaN
User
Offline Off
CeLiL_CaN has written:
What is zombie, headcrap and snark object type?

Help me please..
10.09.10 12:40:51 pm
Up
kalis
User
Offline Off
help me script
if player go in tiles parse he can't go in tiles water
10.09.10 01:23:58 pm
Up
murilog
User
Offline Off
Code:
addhook("leave","RPsave")
function RPsave(id)
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
rp_cr[id] = 0
end

addhook("join","RPload")
function RPload(id)
if (player(id,"usgn") > 0) then
msg2(id,'Seu U.S.G.N. ID é : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end

addhook("say","SaySaveLoad")
function SaySaveLoad(id,txt)
if (txt=="!save") then
if (player(id,"usgn") > 0) then
msg2(id,'Salvando U.S.G.N. : '..player(id,"usgn")..'@C')
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
end
if (txt=="!load") then
if (player(id,"usgn") > 0) then
msg2(id,'Carregando U.S.G.N. : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
end

function RPTransition(id,f:read("*all"))
rp_cr[id] = f
msg2(id,'Save carregado com sucesso!@C')
parse('hudtxt2 '..id..' 3 "©000000255Dinheiro : R$ '..rp_cr[id]..'" 17 430')
end

What's wrong ?

and , can make !givemoney <id> whit this script
10.09.10 02:53:25 pm
Up
Rainoth
Moderator
Offline Off
Hello could some one show me such code:

You spawn with random items. If i write it would do 1-6 weapons but what to do to example get 3 or 5 or 6 ?

Plz explain me this math.random stuff
10.09.10 02:55:28 pm
Up
RAVENOUS
BANNED
Offline Off
math.random() is randomizing between the two numbers in the brickets.

Example: math.random(10,50) = random number between 10 and 50.
"A work of art is the unique result of a unique temperament." - Oscar Wilde
10.09.10 04:01:43 pm
Up
CeLiL_CaN
User
Offline Off
What is zombie, headcrap and snark object type id?
edited 1×, last 10.09.10 04:01:55 pm
To the start Previous 1 2 ... 254 255 256 ... 338 339 Next To the start