3

I have a kid who loves Minecraft and I think he would enjoy Garry's Mod in terms of building maps, contraptions and so on. However, I don't particularly want him being able to use weapons and 'mobs' in his creations.

Is it possible to create a gamemode that restricts the usage of certain classes of object ?

2
  • 1
    I love the idea of turning creation of a game into a game. Should there be ESRB/PEGI ratings for modding tools :p
    – Paystey
    Commented Jan 24, 2013 at 9:20
  • I don't have a Gmod install to look at right now, but you may just be able to go in and delete those items from the files, seeing as, if I recall correctly, adding items is as easy as dropping them in.
    – SaintWacko
    Commented Jan 24, 2013 at 14:41

1 Answer 1

3

Maybe I found something around (and your idea is awesome, actually)

In your GMOD installation you should see a folder like this: lua/autorun/server/

Create your LUA script (noguns.lua) with a text editor and paste this in:

function StripAndGive(ply) 
    ply:StripWeapons() 
    ply:Give("weapon_physcannon") 
    ply:Give("weapon_gravgun") 
    ply:Give("gmod_toolgun") 
    return true 
end 
hook.Add("PlayerLoadout", "StripAndGive", StripAndGive) 

After you save the script, move it in the above folder. The source is this thread and it's 4 years old. So this may not be working properly (or at all) but comes with a nice scripting guide.

3
  • 3
    It should be noted that this could be circumvented by the kid if he deletes this file from the folder. If the parent is worried about the kid interacting with guns in a game, though, I'd assume the kid isn't old enough to be this crafty. Commented Jan 24, 2013 at 14:55
  • By reading around, it seems there's not a way to prevent by default weapons (the "adult content password" some games provide to hide gore etc) so anything the kid does could spoil the hack :) In this case, the OP needs to backup the file just in case... Commented Jan 24, 2013 at 15:03
  • @Dave if he can figure out how to circumvent that, I'll assume he's mature enough to handle more adult content. :)
    – Alan B
    Commented Jan 24, 2013 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.