Hello, i’m new to the forums and in need of someones help.
I need to set up a timer/CurTime for my script.
You can guess what it does by looking at it.
The script needs to have an auto kick timer if they do not initiate “removeafk” i have tried a few things to do with Curtime & simple.timer but i’am hopeless and new to scripting.
What the script looks like:
function chatCommand( ply, text, public ) if (string.sub(text, 1, 4) == "/afk") then local afk = ply afk:GodEnable() afk:SetRenderMode(RENDERMODE_TRANSALPHA) afk:SetColor(Color(0, 0, 0, 59)) afk:Freeze( true ) afk:SetCollisionGroup(COLLISION_GROUP_DEBRIS) afk:ConCommand("afkmenu") end end hook.Add( "PlayerSay", "chatCommand", chatCommand ) concommand.Add( "removeafk", function( ply, cmd, args ) local rafk = ply rafk:GodDisable() rafk:SetColor(Color(255, 255, 255, 255)) rafk:Freeze( false ) rafk:SetCollisionGroup(COLLISION_GROUP_NONE) end )
I also need an example of a VGUI element that counts down the time on the frame i made.
kinda like how an motd counts down before you can close it but in this case it would only be counting down the time before it kicks you.