Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Pilot last won the day on November 28 2017

Pilot had the most liked content!

Community Reputation

1 Neutral

1 Follower

About Pilot

  • Rank
    Junior Member
  1. Nutscript Animation List

    Solution: You have to look at the Gmod base gamemode to see the list of animations that they converted from HL2MP to MP Thanks.
  2. Nutscript Animation List

    So, from sh_anims we see that the animations that are translated are: [ACT_MP_STAND_IDLE] [ACT_MP_CROUCH_IDLE] [ACT_MP_WALK] [ACT_MP_CROUCHWALK] [ACT_MP_RUN] But these aren't the only animations used. I was wondering if I could get a list of all the animations Nutscript would need to translate. Or maybe to get an explanation as to why these specific animations are the ones needing to be translated when Gmod specifically says that playermodels use ACT_HL2MP_* animations.
  3. I'm trying to make a plugin that allows players to make factions in-game. And I got so close to the point that the gamemode is able to register all this information for the faction, but then when I set the player to that faction it doesn't show up on the scoreboard as if the faction doesn't exist. My question is, how do you register factions? Here's the relevant piece of code for this: net.Receive("nut_mfactionchoices", function(length, client) local factionchoices = net.ReadTable() local character = client:getChar() for k, v in ipairs(ents.FindByClass("nut_campfire")) do v:setNetVar("factionname", factionchoices[1]) v:setNetVar("factiondesc", factionchoices[2]) v:setNetVar("factioncolor", factionchoices[3]) v:setNetVar("factionleader", factionchoices[4]) -- nut.faction.teams[character.vars.faction] GETS YOUR FACTION -- nut.faction.indices GETS ALL FACTIONS NON-NUMERICALLY -- nut.faction.teams GETS ALL FACTIONS NUMERICALLY local FACTION = {index = table.Count(nut.faction.teams) + 1, isDefault = false} FACTION.name = v:getNetVar("factionname") FACTION.desc = v:getNetVar("factiondesc") FACTION.color = Color(255,255,255,255) FACTION.models = { "models/lazarusroleplay/heads/female_african.mdl", "models/lazarusroleplay/heads/female_asian.mdl", "models/lazarusroleplay/heads/female_caucasian.mdl", "models/lazarusroleplay/heads/female_hispanic.mdl", "models/lazarusroleplay/heads/male_african.mdl", "models/lazarusroleplay/heads/male_asian.mdl", "models/lazarusroleplay/heads/male_caucasian.mdl", "models/lazarusroleplay/heads/male_hispanic.mdl" } PrintTable(FACTION) character:setFaction(FACTION.index) --After this the player doesn't show up on the scoreboard. end end) end Also PrintTable (FACTION) prints this, which shows that a faction IS being made: color: a = 255 b = 255 g = 255 r = 255 desc = FactionDescIMadeIngame index = 11 isDefault = false models: 1 = models/lazarusroleplay/heads/female_african.mdl 2 = models/lazarusroleplay/heads/female_asian.mdl 3 = models/lazarusroleplay/heads/female_caucasian.mdl 4 = models/lazarusroleplay/heads/female_hispanic.mdl 5 = models/lazarusroleplay/heads/male_african.mdl 6 = models/lazarusroleplay/heads/male_asian.mdl 7 = models/lazarusroleplay/heads/male_caucasian.mdl 8 = models/lazarusroleplay/heads/male_hispanic.mdl name = FactionNameIMadeIngame Any ideas from expert dudes?
  4. Sending different chat lines

    I'm trying to make it so that if a listener has a different piece of data to the speaker, then another chat line is given to only the listener: for k, v in pairs(SCHEMA.Languages) do nut.chat.register(v, { onChatAdd = function(speaker, text) if speaker:getChar():getBackground() == v then chat.AddText(LocalPlayer(), " says in "..v..", "..'"'..text..'"') else nut.util.notify("You cannot speak "..v..".") end end, onCanHear = function(speaker, listener) --GET LISTENER AND SEND SOMETHING ELSE IF speaker:getChar():getBackground() != listener:getChar():getBackground() end, prefix = {"/"..string.lower(string.gsub(v, "%s", ""))} }) end So right now this basically checks if the language the player is trying to speak is what the player is able to speak and if so does: chat.AddText(LocalPlayer(), " says in "..v..", "..'"'..text..'"') If not it does: nut.util.notify("You cannot speak "..v..".") This works and it's totally fine. But basically now I need to make it so that if a listener does not understand the language the player is speaking then it'll do chat.AddText(LocalPlayer(), " speaks in "..v..".") Although I have no idea where to put that and I tried playing around with onCanHear but I don't understand it well enough to get what I want it to do. Any help?
  5. Setting and getting data using registerVar

    Nah I actually fixed it, all I needed to do next was to add panel.payload.Background = k
  6. Setting and getting data using registerVar

    As an update: I managed to get _background to become a column in SQlite. My issue now is getting nut.char.registerVar to actually set what's in the DComboBox as data. Which I have no idea how that works considering all other instances of nut.char.registerVar in sh_character.lua seems like it just assumes how data is even called. Pretty frusturating
  7. Setting and getting data using registerVar

    I guess I need to set that in nut.char.registerVar specifically when the player chooses an option it needs to save what you chose, but I can't seem to do that while I'm coding in client.
  8. Setting and getting data using registerVar

    Ahh so I added it and data.background still returns a nil value. I tried doing this before too, the only reason I didn't add it this time was because I thought it wasn't needed since I was only using SQlite. That being said I added it as `_background` text NOT NULL,
  9. Setting and getting data using registerVar

    I'm extremely new to doing anything related to SQLite. I know i added _background to the tables in both sh_character.lua and sv_database.lua but where else do I need to add _background?
  10. Hi I'm Pilot

    I am indeed The Caesar of FalloutRP.
  11. Hi I'm Pilot

    Hi I'm Pilot, I've coded for Nutscript since it first came out and I'm pretty sure I was one of the first to have a small HL2RP community using the framework and rebel1324 got on and I told all my members to "BE ON THEIR BEST BEHAVIOR" and then the friendship legacy began between rebel, Chessnut and I. Up until like a few weeks ago I was pretty bad at coding in general, although I'm learning a lot more as I'm venturing on to do a lot of things that I would have otherwise been too timid to approach and I find it JUST SWELL. So yeah...
  12. Steam Name: Pilot Steam ID: STEAM_0:1:26100133 I've been trying for the longest time to create a new variable for a character but it seems I struggle to do two things: Setting a variable to be saved Getting the variable in onValidate to see if the character chose one or not. Here is the code snippet on what I've been working on: nut.char.registerVar("Background", { default = "Unknown", field = "_background", index = 5, onDisplay = function(panel, y) local scroll = panel:Add("DScrollPanel") scroll:SetSize(panel:GetWide(), 260) scroll:SetPos(0, y) local choices = scroll:Add("DComboBox") choices:Dock(BOTTOM) ChoicesList = {} ChoicesList[1] = {"Blackfoot"} ChoicesList[2] = {"Fredonians"} ChoicesList[3] = {"Kaibabs"} ChoicesList[4] = {"Twisted Hairs"} ChoicesList[5] = {"Painted Rock"} ChoicesList[6] = {"Hangdogs"} ChoicesList[7] = {"Western"} choices:SetValue( "Options" ) for k, v in SortedPairs(ChoicesList) do choices:AddChoice(v[1]) choices.OnSelect = function( index, value, data ) panel.payload.Background = k end end end, onValidate = function(value, data, client) if (!data.background) then --Doesn't return the background chosen return false, "needBackground" end end }) From this code snippet !data.background returns a nil value which is the main issue. Here's the full code: https://pastebin.com/k0E3s8t3 Specifically lines 25, 27, 75, 173 are what's edited. This alone would return that _background doesn't exist so I have a sv_database.lua file in which I added _background: https://pastebin.com/V96vp8Kj Specifically line 260