@0ssm4n, @xPuff_le@WEcompany
Thank you, but those ideas don’t seem to be working. I’m starting to wonder if the problem is with my version of studio rather than the script. It may work while playing in Roblox rather than Play-Testing
Maybe make sure the mouse exists before changing it? I noticed that sometimes the Mouse doesn’t really get replicated until the initial loading stage (invisible mouse, not replicated).
The same issue happens with LocalPlayer with Replication sometimes.
local Player = game.Players.LocalPlayer or game.Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
Player:GetMouse().Icon = "rbxassetid://5923963876"
What may be happening is Roblox automatically switching the mouse icon when it’s hovering over a GuiElement.
Sadly, Roblox will change back to the default icon instead of using the last mouse icon. You’ll have to either set it constantly or listen when it changes to a value that isn’t your custom icon.
On a side-note, you should use the rbxassetid protocol instead of using a direct link to keep your code clean!
local ID = "rbxassetid://5923963876"
local plr = game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()
repeat wait() until game:IsLoaded()
mouse.Icon = ID
Let me know if this works.
If you want a reset one just like @jrelvas said, do this:
local ID = "rbxassetid://5923963876"
local plr = game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()
repeat wait() until game:IsLoaded()
while true do
mouse.Icon = ID
end
It is not working for me also with most of the roblox Ids, no matter if I use rbxasset://SystemCursors/Cross, rbxassetid or any other kind of url.
The problem appears when I set the Icon from the beginning of the game, I solve it adding a wait() before setting the icon.
Also this shouldnt happen and I’m pretty sure is a bug that no one wants to fix. Even the example here: Mouse | Roblox Creator Documentation is not working without the wait().
I had to change the actual image of the icon because either the image that I was using before was corrupted or taken down, try this if you’re having problems. (MAKE SURE TO FIND YOUR IMAGES IN STUDIO FOR THIS)
I had the same issue. I fixed it by changing the link to "http://www.roblox.com/asset/?id=YourID" instead of "rbxassetid://YourID"
and using the UserInputService
local userInputService = game:GetService("UserInputService")
userInputService.MouseIcon = "http://www.roblox.com/asset/?id=YourID"