Lua Scripts/Questions/Help
6,770 repliesmurilogc has written:
... and the cmd !gomedic , its to go to the medic , gohotel , its to go to hotel ...
so you want that the player (if hes a medic/hotelowner) gets teleportet to a special point for medics/hotelowners?
Then I need the Xtile and the Ytile for the special places.
You dont want a command !goshop?
murilogc has written:
...and i want pay day medic win 10k , shop owner win 5k and hotel owner win 6k...
how long should a day go? ~5minutes?
Soja1997 has written:
i need script
If Terrorist(predator) Kill CT(Marine)
parse sv_sound
If Terrorist(predator) Kill CT(Marine)
parse sv_sound
Code:
1
2
3
4
5
6
2
3
4
5
6
addhook("kill","killsound")
function killsound(vic,killer,weapon,x,y)
if(player(killer,"team")==1 and player(vic,"team")==2)then
parse("sv_sound \" THEFOLDER/THESOUND.wav\"")
end
end
function killsound(vic,killer,weapon,x,y)
if(player(killer,"team")==1 and player(vic,"team")==2)then
parse("sv_sound \" THEFOLDER/THESOUND.wav\"")
end
end
insted of THEFOLDER write the name of the folder in the sfx folder.
insted of THESOUND write the name of the sound
insted of .wav write the soundtype (.wav .ogg .wma .....)
edited 1×, last 23.08.10 07:37:24 pm
@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
edited 1×, last 24.08.10 08:22:49 pm
beckerchen has written:
so you want that the player (if hes a medic/hotelowner) gets teleportet to a special point for medics/hotelowners?
Then I need the Xtile and the Ytile for the special places.
You dont want a command !goshop?
how long should a day go? ~5minutes?
insted of THEFOLDER write the name of the folder in the sfx folder.
insted of THESOUND write the name of the sound
insted of .wav write the soundtype (.wav .ogg .wma .....)
murilogc has written:
... and the cmd !gomedic , its to go to the medic , gohotel , its to go to hotel ...
so you want that the player (if hes a medic/hotelowner) gets teleportet to a special point for medics/hotelowners?
Then I need the Xtile and the Ytile for the special places.
You dont want a command !goshop?
murilogc has written:
...and i want pay day medic win 10k , shop owner win 5k and hotel owner win 6k...
how long should a day go? ~5minutes?
Soja1997 has written:
i need script
If Terrorist(predator) Kill CT(Marine)
parse sv_sound
If Terrorist(predator) Kill CT(Marine)
parse sv_sound
Code:
1
2
3
4
5
6
2
3
4
5
6
addhook("kill","killsound")
function killsound(vic,killer,weapon,x,y)
if(player(killer,"team")==1 and player(vic,"team")==2)then
parse("sv_sound \" THEFOLDER/THESOUND.wav\"")
end
end
function killsound(vic,killer,weapon,x,y)
if(player(killer,"team")==1 and player(vic,"team")==2)then
parse("sv_sound \" THEFOLDER/THESOUND.wav\"")
end
end
insted of THEFOLDER write the name of the folder in the sfx folder.
insted of THESOUND write the name of the sound
insted of .wav write the soundtype (.wav .ogg .wma .....)
ohh thanks it works
@EDIT
hello i need script
if CT Kill TT
CT Go to TT
and TT Go To CT
edited 1×, last 23.08.10 09:07:04 pm
Soja, fuck you. Stop fucking begging for you noob fucking scripts. Stop being a fucking retard and learn fucking lua. It isn't hard... I understand you're only 12 year old, no problem, but Lua is such an easy language that even a retard could learn it. So stop fucking beggin' for your goddamn noob fucking idiot scripts. Nobody wants to spoonfed a fkin retarded 12 year old kid.
Admin/mod comment:
better stop raging and flaming NOW or you will receive a community ban! /DC Hi guys! I want one lua script - door, which can open only players, when USGN i write in lua. Please help me!
Sorry for my bad english, i am polish.
Sorry for my bad english, i am polish.
@Soja1997:
Yeah u can make a classes only for 1 team by adding this
Remove the old spawn and add this , this will make classes for team == 2 (For Cs team)
and number 1 (For Tt team)
Yeah u can make a classes only for 1 team by adding this
Code:
1
2
3
2
3
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
if (player(id,"team") == 2) then
function sample.classes.spawn(id)
if (player(id,"team") == 2) then
Remove the old spawn and add this , this will make classes for team == 2 (For Cs team)
and number 1 (For Tt team)
hi i need help with my map script
whats wrong?
ps:
Yellow Banana yes lua isnt hard but someone who isnt good in english like soja or me its problem lua havent polish tutorials teach him it and he wont nonstop ask u!

