Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 239 40 41338 339 Next To the start

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
mortyr22 has written
give me lua.and if you speedmod -100 you can shot

Make it your self
Its pretty easy and you need just 2 hooks for that.
attack and parse hooks.

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
wups has written
You can't block the shooting.
The only way is to replacing hit with nothing.

Right. You cant return attacking. ×

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
I need some help wiyh lua again for a fallout mod complete
with maps weapons ect. heres the lua im not finished with it
yet but i get this error msg
LUA ERROR:sys/lua/fallout3mod.lua:56: '=' expected near "fallout"
heres the lua i have:

if(fallout==nil) then fallout = {} end
fallout.mod = {}

fallout.mod.killstolevelup = 5
fallout.mod.creditsperlevel = 10

function fallout.mod.split(t,d)
if not d then d = "[^%s]+" end
local cmd = {}
for word in string.gmatch(t,d) do
table.insert(cmd,word)
end
return cmd
end

function initArray(f,v)
local cmd = {}
for c = 1, f do
cmd[c] = v
end
return cmd
end

function fallout.mod.hudtext2(id,tid,color,txt,x,y)
local toprint = ("©"..color.." "..txt)
parse('hudtxt2 '..id..' '..tid..' "'..toprint..'" '..x.." "..y)
end

function fallout.mod.updatehud(id)
fallout.mod.hudtext2(id,1,"255000000","Exp: "..fallout.mod.kills[id].."/"..fallout.mod.killstolevelup,5,200)
fallout.mod.hudtext2(id,2,"255128000","Level: "..fallout.mod.level[id],5,215)
fallout.mod.hudtext2(id,3,"255255000","Caps: "..fallout.mod.credits[id],5,230)
end

function fallout.mod.openmenu(id,menuid)
if(menuid=="main") then
menu(id,"MAIN MENU,Light Weapons,Heavy Weapons,Melee,Grenades,Armor,Aid,Ammo")
elseif(menuid=="lightweapons") then
menu(id,"Light Weapons,10mm. SubMach.|25,Scoped .44 Magnum|30,Assault Rifle|34,.32 pistol,Laser Rifle|80,Sawed-off Shotgun|30")
elseif(menuid=="heavyweapons") then
menu(id,"Heavy Weapons,Flamer|75,Missle Launcher|80,Fat Man|90,Grenade Launcher|65,Minigun|83,Sniper Rifile")
elseif(menuid=="melee") then
menu(id,"Melee,Pool Cue|12,Ripper|25,Combat Knife|12")
elseif(menuid=="grenades") then
menu(id,"Grenades,Frag Grenade|5,Smoke Grenade|4,Gas Grenade|6")
elseif(menuid=="armor") then
menu(id,"Armor,BHSPower Armor|75,Enclave Armor|80,Recon armor|70")
elseif(menuid=="aid") then
menu(id,"Aid,Stimpack|20,Beer|15,Med-X|16,Pscycho|13,Wine|16,Purified Water|17")
elseif(menuid=="ammo") then
menu(id,"Ammo,Primary Ammo|5,Secondary Ammo|6")
end
end

addhook("serveraction","fallout.mod.serveraction")
fuction fallout.mod.serveraction(id,action)
if(action == 1) then
fallout.mod.openmenu(id,"main")
end
end
I know its not complete but i dont think thats the problem pls help

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
playa slaya has written
I need some help wiyh lua again for a fallout mod complete
with maps weapons ect. heres the lua im not finished with it
yet but i get this error msg
LUA ERROR:sys/lua/fallout3mod.lua:56: '=' expected near "fallout"


Dude, you're just editing my script

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
This is wrong:
1
2
3
4
5
6
addhook("serveraction","fallout.mod.serveraction")
f[u]uc[/u]tion fallout.mod.serveraction(id,action)
if(action == 1) then
fallout.mod.openmenu(id,"main")
end
end


It should be like this:
1
2
3
4
5
6
addhook("serveraction","fallout.mod.serveraction")
[u]function[/u] fallout.mod.serveraction(id,action)
if(action == 1) then
fallout.mod.openmenu(id,"main")
end
end

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
sry i did not ask.but i wasnt going to upload it without your permission but use it for myself.oh and pm me if care if i upload it.thx and it should have the gfx and other stuff done in a few days or a week or two(because of shcool)
edited 1×, last 18.08.09 04:37:42 am

old Re: Lua Scripts/Questions/Help

Zune5
COMMUNITY BANNED Off Offline

Quote
playa slaya, put your stuff in 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
if(fallout==nil) then fallout = {} end 
fallout.mod = {} 

fallout.mod.killstolevelup = 5 
fallout.mod.creditsperlevel = 10 

