How to make it seem like you are not afk?

Would running something on the client or just coding the player to move from time to time be able to avoid the kicked for being afk 20 mins? All I want to do is be afk in my game. Could I do something to simulate user input?

I’d suggest try something with VirtualUser, but the bad part is that you will have to wait 20 minutes for tests.
If you make the player move automatically, that won’t count, since I went AFK and when I came back, disconnected, I was in a total different place.

Hmm ok I can look at that. It says it hasn’t been maintained in several years though.

Yeah, but it may work fine for maintaining the user “alive”.

Yea true. This is off topic, but what exactly is/was the purpose of virtual user? The only scenario I can think of using it would be if you wanted some weird roundabout way to move the character.

As it says, VirtualUser’s purpose is to record and playback a player’s input. Like UserInputService, but that service listens for input.

Oh ok I see that now. I was looking at the list of functions and I wasn’t down far enough to see the StartRecording() and StopRecording() stuff. I didnt seem to register the whole

VirtualUser is a service that allows you to record the inputs of a user

I am glad you found the solution, hopefully. If this helps, make sure to mark it as a :white_check_mark: for others to see and learn faster from this!

Are you sure that local scripts can use these functions? I tested it and they lack permissions for these.

I personally didn’t try out. Try on both server and client. This is an issue if NONE work, or maybe they need to be used differently?

Well i won’t really try testing on server , cause server doesn’t have a local player and this service provides no way to control any specific player , but I did try it in a local script and the script lacked permission.Roblox giving client the access to such stuffs would be risky so I think it can be accessible only by the CoreScripts.

I never used the service. I would try to enable API services, or use the functions different, other than that, it clearly stated that this service hasn’t been been maintained in several years, thus it may break.

This isn’t something related to the vulnerability of the service i guess , it returns the error showing that the script has no permission so not something related API services/ not being maintained.

I guess then the DevHub team forgot to mention that the service can only be used in the command bar and/or in plugins. Outside that, I have no idea how to simulate user input.

You could use something like this which I used in my old game.

local virtualuser = game:GetService(“VirtualUser”)
game:GetService(“Players”).LocalPlayer.Idled:connect(function()
virtualuser:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
wait(5)
virtualuser:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
end)

Add a solution if this helps!

1 Like

You can also tinker the time where it says wait(5) to your own liking, I suggest it being 1-5.

Ok thank you I think this will work. I may need to test some more but I am marking it as a solution