Code:
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("usebutton","onlyican")
function onlyican(id,x,y)
x="10"
y="1"
if (player(id,"usgn")>16304) then
parse("trigger door2")
end
end
function onlyican(id,x,y)
x="10"
y="1"
if (player(id,"usgn")>16304) then
parse("trigger door2")
end
end
whats wrong?

ps:
YellowBanana has written:
Soja, fuck you. Stop fucking begging for you noob fucking scripts. Stop being a fucking retard and learn fucking lua. It isn't hard... I understand you're only 12 year old, no problem, but Lua is such an easy language that even a retard could learn it. So stop fucking beggin' for your goddamn noob fucking idiot scripts. Nobody wants to spoonfed a fkin retarded 12 year old kid.
Yellow Banana yes lua isnt hard but someone who isnt good in english like soja or me its problem lua havent polish tutorials teach him it and he wont nonstop ask u!
edited 3×, last 24.08.10 09:08:59 pm
Exactly,
"Give a man a fish, and he has food for one day,
Teach him how to fish, and he has food for all his life"
"Give a man a fish, and he has food for one day,
Teach him how to fish, and he has food for all his life"
Code:
now is good 1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("usebutton","onlyican")
function onlyican(id,y,x)
if (x==10) and (y==1) then
if (player(id,"usgn")>16304) then
parse("trigger door2")
end
end
function onlyican(id,y,x)
if (x==10) and (y==1) then
if (player(id,"usgn")>16304) then
parse("trigger door2")
end
end

FaStDiE has written:
Yellow Banana yes lua isnt hard but someone who isnt good in english like soja or me its problem lua havent polish tutorials teach him it and he wont nonstop ask u!
YellowBanana has written:
flame, flame, flame
Yellow Banana yes lua isnt hard but someone who isnt good in english like soja or me its problem lua havent polish tutorials teach him it and he wont nonstop ask u!
Lies. Those cases are the least.
Also, there was a polish guy who sucked very bad at lua and blamed his language until the day he realized that nobody would make his noobish scripts and share with him the credits so he learnt lua.
At first he started making easy scripts and asked for help when he couldn't understand something, maybe you should start doing something too?
EDIT: Oh, Fehuziom was faster, but he is missing an end to close the first if

@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
Flacko has written:
0hh... Thx flacko EDIT: Oh, Fehuziom was faster, but he is missing an end to close the first if 


edit//
flacko i from poland

edit 2//
flacko i can start making polish lua tutorial / help :]
-BLACK_J93- has written:
@Soja1997:
Yeah u can make a classes only for 1 team by adding this
Remove the old spawn and add this , this will make classes for team == 2 (For Cs team)
and number 1 (For Tt team)
Yeah u can make a classes only for 1 team by adding this
Code:
1
2
3
2
3
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
if (player(id,"team") == 2) then
function sample.classes.spawn(id)
if (player(id,"team") == 2) then
Remove the old spawn and add this , this will make classes for team == 2 (For Cs team)
and number 1 (For Tt team)
Very thanks for you its works ;]
why error
? help
attempt to call glotbal 'totable' (a nil value)
Code:
function load(id)
usgn = player(id,"usgn")
if (usgn > 0) then
local usgn = player(id, "usgn")
files = io.open("sys/lua/scelldata/"..usgn..".txt","r")
if(files~=nil) then
msg2(id,"©000255000Your save file found!@C")
msg2(id,"©160160255Your U.S.G.N ID: "..usgn.."@C")
parse('hudtxt2 '..id..' 7 "©000255000Login as: '..usgn..'" 40 415')
for line in io.lines("sys/lua/scelldata/"..usgn..".txt","r") do
local parses = totable(line)
if (tonumber(parses[1])>0) then
yourmon[id] = tonumber(parses[1])
license[id] = tonumber(parses[2])
break
end
end
else
msg2(id,"©255000000Failed to load save!@C")
msg2(id,"©255000000Please check your U.S.G.N account settings!@C")
parse('hudtxt2 '..id..' 7 "©255000000Failed to Load Save" 40 415')
end
end
end
addhook("leave","save")
function save(id)
if (player(id, "usgn") > 0) then
save_data = license[id].." "..yourmon[id]
file = assert(io.open("sys/lua/scelldata/"..usgn..".txt","w"))
file:write(save_data)
file:close()
msg2(id,'©000255001Save Data Successfull!@C')
else
msg2(id,"©255000000Failed to Save!@C")
end
end
? help
attempt to call glotbal 'totable' (a nil value)
Code:
function load(id)
usgn = player(id,"usgn")
if (usgn > 0) then
local usgn = player(id, "usgn")
files = io.open("sys/lua/scelldata/"..usgn..".txt","r")
if(files~=nil) then
msg2(id,"©000255000Your save file found!@C")
msg2(id,"©160160255Your U.S.G.N ID: "..usgn.."@C")
parse('hudtxt2 '..id..' 7 "©000255000Login as: '..usgn..'" 40 415')
for line in io.lines("sys/lua/scelldata/"..usgn..".txt","r") do
local parses = totable(line)
if (tonumber(parses[1])>0) then
yourmon[id] = tonumber(parses[1])
license[id] = tonumber(parses[2])
break
end
end
else
msg2(id,"©255000000Failed to load save!@C")
msg2(id,"©255000000Please check your U.S.G.N account settings!@C")
parse('hudtxt2 '..id..' 7 "©255000000Failed to Load Save" 40 415')
end
end
end
addhook("leave","save")
function save(id)
if (player(id, "usgn") > 0) then
save_data = license[id].." "..yourmon[id]
file = assert(io.open("sys/lua/scelldata/"..usgn..".txt","w"))
file:write(save_data)
file:close()
msg2(id,'©000255001Save Data Successfull!@C')
else
msg2(id,"©255000000Failed to Save!@C")
end
end

