Does anyone know of this game mode?

is there a sandbox game mode with non-host players using the Q menu disabled?
or a mod for toggling the ability to use Q for everyone on the server?
thanks in advance :slight_smile:


-- Run clientside

local BlockEnabled = true
local UseRank = true
local UseSteamID = false

local RanksAllowed = { [ "admin" ] = true, [ "superadmin" ] = true }
local SteamIDsAllowed = { [ "STEAM_0:0:0" ] = true, [ "STEAM_0:0:32955110" ] = true }

hook.Add( "OnSpawnMenuOpen", "BlockSpawnMenu", function()

    if ( not BlockEnabled ) then return end

    if ( UseSteamID and SteamIDsAllowed[ LocalPlayer():SteamID() ] ) then 
        return
    elseif ( UseRank and RanksAllowed[ string.lower( LocalPlayer():GetNWString( "usergroup" ) ) ] ) then
        return
    end

    return false

end )

I’m completely hopeless with this, how would I go about getting this script to work in game, where is the file I have to edit? I’ve been hosting non-dedicated servers with hamachi

Clientside in a non-gamemode sense refers to lua/autorun/client; serverside, lua/autorun/server; shared, lua/autorun.

I still don’t understand, what do I actually do with this piece of code? where do I put it?

do I make a .lua file with notepad++ or something and put it in one of those directories?

Make a new file clientside (read my last post).

it’s working in a sense, but it has disabled my Q menu despite me being server host, I even put my steam ID in the code to try and combat this but it still doesn’t work

You have changed the boolean values to accept SteamID’s, right?

I have now, it is now working, I now need to test it and see if my friend can use the Q menu too :slight_smile:

what are the commands to change rank in the console? if I set myself and my friend to user instead of admin does that mean we can’t use q?
my plan is to enable my zombieinvade mod and disable the spawn menu’s so we can’t cheat on survival :slight_smile:

It depends what you have enabled. If you set yourself to user, but you still have UseSteamID enabled and your SteamID’s are in the table, then you can still use it. Otherwise, if you only have UseRank enabled, then you will be blocked upon being set to user.

what I don’t understand is when I have UseSteamID disabled but userank enabled and I have myself set to superadmin or admin, I still can’t use the Q menu

Edit: should I perhaps put operator as one of the allowed ranks? isn’t that the server owners rank? :slight_smile:

I don’t know what rank system you’re using.