• What do you need help with V4
    639 replies, posted
  • [addons\evolve\lua\ev_plugins\sh_country.lua:16] attempt to perform arithmetic o n local 'i' (a nil value)Dropped aLTeR from server (Disconnect by user.) [CODE] /*------------------------------------------------------------------------------------------------------------------------- Country -------------------------------------------------------------------------------------------------------------------------*/ local PLUGIN = {} PLUGIN.Title = "Country" PLUGIN.Description = "Displays the Country of the spawning Players." PLUGIN.Author = "MrWireTuts" PLUGIN.ChatCommand = nil function PLUGIN:PlayerInitialSpawn( ply ) if not ply then return end http.Get("http://www.ip2location.com/" .. string.Explode(":",ply:IPAddress())[1],"",function(contents,size) if not contents then return end local i = string.find(string.lower(contents), "lblicountry") local country = string.sub(contents,i + 13) country = string.Explode("<",country)[1] country = string.sub(country,0,1) .. string.lower(string.sub(country,2)) evolve:Notify(evolve.colors.blue,ply:Nick(),evolve.colors.white," has connected from ",evolve.colors.red,country,evolve.colors.white,".") end) end evolve:RegisterPlugin( PLUGIN ) [/CODE]
  • Avatar of pennerlord
  • [QUOTE=airidas338;35204532][addons\evolve\lua\ev_plugins\sh_country.lua:16] attempt to perform arithmetic o n local 'i' (a nil value)Dropped aLTeR from server (Disconnect by user.) -code-[/QUOTE] Line 15: [lua]local i = string.find(string.lower(contents), "lblicountry")[/lua] "lblicountry" was not found in "contents". So string.find returns nil.
  • Avatar of Gmod4ever
  • [QUOTE=Spencer Sharkey;35200055]Rotated text anyone? Didn't find any functions for it, although I thought there was one. Would it be feasible to render text to a render target then draw a rotated textured quad? Or does it not have alpha.. hmm.[/QUOTE] I saw the "rotated text anyone" and was about to suggest rendering the text to an RT, then drawing the RT as a rotated quad / rect, but apparently you thought the same thing. That'd be my first attempt, but if I remember correctly, RTs work differently in gmod than then do in LOVE 2D. In LOVE 2D, that'd be the way you do it, though. :v:
  • Avatar of Jvs
  • [QUOTE=Spencer Sharkey;35200055]Rotated text anyone? Didn't find any functions for it, although I thought there was one. Would it be feasible to render text to a render target then draw a rotated textured quad? Or does it not have alpha.. hmm.[/QUOTE] Wizard of Ass found a way to do it without render targets. [QUOTE=Wizard of Ass;32614030]Rotated text, finally got that done. [lua] local sSetTextPos = surface.SetTextPos; local sDrawText = surface.DrawText; local cPushModelMatrix = cam.PushModelMatrix; local cPopModelMatrix = cam.PopModelMatrix; local mat = Matrix(); local matAng = Angle(0, 0, 0); local matTrans = Vector(0, 0, 0); local matScale = Vector(0, 0, 0); local function drawSpecialText(txt, posX, posY, scaleX, scaleY, ang) matAng.y = ang; mat:SetAngle(matAng); matTrans.x = posX; matTrans.y = posY; mat:SetTranslation(matTrans); matScale.x = scaleX; matScale.y = scaleY; mat:Scale(matScale); sSetTextPos(0, 0); cPushModelMatrix(mat); sDrawText(txt); cPopModelMatrix(); end[/lua] (Yes I also have a version where it draws centered.)[/QUOTE]
  • [QUOTE=Jvs;35208119]Wizard of Ass found a way to do it without render targets.[/QUOTE] Thanks :) Makes sense. Now, would surface.DrawTexturedRectUV() allow me to cut certain pieces out of larger textures and only draw, say, a small box from it? Or is that another function. example: rendering a sprite from a sprite sheet.
  • I could use a hand if someone can help. I've been trying to make an rpg that shoots a large bomb, and I used the SWEP Construction Kit made by Clavus. Does anybody know how to remove the added elements on primary fire, and create them again on reload? Here's a pastebin of the swep code. Thanks guys. [URL="http://pastebin.com/1b1aUGwY"]http://pastebin.com/1b1aUGwY[/URL]
  • Avatar of ArmageddonScr
  • How can I make an entity move in a direction depending on its angle? This works, but only 70% of the time [lua] local angles=ent:GetAngles() angles=angles-Angle(270,0,0) local dir=angles:Forward() * speed phys:ApplyForceCenter( dir ) [/lua] It will at random times change the direction it goes in, instead of forward it goes backwards.
  • Avatar of ralle105
  • Try this [lua] local angles=ent:GetAngles() angles:RotateAroundAxis(angles:Right(),270) local dir=angles:Forward() * speed phys:ApplyForceCenter( dir ) [/lua]
  • Avatar of Neddy
  • [lua] resource.AddFile("sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-11-Omen.mp3") resource.AddFile("sound/ttt/Inno-Zeph-12-BloodSugar.mp3") resource.AddFile("sound/ttt/Inno-Zeph-13-Lullaby1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-14-Lullaby2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3") resource.AddFile("sound/ttt/Inno-Zeph-18-Iridescent.mp3") resource.AddFile("sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3") resource.AddFile("sound/ttt/Inno-Zeph-3-ParadiseCity.mp3") resource.AddFile("sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3") resource.AddFile("sound/ttt/Inno-Zeph-5-CominInHot.mp3") resource.AddFile("sound/ttt/Inno-Zeph-6-RunToTheHills.mp3") resource.AddFile("sound/ttt/Inno-Zeph-7-Shots.mp3") resource.AddFile("sound/ttt/Inno-Zeph-8-BottomsUp.mp3") resource.AddFile("sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-11-Omen.mp3") resource.AddFile("sound/ttt/Inno-Zeph-12-BloodSugar.mp3") resource.AddFile("sound/ttt/Inno-Zeph-13-Lullaby1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-14-Lullaby2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3") resource.AddFile("sound/ttt/Inno-Zeph-18-Iridescent.mp3") resource.AddFile("sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3") resource.AddFile("sound/ttt/Inno-Zeph-3-ParadiseCity.mp3") resource.AddFile("sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3") resource.AddFile("sound/ttt/Inno-Zeph-5-CominInHot.mp3") resource.AddFile("sound/ttt/Inno-Zeph-6-RunToTheHills.mp3") resource.AddFile("sound/ttt/Inno-Zeph-7-Shots.mp3") resource.AddFile("sound/ttt/Inno-Zeph-8-BottomsUp.mp3") resource.AddFile("sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3") resource.AddFile("sound/ttt/Trait-Zeph-1-HighwayToHell.mp3") resource.AddFile("sound/ttt/Trait-Zeph-10-Burn.mp3") resource.AddFile("sound/ttt/Trait-Zeph-11-Monster.mp3") resource.AddFile("sound/ttt/Trait-Zeph-12-DangerZone.mp3") resource.AddFile("sound/ttt/Trait-Zeph-13-RaiseALittleHell.mp3") resource.AddFile("sound/ttt/Trait-Zeph-14-CantTouchThis.mp3") resource.AddFile("sound/ttt/Trait-Zeph-15-MidnightQueen.mp3") resource.AddFile("sound/ttt/Trait-Zeph-16-BloodOnMyHands.mp3") resource.AddFile("sound/ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3") resource.AddFile("sound/ttt/Trait-Zeph-18-ChaChing.mp3") resource.AddFile("sound/ttt/Trait-Zeph-2-CrazyTrain.mp3") resource.AddFile("sound/ttt/Trait-Zeph-3-Glory.mp3") resource.AddFile("sound/ttt/Trait-Zeph-4-Tendencies.mp3") resource.AddFile("sound/ttt/Trait-Zeph-5-BleedItOut.mp3") resource.AddFile("sound/ttt/Trait-Zeph-6-Battery.mp3") resource.AddFile("sound/ttt/Trait-Zeph-7-RideTheLightning.mp3") resource.AddFile("sound/ttt/Trait-Zeph-8-MasterOfPuppets.mp3") resource.AddFile("sound/ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3") local songs = { "sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3" "sound/ttt/Inno-Zeph-11-Omen.mp3" "sound/ttt/Inno-Zeph-12-BloodSugar.mp3" "sound/ttt/Inno-Zeph-13-Lullaby1.mp3" "sound/ttt/Inno-Zeph-14-Lullaby2.mp3" "sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3" "sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3" "sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3" "sound/ttt/Inno-Zeph-18-Iridescent.mp3" "sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3" "sound/ttt/Inno-Zeph-3-ParadiseCity.mp3" "sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3" "sound/ttt/Inno-Zeph-5-CominInHot.mp3" "sound/ttt/Inno-Zeph-6-RunToTheHills.mp3" "sound/ttt/Inno-Zeph-7-Shots.mp3" "sound/ttt/Inno-Zeph-8-BottomsUp.mp3" "sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3" "sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3" "sound/ttt/Inno-Zeph-11-Omen.mp3" "sound/ttt/Inno-Zeph-12-BloodSugar.mp3" "sound/ttt/Inno-Zeph-13-Lullaby1.mp3" "sound/ttt/Inno-Zeph-14-Lullaby2.mp3" "sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3" "sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3" "sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3" "sound/ttt/Inno-Zeph-18-Iridescent.mp3" "sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3" "sound/ttt/Inno-Zeph-3-ParadiseCity.mp3" "sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3" "sound/ttt/Inno-Zeph-5-CominInHot.mp3" "sound/ttt/Inno-Zeph-6-RunToTheHills.mp3" "sound/ttt/Inno-Zeph-7-Shots.mp3" "sound/ttt/Inno-Zeph-8-BottomsUp.mp3" "sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3" "sound/ttt/Trait-Zeph-1-HighwayToHell.mp3" "sound/ttt/Trait-Zeph-10-Burn.mp3" "sound/ttt/Trait-Zeph-11-Monster.mp3" "sound/ttt/Trait-Zeph-12-DangerZone.mp3" "sound/ttt/Trait-Zeph-13-RaiseALittleHell.mp3" "sound/ttt/Trait-Zeph-14-CantTouchThis.mp3" "sound/ttt/Trait-Zeph-15-MidnightQueen.mp3" "sound/ttt/Trait-Zeph-16-BloodOnMyHands.mp3" "sound/ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3" "sound/ttt/Trait-Zeph-18-ChaChing.mp3" "sound/ttt/Trait-Zeph-2-CrazyTrain.mp3" "sound/ttt/Trait-Zeph-3-Glory.mp3" "sound/ttt/Trait-Zeph-4-Tendencies.mp3" "sound/ttt/Trait-Zeph-5-BleedItOut.mp3" "sound/ttt/Trait-Zeph-6-Battery.mp3" "sound/ttt/Trait-Zeph-7-RideTheLightning.mp3" "sound/ttt/Trait-Zeph-8-MasterOfPuppets.mp3" "sound/ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3" } for i = 0, #t, 1 do Resource.AddFile(songs[i]) end local function PlayMusic(wintype) local randomsound = songs[math.random(#songs)] local stringsong = string.Implode("", { "'surface.PlaySound(\"", randomsound, "\")'" }) BroadcastLua(stringsong) end hook.Add("TTTEndRound", "MyMusic", PlayMusic) [/lua] So I made this to choose between all of them sounds on round end. Yet it doesn't do anything. Doesn't play any sound at all. Anyone know why :C?
  • Avatar of ArmageddonScr
  • Is there something from the code you aren't showing? From what I can tell, you resource.AddFile all the mp3s, and then, created a table of all the songs [I](which didn't work because you didn't put a , after each mp3)[/I] then looped through it [I](using #t and t was nil)[/I] and tried to Resource.AddFile them again [I](and Resource isn't in gmod by default by the way)[/I] And, sound/ is the filepath you tried to play which didn't work because you don't need sound/ in the path. edit: I think this is what you want [lua] local songs = { "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Trait-Zeph-1-HighwayToHell.mp3", "ttt/Trait-Zeph-10-Burn.mp3", "ttt/Trait-Zeph-11-Monster.mp3", "ttt/Trait-Zeph-12-DangerZone.mp3", "ttt/Trait-Zeph-13-RaiseALittleHell.mp3", "ttt/Trait-Zeph-14-CantTouchThis.mp3", "ttt/Trait-Zeph-15-MidnightQueen.mp3", "ttt/Trait-Zeph-16-BloodOnMyHands.mp3", "ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3", "ttt/Trait-Zeph-18-ChaChing.mp3", "ttt/Trait-Zeph-2-CrazyTrain.mp3", "ttt/Trait-Zeph-3-Glory.mp3", "ttt/Trait-Zeph-4-Tendencies.mp3", "ttt/Trait-Zeph-5-BleedItOut.mp3", "ttt/Trait-Zeph-6-Battery.mp3", "ttt/Trait-Zeph-7-RideTheLightning.mp3", "ttt/Trait-Zeph-8-MasterOfPuppets.mp3", "ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3" } for k,v in pairs(songs) do resource.AddFile("sound/"..v) end local function PlayMusic(wintype) local randomsound = songs[math.random(#songs)] local stringsong = "surface.PlaySound('"..randomsound.."')" BroadcastLua(stringsong) end hook.Add("TTTEndRound", "MyMusic", PlayMusic) [/lua]
  • Avatar of Neddy
  • [QUOTE=ArmageddonScr;35220018]Is there something from the code you aren't showing? From what I can tell, you resource.AddFile all the mp3s, and then, created a table of all the songs [I](which didn't work because you didn't put a , after each mp3)[/I] then looped through it [I](using #t and t was nil)[/I] and tried to Resource.AddFile them again [I](and Resource isn't in gmod by default by the way)[/I] And, sound/ is the filepath you tried to play which didn't work because you don't need sound/ in the path. edit: I think this is what you want [lua] local songs = { "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Trait-Zeph-1-HighwayToHell.mp3", "ttt/Trait-Zeph-10-Burn.mp3", "ttt/Trait-Zeph-11-Monster.mp3", "ttt/Trait-Zeph-12-DangerZone.mp3", "ttt/Trait-Zeph-13-RaiseALittleHell.mp3", "ttt/Trait-Zeph-14-CantTouchThis.mp3", "ttt/Trait-Zeph-15-MidnightQueen.mp3", "ttt/Trait-Zeph-16-BloodOnMyHands.mp3", "ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3", "ttt/Trait-Zeph-18-ChaChing.mp3", "ttt/Trait-Zeph-2-CrazyTrain.mp3", "ttt/Trait-Zeph-3-Glory.mp3", "ttt/Trait-Zeph-4-Tendencies.mp3", "ttt/Trait-Zeph-5-BleedItOut.mp3", "ttt/Trait-Zeph-6-Battery.mp3", "ttt/Trait-Zeph-7-RideTheLightning.mp3", "ttt/Trait-Zeph-8-MasterOfPuppets.mp3", "ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3" } for k,v in pairs(songs) do resource.AddFile("sound/"..v) end local function PlayMusic(wintype) local randomsound = songs[math.random(#songs)] local stringsong = "surface.PlaySound('"..randomsound.."')" BroadcastLua(stringsong) end hook.Add("TTTEndRound", "MyMusic", PlayMusic) [/lua][/QUOTE] That worked! Thanks
  • Avatar of Nerdeboy
  • [b][url=http://luasearch.netau.net/?list=Panel+methodmatch&func=Panel.Remove]Panel:Remove [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b]
  • Avatar of Nerdeboy
  • You could try using [b][url=http://luasearch.netau.net/?list=gui&func=gui.EnableScreenClicker]gui.EnableScreenClicker [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b] set to false.
  • Avatar of ArmageddonScr
  • [QUOTE=Nerdeboy;35222945]You could try using [b][url=http://luasearch.netau.net/?list=gui&func=gui.EnableScreenClicker]gui.EnableScreenClicker [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b] set to false.[/QUOTE] I tried that but it didn't do anything.
  • Avatar of lorde banana
  • I generally use gui.EnableScreenClicker instead of MakePopup with things like scoreboards and admin mods when I want the player to be able to move while the popup is made [editline]20th March 2012[/editline] Is it possible to use any text drawing functions in the menu state like you could with HUDPaint
  • Avatar of NnyAskC
  • Okay this is only bits of the code, so if you see what I'm doing wrong or need more info, let me know. First of all, the timers don't seem to be working. Second of all, the tazedPlayer:ConCommand("pp_motionblur 1") also blurs me. Nothing else happens to me like the hud print, only the motion blur. [lua] eyeTrace = self.Owner:GetEyeTrace() if !eyeTrace.Entity:IsPlayer() then return end [/lua] ------------------------------------------------------------------------------------------------------------- [lua] if eyeTrace.Entity:IsPlayer() then self.Weapon:EmitSound("Weapon_StunStick.Activate") self:tasePlayer(eyeTrace.Entity) self.BaseClass.ShootEffects(self) SetGlobalInt("reloadTimer",CurTime()+10) SetGlobalInt("tazedTimer",CurTime()+5) tazedPlayer = eyeTrace.Entity oldModel = eyeTrace.Entity:GetMaterial() end [/lua] ------------------------------------------------------------------------------------------------------------- [lua] function SWEP:tasePlayer(tazedPlayer) if ( CurTime() < GetGlobalInt("tazedTimer") ) then tazedPlayer:SetMoveType(MOVETYPE_NONE) tazedPlayer:ConCommand("pp_motionblur 1") tazedPlayer:PrintMessage(HUD_PRINTCENTER, "You got tased bro.") tazedPlayer:SetMaterial( "models/alyx/emptool_glow" ) end if ( CurTime() > GetGlobalInt("tazedTimer") ) then tazedPlayer:SetMoveType(MOVETYPE_WALK) tazedPlayer:ConCommand("pp_motionblur 0") tazedPlayer:SetMaterial( oldModel ) end end [/lua]
  • Avatar of marvincmarvin
  • Shouldn't it return nil if I try to access "_G.global" if I run this? [lua] global={"secrets"} setmetatable(_G,{ __index=function(tbl,key) if key=="global" then print "This is private!" return nil end return rawget(_G,key) end }) [/lua]
  • Avatar of nick_9_8
  • I am trying to remove the chat commands from Evolve, so you cannot see or use the chat commands in the chat box. This would mean you could only access the commands from the menu. Anyone know a way?
  • Hey guys, i downloaded a vehicle pack for darkrp ([url]http://www.garrysmod.org/downloads/?a=view&id=110381[/url]) and the main problem i am running into is that i set the vehicles so certain classes could spawn certain vehicles, but when they change class, the vehicle stays. Is there a way to make it so when a player changes jobs his vehicle disappears? A smaller and less important issue i am running into is that some of the vehicle models wont download to my clients, anyone have any idea why? Only a few of them don't. Any help is appreciated! Thanks in advance!
  • Avatar of ralle105
  • [QUOTE=marvincmarvin;35225413]Shouldn't it return nil if I try to access "_G.global" if I run this? [lua] global={"secrets"} setmetatable(_G,{ __index=function(tbl,key) if key=="global" then print "This is private!" return nil end return rawget(_G,key) end }) [/lua][/QUOTE] __index is only called if the variable being accessed is nil.
  • Avatar of NnyAskC
  • [QUOTE=RCRad;35227009]Hey guys, i downloaded a vehicle pack for darkrp ([url]http://www.garrysmod.org/downloads/?a=view&id=110381[/url]) and the main problem i am running into is that i set the vehicles so certain classes could spawn certain vehicles, but when they change class, the vehicle stays. Is there a way to make it so when a player changes jobs his vehicle disappears? A smaller and less important issue i am running into is that some of the vehicle models wont download to my clients, anyone have any idea why? Only a few of them don't. Any help is appreciated! Thanks in advance![/QUOTE] Which vehicles? Also I'd set it to check when they die if they're still the required class for the vehicle (if you have it set to kill them when they change jobs).
  • Avatar of marvincmarvin
  • [QUOTE=ralle105;35228693]__index is only called if the variable being accessed is nil.[/QUOTE] So making "global" a local table should do the trick?