Hi! I am trying to change the players mouse using:
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "http://www.roblox.com/asset?id=6936773141"
But it won’t work over a Gui. In this article over Mouse.Icon it explains that it won’t work while the mouse is over a Gui. Is there a way to get around this?
1 Like
gui.MouseEnter:Connect(function()
mouse.Icon = "url"
end)
gui.MouseLeave:Connect(function()
mouse.Icon = "default icon url"
end)
Not tested m on phone rn
1 Like
Sorry, but it is not working. Its weird that I am not getting any errors.
Am on ph rn and it’s 12 am. Sorry am not being able to help u
Its fine! I will try to find a tutorial.
1 Like
Not possible unless you make your own custom mouse.
Roblox doesn’t let you change your mouse icon on GUI objects (Most likely because you could change mouse icons for CoreGui? Unsure)
Best option you’ve got rn is to use an “mouse gui”, track the mouse’s position using renderstepped and make the “mouse gui” go to that position every frame, just like a “fake mouse”
Here is the answer!
local button = script.Parent.Parent.Parent.Frame
local mouse = game.Players.LocalPlayer:GetMouse()
local icon = button.Mouse.Mouse
button.MouseEnter:connect(function(x,y)
game:GetService("UserInputService").MouseIconEnabled = false
icon.Visible = true
end)
button.MouseLeave:connect(function()
game:GetService("UserInputService").MouseIconEnabled = true
icon.Visible = false
end)
game:GetService("RunService").RenderStepped:connect(function()
icon.Position = UDim2.new(0, mouse.X - 25, 0, mouse.Y - 25)
end)
You have to create a ImageLabel to use as a mouse.
Here is a DevForum Post about it.
1 Like
I don’t get it though, why are you using renderstepped AND gui events?
Gui event is to see if the mouse in on the gui
Isn’t it just easier, better and more efficient to just leave the “fake mouse” always visible instead of turning it on and off everytime you hover over a gui?
Ill try to fix it to work without the gui event
1 Like