Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to change mouse icon for everything?

I'm trying to change the mouse icon in my game, but when I hover my mouse over a gui, it changes to a different one.

The code I use is:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

mouse.Icon = 'http://www.roblox.com/asset/?id=5512887231'

1 answer

✓ Accepted answer

Yes While the cursor hovers over a GuiButton, this property is temporarily ignored

A solution could be to create a custom mouse gui

Use this

local Player = game:GetService("Players").LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local RunService = game:GetService("RunService")
local UserInput = game:GetService("UserInputService")

local ScreenGui = Instance.new("ScreenGui",PlayerGui)
local Cursor = Instance.new("ImageLabel",ScreenGui)

ScreenGui.Enabled = true
ScreenGui.ResetOnSpawn = false
ScreenGui.IgnoreGuiInset = true
ScreenGui.DisplayOrder = 9999

Cursor.Visible = true
Cursor.Size = UDim2.fromOffset(50,50) --Mouse icon size
Cursor.BackgroundTransparency = 1
Cursor.Image = "http://www.roblox.com/asset/?id=5512887231" --Assed ID
Cursor.AnchorPoint = Vector2.new(0.5,0.5) --Change for the image position
UserInput.MouseIconEnabled = false --Disable mouse icon
RunService.RenderStepped:Connect(function()
	local MousePos = UserInput:GetMouseLocation()
	UserInput.MouseIconEnabled = false --just to be sure xd
	Cursor.Position = UDim2.fromOffset(MousePos.X,MousePos.Y)
end)

1 comment

0

Too much work if i'm going to have to change it for all my guys. I'm just not going to change icon. But i'm accepting anyways.

This discussion is preserved as it was. New answers, comments, and votes are closed.