• Need help with a few stupid issues.
    6 replies, posted
garrysmod\addons\tttleveling\lua\autorun\sh_tttlevels.lua [CODE] BodyFoundXP = 20 PlayerKillXP = 40 LevelDifficulty = 2 --2x EXP from previous level, 3x EXP from previous level, etc. ranks = { [1] = { name = "Silver I", image = Material("silver1.png"), }, [2] = { name = "Silver II", image = Material("silver2.png"), }, [3] = { name = "Silver III", image = Material("silver3.png"), }, [4] = { name = "Silver IV", image = Material("silver4.png"), }, [4] = { name = "Silver IV", image = Material("silver4.png"), }, [5] = { name = "Silver Elite", image = Material("silverelite.png"), }, [6] = { name = "Silver EM", image = Material("silverelitem.png"), }, [7] = { name = "Nova I", image = Material("nova1.png"), }, [8] = { name = "Nova II", image = Material("nova2.png"), }, [9] = { name = "Nova III", image = Material("nova3.png"), }, [10] = { name = "Nova IV", image = Material("nova4.png"), }, [11] = { name = "MG", image = Material("mguard.png"), }, [12] = { name = "MG II", image = Material("mguard2.png"), }, [13] = { name = "MGE", image = Material("mguarde.png"), }, [14] = { name = "DMG", image = Material("dmg.png"), }, [15] = { name = "LE", image = Material("le.png"), }, [16] = { name = "LEM", image = Material("lem.png"), }, [17] = { name = "Supreme", image = Material("supreme.png"), }, [18] = { name = "Global Elite", image = Material("globalelite.png"), }, } [/CODE] Server Side: garrysmod\addons\tttleveling\lua\autorun\server\sv_leveling.lua AddCSLuaFile("autorun/client/cl_leveling.lua") AddCSLuaFile("autorun/sh_tttlevels.lua") include("autorun/sh_tttlevels.lua") Client Side: garrysmod\addons\tttleveling\lua\autorun\client\cl_leveling.lua include("autorun/sh_tttlevels.lua") I tried printing the table server side, it works. I tried printing the table client side, it doesn't work. Conclusion: Doesn't exist client side. rankimage = ranks[ply:GetNWInt("playerlvl")].image This has been bugging me for a while now, if Index these values client side, they return nil. Please help me all mighty lua coders.
Seems like it doesn't exist clientside. This is just a rough guess, but maybe you could try networking it to the client?
[QUOTE=Bubbie;50418107]Seems like it doesn't exist clientside. This is just a rough guess, but maybe you could try networking it to the client?[/QUOTE] How would I go about doing that? And doesn't it make sense that it would already be existing client side though?
bump, this is very irritating. I don't want to do anything ineffeciently.
Bump only after 24 hours Try adding [code] error('test') [/code] in your clientside file and seeing if it errors so you can see weather or not the file runs at all
[QUOTE=Coffeee;50421246]Bump only after 24 hours Try adding [code] error('test') [/code] in your clientside file and seeing if it errors so you can see weather or not the file runs at all[/QUOTE] The code is being ran. [editline]30th May 2016[/editline] I feel like this is entirely user error, could someone please help me with this privately. I would post my code here, but I honestly don't want everyone to see it. That would be widely appreciated. Thank you.
None of us are out to steal anyone's code, and besides think about this: how many people would want to take your code, which isn't finished and doesn't even work in its current form, go through the trouble of fixing it, then pass it off as their own? Answer: only you. I mean this with no offense whatsoever, people are generally not interested in incomplete nonfunctional code. At the same time, a massive code dump wouldn't really get you much help either. Here's what I do when I encounter a problem: First and foremost, isolate the problem. Try to make the code as short as possible while still showing the problem. What I usually do is to stop what I'm working on, start with a blank file, and type the most fundamental things that aren't working. After you've done that, you would [I]usually[/I] have 20 lines of code at most. If at this point you can't identify the problem, post the entirety of the problematic code and ask for help. When the problem is in a short sample I am much more likely to try and help, and I can only assume others feel the same.
Sorry, you need to Log In to post a reply to this thread.