• Help with 'IncludeCSLua()' / 'include': TTT
    2 replies, posted
Hey, I'm pretty new to coding and I'm working on my first addon. What I want to do is make it such that when the Detective updates a tag on the scoreboard (done through the sb_info.lua file pastebinned here, use '-----' to find the section highlighted), it updates for all players. Below is a screencap of my code so far, the idea is to call the check to see if a player is detective whenever a player uses PANEL:DoClick() in sb_info.lua, then write which player they selected and what tag they picked as a string and table and send it to the server, then send it to all but the Detective, then force the client to run a function which sets the selected player tag to the tag specified. https://files.facepunch.com/forum/upload/257694/b071a64e-0e77-48e4-bb69-f0188fb03959/Capture.PNG My problem is simply that I am unsure how to go about making the check whenever someone calls PANEL:DoClick(), I've tried 'IncludeCSLua()' along with just 'include' but I always am given the 'incorrect file path' error, likely due to it running from the addon directory and not able to find it via the absolute directory either. If I'm just being stupid and consistently specifying the incorrect file path, I'll leave it here for someone to just correct me: C:\Program Files (x86)\Steam\steamapps\username\garrysmod\garrysmod\gamemodes\terrortown\gamemode\vgui\sb_info.lua
You have to edit this function (and the right click one) and you are using net library wrong: Net Library Usage, Net Library Example
Thanks bud, think I got it working - will need to test with actual players.
Sorry, you need to Log In to post a reply to this thread.