Garry's Mod
Help with code!
Submitted by PHM_P, 13-01-2022, 07:58 PM, Thread ID: 231005
Thread Closed
[font=Consolas, "Courier New", monospace]Heeeeelp me please![/font]
error:
[font=Consolas, "Courier New", monospace]https://ibb.co/2tn6DBB[/font]
[font=Consolas, "Courier New", monospace]
[/font]
error:
[font=Consolas, "Courier New", monospace]https://ibb.co/2tn6DBB[/font]
[font=Consolas, "Courier New", monospace]
[/font]
Code:
function ENT:Draw()
self:DrawModel()
local ang = self:GetAngles()
local pos = self:GetPos()+ang:Up()*15+ang:Forward()*35
local mypos = LocalPlayer():GetPos()
local dist = pos:Distance(mypos)
local ID = self:GetId() or nil
if dist > 350 or (mypos - mypos):DotProduct(LocalPlayer():GetAimVector()) < 0 then
return -- fancy math says we dont need to draw
end
ang:RotateAroundAxis(ang:Forward(), 0)
ang:RotateAroundAxis(ang:Right(), -45)
ang:RotateAroundAxis(ang:Up(), 90)
if ID then
cam.Start3D2D(pos, ang, 0.070)
anim_capture = Lerp(0.05, anim_capture, self:GetNetVar('Control_Capture') or 0)
if self:GetNetVar('Control_Capture') and self:GetNetVar('Control_Capture') >= 1 then
DrawSimpleCircle(0, -500, 100, Color(50, 50, 50, 200))
DrawCircle(0, -500, 100, math.Clamp(100/100 * anim_capture/100,0,1), capture.Zones[ID].color)
draw.ShadowSimpleText(self:GetNetVar('Control_Capture').."%", 'font_base_45', 0, -500, color_white, 1, 1)
draw.ShadowSimpleText(' ...', 'font_base_45', 0, -390, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
end
draw.ShadowSimpleText(capture.Zones[ID].name, 'font_base_45', 0, -680, color_white, 1, 1)
if !self:GetFraction() or self:GetFraction() == "" then
draw.ShadowSimpleText(": ? ", 'font_base_45', 0, -640, color_white, 1, 1)
else
draw.ShadowSimpleText(": "..self:GetFraction(), 'font_base_45', 0, -640, color_white, 1, 1)
end
cam.End3D2D()
end
end
RE: Help with code!
14-01-2022, 10:16 AM
#2 Are you attempting to make your own script? If yes, I would recommend finding a different forum that can offer you more support when it comes to developing Lua scripts. If no, see below.
Is this is a script off gmodstore? Is it a leak? I find that sometimes leaks simply do not work and you will have to find the script via other leaks or methods.
If this script is off gmodstore, have you edited it at all? If you plan on editing your scripts I would recommend watching some basic GLua videos on youtube so you can learn some more about GLua. Have you been config'ing your script? If yes, I would look over your code and make sure you haven't forgotten any commas or any basic things. Most of the time the script author will leave notes in the config files on how to properly edit them.
If the script you are using is stock and is from gmodstore (You have not changed any files) then I would recommend creating a support ticket for the script on gmodstore.
Is this is a script off gmodstore? Is it a leak? I find that sometimes leaks simply do not work and you will have to find the script via other leaks or methods.
If this script is off gmodstore, have you edited it at all? If you plan on editing your scripts I would recommend watching some basic GLua videos on youtube so you can learn some more about GLua. Have you been config'ing your script? If yes, I would look over your code and make sure you haven't forgotten any commas or any basic things. Most of the time the script author will leave notes in the config files on how to properly edit them.
If the script you are using is stock and is from gmodstore (You have not changed any files) then I would recommend creating a support ticket for the script on gmodstore.
Users browsing this thread: 2 Guest(s)