Added: 2 years ago
From: humblesnurp
Views: 23,189
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (275)

Sign In or Sign Up now to post a comment!
  • So let me clarify this... At 5:37, when he put 0,9 did he mean 0.9??? because when you say 0 - 1 then I think of .5 and such.. Is that right??? If I put. . .

    ply:SetGravity( 0.9 )

    Would that be okay?

  • I get those errors when starting gamemode:

    [gamemodes\cakemod\gamemode\in­it.lua:31] attempt to index field 'Baseclass' (a nil value)(Hook: PlayerInitialSpawn)

    [gamemodes\cakemod\gamemode\in­it.lua:15] attempt to index field 'Baseclass' (a nil value)(Hook: PlayerSpawn)

    Please help! ;_;

  • i love it!

  • What folder do you need to put the gametype in, to be able to use it on Garry's Mod?

  • Everything works in the code, if you have no mistakes. Excellent.

  • Um. the line

    ply:SetMaxHealth( 500, true )

    didn't work for me, but

    ply:SetArmor( 500 )

    did. should I try

    ply:SetHealth( 500 )?

  • Oh My God my computer destroyed

  • What's that font your using

  • How do i get codes oh and what code?

  • Those "things you use it on" are called "arguments".

    Just wanted to say that :P

  • The weapon stripper leaves me with the smg, pistol, stunstick, grenade, physgun and gravity gun, any way to fix?

  • @ExtraKawaii same here wtf!?!?!

  • @Olliedageek I figured it out. You have a coding error further up that is stopping the script before the weapon stripper can finish. Find it and fix it.

  • @ExtraKawaii weapon stripper LOLZ!

  • @nicraptor11 Yeah dude, everyone likes a hot blonde weapon stripper.

  • @ExtraKawaii yep who doeesnt

  • @Robloxfreek221 Why can i CRASH the Computer ???????

    plz answer ????

  • @Zerikization He was quoting from the video.

  • @teslaDan5 Ohh... Okay Srry for wasting your time :)

  • All i want to do is make NO MORE friendly fire,thats about it.

  • @Thefishforthedish Under options in the tool menu there is something for no PvP, I think that turns it off.

  • @1337lolguyman omg thanks you so much.

    Now I just need to do that and take away the ability to go in the spawn menu and im set.

  • Negative...

  • Ugh... Is there a tutorial for someone who already knows a lot about lua? When I watched this I felt my self becoming progressively stupider...

  • Im new to gmod. When i saw this I GOT MINDFUCKED. But then then the more i listened the more i discover. And the more i learn.

  • doesnt work :(

    

  • Comment removed

  • Comment removed

  • Comment removed

  • Comment removed

  • Comment removed

  • @Sikeman214 i would use the PlayerInitialSpawn hook, search it on the gmod lua wiki ;p

  • how can you make: sometin like

    if ply:IsNew or something?

    like if its their first time joing?

    (if you can)

  • *spends two hours scripting and setting up gamemode* z0mg this r gunna b so 1337! *loads up gmod and gametype, notices nothing is changed or altered in any way* FUUUUUUUUUUUUUUU

  • @Deniedoath *Spends 2 minutes laughing because you probably never changed youre gamemode from Sandbox to your gamemode.*

  • @Sikeman214 negative.

  • I Have A Problem, My Gamemode is Dinosaur Invasion (Humans Vs Dinos) And Dinos And Humans Have A Different Loadout... WTF Do I I Do?

  • dude im spawning with no weapons and i only wanted a pistol and sunstick and everythings right there but theres everything in sandbox in there too.how do i make it so you cant spawn anything and get sertane weps?

  • Comment removed

  • I spawned with normal weapons, and the "CAKEMOD: (text here)" won't show up.... help? and i've checked it like 5 times it's perfectly same as you made, still wont work

  • @qwerkaz You're still in sandbox.

  • @Sikeman214 what

    

  • @qwerkaz Goto Start a new game. And on the top right, theres 3 icons on top of each other. i Think its the like 2nd (its the original Create Server button at the menu, now you click Start New Game and choose the 2nd one of the right) one down or something. And where it says "sandbox" put Cakemod .

  • @Sikeman214 Uhh.........what.. no it wasn't that, i'm not that idiot, i know how to change a gamemode, but thank you. The problem has been solved ages ago. And it wasn't because wrong gamemode

  • @ ~1:22, "(things to use it on)" Lolno, it's called a parameter. And you call a function and give arguments. :P

  • i spawned with a submachine gun a gravity gun and grenades :( any way around this

  • Humble... your Lua tutorials are amazing! Easy to understand unlike the actual Lua handbook. Thanks!

  • I have the same code you have but still spawn with the normal weapons

  • awesome tutorial, thanks!

  • 1982 Music?

  • I had the same problem, spawning with lots of guns. I went through the init.lua and found a lot of places where i missed capitals and made sure everything was perfect. After fixing them, it all worked fine!

  • the music makes me want to cry stinky tears

  • this isnt working in the new garrys mod idk why but its not

  • what about coding to insert custom weps?

    I am designing a Gmod guitar hero type game mod and I want to use the guitar from PHX can I code that into an swep somehow?

  • can you make a gamemode to me

  • I dont have Create Multiplayer Option

  • @2GameBrothers Fixed this but it doesnt work

  • everything works but i have no weapons can someone please help me

  • Is the physgun weapon_physgun or weapon_physcannon

  • @nick556x weapon_physcannon is the Gravity Gun name. I think.

  • hey, i got it to work, kinda,

    i spawn with my weapons that i have, but they dont have much ammo, and i think my speed is normal gmod speed,

    but my biggest concern is that it still it sandbox, it still has the spawn menue and everything, i want it to be like a zombie survival gamemode, and i would like to know how to change it ;P

  • For some reason I can't create a multiplayer game, like you do at 7:12. Help?

  • @technoSprint the side of the choose map window, there should be a litle screw driver, it is the settings.

  • My code imploded D:

  • This is not working O.o i really need this to work but it wont.. i got all the codes down right..

    but it wont say hi admin lols  and it wont make mespawn with the weps i chose!

    instead i spawn with all teh gmod weps!

  • When i used the weapon codes i go onto the gamemode and my weapons are still stripped anybody know how to stop this?

  • didn't work for me :/

  • Nothing worked on me and I've Multichecked my scripts for errors, is it wrong to use Notepad++? btw, the only change at ALL is that the toolgun and phsygun is gone.. and I got stunstick, why the fuck that?!

  • @Roxxo88 The problem is that GMod can't find some of the files, I'm having the same error. It's unable to open CakeMod so it instead opens the "Base Gamemode"

  • I'm trying to add a function where if a player says in chat "/tp" the camera will change into thirdperson, can anyone help me with that?

  • @bobmattis3 That's more of a console command than a chat command. It'd be better to make an In Character menu that has a button that switches to it.

  • @theuberowner I see. I'll try to do that then I suppose. Thank you.

  • great tutorial thanks!!! what is the music used in these tutorials?

  • i spawned with more weapons...is any way to fix this?

  • @halfeatensniper EVERYONE WITH THIS PROB YOU NEED TO MAKE SURE THAT THE GAMEMODE FOLDER NAME AND THE GAMEMODE NAME IN THE LUA FILES ARE ONE WORD AND THE SAME EXACT SPELLING.. it worked for me ;D

  • @Frogger564 That's right! I should have pointed that out in the tutorial!

  • @humblesnurp can you teach me how to make props buyable and how to make it so that you have to pay for weps in spawn menu or hwo to add health to props like in ZS

  • @halfeatensniper well don't do the DeriveGamemode( "sandbox" )

  • @halfeatensniper Since the gamemode is derived from sandbox, you spawned with all of the sandbox weapons.

    Remove the derive script, and you'll be fine.

  • @Robloxfreek221 that way i'll have a reason to format it

  • THANKS SO F***** aLOT !

    Works perfectly!

  • [gamemodes\cakemod\gamemode\in­it.lua:47] attempt to call method 'PlayerIntialSpawn' (a nil value)(Hook: PlayerInitialSpawn)

    I coped everything from the 47th line down exactly as on screen (spaces, upper-case and lower-case letters correct) and it still comes up with this message. What's wrong with this code?

    function GM:PlayerInitialSpawn( ply ) self.BaseClass:PlayerIntialSpa­wn( ply ) if ply:IsAdmin() then ply:PrintMessage( HUD_PRINTTALK, "CAKEMOD: oh hai thar admin! lolz!" ) end

  • so when i spawn the weapons are gone and the give weapon dosnt give me any weapons can anyone help me with that

  • @superhappyfunlandman Did you put ply:Give( "" ) then ply:stripweapons() ?

    if you did put the Give first so when you die it doesnt give you them, and then strip your weapons

  • when i use my gamemode i start with

    stun batton

    pistol

    grenade

    smg

    grav gun

    and crowbar wat do i do

  • @Dude5464673 It's calling the Base GameMode. It's doing that because it can't find those important files and I don't have shit of an idea why not.

  • do u have 2 derive gamemode?

  • @Dude5464673 You dont have to but, it saves settings everything else like gravity and the Spawn Menu and all that other hard stuff

  • well this sucks i cant create a multiplayer on old gmod

  • i don't under stand why when i start my gamemode up it just goes straight to sandbox settings and does not work. plz help me.

    -Alex

  • Comment removed

  • Comment removed

  • @ 4:00 How do you make the print say your name? for example: Hi there Dp908!

  • @skoolrox123 ply:PrintMessage( HUD_PRINTTALK, "Hi there "..ply:GetName() )

  • @GmodsVendetta You are credit to team! Heres a cookie (::)

  • @GmodsVendetta what about server, would it be GetServer?

  • I'm making a RP of The Mafia in the 1950's should i type DeriveGamemode( "RolePlay" ) Can you help me with this plz?

  • @D3m0snipe1 Unless you have a gamemode already named roleplay... No.

    You will want to derive it from sandbox because you will want the Q menu and prop spawning.

  • nice vid worx fine 4 me

  • works fine for me lol

  • There was a problem opening the gamemode file 'FirstAttempt/gamemode/init.lu­a'

    There was a lot of writing above this (basicaly what dvds4eva said) but this is the only bit that seemed usefull

    How do i fix this? i DID exactly what he did on the video, other than the "cakemod" name, of the document (folder) and i want to expand into adding my own things to the game mode, however i cant do that if the basics dont work

  • ur a god!~!!!! i wanna make a dm/zombie co-op gamemode. can u help D:? and how do i enable gamemodes?!?!?!? havent found an answer. i got a 12 slot gmod server currently build cause i cant enable stuff D:

  • when i start the game it dosnt show the message i told it to pop up, all it is is base game mode. i had it overided to goto my gamemode becasue normaly it just goes to sandbox, but it jut goes to base gamemode !!!!!! plz resond :*(

  • ehm ply:Stripweapons() shouldnt be there if u want to have weapons on ur gamemode, i tried it myself, i didnt have any weapons, then i removed ply:Stripweapons() and now everything is working fine!

  • Comment removed

  • LuaGetfile: Not Loading Team Deathmatch\gamemode\cl_init.lu­a

    Couldn't include file 'Team Deathmatch\gamemode\cl_init.lu­a' (File not found)

    COULDN'T LOAD GAMEMODE!!

    There was a problem opening the gamemode file 'Team Deathmatch/gamemode/cl_init.lu­a'

    Can someone please fix this and also the cannot load gamemode has stars all around it

  • @dvds4ever Same problem here, cant find the problem!

  • Comment removed

  • Comment removed

  • Comment removed

  • are the spaces neeeded for the oly:give weapon part?

  • how do you add cars to the gamemode and make them have health?

    so after shooting them a while they explode?

    and is there a way to make cars get damaged from impacts then explode if they are too damaged??

  • how do i make it so someone dies they drop the weapon their holding?

  • @FreeDownloads1 put that in init.lua :

    function PlayerDropWeapon(ply) if ply:GetActiveWeapon() ~= NULL then ply:DropWeapon(ply:GetActiveWe­apon()) end

    end

    hook.Add("DoPlayerDeath", "Player.DropWeapon", PlayerDropWeapon)

  • How do I set how much ammo is loaded in the gun? Example please?

  • so its giving me all the weapons and i don't know y i have put in what you have showed

  • @tromboneman12 make sure your gamemode name doesnt have a space

  • Comment removed

  • Comment removed

  • the ply:Give( "weapon_crowbar" ) not working for me

  • @ActiveMovies player is misspelled its 

    pl:Give( "weapon_crowbar" )

  • @ActiveMovies wait sorry its right :)

  • I have a small problem.

    I use the team.SetUp to make teams, but when i derive the "sandbox" gamemode i cant set players to teams. it does not show my team names in the list, but when i do not derive the gamemode i can see the team names in the list. do you know why?

  • I did everything you said, and I tried the Gamemode. I got two GameMode errors. I fixed the first one, but I can't find the last problem. It said that function GM:PlayerLoadout( ply ) is a nil value. I can't find any faults in it.

    Code:

    function GM:PlayerLoadout( ply ) ply:Stripweapons() ply:Give( "weapon_crowbar" ) ply:Give( "weapon_pistol" )

    end

    Anyone understand what's wrong?

  • @Jibzab Use the function in the video, but instead of 'function GM:PlayerLoadout( pl )', use function GM:PlayerLoadout( ply )

  • what's the name for physgun?

  • @humblesnurp Hope. That command doesn't work.

    Anyways, I have a little problem. My combo fists only play the left hand animation, even if I click with my right mouse button. It does this for every similar skin fists, including lee_fists. I am sure that I installed it correctly, but it still doesn't work. Any ideas?

  • Humblesnurp ur vids, they are awesome!

  • Where can I find a list of all weapons (For example, "Weapon_crowbar" and so on)?

  • Du er jo Norsk kult xD

  • du er jo norsk xD

    kult

  • I am having a similar error, it says it cannot find cl_init.lua even though it is clearly in the right place, but I forced it to run my gamemode so it wouldn't revert back to sandbox.

    There was a problem opening the gamemode file 'Left for Oblivion/gamemode/cl_init.lua'

    It says that for init.lua as well even though I triple checked my code in a side by side comparison...

  • Also, I would love it if you have a link to this code to make sure I copied it right, since it is utterly failing. :<

  • What's the music in the video?

  • gave me this error when spawning-

    ERROR: GAMEMODE:'PlayerSpawn' Failed: sandbox/gamemode/init.lua:40: stack overflow

    and i dont spawn with any guns

  • can someone tell me the name of song?

  • Jeg får med tre ekstra våpen når jeg spawner Stunstick, SMG og granat hvordan får jeg dem bort? Men resten funker TAKK :D

    bortset fra den Hai thar admin lolz tingen må du være admin på en server for at den skal funke?

  • what is name of the toolgun?

  • @oOosupernicoOo "gmod_tool" i believe

  • @humblesnurp why arent i spawning with that ingame? this is what it looks like plz tell me is anything's wrong

    Function GM:PlayerSpawn( ply ) Self.BaseClass:PlayerSpawn( ply ) ply:SetGravity( 0,90 ) ply:SetMaxHealth( 100, true ) ply:SetWalkSpeed( 350 ) ply:SetRunSpeed ( 550 )

    end

    function GM:PlayerLoadout( ply ) ply: Stripweapons() ply: Give( "weapon_crowbar" ) ply: Give( "gmod_tool" ) ply: Give( "weapon_phsygun" ) ply: Give( "weapon_physcannon" )

    end

  • Comment removed

  • @kanexyz24i did change the capital f in Function at the top to a lowercase f

  • @kanexyz24 donno if this is the problem but you spelt weapon_physgun wrong

  • @NAPREDATOR Its called gmod_physgun

  • @alotatime oh, you should tell kanexyx24 that

  • When I start it up it says it couldn't load the cakemod in the upper right-hand corner of my screen?

  • When i tried the test run like you did, it didn't say the thingy for admin and i started with all weapons AND a stunstick which I've never actully started with before sooo.....yeah...

  • @leku200 I know you posted that comment 4 months ago, but if you found a solution to your problem, could you tell me what it was?

  • I made admins have special weapons like the police_arrester stick

  • NORSK!!!!

  • how do i give players a choise of weapons from the spawn menu?

  • Stupid question but, If I select my gamemode NOT to derive from any other one like you did from sandbox, will i still need those code lines that you said fix some sandbox bugs?

  • I just did what you did perfectly but when i start it have some of the stuff out but i still have the smg and for som resion i have a stun stick ..... plz help

  • it won't strip the weapons or register that it is my gamemode, it thinks that i am running sandbox HELP

  • I have done everything you have done but it just loads up as normal sandbox! HELP!

  • why don't u use notepad++ with the lua coding plugin?

  • There was a problem opening the gamemode file 'NovMod/gamemode/init.lua'

    `can you help meh out?

  • i tried using the setmaxhealth function in the dark rp sv_gamemode_functions lua but it had no effect any one have any answers for me or how to set a maxhealth in darkrp

  • It works great, bu t when i spawn i dont get the crowbar i typed D:

  • everytime i start up i get a error with strip weps and walk speed send me a message and ill give u the info if u think u can help :\

  • Really Nice videos! And the Music which is played is Awesome! I need to know the Name of the songs :(

  • i HAVE coded sometime, like 2 years ago, and i didn't remember anything.. thanks for gettin' me rolling again xD

  • can you make a tutorial on how to make npc plz?

  • I believe he has already made one.

  • how to make a mod for max payne 2

  • I need help...

    I am doing a little menu, and in it there's a button. if you click it, I want it to set your health to 1000....but it don't work.

    Any help?

  • add a function to enable cheats in one of the files

  • ah, it needs SV_CHEATS set to 1?

  • uhh...what would the code look like?

    first the button setup stuff

    then

    Button.DoClick = function() ply:SetHealth( 1000 )

    end

    ??

  • Thanks Humble, ive been looking for something like this for awhile!

  • When I try to test it out it doesn't show the gamemode im making only other ones. Help :/

  • Uhh what if you wanted to add the Super rocket launcher...just put "weapons_superrocketlauncher" ??

  • hi! im trying to make a jailbreak gamemode for my server, i cant figure it out tho, it is supposed to randomize weapons every time they spawn, but i dont know how to make the models be cops/prisoners, please help me!