function fallout.mod.split(t,d) 
if not d then d = "[^%s]+" end 
local cmd = {} 
for word in string.gmatch(t,d) do 
table.insert(cmd,word) 
end 
return cmd 
end 

function initArray(f,v) 
local cmd = {} 
for c = 1, f do 
cmd[c] = v 
end 
return cmd 
end 

function fallout.mod.hudtext2(id,tid,color,txt,x,y) 
local toprint = ("©"..color.." "..txt) 
parse('hudtxt2 '..id..' '..tid..' "'..toprint..'" '..x.." "..y) 
end 

function fallout.mod.updatehud(id) 
fallout.mod.hudtext2(id,1,"255000000","Exp: "..fallout.mod.kills[id].."/"..fallout.mod.killstolevelup,5,200) 
fallout.mod.hudtext2(id,2,"255128000","Level: "..fallout.mod.level[id],5,215) 
fallout.mod.hudtext2(id,3,"255255000","Caps: "..fallout.mod.credits[id],5,230) 
end 

function fallout.mod.openmenu(id,menuid) 
if(menuid=="main") then 
menu(id,"MAIN MENU,Light Weapons,Heavy Weapons,Melee,Grenades,Armor,Aid,Ammo") 
elseif(menuid=="lightweapons") then 
menu(id,"Light Weapons,10mm. SubMach.|25,Scoped .44 Magnum|30,Assault Rifle|34,.32 pistol,Laser Rifle|80,Sawed-off Shotgun|30") 
elseif(menuid=="heavyweapons") then 
menu(id,"Heavy Weapons,Flamer|75,Missle Launcher|80,Fat Man|90,Grenade Launcher|65,Minigun|83,Sniper Rifile") 
elseif(menuid=="melee") then 
menu(id,"Melee,Pool Cue|12,Ripper|25,Combat Knife|12") 
elseif(menuid=="grenades") then 
menu(id,"Grenades,Frag Grenade|5,Smoke Grenade|4,Gas Grenade|6") 
elseif(menuid=="armor") then 
menu(id,"Armor,BHSPower Armor|75,Enclave Armor|80,Recon armor|70") 
elseif(menuid=="aid") then 
menu(id,"Aid,Stimpack|20,Beer|15,Med-X|16,Pscycho|13,Wine|16,Purified Water|17") 
elseif(menuid=="ammo") then 
menu(id,"Ammo,Primary Ammo|5,Secondary Ammo|6") 
end 
end 

addhook("serveraction","fallout.mod.serveraction") 
fuction fallout.mod.serveraction(id,action) 
if(action == 1) then 
fallout.mod.openmenu(id,"main") 
end 
end

old Re: Lua Scripts/Questions/Help

wups
User Off Offline

Quote
I sucks at math and wonder how can i fix os.clock() too return hh:mm:ss instead of seconds.

F = os.clock()
F = math.ceil(F)
?? calculate F to hh:mm:ss
edited 1×, last 18.08.09 11:09:27 am

old HELP!!

craza424
User Off Offline

Quote
I need a script, can anyone write a script and put the link on here, on the script I want to spawn with super armor, laser, flamethrower (i know thats more than 1), rpg launcher, night vision and every type of grenade (unlimited).
Can anyone make that?
∗∗∗ thnx ∗∗∗
P.S. I want the stuff to spawn on only the person who made the server. thnx

old Re: Lua Scripts/Questions/Help

RedPillow
User Off Offline

Quote
Craza is requesting a hack here?

You want to make a script...which...umm...spams useless crap --> in this case weapons to server admin/owner...

That is just LAME

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
wups has written
I sucks at math and wonder how can i fix os.clock() too return hh:mm:ss instead of seconds.

F = os.clock()
F = math.ceil(F)
?? calculate F to hh:mm:ss


Lua's super über manual has written
os.date ([format [, time]])

Returns a string or a table containing date and time, formatted according to the given string format.

If the time argument is present, this is the time to be formatted (see the os.time function for a description of this value). Otherwise, date formats the current time.

If format starts with '!', then the date is formatted in Coordinated Universal Time. After this optional character, if format is the string "*t", then date returns a table with the following fields: year (four digits), month (1--12), day (1--31), hour (0--23), min (0--59), sec (0--61), wday (weekday, Sunday is 1), yday (day of the year), and isdst (daylight saving flag, a boolean).

If format is not "*t", then date returns the date as a string, formatted according to the same rules as the C function strftime.

When called without arguments, date returns a reasonable date and time representation that depends on the host system and on the current locale (that is, os.date() is equivalent to os.date("%c")).
To the start Previous 1 239 40 41338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview