generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: how do i check if a player is afk?

Previous Thread :: Next Thread 
Uiom19 is not online. Uiom19
Joined: 17 Mar 2015
Total Posts: 144
26 Mar 2017 01:00 PM
are there any good methods
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Mar 2017 01:13 PM
local player = game.PlayersLocalPlayer()
loacl uis = game:GetService("UserInputService")
local lastInput = tick()
local timeout = 60 -- how many seconds for AFK to occur

uis.InputBegan:connect(function(input,gp)
lastInput = tick()
end)

while wait(1) do
if tick()-lastInput > timeout then
print(player,"is afk")
end
end




Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Mar 2017 01:14 PM
Why did I put parenthesis on the first line


Report Abuse
Deranged_User is not online. Deranged_User
Joined: 14 Sep 2008
Total Posts: 1122
26 Mar 2017 01:20 PM
newb :p
Report Abuse
Uiom19 is not online. Uiom19
Joined: 17 Mar 2015
Total Posts: 144
26 Mar 2017 03:18 PM
lol calls me a noob when u have 14 visits and my main has #########
Report Abuse
Uiom19 is not online. Uiom19
Joined: 17 Mar 2015
Total Posts: 144
26 Mar 2017 03:19 PM
five million
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Mar 2017 03:46 PM
Well if you can't do this then honestly you clickbaited all of your players with a 50/50 like/dislike piece of crap place that anyone should be ashamed to own.



Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
26 Mar 2017 03:46 PM
Soybeen you're giving people bad advice. #############################################################
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Mar 2017 03:47 PM
Also he was talking to me.


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
26 Mar 2017 03:47 PM
API:Class/Player/Idled


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Mar 2017 03:48 PM
"Usually fired two minutes after the game engine classes the player as idle."

Maybe he wants to wait 30 seconds or 5 minutes.


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Mar 2017 03:49 PM
I suppose you could check the time argument.

Yeah you're right that's more useful.


Report Abuse
Uiom19 is not online. Uiom19
Joined: 17 Mar 2015
Total Posts: 144
26 Mar 2017 04:19 PM
lol the funny thing is i did
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image