English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 255 256 257 ... 338 339 Next To the start
10.09.10 04:01:53 pm
Up
Rainoth
Moderator
Offline Off
Do you mean that if i make example Say hook. I say something and after that u get in random weapon 10 or weapon 50 ? or you get randomly 10,11,12,13,14,15 and so on till 50 ? I want to know how to make EXACTLY 50 or 10 not between them.
10.09.10 04:40:54 pm
Up
RAVENOUS
BANNED
Offline Off
tell me exactly what you want, I can make you an easy sample.
"A work of art is the unique result of a unique temperament." - Oscar Wilde
10.09.10 04:43:01 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 05:05:45 pm
Up
CeLiL_CaN
User
Offline Off
@murilog:
Did you have a saves folder in "YOUR CS2D/sys/lua" ??
10.09.10 05:13:59 pm
Up
Rainoth
Moderator
Offline Off
Just that you spawn with random weapon and random grenade 200 hp and 10 speed. No laser rpg or Portal gun plz.And of course a random wep "sight -_-" Can be armor too
10.09.10 05:15:31 pm
Up
murilog
User
Offline Off
yes , the error , in console is , LUA ERROR: sys/lua/rp.lua:59: ')' expected near ':'
10.09.10 05:23:35 pm
Up
CeLiL_CaN
User
Offline Off
murilog has written:
yes , the error , in console is , LUA ERROR: sys/lua/rp.lua:59: ')' expected near ':'

You try this code line 59:
Code:
1
function RPTransition(id,"f:read("*all")")


@Batlaizys
Use tables..
Like it:
Code:
1
2
t = {1,3,5}
a = t[math.random(1,3)]
10.09.10 05:34:07 pm
Up
murilog
User
Offline Off
oh , it's wrong again , and is the same error
10.09.10 05:35:53 pm
Up
CeLiL_CaN
User
Offline Off
murilog has written:
oh , it's wrong again , and is the same error

0.o i dont know...
10.09.10 05:38:02 pm
Up
murilog
User
Offline Off
ok , but you can do the comand !givemoney <id> <amount> ?? , whit this script
10.09.10 06:10:23 pm
Up
RAIGEKI
User
Offline Off
whats the npc script?
the tibia npc
pleace help me
sorry for my bad english
IMG:http://i.imgur.com/dp2Us3I.png
10.09.10 06:16:31 pm
Up
Pwncookies
User
Offline Off
Hello, would anyone be so kind to tell/make/post a script to make an image appear on everyone's screen on join?

More detailed(i think):
Player joins - Now an image appears on his screen and stays there.

Thank you.
10.09.10 07:28:01 pm
Up
senar
User
Offline Off
@pwncookies
i think that is imbossible
________________________________________________
Hi all is there is any script that makes infinity sparys?
i mean when you press 'T' you don't have to wait to do it again
is there is any?
10.09.10 07:55:44 pm
Up
HaRe
User
Offline Off
senar has written:
@pwncookies
i think that is imbossible
________________________________________________
Hi all is there is any script that makes infinity sparys?
i mean when you press 'T' you don't have to wait to do it again
is there is any?


first of all ur wrong with the impossible thing that u tould pwncookies

and second that impossible that you said with the Spray
w0w im so eXotiK
10.09.10 08:25:54 pm
Up
Blacko
User
Offline Off
Hi all ! I want a scipt for my RolePlay Server, just a script who save money, license and more with USGN ...
Please help me !
Thanks you !
IMG:http://www.web-modules.net/upload/cache/userbar/123/452.gif
IMG:http://www.web-modules.net/upload/cache/userbar/124/277.gif
10.09.10 08:48:29 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> <amount> whit this script
edited 1×, last 10.09.10 08:59:32 pm
11.09.10 07:54:45 am
Up
kalis
User
Offline Off
heocon953 has written:
help me script
if player go in tiles parse he can't go in tiles water

help me pls
thkx
edited 1×, last 11.09.10 10:38:12 am
11.09.10 09:47:34 am
Up
Snake_Eater
User
Offline Off
Hi all.
Can anybody explain me the timer function or give an sample like if I say !laser I have to wait 5 seconds then I get laser and 10 sec later I lose laser again.
pls Help
[Death Note]
11.09.10 10:19:34 am
Up
texnonikWP
User
Offline Off
http://www.youtube.com/watch?v=-RuY3tR-9xE&NR=1
<< potal 2 >>
PLIZ need new update for cs2d (portal)
or script but who can very like portal 2 .
IT will be best !cs2d!
11.09.10 10:36:48 am
Up
kalis
User
Offline Off
Snake_Eater has written:
Hi all.
Can anybody explain me the timer function or give an sample like if I say !laser I have to wait 5 seconds then I get laser and 10 sec later I lose laser again.
pls Help


i have script but i have a problem
but after 10 sec laser you not lose @ @

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

addhook("say","laser")
function laser(id,t)
     if t == "!laser" then
          if laser[id] == 0 then
               laser[id]=1
          else
               return 0
          end
     end
end

addhook("second","lasertime")
function lasertime()
for i = 1, 32 do
if laser[i] == 1 then
laser[i]=2
elseif laser[i] == 2 then
laser[i]=3
elseif laser[i] == 3 then
laser[i]=4
elseif laser[i] == 4 then
laser[i]=5
elseif laser[i] == 5 then
msg2(i,"You have laser!!@C")
parse("equip "..i.." 45")
laser[i]=6
elseif laser[i] == 6 then
laser[i]=7
elseif laser[i] == 7 then
laser[i]=8
elseif laser[i] == 8 then
laser[i]=9
elseif laser[i] == 9 then
laser[i]=10
elseif laser[i] == 10 then
laser[i]=11
elseif laser[i] == 11 then
laser[i]=12
elseif laser[i] == 12 then
laser[i]=13
elseif laser[i] == 13 then
laser[i]=14
elseif laser[i] == 14 then
laser[i]=15
elseif laser[i] == 15 then
laser[i]=0
msg2(i,"You lose laser!!@C")
parse("killplayer "..i)
end
end
end

addhook("minute","laser_msg")
function laser_msg()
     msg("©255255255Type !laser to used laser :))!!!")
end
edited 1×, last 11.09.10 10:52:17 am
To the start Previous 1 2 ... 255 256 257 ... 338 339 Next To the start