• NutScript 1.1 - A free role-play framework
    239 replies, posted
Change drug:Use(item.player, item.player) to drug:Use(item.player, item.player, USE_ON, 1)
Works like a charm, thank you! Again, thanks a ton for the framework + being helpful and stuff.
Is there a custom class plugin at all?
no
Any nutscript coders to throw money at for some small work?
[QUOTE=jmayo;47464998]I need some help with this, the door in rp_city17_build192 which leads into the combine citadel won't open even if I'm a CP or Overwatch member. It worked with the older version but for 1.1 version, it does jack. [t]http://cloud-4.steamusercontent.com/ugc/34115979021775396/E86B22056FC35657C0393D080FAF3F53EA339528/1024x640.resizedimage[/t][/QUOTE] [url]http://nutscript.rocks/community/showthread.php?tid=157[/url] - try this
Love NS HL2RP. By the way, video make me lmao. :)
-snip-
So I'm trying to make it so that the player can't equip this weapon if they don't have a certain item in their inventory. This is the code that I'm using: [code] ITEM.name = "Active Camouflage Augment" ITEM.desc = "An augment that projects an active 'smart field' of camouflage around the user, making them mostly invisible." ITEM.model = "models/Items/battery.mdl" ITEM.class = "weapon_stealthcamo" ITEM.price = 3000 ITEM.flag = "c" ITEM.width = 1 ITEM.height = 1 ITEM.functions.Use = { onRun = function(item) if (character and character:getInv() and !character:getInv():hasItem("interface")) then client:notify(("You lack a neural interface.")) return false end } [/code] But no matter what I do, I'm faced with this error: [code] [ERROR] gamemodes/cyberpunk/plugins/cybernetics/items/sh_stealthaug.lua:19: unexpected symbol near '}' 1. unknown - gamemodes/cyberpunk/plugins/cybernetics/items/sh_stealthaug.lua:0 [/code] Anything that could be a probable cause of this...? The only thing on line 19 is the bracket, as far as I know - or am I just doing it entirely wrong?
1.) You need to add local character = item.player:getChar(). Stop pulling variables from your ass. 2.) You forgot an 'end' which is why you should properly indent your code so you can see these mistakes.
I've heeded your words and cleaned up my code + added the necessary edits. The item functions fine now as it needs to, and won't be 'used' unless the player has the Interface item. There's a problem, though, with the one problem being that it doesn't actually equip the SWEP upon use and the item is consumed by the inventory without it actually doing anything. I'm 99% sure this is because I added the ITEM.functions.Equip function to check if the item is in the inventory, which would invalidate the weapon base's natural 'equip' functions. Any tips on how I could get it working, or if I could at all? The cleaned-up script: [code]ITEM.functions.Use = { ITEM.name = "Active Camouflage Augment" ITEM.desc = "An augment that projects an active 'smart field' of camouflage around the user, making them mostly invisible." ITEM.model = "models/Items/battery.mdl" ITEM.class = "weapon_stealthcamo" ITEM.price = 3000 ITEM.flag = "c" ITEM.width = 1 ITEM.height = 1 local effectText = { "You lack a cybernetic neural interface, and thus cannot install this augment.", } ITEM.functions.Equip = { onRun = function(item) local character = item.player:getChar() if (character and character:getInv() and !character:getInv():hasItem("interface")) then item.player:ChatPrint(table.Random(effectText)) return false end end } [/code]
-snip- ignore this entirely, i'm stupid and should read before i post
If you don't want to overwrite it then use ITEM:hook("Equip", function(item) stuff end)
-snip- Nevermind, the newest Nutscript update fixed this. Thanks, Chessnut.
(Apologies if, these appears "noobish") How do I set my group as the Owner, within Nutscript 1.1 I had looked on google, and one post said to use the server's console, but another said that Nutscript 1.1 doesn't follow that.. I decided to come here, since I figured this would have a solid answer. Rather than having a bunch of people claiming different things.
[QUOTE=Kamucaz;48081826](Apologies if, these appears "noobish") How do I set my group as the Owner, within Nutscript 1.1 I had looked on google, and one post said to use the server's console, but another said that Nutscript 1.1 doesn't follow that.. I decided to come here, since I figured this would have a solid answer. Rather than having a bunch of people claiming different things.[/QUOTE] nutscript 1.1 simply takes admins from whatever admin mod is running, so just make your self admin/superadmin/owner in your admin mod and then that should be all you need to do
Thanks :) For the Admin-Mod, should I use ULX? (Not sure, what I should use)
[QUOTE=Kamucaz;48082621]Thanks :) For the Admin-Mod, should I use ULX? (Not sure, what I should use)[/QUOTE] i use chessnut's moderator but anything will work, i'd use whatever you like the most I suppose
How do I use chessnut's moderator, to make me the owner; I have chessnut's moderator installed and (for some reason, not sure why) I assumed It'd automatically set me as the owner. so, how exactly do I set myself as Owner (with using chessnut's moderator) (Apologies, I'm new NutScript)
mod_setrank <name> owner
I put my name(steam nickname) and I get greeted with "You did not enter a valid player" Do I put the name of my account(that I log in with)?
You put whatever name shows up on the scoreboard
I'm assuming, you mean my character's name. I do that, and I still get back "You did not enter a valid player" (I'm currently on that player, on the server).
Show exactly what you're typing in chat
I figured out my problem, I kept on putting quotation marks around my name. However, It sets me to user. (What I'm typing) mod_setrank Joseph LaPresti owner and I get in return "You have set the usergroup of Joseph LaPresti to user"
This is the NutScript thread, not the moderator thread. Just use mod_setrank LaPresti owner
Is there any way presently that I could create a flag to allow access to a console command? For example, if I wanted somebody with the flag "X" to be able to use the "ToggleHud" command, is there any file i could edit to do that as-is in Nutscript right now?
[url]https://github.com/Chessnut/NutScript/wiki/nut.flag[/url]
Hey Chessnut, I'm having an issue with the Business tab which I'd rather address here instead of Github because it's probably only affecting me. If there are more than 2 rows of items, the 3rd row gets cut off, and there's no scroll bar. I'm running a slightly modified version of the modernrp schema off of a local listen server. Is it because I am testing Nutscript with a listen server? There are no immediate errors in console, and I've disabled all addons excluding the Nutscript content. Are you able to replicate this? [t]http://i.imgur.com/Uc3GrMu.png[/t] [t]http://i.imgur.com/mcBxX03.png[/t]
Might be a dumb question, but I'm not gonna get anywhere if I don't ask. I'm fiddling with Nutscript 1.1 after a long while, and I'm trying to use the in-game Config menu to change the Menu Music. By default, I'm sure most of you know, the default menu music is located at 'music/hl2_song2.mp3'. I added my own music which I put into a folder in my Addons, to which I would assume the line would be along the lines of 'addons/warneverchangescontent/music/menutheme.mp3' However when I enter this it does not stick. It will say it has set the music to said line, but when I go back in the Config menu to double check it's still set to 'music/hl2_song2.mp3'. Any suggestions or aid would be greatly appreciated, as this is quite an annoyance. UPDATE: I found this console error to pop up when entering the Menu. 2 BASS_ERROR_FILEOPEN
Sorry, you need to Log In to post a reply to this thread.