• NutScript - Nutty name, serious framework
    2,778 replies, posted
there is so much stuff I want to add but I can't be bothered at the moment.
Can someone help me with this error. [ERROR] gamemodes/harborrp/gamemode/schema/sv_hooks.lua:26: attempt to index loc al 'client' (a nil value) 1. fn - gamemodes/harborrp/gamemode/schema/sv_hooks.lua:26 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183 my code: [CODE] -- Zones Script function Init_Vars() HABORSquare = {Vector(-16111,16111,10312), Vector(-8473,11829,25)} HARBORPos = Vector(13427,14410) end function SCHEMA:GetDefaultInv(inventory, client, data) -- PrintTable(data) to see what information it contains. if (data.faction == FACTION_CITIZEN) then inventory:Add("cid", 1, { Digits = math.random(11111, 99999), Owner = data.charname }) end end --[[ Purpose: Called when the player has spawned with a valid character. --]] function SCHEMA:PlayerSpawn(client) print("Just like regular gamemodes, except we replace GM with SCHEMA.") end local function SCHEMA:PlayerMove() local players = player.GetAll() for k,ply in pairs(players) do local plyPos = ply:GetPos() if plyPos:Distance(HARBORPos) < 4500 or isInBox(plyPos,HABORSquare[1],HABORSquare[2]) then ply:PrintMessage("Harbor") end end end hook.Add("Think", "HarborRP_movement", PlayerMove) [/CODE]
[QUOTE=Hellowar;42047890]-stuff-[/QUOTE] Try removing the client parameter from SCHEMA:PlayerSpawn() Also why don't you just replace SCHEME:PlayerMove() with SCHEME:Think() and remove hook.Add("Think") ?
How i am create my own function on Nutscript ? [CODE] function movePlayer(client) HABORSquare = {Vector(-16111,16111,10312), Vector(-8473,11829,25)} HARBORPos = Vector(13427,14410) PlayerPOS = client:GetPos() Distance = HARBORPos:Distance(PlayerPOS) client:ChatPrint(Distance) end [/CODE]
I don't think you understand how the SCHEMA table works, just treat it like GM. [editline]1st September 2013[/editline] Started on an admin plugin. So far I got slap/kick and ban. Cool thing about ban is that you can specify a string like: 1y5mo2d and it will ban for 1 year, 5 months, and 2 days. Whenever someone is banned and tries to join the server, they will instantly be kicked off rather than waiting until sending client info. The ban time formatting supports: #y = year #mo = month #w = week #d = day #m = minute # = seconds and having just 0 = perm
Would it be possible to make a permadeath plugin? As in, when you die your character is deleted and you must make a new one. Thanks in advance. I can't seem to figure out how to make this work on my own.
As I do for the NPCs carry along when you turn on the server? can you give me some examples?
[QUOTE=Ryx;42056740]Would it be possible to make a permadeath plugin? As in, when you die your character is deleted and you must make a new one. Thanks in advance. I can't seem to figure out how to make this work on my own.[/QUOTE] Try looking at the clockwork code for permadeaths, there should be some similarities like the way it calls on the database. [QUOTE=Hellowar;42057351]As I do for the NPCs carry along when you turn on the server? can you give me some examples?[/QUOTE] Could you please rephrase that?
You should definitely get a website / Forum up and running, for sharing plugins and gamemode discussion etc. Love yer work.
He already has a Wiki / Plugin-Site. See: [url]http://ns.chessnut.info/Plugins[/url] (Also @Chessnut - I sent you a friend request in Steam)
[QUOTE=Ryx;42056740]Would it be possible to make a permadeath plugin? As in, when you die your character is deleted and you must make a new one. Thanks in advance. I can't seem to figure out how to make this work on my own.[/QUOTE] Isn't that used mostly in HL2RP? I think it'd fit better in an standalone schema instead of the base.
[QUOTE=Persious;42066808]Isn't that used mostly in HL2RP? I think it'd fit better in an standalone schema instead of the base.[/QUOTE] It was used in every RP gamemode I've played (that isn't DarkRP). Even Severance, which someone should replicate in NutScript. Was the only RP schema I liked.
[QUOTE=NightmareX91;42066897]It was used in every RP gamemode I've played (that isn't DarkRP). Even Severance, which someone should replicate in NutScript. Was the only RP schema I liked.[/QUOTE] Severance was a zombie schema, right?
[QUOTE=rebel1324;42068139]Severance was a zombie schema, right?[/QUOTE] Yeah Severance was a L4D style of zombie serious roleplay. Included factions like C.E.D.A and survivors. EDIT: Custom models for the zombies made it stand out really.
[QUOTE=GTbrawlers;42068947]Yeah Severance was a L4D style of zombie serious roleplay. Included factions like C.E.D.A and survivors. EDIT: Custom models for the zombies made it stand out really.[/QUOTE] You mean the models for zombies that existed since like 2009~ right? Yeah, it was nothing special.
[QUOTE=GTbrawlers;42068947]Yeah Severance was a L4D style of zombie serious roleplay. Included factions like C.E.D.A and survivors. EDIT: Custom models for the zombies made it stand out really.[/QUOTE] I'm working on some zombie stuffs right now. haha
So I have a wooden pallet made from crafting, I dont want the name or desc to show while its on the floor so players dont see it pop up if they make a barricade from it or something, but when I make it it's fine but not when i [b]look at it[/b] [code][ERROR] lua/includes/modules/draw.lua:73: bad argument #1 to 'GetTextSize' (string expected, got nil) 1. GetTextSize - [C]:-1 2. SimpleText - lua/includes/modules/draw.lua:73 3. SimpleTextOutlined - lua/includes/modules/draw.lua:120 4. DrawText - gamemodes/nutscript/gamemode/sh_util.lua:280 5. unknown - gamemodes/nutscript/gamemode/core/cl_hooks.lua:129 6. Call - gamemodes/nutscript/gamemode/libs/sh_schema.lua:74 7. unknown - gamemodes/nutscript/gamemode/core/cl_hooks.lua:81 [/code]
[QUOTE=scopedbyluck;42071274]So I have a wooden pallet made from crafting, I dont want the name or desc to show while its on the floor so players dont see it pop up if they make a barricade from it or something, but when I make it it's fine but not when i [b]look at it[/b] [code][ERROR] lua/includes/modules/draw.lua:73: bad argument #1 to 'GetTextSize' (string expected, got nil) 1. GetTextSize - [C]:-1 2. SimpleText - lua/includes/modules/draw.lua:73 3. SimpleTextOutlined - lua/includes/modules/draw.lua:120 4. DrawText - gamemodes/nutscript/gamemode/sh_util.lua:280 5. unknown - gamemodes/nutscript/gamemode/core/cl_hooks.lua:129 6. Call - gamemodes/nutscript/gamemode/libs/sh_schema.lua:74 7. unknown - gamemodes/nutscript/gamemode/core/cl_hooks.lua:81 [/code][/QUOTE] Some string is not provided for drawing the name/description. Go check your code.
[QUOTE=scopedbyluck;42071274]So I have a wooden pallet made from crafting, I dont want the name or desc to show while its on the floor so players dont see it pop up if they make a barricade from it or something, but when I make it it's fine but not when i [b]look at it[/b] [code][ERROR] lua/includes/modules/draw.lua:73: bad argument #1 to 'GetTextSize' (string expected, got nil) 1. GetTextSize - [C]:-1 2. SimpleText - lua/includes/modules/draw.lua:73 3. SimpleTextOutlined - lua/includes/modules/draw.lua:120 4. DrawText - gamemodes/nutscript/gamemode/sh_util.lua:280 5. unknown - gamemodes/nutscript/gamemode/core/cl_hooks.lua:129 6. Call - gamemodes/nutscript/gamemode/libs/sh_schema.lua:74 7. unknown - gamemodes/nutscript/gamemode/core/cl_hooks.lua:81 [/code][/QUOTE] make the name and description empty strings?
I keep getting this error from the crafting plugin whenever i open F1 [LUA] [ERROR] gamemodes/nutscript/plugins/crafting/sh_menu.lua:131: attempt to call local 'addButton' (a nil value) 1. unknown - gamemodes/nutscript/plugins/crafting/sh_menu.lua:131 2. Call - gamemodes/nutscript/gamemode/libs/sh_schema.lua:56 3. Init - gamemodes/nutscript/gamemode/derma/cl_menu.lua:82 4. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:153 5. func - gamemodes/nutscript/gamemode/derma/cl_menu.lua:109 6. unknown - lua/includes/modules/net.lua:31 [/LUA] I haven't modified anything in the crafting plugin yesterday it was working fine. What can i do to fix this?
Did you modify anything related to the derma in the framework?
[QUOTE=Chessnut;42072484]Did you modify anything related to the derma in the framework?[/QUOTE] I Added function self:Paint to the cl_business, cl_inventory, cl_settings. EDIT: Would that really affect the crafting menu?
[QUOTE=M60warrior;42072541]I Added function self:Paint to the cl_business, cl_inventory, cl_settings. EDIT: Would that really affect the crafting menu?[/QUOTE] It could have, why are you editing this stuff without knowledge as to what you are doing?
[QUOTE=Johnny Guitar;42073143]It could have, why are you editing this stuff without knowledge as to what you are doing?[/QUOTE] What do you mean by that? I know what i am doing and what i edited works how i wanted it to but the crafting menu doesn't show up in F1. EDIT: I just reverted all the derma files back to their original state and the error still occurs. So it is not anything i did.
Is there any function to play an animation since setforcedanimation is kinda glitchy. [editline]4th September 2013[/editline] [QUOTE=M60warrior;42073204]What do you mean by that? I know what i am doing and what i edited works how i wanted it to but the crafting menu doesn't show up in F1. EDIT: I just reverted all the derma files back to their original state and the error still occurs. So it is not anything i did.[/QUOTE] Stuff doesn't randomly break lmao
See the act plugin.
Can someone code a hunger & thirst plugin? I'd much appreciate it, but unfortunately I'm just a beginner coder; I wouldn't know where to start. [editline]5th September 2013[/editline] Also, what's wrong with this? Citizen anims still aren't assigned properly even with this in sh_schema: local function defineCitizenClass(prefix) for k, v in pairs(file.Find("models/humans/group01/"..prefix.."_*.mdl", "GAME")) do nut.anim.SetModelClass("citizen_"..prefix, "models/humans/group01/"..v) end for k, v in pairs(file.Find("models/humans/group02/"..prefix.."_*.mdl", "GAME")) do nut.anim.SetModelClass("citizen_"..prefix, "models/humans/group02/"..v) end for k, v in pairs(file.Find("models/humans/group03/"..prefix.."_*.mdl", "GAME")) do nut.anim.SetModelClass("citizen_"..prefix, "models/humans/group03/"..v) end for k, v in pairs(file.Find("models/humans/group03m/"..prefix.."_*.mdl", "GAME")) do nut.anim.SetModelClass("citizen_"..prefix, "models/humans/group03m/"..v) end end defineCitizenClass("male") nut.anim.SetModelClass("citizen_male", "models/wehrmacht_02.mdl"); nut.anim.SetModelClass("citizen_male", "models/wehrmacht_04.mdl"); nut.anim.SetModelClass("citizen_male", "models/wehrmacht_06.mdl"); nut.anim.SetModelClass("citizen_male", "models/wehrmacht_08.mdl"); nut.anim.SetModelClass("citizen_male", "models/wehrmacht_09.mdl");
[QUOTE=Foreskin;42090624] code [/QUOTE] Hunger and thirst is already on the cookfood plugin. Only thing I have to do is making hooks for it. Unfortunately, I'm currently fully active irl, Maintaining What I've done in NutScript could be slower.
Alright, so what's wrong with the code I posted? thanks for the quick reply btw. [editline]5th September 2013[/editline] Are you kidding me? Nobody knows?
Are you sure the model actually has the animations?
Sorry, you need to Log In to post a reply to this thread.