Revive/Traitor/Detective/Innocent Script

–[[
Title: TTT

    Some TTT related functions (respawn,traitor,detective,innocent)
   
    Made by Oren Yomtov (thenameisoren at gmail)

]]
ulx.setCategory( “TTT” )

function ulx.cc_respawn( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

    local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
    if not targets then
            ULib.tsay( ply, err, true )
            return
    end

    for _, v in ipairs( targets ) do
            ulx.logUserAct( ply, v, "#A respawned #T" )
            v:SpawnForRound(true)
    end

end
ulx.concommand( “respawn”, ulx.cc_respawn, “<user(s)> - Respawns target(s).”, ULib.ACCESS_ADMIN, “!respawn”, _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, “Respawn”, “ulx respawn” )

function ulx.cc_traitor( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

    local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
    if not targets then
            ULib.tsay( ply, err, true )
            return
    end

    for _, v in ipairs( targets ) do
            ulx.logUserAct( ply, v, "#A turned #T into a traitor" )
            v:SetRole(ROLE_TRAITOR)
            SendFullStateUpdate()
    end

end
ulx.concommand( “traitor”, ulx.cc_traitor, “<user(s)> - Turns target(s) into traitors.”, ULib.ACCESS_ADMIN, “!traitor”, _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, “Traitor”, “ulx traitor” )

function ulx.cc_detective( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

    local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
    if not targets then
            ULib.tsay( ply, err, true )
            return
    end

    for _, v in ipairs( targets ) do
            ulx.logUserAct( ply, v, "#A turned #T into a detective" )
            v:SetRole(ROLE_DETECTIVE)
            SendFullStateUpdate()
    end

end
ulx.concommand( “detective”, ulx.cc_detective, “<user(s)> - Turns target(s) into detectives.”, ULib.ACCESS_ADMIN, “!detective”, _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, “Detective”, “ulx detective” )

function ulx.cc_innocent( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

    local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
    if not targets then
            ULib.tsay( ply, err, true )
            return
    end

    for _, v in ipairs( targets ) do
            ulx.logUserAct( ply, v, "#A turned #T into an innocent" )
            v:SetRole(ROLE_INNOCENT)
            SendFullStateUpdate()
    end

end
ulx.concommand( “innocent”, ulx.cc_innocent, “<user(s)> - Turns target(s) into innocents.”, ULib.ACCESS_ADMIN, “!innocent”, _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, “Innocent”, “ulx innocent” )

This script from Oren Yomtav.

So this script is supposed to add buttons to the XGUI but for some reason it won’t work, I am an admin, and putting it in the right folder, can someone help me? What is wrong?

No errors?

Use code tags, please.

That is code for the old version of ULib/ULX
Here is updated code
[LUA]
local CATEGORY_NAME = “TTT”

function ulx.respawn( calling_ply, target_plys )
for i=1, #target_plys do
target_plys[ i ]:SpawnForRound( true )
end
ulx.fancyLogAdmin( calling_ply, “#A respawned #T”, target_plys)
end
local respawn = ulx.command( CATEGORY_NAME, “ulx respawn”, ulx.respawn, “!respawn” )
respawn:addParam{ type=ULib.cmds.PlayersArg }
respawn:defaultAccess( ULib.ACCESS_ADMIN )
respawn:help ( “<user(s)> - Respawns target(s).” )

function ulx.traitor( calling_ply, target_plys )
for i=1, #target_plys do
target_plys[ i ]:SetRole(ROLE_TRAITOR)
end
ulx.fancyLogAdmin( calling_ply, “#A set #T as a traitor”, target_plys)
SendFullStateUpdate()
end
local traitor = ulx.command( CATEGORY_NAME, “ulx traitor”, ulx.traitor, “!traitor” )
traitor:addParam{ type=ULib.cmds.PlayersArg }
traitor:defaultAccess( ULib.ACCESS_ADMIN )
traitor:help( “<user(s)> - Turns target(s) into traitors.” )

function ulx.detective( calling_ply, target_plys )
for i=1, #target_plys do
target_plys[ i ]:SetRole(ROLE_DETECTIVE)
end
ulx.fancyLogAdmin( calling_ply, “#A set #T as a detective”, target_plys)
SendFullStateUpdate()
end
local detective = ulx.command( CATEGORY_NAME, “ulx detective”, ulx.detective, “!detective” )
detective:addParam{ type=ULib.cmds.PlayersArg }
detective:defaultAccess( ULib.ACCESS_ADMIN )
detective:help( “<user(s)> - Turns target(s) into detectives.” )

function ulx.innocent( calling_ply, target_plys )
for i=1, #target_plys do
target_plys[ i ]:SetRole(ROLE_INNOCENT)
end
ulx.fancyLogAdmin( calling_ply, “#A set #T as a innocent”, target_plys)
SendFullStateUpdate()
end
local innocent = ulx.command( CATEGORY_NAME, “ulx innocent”, ulx.innocent, “!inncoent” )
innocent:addParam{ type=ULib.cmds.PlayersArg }
innocent:defaultAccess( ULib.ACCESS_ADMIN )
innocent:help( “<user(s)> - Turns target(s) into innocents.” )
[/LUA]


--[[
Title: TTT

Some TTT related functions (respawn,traitor,detective,innocent)

Made by Oren Yomtov (thenameisoren at gmail)
]]
ulx.setCategory( "TTT" )

function ulx.cc_respawn( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A respawned #T" )
v:SpawnForRound(true)
end
end
ulx.concommand( "respawn", ulx.cc_respawn, "<user(s)> - Respawns target(s).", ULib.ACCESS_ADMIN, "!respawn", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Respawn", "ulx respawn" )

function ulx.cc_traitor( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A turned #T into a traitor" )
v:SetRole(ROLE_TRAITOR)
SendFullStateUpdate()
end
end
ulx.concommand( "traitor", ulx.cc_traitor, "<user(s)> - Turns target(s) into traitors.", ULib.ACCESS_ADMIN, "!traitor", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Traitor", "ulx traitor" )

function ulx.cc_detective( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A turned #T into a detective" )
v:SetRole(ROLE_DETECTIVE)
SendFullStateUpdate()
end
end
ulx.concommand( "detective", ulx.cc_detective, "<user(s)> - Turns target(s) into detectives.", ULib.ACCESS_ADMIN, "!detective", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Detective", "ulx detective" )

function ulx.cc_innocent( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A turned #T into an innocent" )
v:SetRole(ROLE_INNOCENT)
SendFullStateUpdate()
end
end
ulx.concommand( "innocent", ulx.cc_innocent, "<user(s)> - Turns target(s) into innocents.", ULib.ACCESS_ADMIN, "!innocent", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Innocent", "ulx innocent" ) 

edit

i tried to help time to walk away with shame

Hello there.

This code is from 2010. You got it from the ZombieMaster Forums.

Again, it’s amost 3 years old. THAT’s why it isn’t working.

Centran, thanks so much! That goes right into the SH folder right?