Soja1997 has written:
i need script if CT Kill TT
This CT maket
This TT makect
Can make this? script someone plz
This CT maket
This TT makect
Can make this? script someone plz
you did it yourself!
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("kill","killa")
function killa(killer,victim)
if player(killer,"team")==2 and player(victim,"team")==1 then
parse("maket "..killer)
parse("makect "..victim)
end
end
function killa(killer,victim)
if player(killer,"team")==2 and player(victim,"team")==1 then
parse("maket "..killer)
parse("makect "..victim)
end
end
@heocon953
You didn't add finction "totable" to your script
Vectar666 thanks you
and i need next script
no more than 1 predator(terrorist) can you make this?
and i need script
if i use gutbomb to kill change name gutbomb to harpun
and i need next script

no more than 1 predator(terrorist) can you make this?
and i need script
if i use gutbomb to kill change name gutbomb to harpun
Vectar666 has written:
you did it yourself!
@heocon953
You didn't add finction "totable" to your script
Soja1997 has written:
i need script if CT Kill TT
This CT maket
This TT makect
Can make this? script someone plz
This CT maket
This TT makect
Can make this? script someone plz
you did it yourself!
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("kill","killa")
function killa(killer,victim)
if player(killer,"team")==2 and player(victim,"team")==1 then
parse("maket "..killer)
parse("makect "..victim)
end
end
function killa(killer,victim)
if player(killer,"team")==2 and player(victim,"team")==1 then
parse("maket "..killer)
parse("makect "..victim)
end
end
@heocon953
You didn't add finction "totable" to your script
tkx
but you can help me to addd?
function totable()
function load(id)
usgn = player(id,"usgn")
if (usgn > 0) then
local usgn = player(id, "usgn")
files = io.open("sys/lua/scelldata/"..usgn..".txt","r")
if(files~=nil) then
msg2(id,"©000255000Your save file found!@C")
msg2(id,"©160160255Your U.S.G.N ID: "..usgn.."@C")
parse('hudtxt2 '..id..' 7 "©000255000Login as: '..usgn..'" 40 415')
for line in io.lines("sys/lua/scelldata/"..usgn..".txt","r") do
local parses = totable(line)
if (tonumber(parses[1])>0) then
yourmon[id] = tonumber(parses[1])
license[id] = tonumber(parses[2])
break
end
end
else
msg2(id,"©255000000Failed to load save!@C")
msg2(id,"©255000000Please check your U.S.G.N account settings!@C")
parse('hudtxt2 '..id..' 7 "©255000000Failed to Load Save" 40 415')
end
end
end
addhook("leave","save")
function save(id)
if (player(id, "usgn") > 0) then
save_data = license[id].." "..yourmon[id]
file = assert(io.open("sys/lua/scelldata/"..usgn..".txt","w"))
file:write(save_data)
file:close()
msg2(id,'©000255001Save Data Successfull!@C')
else
msg2(id,"©255000000Failed to Save!@C")
end
end
? error

edited 1×, last 25.08.10 01:20:59 pm
