Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can we put the original mouse icon after change ?

Asked by 5 years ago

So , in my game i changed the mouseicon but the thing is that i need to put the mouse back to normal when the player open a stat menu but i cant find a way to put the mouse back to normal so if u know help me :)

1 answer

Log in to vote
2
Answered by 5 years ago

To return the mouse to normal, just set the mouse.Icon Property to an empty string ("", not nil)

local mouse = game:GetService("Players").LocalPlayer:GetMouse()

mouse.Icon = ""

Since you want this to occur with a GuiObject, you can use the MouseEnter and MouseLeave events to set the MouseIcon when it enters the Gui and when it Leaves (Frames, Buttons, Labels, etc, but not the literal Gui itself)

local mouse = game:GetService("Players").LocalPlayer:GetMouse()
mouse.Icon = "http://www.roblox.com/asset/?id=0"

script.Parent.MouseEnter:Connect(function()
    mouse.Icon = ""
end)

script.Parent.MouseLeave:Connect(function()
    mouse.Icon = "http://www.roblox.com/asset/?id=0"
end)
Ad

Answer this question