Custom Mouse Help

So I am have been working on a custom mouse and here is the code.


--// Services \\--
local UserInputService = game:GetService("UserInputService")

--// Functions \\--
function Mouse:Start()
	UserInputService.MouseIconEnabled = false
	
	script.Parent.Visible = true
	
	UserInputService.InputChanged:Connect(function(input)
		if (input.UserInputType == Enum.UserInputType.MouseMovement) then
			script.Parent.Position = UDim2.new(0, input.Position.X, 0, input.Position.Y)
		end
	end)
end

return Mouse

Is there a better way to do this? or even using a local script?

You have to input a mouse image

You can find out how to change the Mouse icon by reading here Mouse | Documentation - Roblox Creator Hub

I would think that you have to use a local script for a custom mouse because it is only seen by the player.

Put this in a local script under StarterGUI -

local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = ‘robloxassetid://NUMBERSHERE’

What do you mean by mouse image?

Like an icon for your mouse. (30)

I do have a mouse image. The mouse icon is script.Parent

Oh I didn’t know because you never mentioned the mouse as script.Parent sorry!

Well… What should I do? (30 characters really suck)

So does the script work, or are you trying to make the script more efficient?

Doesnt work ( 30 chars ooof aawfag )

This may be the error. You never mention Emun.UserInputType.Mouse Movement being equal to input.UserInputType. Hope this helped!