Gui Button with Virtual User?

Is it possible to click a Gui Button using the Virtual User Service? Any other ways of going about clicking a Gui Button without actually clicking it yourself or using a different remote event to emulate clicking?

what do you mean by this? Like clicking keys or just having it automatically click it for you?

I want to emulate a click without touching anything, completely done by the script.

I’m not sure you could emulate a click, but you could make it seem like it to the player if you make a loop that does it at certain intervals.

You can click the users mouse using VirtualUser ClickButton1 and ClickButton2 but it refuses to click on a Gui Button. I probably should have mentioned that the clicking part works but again it won’t actually click the Gui Button.

I don’t think roblox allow ClickButton1/ClickButton2 for client’s to use.

This member cannot be used in scripts, but is usable in the command bar.

I’m running my script in the command bar, but it still won’t click a Gui Button.

Maybe this can help you under stand it a little better. The parameters are what’s important.

This is what I have:

local Position = Vector2.new(456, 889)

VirtualUser:Button1Down(Position, CurrentCamera.CFrame)
        
wait(0.1)
        
VirtualUser:Button1Up(Position, CurrentCamera.CFrame)

I’ve also tried:

local Position = Vector2.new(456, 889)

VirtualUser:ClickButton1(Position, CurrentCamera.CFrame)

( VirualUser = game:GetService("VirtualUser" and CurrentCamera = game:GetService("Workspace").CurrentCamera)

If its an outdated issue, is there anyway of fixing it? or are there any other methods of emulating a click?

This service hasn’t been maintained in several years, so it doesn’t work very well anymore.

Currently there are no other emulating services in roblox since it is the best way for exploiters to abuse afk farming.

Darn exploiters, someone on a roblox script support server told me I could use ray casts somehow but he won’t explain it too me. Any ideas?

Raycast? Ray cast are only meant for checking if there is something in front of the ray or avoid things that you want to avoid

Well thanks for your help, I don’t know what else I could do.

1 Like

Yeah, so basically it says you cannot use the ClickButton1 in scripts but is it usable in the command bar.


You can’t use any of the functions in a script… I think you probably already figured this out though.

If you want to fire a button without actually clicking it, you could try this:

Button.Activated:Connect(function()
print('Button Activated');
end);

Button:Activate();
1 Like

It is working for me.

You’re still using the command bar in studio, which is like using a roblox exploit.

This service was made for only plugins

???

This service cannot be used in plugins. Only in the command bar.