Nothing in my Gamemode Works!

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
function GM:ScalePlayerDamage(ply,hitgroup,dmginfo)
Msg ("Player “…ply:Name()…” took “…dmginfo:GetDamage()…” damage!
I know its from But its just a Test.
And, it does not work. Nothing.

have you tried bert?

(User was banned for this post ("Can't help? Don't reply." - mahalis))


everybody gets a piece

I really dont know what you mean.

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.
local prammo = client:GetActiveWeapon():Clip1();
Its a Variable for the
local text = string.format( “Primary: %i AMMO”, prammo );
But, if i use client:armor
it works.
But with Clip1() … not :confused:

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 :frowning:

I think you need to check, like SteveUK said, if the active weapon is valid or has a clip?