Hello! I have a deathrun server using .//MrGash's Deathrun Gamemode (
https://github.com/Mr-Gash/GMod-Deathrun) and was trying to see if I could get a simple Spectator mode to work. It appeared that it already had the team created, but no way of entering it.
So, I tried making this, and put it in /addons/ulx/lua/ulx/modules/sh.
local CATEGORY_NAME = "Spectate"
function ulx.spectate( calling_ply )
ply:Kill
ply:SetTeam(TEAM_SPECTATOR)
end
local spectate = ulx.command( CATEGORY_NAME, "ulx spectate", ulx.spectate, "!spectate", false )
spectate:defaultAccess( ULib.ACCESS_ALL )
spectate:help( "Enters Spectator Only Mode." )
Here is the error I get:
[ERROR] addons/ulx/lua/ulx/modules/sh/spec.lua:10: function arguments expected near 'ply'
1. unknown - addons/ulx/lua/ulx/modules/sh/spec.lua:0
This is the first thing I've tried creating, and wasn't totally sure what was happening.