• NutScript - Nutty name, serious framework
    2,778 replies, posted
[QUOTE=a-cookie;41968079]uhh its this weird thing called forgive n forget[/QUOTE] oh i wasnt aware that existed thanks :smile: [editline]26th August 2013[/editline] Here are the last two errors: [ERROR] gamemodes/nutscript/plugins/chatbox/sh_chatbox.lua:149: attempt to index field 'content' (a nil value) 1. AddText - gamemodes/nutscript/plugins/chatbox/sh_chatbox.lua:149 2. AddText - gamemodes/nutscript/plugins/chatbox/sh_chatbox.lua:141 3. v - gamemodes/nutscript/gamemode/libs/sh_chatbox.lua:181 4. unknown - lua/includes/modules/hook.lua:82 [ERROR] gamemodes/nutscript/gamemode/items/base/sh_weapon.lua:97: attempt to index local 'itemTable' (a nil value) 1. unknown - gamemodes/nutscript/gamemode/items/base/sh_weapon.lua:97 Timer Failed! [Simple][@gamemodes/nutscript/gamemode/items/base/sh_weapon.lua (line 89)] Frederick O'Connor has ran command 'chargiveitem fred karabiner' You specified an invalid item. Weapon Code: ITEM.base = "weapon_dod_sim_base" ITEM.name = "Karabiner 98k" ITEM.uniqueID = "k98k" ITEM.class = "weapon_sim_kar98k" ITEM.model = Model("models/weapons/b_k98_f.mdl") ITEM.desc = "A bolt-action rifle with a wooden stock and a rather plain design."
ITEM.base refers to the item base, delete that line.
I'll be making my NutScript - Black Mesa Roleplay Test Server public this afternoon! (12 Slots) It's up! You can find it under NutScript - Black Mesa Roleplay
What about ApertureRP. Regular people would be test subjects and white listed would be scientists, guards, etc.
[QUOTE=pilot;41971239]What about ApertureRP. Regular people would be test subjects and white listed would be scientists, guards, etc.[/QUOTE] Doesn't sound that fun at all.
[QUOTE=Eldeos;41972702]Doesn't sound that fun at all.[/QUOTE] Yeah...but, I'm trying to think how it would work. I feel like it would be somewhat similar to Black Mesa just...with different roles.
[QUOTE=Eldeos;41972702]Doesn't sound that fun at all.[/QUOTE] hl2rp 2.0??? rape rp simulation 2013
[QUOTE=LauScript;41973886]hl2rp 2.0??? rape rp simulation 2013[/QUOTE] I've always wanted a server dedicated to ERP:(
Man I can not get much made with this and it's giving me mind grains, just need to...ask for help if I can. First off. I made a faction and a class for it, but when I try to whitelist the player it tells me that I gave an invalid faction. Another thing, I make a simple item but when I try to spawn it it's not in the buisness menu. Or in the vendor list. And the last news, I am currently trying to optimize the GUI and I'm learning it as I go so thats a thumbs up! Anyway, anyone got any help for this? And most of the script I made was just renditions of other ones in the examples, but changed it to my fitting.
[QUOTE=pilot;41975275]Man I can not get much made with this and it's giving me mind grains, just need to...ask for help if I can. First off. I made a faction and a class for it, but when I try to whitelist the player it tells me that I gave an invalid faction. Another thing, I make a simple item but when I try to spawn it it's not in the buisness menu. Or in the vendor list. And the last news, I am currently trying to optimize the GUI and I'm learning it as I go so thats a thumbs up! Anyway, anyone got any help for this? And most of the script I made was just renditions of other ones in the examples, but changed it to my fitting.[/QUOTE] Wanna pm me your faction and class ill see if i can fix it?
Do i put this on garrysmod/garrysmod/gamemodes? because when i do it, it doesnt appear ;l
[QUOTE=CounterCraftz;41975683]Do i put this on garrysmod/garrysmod/gamemodes? because when i do it, it doesnt appear ;l[/QUOTE] With the new steam pipe put in steam/steamapps/common/gmod/gmod/gamemodes
[QUOTE=ds;41975867]With the new steam pipe put in steam/steamapps/common/gmod/gmod/gamemodes[/QUOTE] I did with NutScript-master file folder but it didnt appear in my gamemodes section D:
[QUOTE=CounterCraftz;41975889]I did with NutScript-master file folder but it didnt appear in my gamemodes section D:[/QUOTE] rename it too "nutscript" make sure you have the schema "sample" in gamemodes too
okay i renamed it but i dont see "sample" anywhere into my gamemodes tab [IMG]http://i.imgur.com/Mdxtlf9.png[/IMG] and i restarted gmod
Did you download it?
Yes i downloaded Nutscript from gibhut and sample no
ITEM.name = "Karabiner 98k" ITEM.uniqueID = "k98k" ITEM.class = "weapon_sim_kar98k" ITEM.model = Model("models/weapons/b_k98_f.mdl") ITEM.desc = "A bolt-action rifle with a wooden stock and a rather plain design." What do I need to add to make this equippable and shootable? Right now it appears as miscellaneous and is unequippable.
[QUOTE=CounterCraftz;41976131]Yes i downloaded Nutscript from gibhut and sample no[/QUOTE] Facepalm, you dont run nutscript you run the schema which is sample. Download sample and put it in the same gamemodes folder.
[QUOTE=hooghoog;41976171]ITEM.name = "Karabiner 98k" ITEM.uniqueID = "k98k" ITEM.class = "weapon_sim_kar98k" ITEM.model = Model("models/weapons/b_k98_f.mdl") ITEM.desc = "A bolt-action rifle with a wooden stock and a rather plain design." What do I need to add to make this equippable and shootable? Right now it appears as miscellaneous and is unequippable.[/QUOTE] First you need a base for the weapon, and second theres more too it for instance once you finish the base the first top of the actual weapon code would be something like [code] if (SERVER) then SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false end if ( CLIENT ) then SWEP.PrintName = "SMG" SWEP.Author = "scoped" SWEP.Instructions = "Base Weapon." SWEP.Contact = "" SWEP.DrawAmmo = false SWEP.DrawCrosshair = false SWEP.ViewModelFOV = 50 SWEP.ViewModelFlip = false SWEP.ShowViewModel = true SWEP.ShowWorldModel = true end SWEP.Base = "hl2_base" SWEP.Category = "scoped" SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.Slot = 1 // Slot in the weapon selection menu SWEP.SlotPos = 1 // Position in the slot SWEP.ViewModel = "models/weapons/v_smg1.mdl" SWEP.WorldModel = "models/weapons/w_smg1.mdl" SWEP.HoldType = "pistol" SWEP.Primary.Sound = Sound( "Weapon_SMG.Single" ) SWEP.Primary.Recoil = 1 SWEP.Primary.RecoilMax = { vmin = -0.1, vmax = -0.4, hmax = -0.2, hmin = 0, } SWEP.Primary.ClipSize = 30 // Size of a clip SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * 5 // Default number of bullets in a clip SWEP.Primary.Automatic = true // Automatic/Semi Auto SWEP.Primary.Delay = 0.07 SWEP.Primary.Damage = 30 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0.01 SWEP.Primary.Ammo = "pistol" [/code]
[QUOTE=ds;41976279]Facepalm, you dont run nutscript you run the schema which is sample. Download sample and put it in the same gamemodes folder.[/QUOTE] kk ;p
NutScript doesn't work on singleplayer.
I am in love with Nutscript now. I got a few things working and actually started to learn it. I actually love this more then Clockwork.
[QUOTE=Eldeos;41977555]NutScript doesn't work on singleplayer.[/QUOTE] Well he could be running it on a listen server
[QUOTE=Chessnut;41977750]Well he could be running it on a listen server[/QUOTE] [img]http://i.imgur.com/Mdxtlf9.png[/img] it sounds and looks like hes trying to run it like you run sandbox not on a listen server, that is
The listen server (Start Multiplayer) shares the gamemode selector with Sandbox. If you want your schema to show up on the list, add "menusystem" "1" to your sample.txt (or whatever you named it) so it looks similar to this: [code] "Gamemode" { "base" "nutscript" "title" "My Schema" "author" "You" "menusystem" "1" } [/code]
How would I go about making a cl_(file) from nutscript/gamemode/derma be called with an item from (myschema)/plugins/(myplugin)/items/sh_(file) I got the whole: [CODE]ITEM.functions = {} ITEM.functions.Use = { } [/CODE] in the sh_(file) and I want it to call: [CODE] function something() local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 100, 100 ) DermaPanel:SetSize( 300, 200 ) DermaPanel:SetTitle( "My new Derma frame" ) DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( true ) DermaPanel:ShowCloseButton( true ) DermaPanel:MakePopup() end[/CODE] in the cl_(file) to test if it works.
[QUOTE=scopedbyluck;41976288]--SNIP--[/QUOTE] If you have a look at his quote, all that code is the purpose of "ITEM.class = "weapon_sim_kar98k" If you use an ITEM.class then that allows you to have the actual swep file in the "schema/entities/weapons" directory. ------------------------------------------------ As for the item file you still need to include the following lines of code. [code] ITEM.hasFlashlight = true ITEM.loweredOrigin = Vector(3, 0, -4) ITEM.loweredAngles = Angle(0, 45, 0) ITEM.attachmentBone = "ValveBiped.Bip01_Spine" ITEM.attachmentOffsetAngles = Angle(0, 0, 0) ITEM.attachmentOffsetVector = Vector(-2, 5, 4) [/code] I don't think the "ITEM.hasFlashlight = true" code will work on this but I may be able to add that to the base (That means that the weapon automatically has a flashlight attached). As for the rest I think you can work it out but above are the relevant vectors for a shotgun / assault rifle which can be holstered to be shown on the back. ------------------------------------------------- On an unrelated note to my post, can someone post an [B]example file for clothing that uses the nutscript clothing base[/B]? I can't seem to get it to work using "ITEM.replacement" etc EDIT: Also further on the subject of weapons. When spawning a weapon from the "weapons" menu and likely from the "entities" menu also, the item appears in your "inventory" with your hands and keys etc but when you equip the weapon you cannot raise it, same thing with the fists. Any ideas?
[QUOTE=pilot;41978780]How would I go about making a cl_(file) from nutscript/gamemode/derma be called with an item from (myschema)/plugins/(myplugin)/items/sh_(file) I got the whole: [CODE]ITEM.functions = {} ITEM.functions.Use = { } [/CODE] in the sh_(file) and I want it to call: [CODE] function something() local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 100, 100 ) DermaPanel:SetSize( 300, 200 ) DermaPanel:SetTitle( "My new Derma frame" ) DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( true ) DermaPanel:ShowCloseButton( true ) DermaPanel:MakePopup() end[/CODE] in the cl_(file) to test if it works.[/QUOTE] If something() is a global function (no local prefix), then just add to your item: [lua] if (CLIENT) then ITEM:Hook("Use", function() something() end) end [/lua]
[QUOTE=Chessnut;41979379]If something() is a global function (no local prefix), then just add to your item: [lua] if (CLIENT) then ITEM:Hook("Use", function() something() end) end [/lua][/QUOTE] I tried, I put the: [CODE]if (CLIENT) then ITEM:Hook("Use", function() something() end) end[/CODE] Right under the ITEM script. To be exact under: [CODE]ITEM.functions.Use = { }[/CODE] No luck though.
Sorry, you need to Log In to post a reply to this thread.