• NutScript - Nutty name, serious framework
    2,778 replies, posted
[QUOTE=GTbrawlers;44543281]I assume there's a lua table somewhere where you can specify what can be spawned from it? It would also be better if we could specify the percentage chance of a certain item spawning or something.[/QUOTE] Actually, it does. It has a rare and regular items setting. Here, let me show you an example. [QUOTE]ITEM.functions.Open = { run = function(itemTable, client, data) if (CLIENT) then return end rareitems = {""} -- Put Unique ID for item HERE regitems = {""} -- Put Unique ID for item HERE[/QUOTE] Now, where it has the {""} put your item unique ID in there, like this. [QUOTE]rareitems = {"test_item"} regitems = {"bla_flala"}[/QUOTE] and if anybody doesn't know, unique ID's can normally be found in item files like so: [QUOTE]ITEM.uniqueID = "base_lootcrate"[/QUOTE] if there is no unique ID, look at the file name. for example, sh_uid would be: uid ------------------------------------- And also, here is where you can change the rarity. [QUOTE] if (chance >= 80) then client:UpdateInv(table.Random(rareitems), 1) elseif (chance >= 50) then client:UpdateInv(table.Random(regitems), 1) elseif (chance < 50) then nut.util.Notify("The crate is empty.", client) end end }[/QUOTE]
[B]Random Item[/B] [url=https://github.com/fayzgolden666/NSPlugins/tree/master/randomitems] [img]http://www.imgbox.de/users/public/images/JGEsBMZSNu.png[/img][/url] -Allows owner to set items to randomly spawn for player using randomizers [B]!Requires [B][U]basic[/U][/B] lua knowledge![/B]
[QUOTE=sants1;44549444][B]Random Item[/B] [url=https://github.com/fayzgolden666/NSPlugins/tree/master/randomitems] [img]http://enmast.com/wp-content/uploads/2011/05/Download-button_small.png[/img][/url] -Allows owner to set items to randomly spawn for player using randomizers [B]!Requires no [B][U]basic[/U][/B] lua knowledge![/B] (sorry for shitty download buttons, image site went down)[/QUOTE] lol, I am so scared by his comment on me. [editline]15th April 2014[/editline] Also, he apparently thinks I wanted that XD. Not even close to what I asked for.
[QUOTE=Halokiller38;44549447]lol, I am so scared by his comment on me. [editline]15th April 2014[/editline] Also, he apparently thinks I wanted that XD. Not even close to what I asked for.[/QUOTE] you didn't ask for that. what the fuck are you smoking? infact you didn't ask for shit. you asked for some simple ass code for npcs to drop an item upon their death, and i posted it on the ns forums. what the fuck?
[QUOTE=Halokiller38;44549447]lol, I am so scared by his comment on me. [editline]15th April 2014[/editline] Also, he apparently thinks I wanted that XD. Not even close to what I asked for.[/QUOTE] [url]http://www.mediafire.com/listen/l82okeecwwkz2ny/blackteawot.wav[/url]
[QUOTE=sants1;44549476][url]http://www.mediafire.com/listen/l82okeecwwkz2ny/blackteawot.wav[/url][/QUOTE] only halokiller would think black tea's voice is dumb.
Halokiller, Can you just try not to post? You're constantly derailing the thread. If you have something personal, Can you stay in PM/Messenger?
Hey, again I now have set up my server with all the fancy stuff (Admin lock, CWu lock, conscript.. and so on..) Now i want to make it extra fancy, means i want to make "working" Kevlar Vests, so here is my question: Is there any way to Give an Item some Health? for Example: Light Kevlar has +25 HP, Normal has +50 HP and Heavy has +75 HP Lua nerds :D :eng101:
[QUOTE=Saxithon;44555979]Hey, again I now have set up my server with all the fancy stuff (Admin lock, CWu lock, conscript.. and so on..) Now i want to make it extra fancy, means i want to make "working" Kevlar Vests, so here is my question: Is there any way to Give an Item some Health? for Example: Light Kevlar has +25 HP, Normal has +50 HP and Heavy has +75 HP Lua nerds :D :eng101:[/QUOTE] Next plugin, thanks for the suggestion! Sants and myself are quickly running out of ideas here.
[QUOTE=Saxithon;44555979]Hey, again I now have set up my server with all the fancy stuff (Admin lock, CWu lock, conscript.. and so on..) Now i want to make it extra fancy, means i want to make "working" Kevlar Vests, so here is my question: Is there any way to Give an Item some Health? for Example: Light Kevlar has +25 HP, Normal has +50 HP and Heavy has +75 HP Lua nerds :D :eng101:[/QUOTE] Giving the item a health suggest deterioration. It is very possible to have it so clothing has an armour value though which I suppose is what you mean.
[QUOTE=GTbrawlers;44558115]Giving the item a health suggest deterioration. It is very possible to have it so clothing has an armour value though which I suppose is what you mean.[/QUOTE] It's actually pretty simple. Tomorrow I'll get it posted by Sants.
Scaling damage would be more better. Of course you need hit sounds for armors.
Armor hitsounds shouldn't be hard to make. It could be a small mix of the flesh impact and the cardboard impact. Cardboard sounds quite fine with that combination in my head. but then again, I didn't hear the cardboard impact for ages
Armor Sound Suggestion Walk - [url]http://hl2.gamebanana.com/sounds/21642[/url]
[B]NPC Item Drop[/B] - [B][U][URL="http://www.mediafire.com/download/pcxr9hna7c7qcq1/npcdrop.rar"]Download[/URL][/U][/B] - This plugin makes it when you kill a zombie it drops a random item from the junk category. If you want to change the category I added a how to in the sh_plugin.lua file on how. If you want something a bit more advanced, such as several categories and be rare, then add me and I will make a version. Here is a little demonstration. [video=youtube;zKF5_P7FQJE]http://www.youtube.com/watch?v=zKF5_P7FQJE[/video]
can we stop with the two second plugins, I don't wanna be an asshole but when a plugin is less than 100 lines of code there is no point in releasing it, if you wanna make little plugins consider starting up a collection and releasing a healthy amount of them also, what are you doing. [lua]function SCHEMA:OnNPCKilled(entity) local class = entity:GetClass() local items = {} for k, v in pairs( nut.item.GetAll() ) do if (v.category == "Junk") then items[k] = v end; end; local RandomItem = table.Random(items) if (class == "npc_zombie" or class == "npc_zombie_torso" or class == "npc_poisonzombie" or class == "npc_fastzombie" or class == "npc_fastzombie_torso") then nut.item.Spawn(entity:GetPos() + Vector(0, 0, 8), nil, RandomItem) end end local PLUGIN = PLUGIN[/lua] WHAT WHAT
[QUOTE=Johnny Guitar;44559632]can we stop with the two second plugins, I don't wanna be an asshole but when a plugin is less than 100 lines of code there is no point in releasing it, if you wanna make little plugins consider starting up a collection and releasing a healthy amount of them also, what are you doing. [lua]function SCHEMA:OnNPCKilled(entity) local class = entity:GetClass() local items = {} for k, v in pairs( nut.item.GetAll() ) do if (v.category == "Junk") then items[k] = v end; end; local RandomItem = table.Random(items) if (class == "npc_zombie" or class == "npc_zombie_torso" or class == "npc_poisonzombie" or class == "npc_fastzombie" or class == "npc_fastzombie_torso") then nut.item.Spawn(entity:GetPos() + Vector(0, 0, 8), nil, RandomItem) end end local PLUGIN = PLUGIN[/lua] WHAT WHAT[/QUOTE] Oh you mean the schema thing, yea I was testing it out at first in sv_hooks.lua and kind of just moved it to a plugin format. Fixed. xs
Why would you whine at people for releasing plugins of any size? You should be happy that people are making plugins in the first place, and learning to develop for this framework, not discouraging them. The framework is coming along nicely now, though, Chessnut.
I think if it can be written in under 5 minutes there is no point to releasing it.
[QUOTE=GTbrawlers;44558115]Giving the item a health suggest deterioration. It is very possible to have it so clothing has an armour value though which I suppose is what you mean.[/QUOTE] exact. this is this what i want.
Is it possible to make it so NPCs don't drop their weapons upon death? Or even better, their weapons turn into script items upon dropping, like in CW?
[QUOTE=Blazer232;44563029]Is it possible to make it so NPCs don't drop their weapons upon death? Or even better, their weapons turn into script items upon dropping, like in CW?[/QUOTE] You can use the hook I posted from Halokiller38's plugin, that should get you started.
[QUOTE=Blazer232;44563029]Is it possible to make it so NPCs don't drop their weapons upon death? Or even better, their weapons turn into script items upon dropping, like in CW?[/QUOTE] iirc they dont drop as scripted weapons, you're just forced to press e to pick them up.
-snip-
[QUOTE=Johnny Guitar;44563863]You can use the hook I posted from Halokiller38's plugin, that should get you started.[/QUOTE] how many times john do i have to tell you i can't script
I have a couple of questions. first, how would I go about disabling basic plugins like recognize, or the one that shows what you're typing over your head, or the stat system? I wanna disable them without modifying the base gamemode because that's awkward as fuck. second, is there a way to create items on demand? as in, make a new item out of a base item with some of its data modified while the gamemode is running?
You can just delete the plugin, or use [url=https://github.com/Chessnut/NutScript/commit/45844e3ca04b1caa847fa122eb57709aba358c4e]the hook Looter added[/url]. As for creating items on demand, there is a nut.item.Register function but you will need to get it networked so it runs shared.
Excuse me, I have a question. Is the BadAir plugin broken? I tried to use it, but the command doesn't do anything. The console is clear, like nothing happend (Both. Server and client) Can you take a look? Maybe it´s only my problem, I don´t know. Thanks.
[QUOTE=Cebolla_Man;44577695]Excuse me, I have a question. Is the BadAir plugin broken? I tried to use it, but the command doesn't do anything. The console is clear, like nothing happend (Both. Server and client) Can you take a look? Maybe it´s only my problem, I don´t know. Thanks.[/QUOTE] Be sure you created 'Box' with the command. The min, max point will the the position where you are standing on.
Yeah, we can't see the time or tokens in the top right and yes we checked to see if it was enabled.
Sorry, you need to Log In to post a reply to this thread.