English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 256 257 258 ... 338 339 Next To the start
11.09.10 10:44:51 am
Up
Mr_God
User
Offline Off
Code:
1
2
3
4
5
help me script
if player go in tiles parse he can't go in tiles water in RPG
but i don't used it @ @
help me pls
thkx :)
11.09.10 11:09:39 am
Up
Snake_Eater
User
Offline Off
sry but I mean the timer function not the second hook
[Death Note]
11.09.10 11:25:03 am
Up
RAIGEKI
User
Offline Off
what is the script
than i our bots not movent to water
(rpg_Tibia)
IMG:http://i.imgur.com/dp2Us3I.png
11.09.10 11:36:43 am
Up
sixpack
User
Offline Off
Hello there Unreal Software Scripters!

I need your help for two things:

>How to make a lua script that picks a random number between 2 numbers I give. Like Pick a number from 1 to 10.

>How to make a script like:
An admin can say:
!kick 1 or !kick 2
[I know how to make the say func etc. but I don't know how to make a command that can accept a number.]
[I have to do right now:]
if(txt=="!kick 1") then
parse(command)
end
if(txt=="!kick 2") then
parse(command)
end
11.09.10 11:56:25 am
Up
RAVENOUS
BANNED
Offline Off
@ Daknob - Try math.random() / for example: math.random(1,10) = a random number between 1 and 10.


Could someone please tell me why my gaming is crashing when I make one shot with the P228?

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
addhook("spawn","spawn_hook")
addhook("attack","att_hook")
addhook("kill","kill_hook")

------

function Array(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

just_equipped = Array('sv_maxplayers')

parse("mp_damagefactor 50")

function spawn_hook(id)
     return 4
end

just_equipped = {}
function att_hook(id)
     if just_equipped[id] then
          just_equipped[id] = nil
          return
     end
     if (player(id,"weapontype") == 4) then
          parse("strip "..id.." 4")
     end
end

function kill_hook(killer)
    parse("equip "..killer.." 4")
    just_equipped[killer] = true
end
"A work of art is the unique result of a unique temperament." - Oscar Wilde
11.09.10 12:14:14 pm
Up
CJ7
BANNED
Offline Off
just_equipped = Array('sv_maxplayers')


You can't call it with a string..



just_equipped = Array(game('sv_maxplayers'))

would be better.
http://uprate6.wordpress.com lua: It's not rocketscience.
11.09.10 12:19:21 pm
Up
CeLiL_CaN
User
Offline Off
--- Read This!! ---


What is zombie, headcrap and snark object type id?


--- Read This!! ---
11.09.10 12:40:41 pm
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 don't give me something like addhook("sec.....")
I NEED TIMER Function not a second hook.
pls help
[Death Note]
11.09.10 12:50:15 pm
Up
TimeQuesT
User
Offline Off
try this(i didn't tested)

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
lazer = {}
lazercount = {}

addhook ("say","samplesay")
function samplesay(id,txt)
if lazer[id]==nil then
lazer[id]= 1
lazercount[id] = 10
timer(1000,"samplelazercountdown",id,11)
end


end

function samplelazercountdown(id)
if lazercount[id]>0 then
lazercount[id]=lazercount[id]-1
if lazercount[id]==5 then
msg2(id,"you got laz0r!!")
parse ("equip "..id.." 45")
end
else
parse ("strip "..id.." 45")
lazercount[id]=-1
end
end
Muh
11.09.10 12:57:07 pm
Up
Evool
User
Offline Off
Evool has written:
Hi, please help me
I have often asked question: How make button, which on first used - off, and second used - on?

Very sorry for my bad english


Please help!
11.09.10 01:02:42 pm
Up
Snake_Eater
User
Offline Off
EDIT:

timer(1000,"samplelazercountdown",id........--How to get in there a second parameter or a third?
edited 1×, last 11.09.10 01:24:45 pm
[Death Note]
11.09.10 01:53:25 pm
Up
Flacko
User
Offline Off
@Celil_can: They share the same object id (30), however, what makes them different one from another is the player attribute (zombie = 1, hcrab = 2, snark = 3)

@Snake_Eater: You can concatenate a whitespace and the second/third parameter you want.
Example:
timer(1000,"asd",id.." "..wpn.." "..x)

Then you will have to divide that string using the whitespaces.
Here's a function by leegao that will do that for you:
Code:
1
2
3
4
5
6
7
8
9
function string.split(text,delimiter)
     local buff = {}
     delimiter = delimiter or " "
     delimiter = "[^"..delimiter.."]+"
     for w in string.gmatch(text,delimiter) do
          table.insert(buff,w)
     end
     return buff
end
11.09.10 03:05:56 pm
Up
Alex_Aaa789
User
Offline Off
This is a part of my License Lua:
Code:
1
2
3
4
5
6
7
8
9
addhook(buildattempt,rp_build)
function rp_build(id)
if rp_license[id]==true then
return 0
elseif rp_license[id]==false then
return 1
msg2(id,""..copyright.."255000000You must to be licensed to build!@C")
end
end


It said end is excepted to close 'if'. Who know what i have to correct it?
[ToW Co-Leader]Aaa789 IMG:http://i302.photobucket.com/albums/nn92/aaa789_alexlaw4/Untitled8.gif
Oh it was ended already
11.09.10 03:14:55 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
11.09.10 03:16:15 pm
Up
Flacko
User
Offline Off
Alex_Aaa789 has written:
This is a part of my License Lua:
It said end is excepted to close 'if'. Who know what i have to correct it?

Try this
Code:
1
2
3
4
5
6
7
8
9
addhook("buildattempt","rp_build")
function rp_build(id)
     if rp_license[id]==true then
          return 0
     elseif rp_license[id]==false then
          msg2(id,copyright.."©255000000You must to be licensed to build!@C")
          return 1
     end
end
11.09.10 03:34:30 pm
Up
Alex_Aaa789
User
Offline Off
Thanks it was fixed, but
Whole Lua:

Spoiler >


LUA ERROR: sys/lua/RP_Aaa789/License.lua:11: attempt to call global 'Array' (a nil value)
edited 2×, last 11.09.10 03:38:39 pm
[ToW Co-Leader]Aaa789 IMG:http://i302.photobucket.com/albums/nn92/aaa789_alexlaw4/Untitled8.gif
Oh it was ended already
11.09.10 03:35:29 pm
Up
CeLiL_CaN
User
Offline Off
Flacko has written:
@Celil_can: They share the same object id (30), however, what makes them different one from another is the player attribute (zombie = 1, hcrab = 2, snark = 3)


How i can use this with cs2d cmd spawnobject ??
11.09.10 03:42:46 pm
Up
comba13
User
Offline Off
Hey Guys,How to make dispenser give money until full to player?Me noob.
11.09.10 03:54:14 pm
Up
kalis
User
Offline Off
@Alex_Aaa789
i'm kalis
error
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

rp_license = initArray(32,false)

addhook("buildattempt","rp_build")
function rp_build(id)
if rp_license[id]==true then
return 0
end
if rp_license[id]==false then
msg2(id,copyright.."©255000000You must to be licensed to build!@C")
return 1
end
end
11.09.10 04:10:50 pm
Up
Mr_God
User
Offline Off
heocon953 has written:
help me script
if player go in tiles parse he can't go in tiles water


help pl
To the start Previous 1 2 ... 256 257 258 ... 338 339 Next To the start