#Mouse Icon help

1 messages · Page 1 of 1 (latest)

left shuttle
#

Anyone got an idea why this isn't working?

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

mouse.Icon = "rbxassetid://128696788610269"

I for the life of me can't get it to stay, whenever I test in game, its fine, but in a public instance it's invisible then gets stuck on whatever icon it changes to ( etc, hovering over leaderboard )

grave vortex
left shuttle
#

I've uploaded it like, 3 different times now, got a decal under the group for it, even an image

grave vortex
left shuttle
#

Works in studio, trying in game now

grave vortex
#

And where did you put the localscript

left shuttle
#

StarterPlayerScripts

#

Doesnt work ingame

grave vortex
#

Weird

left shuttle
#

All I want is just to replace the cursor with a small circle

grave vortex
#

Try this

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

-- wait player
local player = Players.LocalPlayer or Players.PlayerAdded:Wait()
local mouse = player:GetMouse()

local CURSOR_ID = "rbxassetid://128696788610269”

-- Function 
local function setCursor()
    -- Wait game
    if not game:IsLoaded() then
        game.Loaded:Wait()
    end
    
    -- Give time to load
    wait(1)
    
    -- Set cursor
    mouse.Icon = CURSOR_ID
    
    -- Create a loop that runs every 0.5s
    RunService.Heartbeat:Connect(function()
        if mouse.Icon ~= CURSOR_ID then
            mouse.Icon = CURSOR_ID
        end
    end)
    
    -- Print 
    print("Custom cursor set to: " .. CURSOR_ID)
end

local success, errorMsg = pcall(setCursor)
if not success then
    warn("Failed to set cursor: " .. errorMsg)
end
#

Try this

#

@left shuttle

left shuttle
#

Alrighty

#

local CURSOR_ID = "rbxassetid://128696788610269” has an error

#

"Malformed string"

grave vortex
#

Yeah I didn’t write good your id

#

Change it

left shuttle
#

works in studio

grave vortex
#

And in game ?

left shuttle
#

Attempting

#

Same error

grave vortex
#

Wdym same error

left shuttle
#

It just like, makes it so whatever the cursor changes, to it stays like that permanently unless changed

grave vortex
#

Weird

#

You trying on your pc or mobile ?

#

In Roblox

left shuttle
#

PC

grave vortex
#

Weird

left shuttle
#

im starting to wonder if it is the decal / image

#

But idk how to even tell if it is

#

It's uploaded, has an ID, just a small circle

grave vortex
#

Weird

left shuttle
#

Lemme try changing it to the other image ID

#

nope, same bug

lethal vault
lethal vault
left shuttle
left shuttle
#

How can I convert a png into a texture

#

( While you type lemme read up

lethal vault
left shuttle
#

That simple?

lethal vault
left shuttle
#

Switched it over to the texture and used the code from that doc, lemme test in game

#

Same bug

#

let me try a toolbox asset

#

okay wtf, it works with a random toolbox asset

lethal vault
lethal vault
#

then look for it in workspace, or tell if it gives an error

left shuttle
#

it loads 3 models

#

well no it loads 1 model*

#

I just did it 3 times

#

but yea it loads an empty model

lethal vault
#

okay sounds like you published the image wrong

left shuttle
#

I'm not sure how I could've

lethal vault
#

use the Asset Manager

left shuttle
lethal vault
#

or create a decal and click on the texture field and click Add Image

lethal vault
left shuttle
#

Which should I try first

#

And er, where even is asset manager

lethal vault
left shuttle
#

More things to read, fine by me

#

Trying the decal route first

lethal vault
left shuttle
#

Decal route doesnt work

#

Is there something wrong with this ???

lethal vault
#

why is that 1024x1024 in size

left shuttle
#

erm, high quality circle
-# I don't know.

#

I didn't see any resolution max size

lethal vault
#

The default mouse image is 64x64 pixels, with the mouse taking up 17x24 pixels of space.

left shuttle
#

Should I change the file to a 64x64 then

lethal vault
#

might help

left shuttle
#

Attempting

lethal vault
#

still fairly certain you just haven't published it properly

left shuttle
#

somehow

#

the size was the problem

#

Truly, I appreciate you tons for the help

#
  • The additional documents to read up on