So i am creating a gamemode for GMod 11 and i am suing this in the init.
_________________________________________________________
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )
// Serverside only stuff goes here
/*---------------------------------------------------------
Name: gamemode:PlayerLoadout( )
Desc: Give the player the default spawning weapons/ammo "kermite_pist_spb" "ent_knife"
---------------------------------------------------------*/
function GM:PlayerSpawn( pl )
self.BaseClass:PlayerSpawn( pl )
pl:SetGravity( 1 )
pl:SetMaxHealth( 75, true )
pl:SetWalkSpeed( 115 )
pl:SetRunSpeed( 225 )
end
function GM:PlayerLoadout( pl )
pl:Stripweapons()
pl:Give ( "weapon_crowbar" )
pl:Give ( "weapon_pistol" )
end
function GM: PlayerInitialSpawn( pl )
self.BaseClass:PlayerInitialSpawn ( pl )
if pl:IsAdmin() then
pl:PrintMessage( HUD_PRINTTALK, "Call of Gmod,Welcomes you admin!" )
end
end
____________________________________________________________________________
So, when i start of Gmod with my game mode and changes to the shared.lua and the player.lua work but none of these changes occur. I dont lose all my weapons, i dont slow down, and I dont have a lower maz health! Im hoping a more experienced coder could look over my code. Thanks!
add
[code]
DeriveGamemode("sandbox");[/code]
to the top
also:
[code]
function GM:Initialize()
end
[/code]
Thanks, i had that in the shared.lua but I figured out the true reason, I believe it was becuase I had a space in its name, or something.
Sorry, you need to Log In to post a reply to this thread.