• What do you need help with? V3
    6,419 replies, posted
[QUOTE=Chessnut;37844589]It's returning the panel of the tab.[/QUOTE] so why [LUA] if Sheet:GetActiveTab( )==sheet2 then print( " The active tab is 'Super Menu'." ) else print( "The active tab is NOT 'Super Menu'." ) end[/LUA] Doesn't work
[QUOTE=Lyoko2;37845659]so why if Sheet:GetActiveTab( )==sheet2 then print( " The active tab is 'Super Menu'." ) else print( "The active tab is NOT 'Super Menu'." ) end Doesn't work[/QUOTE] is sheet2 the active tab? Is it erroring? Details brother.
I'm working on a Lua player-info-menu. I'm trying to make a kill/death ratio entry in the menu. [url]http://puu.sh/19Pi7[/url] [lua]sd = s:Deaths() if sd == 0 then sd = s:Frags() else sd = (s:Frags()/s:Deaths()) end button:SetText(math.round(tonumber(sd), 2))[/lua] 28 divided by 28 is not 1.56...
[QUOTE=cosy;37848527]I'm working on a Lua player-info-menu. I'm trying to make a kill/death ratio entry in the menu. [url]http://puu.sh/19Pi7[/url] [lua]sd = s:Deaths() if sd == 0 then sd = s:Frags() else sd = (s:Frags()/s:Deaths()) end button:SetText(math.round(tonumber(sd), 2))[/lua] 28 divided by 28 is not 1.56...[/QUOTE] [img]http://puu.sh/19PtZ[/img] This guy is an alt of a perma'd user.
[QUOTE=JustSoFaded;37848651][img]http://puu.sh/19PtZ[/img] This guy is an alt of a perma'd user.[/QUOTE] so ar u n00bie and who's carsn [editline]29th September 2012[/editline] the math is apparently correct, but the kills and deaths are displaying different in the button than in console? [url]http://puu.sh/19PTP[/url] [url]http://puu.sh/19PU2[/url] for the two buttons that display kills and deaths, it just uses SetText(player:Frags()) and deaths. the print to the console is just MsgN(kills.." / "..deaths.." = "..kdr.." or "..kills/deaths) [editline]29th September 2012[/editline] fixed it [highlight](User was permabanned for this post ("Alt of permabanned user boxxyy" - Craptasket))[/highlight]
[b]GMod 13 related:[/b] So, I added a convar, which should enable/disable my hud. I set a DCheckBox into a menu, which I bound to the convar. But each time I change the DCheckBox, the hud doesn't show/hide, tho when I rejoin it the hud has been set to the value I wanted. [editline]30th September 2012[/editline] Easier understanding: [video=youtube;OEl7b0oXVVA]http://www.youtube.com/watch?v=OEl7b0oXVVA[/video] It doesn't apply without rejoining/retrying/changing level [editline]30th September 2012[/editline] nvm, fixed it.. :P Stupid fault.
Hey guys, kind of new to lua coding. I am trying to make a super super super lightweight admin mod for my server and I am stuck at one thing. How do I go about muting someone's microphone? [editline]30th September 2012[/editline] Or, can anyone recommend a lightweight admin mod for a server that has 40-60 players on constantly.
[QUOTE=The freeman;37851311]Hey guys, kind of new to lua coding. I am trying to make a super super super lightweight admin mod for my server and I am stuck at one thing. How do I go about muting someone's microphone?[/QUOTE] You can set a variable on the player, and then check that variable inside the [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1bc4.html]PlayerCanHearPlayersVoice[/url] hook.
Dumb question. (Gmod 13) When I want to code the Players to use a special Playermodel, They always use the T animation for walking/running. Like this: [vid]http://puu.sh/1a05h/30d2ef44937f5ec0888e2d16104889d2[/vid] But when I remove the Line, it works With the default Playermodel. [vid]http://puu.sh/1a00T/a1c2c75e3011874a7e9863912db410ed[/vid] This is my Code: [lua] function GM:PlayerSpawn( ply ) self.BaseClass:PlayerSpawn( ply ) ply:SetModel("models/humans/Group01/Female_03.mdl") ply:SetMaxHealth( 100, true ) ply:SetRunSpeed(300) ply:SetWalkSpeed(150) ply:SetGravity (1) ply:AllowFlashlight(true) end [/lua]
You're setting a ragdoll model on the player. [code] ply:SetModel("models/humans/Group01/Female_03.mdl") [/code] should be [code] ply:SetModel("models/player/Group01/Female_03.mdl") [/code]
[QUOTE=_Undefined;37854810]You're setting a ragdoll model on the player. [code] ply:SetModel("models/humans/Group01/Female_03.mdl") [/code] should be [code] ply:SetModel("models/player/Group01/Female_03.mdl") [/code][/QUOTE] I really feel dumb now... Thanks!
-snip-
I'm in the process of fixing up Rick Dark's original release of TacoScript 2 for GMod 13, with the intention of overhauling it and finishing it. However, I've encounter an issue that boggles my mind: Error: [lua][gamemodes/gear/gamemode/bananavgui/panel.lua:797] attempt to call method 'SetFont' (a nil value)(Hook: HUDPaint) 1. lua/includes/modules/hook.lua:111 (unknown)[/lua] Code: [lua]local label = vgui.Create( "Label", self ); label:SetPos( x, y ); label:SetFont( font ); -- Line 797 label:SetText( text ); label:SizeToContents(); label.OriginalX = x; label.OriginalY = y;[/lua] I've tried googling around and looking at the changelogs in the Beta, but as far as I can tell no changes has been made to "SetFont", so I'm quite honestly not sure why it's returning it as a nil value. The same seems to happen at one more place in the script: Error: [lua][gamemodes/tacoscript2/gamemode/cl_playermenu.lua:369] attempt to call method 'SetFont' (a nil value)[/lua] Code: [lua]local function AddLink( name, y, func ) local link = vgui.Create( "BLink" ); link:SetPos( ( ScrW() * -.15 - 2 ) + ( ( ScrW() * .15 + 8 ) * ( PlayerMenuIntro / 100 ) ), y ); link:SetFont( "NewChatFont" ); -- Line 369 link:SetText( name ); link:SizeToContents(); link.HighlightColor = Color( 0, 65, 160, 255 ); link.Action = func; table.insert( PlayerMenuLinks, link ); end[/lua] Any help at all would be greatly appreciated. [B]UPDATE:[/B] I managed to fix the problem by replacing SetFont with SetFontInternal. I'm not sure if SetFont has been removed entirely, but it's not on the wiki anymore.
im getting an error with my table [code]bone={} bone[1]="ValveBiped.Bip01_Head1" bone[2]="ValveBiped.Bip01_Neck1" bone[3]="ValveBiped.Bip01_Spine4" bone[4]="ValveBiped.Bip01_Spine2" bone[5]="ValveBiped.Bip01_Spine1" bone[6]="ValveBiped.Bip01_Spine" bone[7]="ValveBiped.Bip01_R_UpperArm" bone[8]="ValveBiped.Bip01_R_Forearm" bone[9]="ValveBiped.Bip01_R_Hand" bone[10]="ValveBiped.Bip01_L_UpperArm" bone[11]="ValveBiped.Bip01_L_Forearm" bone[12]="ValveBiped.Bip01_L_Hand" bone[13]="ValveBiped.Bip01_R_Thigh" bone[14]="ValveBiped.Bip01_R_Calf" bone[15]="ValveBiped.Bip01_R_Foot" bone[16]="ValveBiped.Bip01_R_Toe0" bone[17]="ValveBiped.Bip01_L_Thigh" bone[18]="ValveBiped.Bip01_L_Calf" bone[19]="ValveBiped.Bip01_L_Foot" bone[20]="ValveBiped.Bip01_L_Toe0" [/code] this is wats outputting it [CODE]local bonetarget = table.Random(bone) local targetbone = target:LookupBone(bonetarget)[/CODE] heres the error [CODE]Hook 'aimbot' Failed: [RunString:26] attempt to concatenate global 'bone' (a table value) 1. lua/includes/modules/hook.lua:83 (unknown) 2. (tail call):-1 (unknown) [/CODE] i want it to pull a different bone from table eac kill i got rid of the error [CODE]for k,v in pairs(bonename) do local name = target:Nick() local bonetarget = v local targetbone = target:LookupBone(bonetarget) end[/CODE] but i just counts down
Hi. Where can I find a good tutorial on STool making? Not the one by Richard Croxford. I've been looking everywhere a STools seem to be more of a bitch than I thought.
[QUOTE=tigersmith12;37855721]im getting an error with my table [code]bone={} bone[1]="ValveBiped.Bip01_Head1" bone[2]="ValveBiped.Bip01_Neck1" bone[3]="ValveBiped.Bip01_Spine4" bone[4]="ValveBiped.Bip01_Spine2" bone[5]="ValveBiped.Bip01_Spine1" bone[6]="ValveBiped.Bip01_Spine" bone[7]="ValveBiped.Bip01_R_UpperArm" bone[8]="ValveBiped.Bip01_R_Forearm" bone[9]="ValveBiped.Bip01_R_Hand" bone[10]="ValveBiped.Bip01_L_UpperArm" bone[11]="ValveBiped.Bip01_L_Forearm" bone[12]="ValveBiped.Bip01_L_Hand" bone[13]="ValveBiped.Bip01_R_Thigh" bone[14]="ValveBiped.Bip01_R_Calf" bone[15]="ValveBiped.Bip01_R_Foot" bone[16]="ValveBiped.Bip01_R_Toe0" bone[17]="ValveBiped.Bip01_L_Thigh" bone[18]="ValveBiped.Bip01_L_Calf" bone[19]="ValveBiped.Bip01_L_Foot" bone[20]="ValveBiped.Bip01_L_Toe0" [/code] this is wats outputting it [CODE]local bonetarget = table.Random(bone) local targetbone = target:LookupBone(bonetarget)[/CODE] heres the error [CODE]Hook 'aimbot' Failed: [RunString:26] attempt to concatenate global 'bone' (a table value) 1. lua/includes/modules/hook.lua:83 (unknown) 2. (tail call):-1 (unknown) [/CODE] i want it to pull a different bone from table eac kill i got rid of the error [CODE]for k,v in pairs(bonename) do local name = target:Nick() local bonetarget = v local targetbone = target:LookupBone(bonetarget) end[/CODE] but i just counts down[/QUOTE] Hook '[B]aimbot[/B]' Failed: [RunString:26] attempt to concatenate global 'bone' (a table value) I'm outta here.
How can I get the text to display fully? [img]http://puu.sh/1a3jT[/img] I'm using a DNumSlider.
Does anyone have a good DColumnSheet example for me? i need something like DoClick for each button..
Anyone know of, or know how to make a script that will kick players with pings over 300? Maybe warn them a few times before kicking them? I tried one from garrysmod.org, but I'm using [B]Garry's Mod 13[/B] and everything is broken, so it just spams the player and console with errors. I tried this addon: [url]http://www.garrysmod.org/downloads/?a=view&id=123813[/url]
I have placed all of the black mesa source folders in gmod, but it does not change the source npc's, but it changes everything else. I know i need a lua but i don't specifically know how. Could anyone help?
Is there a way to make only specific people (Donators, admins or members things like that) be able to choose specific playermodels? This is on Fretta.
In DarkRP, I'm trying to edit the default money printer. What I'm attempting to alter is the amount that each money printer spits out, but I can't find exactly what to change. [CODE]function ENT:CreateMoneybag() if not ValidEntity(self) then return end if self:IsOnFire() then return end local MoneyPos = self:GetPos() if math.random(1, 22) == 3 then self:BurstIntoFlames() end --1 in 22 chance printer will blow up on CreateMoneybag? local amount = GetConVarNumber("mprintamount") --Can change this in server console... if amount == 0 then amount = 250 --I thought this was what you change, but still didn't work end DarkRPCreateMoneyBag(Vector(MoneyPos.x + 15, MoneyPos.y, MoneyPos.z + 15), amount) self.sparking = false timer.Simple(math.random(100, 350), PrintMore, self) end[/CODE] I labeled some things, but I'm not sure about them. Help would be appreciated!
I'm having a problem with calculating the position of my cursor when I set my CalcView. [lua] function LPCameraScreenToVector( iScreenX, iScreenY, iScreenW, iScreenH, angCamRot, fFoV ) local d = 4 * iScreenH / ( 6 * math.tan( 0.5 * fFoV ) ) ; local vForward = angCamRot:Forward(); local vRight = angCamRot:Right(); local vUp = angCamRot:Up(); local result = ( d * vForward + ( iScreenX - 0.5 * iScreenW ) * vRight + ( 0.5 * iScreenH - iScreenY ) * vUp ); result:Normalize( ); return result end [/lua] ... taken from the old wiki, doesn't work as it doesn't accurately have the result I'm looking for. By changing my player's Eye Angles, and using: [B]gui.ScreenToVector(gui.MouseX(), gui.MouseY())[/B] The normalized vector works perfectly however I'd like to avoid setting Eye Angles and having it be hacky. Instead, by using: [B]LPCameraScreenToVector( gui.MouseY( ), gui.MouseX( ), ScrH( ), ScrW( ), Camera.Ang, 75 )[/B] ... has a completely inaccurate result, not really worth going into detail about. Maybe the function is wrong, it could be possible that someone deliberately messed with the function or it could be perhaps that I'm using it wrong. Either way, If you know anything that could help please.. Halp Meh! I'll still be working with the function, hopefully I'll find a solution soon.
[QUOTE=Persious;37856485]How can I get the text to display fully? I'm using a DNumSlider.[/QUOTE] i think that the SetWide() on the slider is too high but im an idiot and don't know what im talking about [QUOTE=haxordee;37859716]In DarkRP, I'm trying to edit the default money printer. What I'm attempting to alter is the amount that each money printer spits out, but I can't find exactly what to change. I labeled some things, but I'm not sure about them. Help would be appreciated![/QUOTE] are you trying to make several different types of money printers and make them each print different amounts? if you're only trying to edit the amount for the default printer, set the convar mprintamount to something besides 250. that code is saying that if the convar is set to 0, it will print $250, otherwise it will print the convar amount
Is it just me or is Vector:Normalize() broken? Running this: [lua]local test = Vector(23,56,39):Normalize()*10[/lua] Gives me this error: [code]attempt to perform arithmetic on a nil value[/code] [editline]30th September 2012[/editline] Okay, so this works fine: [lua]a = Vector( 4, 3, 2 ) a:Normalize() print( a )[/lua] But this: [lua]local vecSub = tr.HitPos-self.Owner:GetShootPos() MsgN("vecSub "..tostring(vecSub)) local vecFinal = vecSub:Normalize()--*10000 MsgN("vecFinal "..tostring(vecFinal)) local phys = tr.Entity:GetPhysicsObject() [/lua] Prints out this: [code]vecSub -119.880371 -1.104706 -49.188019 vecFinal nil[/code] It worked fine in Gmod 12 so something must of been changed
[QUOTE=ah;37861561]i think that the SetWide() on the slider is too high but im an idiot and don't know what im talking about [/QUOTE] Not the problem, I changed the value of it, but nothing changed.
[QUOTE=highvoltage;37862153]Is it just me or is Vector:Normalize() broken? Running this: local test = Vector(23,56,39):Normalize()*10 Gives me this error: [code]attempt to perform arithmetic on a nil value[/code] [editline]30th September 2012[/editline] Okay, so this works fine: a = Vector( 4, 3, 2 ) a:Normalize() print( a ) But this: local vecSub = tr.HitPos-self.Owner:GetShootPos() MsgN("vecSub "..tostring(vecSub)) local vecFinal = vecSub:Normalize()--*10000 MsgN("vecFinal "..tostring(vecFinal)) local phys = tr.Entity:GetPhysicsObject() Prints out this: [code]vecSub -119.880371 -1.104706 -49.188019 vecFinal nil[/code] It worked fine in Gmod 12 so something must of been changed[/QUOTE] It's because you're trying to multiply a Vector, use [URL="http://glua.me/search/?keywords=Vector%3AMul"][IMG]http://glua.me/search.png[/IMG] [B]Vector:Mul[/B][/URL] instead. [lua]local test = Vector(23,56,39):Normalize():Mul(10)[/lua]
[QUOTE=deathrat;37862601]It's because you're trying to multiply a Vector, use [URL="http://glua.me/search/?keywords=Vector%3AMul"][IMG]http://glua.me/search.png[/IMG] [B]Vector:Mul[/B][/URL] instead. [lua]local test = Vector(23,56,39):Normalize():Mul(10)[/lua][/QUOTE] [code]] lua_run a = Vector( 4, 3, 2 )*2 print( a ) > a = Vector( 4, 3, 2 )*2 print( a )... 8.000000 6.000000 4.000000 [/code] Thats not the problem, if you look at my edit I commented that out and vecFinal was still nil after only normalizing it
Didn't garry remove normalize from vectors?
[code]] lua_run a = Vector(23,56,39):Normalize():Mul(10) print( a ) > a = Vector(23,56,39):Normalize():Mul(10) print( a )... [lua_run:1] attempt to index a nil value [/code] [editline]30th September 2012[/editline] [QUOTE=Banana Lord.;37862692]Didn't garry remove normalize from vectors?[/QUOTE] He did? What should I do instead? I used it alot. I checked the wiki before I posted here, so when I saw it there I figured that it wasn't removed
Sorry, you need to Log In to post a reply to this thread.