General > Developers Corner

Custom Admin Bot

(1/1)

koaandl:
Hi guys! I'm making a script for my server that acts as a computerised admin to control the server when there is no admins on. it works around players messaging the bot and it will do things for them. I have this


--- Code: ---Time = "ply:TimeConnected"
function playerRespawn( ply )
  for a, b in pairs(player.GetAll()) do
b:PrintMessage( HUD_PRINTCENTER, "The server has detected that player: " .. ply:GetName() .. " has been rebirthed: Welcome to life." )
end
end

function ISaid( ply, text, toall )
    if (string.sub(text, 1, 7) == "/noclip") then
        if (Time > 600) then
        ply:SetMoveType(MOVETYPE_NOCLIP)
        end
        if (Time < 599) then
        ply:SendHint( "You have not played long enough to use NoClip!",5)
        end
    end
    if (string.sub(text, 1, 4) == "/nco") then
       ply:SetMoveType(MOVETYPE_WALK)
    end
    return text;
end

hook.Add( "PlayerSpawn", "playerRespawnWelkommen", playerRespawn );
hook.Add( "PlayerSay", "ISaid", ISaid );
--- End code ---

When using this on the server, the ULX menu becomes disabled (using any command like !ulx or !menu does not work), and then this one (the /noclip) doesnt work either. I assume it does that because the two playersay hooks (from ULX and this) are conflicting. Is there a way i can somehow implement this into the server without having to have ULX disable itself?

Megiddo:
Remove the "return text" line.

koaandl:
thanks Megiddo :) (btw, I LOVE YOUR ADDONS MAN! YOU ARE THE BEST MOD MAKER EVER!)

JamminR:
We thank you for your support

Navigation

[0] Message Index

Go to full version