so I’ve been trying to learn LUA lately and im making slow but somewhat acceptable progress considering its my first scripting language ever.
but I decided to gauge my progress by taking a simple wallhack and optimizing it to show item names and class and eventually player model color that changes depending on their job (if dark rp). but I’m running into a problem
first of all, I’m avoiding functions as much as possible here because I just get caught up in them a lot and confuse arguments with the value that calls them up. so even though it’s somewhat embarrassing, do you have any methods to help you remember how a function is set up in defining it and calling it? like what format would it take to define what it’s call value is? would it be
--to define function hello (x) x-6 end --to call hello(2) --output -4
so if that’s somewhat oddly worded sorry I’m on a phone right now
in order to add the text information of an object I use ‘draw.DrawText’
this works (or should) but in order to call it I have to have the x and y coordinates of where it is displayed. I want it to show below the object so I just subtract from the y coordinate, but I’m confused in the fact that Entity:GetPos returns a vector as x,y. I need it to return ONLY x and then in another call ONLY y. I took a guess and tried Entity:GetPos.X but to no avail. anyone know how to get only one coordinate? I’ve considered just using GetPos and having the values placed on a table to be called when needed in the arguments of DrawText, but I’m new still and have no idea how this is done
again, sorry for any errors or confusion. I’m on a phone and I’ll fix problems I see when I get home. if you need to see the part of code im working on let me know and I’ll put it up