You may also reconsider how your weapon works (this would be the better and cleaner solution obviously!). Maybe you can give like 10 shots per use or something like that. Highly depends on the weapon and how it works of course.
Forum
Carnage Contest Lua Scripts/Questions/HelpYou may also reconsider how your weapon works (this would be the better and cleaner solution obviously!). Maybe you can give like 10 shots per use or something like that. Highly depends on the weapon and how it works of course.
DC has written
It's "just" 99 because you never need a higher amount under "normal" circumstances for a "normal" weapon (considering that normal weapons are only used max a few times per round and that a match normally doesn't have that many rounds). 99 is already a very high value which should never be required. So yes, you would somehow have to script your own counter if you need an even higher amount.
You may also reconsider how your weapon works (this would be the better and cleaner solution obviously!). Maybe you can give like 10 shots per use or something like that. Highly depends on the weapon and how it works of course.
You may also reconsider how your weapon works (this would be the better and cleaner solution obviously!). Maybe you can give like 10 shots per use or something like that. Highly depends on the weapon and how it works of course.
Well yea, i guess so. Still, that would be better for thing that we doing right now.
Yep. I just wanted a machinegun with 200 ammo acting like normal one, so it wouldnt work for him the way it should.
Anyway, thanks for making this one clear
1
local file = io.open("path/file", "w \ r")
Lekken has written
Is it possible to write\read variables from a file? I used in mission_start(), but got an error "attempt to call field 'open' (a nil value)".
1
local file = io.open("path/file", "w \ r")
io libraries(and other like os, etc.) is disabled in Carnage Contest.
DC has written
I don't recommend to perform any file IO operations in Carnage Contest scripts.
Why?
CS2D allows you to dofile, and even saving your data somewhere (was it in tibia?), why CC does not allow this?
It would really help to write/read to/from file. REALLY help.
MikuAuahDark has written
io libraries(and other like os, etc.) is disabled in Carnage Contest.
I'm afraid not. One of my script uses os.time thingy (Blazzing guy made it for me a really long time ago when i didnt know how to do timers) and it works, although DC said it wouldnt, or it is not recomended, really long time ago, so i do not properly remember.
Quote
Lua IO functions disabled (potential security vulnerability)
Lua OS.execute function disabled (potential security vulnerability)
Lua OS.execute function disabled (potential security vulnerability)
DC has written
CS2D scripts are running on the server only and they are not transferred automatically (except for map scripts). CC scripts run everywhere. You could easily write and distribute CC weapons which completely destroy the entire system when they are loaded.
So it is not possible in CC to store custom values in a file? (in-game variables resets after you close the game)
Maybe will allow to read and write file in mission folder only?
EDIT (2016.07.09): Is it possible to have a 'negative' effect on the screen?
I think CC doesnt have that ability ._.
edited 4×, last 09.07.16 12:44:00 pm