• Nothing in my Gamemode Works!
    11 replies, posted
Hey. I'm making a little Gamemode. Its just a Simple Modification for the Sandbox. But nothing in my Gamemode Works! Here is a Small Example [lua] function GM:ScalePlayerDamage(ply,hitgroup,dmginfo) Msg ("Player "..ply:Name().." took "..dmginfo:GetDamage().." damage!\n") end [/lua] I know its from gmod.com. But its just a Test. And, it does not work. Nothing.
have you tried bert? [highlight](User was banned for this post ("Can't help? Don't reply." - mahalis))[/highlight]
[QUOTE=X-Villan-X;16072496]have you tried bert?[/QUOTE] bert?
everybody gets a piece
I really dont know what you mean.
[QUOTE=p3acemak3r;16072536]I really dont know what you mean.[/QUOTE] Ignore him, also, in what file did you place it?
init.lua but i dont know why. Now it works -.- . I made a Hud after that it works. But now my Problem is, when i die i get a " Hook 'PaintOurHud' Failed: advancedsandbox\gamemode\hud.lua:147: attempt to call method 'Clip1' (a nil value) " :|
A value is nil, add a check somewhere to check of Clip1 is nil or not.
Yepp, that's the Problem. [lua] local prammo = client:GetActiveWeapon():Clip1(); [/lua] Its a Variable for the [lua] local text = string.format( "Primary: %i AMMO", prammo ); [/lua] But, if i use client:armor it works. But with Clip1() .. not :/
you need to check GetActiveWeapon() to see if it's nil or not
Uhm. If the Player is Dead, its Nil. Because.. He does not have any Weapons. But the "if !client:Alive then return end" is ignored :(
I think you need to check, like SteveUK said, if the active weapon is valid or has a clip?
Sorry, you need to Log In to post a reply to this thread.