I need to fix this so I can have a working cursor.
roblox studio works for mouse cursor but not in game
I’ve changed the icons size to 256x256, I’ve tried using mouse icons already uploaded, I’ve used the actual assetid and not the library id, I’ve tried making a GUI frame but that failed because the cursor was out of line with the mouse.
local script:
local Camera = game.Workspace.CurrentCamera
local mouse1 = game.Players.LocalPlayer:GetMouse()
local Eq = false
function Equipped()
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "http://www.roblox.com/asset?id=9834486087"
print("Changed!")
Camera.FieldOfView = 65
Eq = true
--change icon
end
function Unequipped()
mouse1.Icon = "rbxasset://SystemCursors/Arrow"
Camera.FieldOfView = 70
Eq = false
--change icon to normal cursor
end
mouse1.Changed:Connect(function()
local mouse = game.Players.LocalPlayer:GetMouse()
if Eq == false then return end
if not mouse.Icon == "http://www.roblox.com/asset?id=9834486087" then
mouse.Icon = "http://www.roblox.com/asset?id=9834486087"
print("Changed!?!?!?!")
end
print(mouse.Icon)
end) --- if icon is changed to normal then fix back to crosshair
script.Parent.Equipped:Connect(Equipped)
script.Parent.Unequipped:Connect(Unequipped)
Make sure you published the updates to the game, and that your tool has a handle. If you don’t want your tool to have a handle turn off the property “RequiresHandle” on your tool. It will block some events on the tool if your tool doesn’t have a part in it named “Handle”.
Also set the mouse icon to an empty string inside the “Unequipped” function, otherwise you will still have the Arrow icon as your mouse even if you hover over buttons.
function Unequipped()
mouse1.Icon = ""
Camera.FieldOfView = 70
Eq = false
--change icon to normal cursor
end
Tools Requiredhandle is already turned off, if you test the script I made you will see that it prints when it is equipped and everything. game is published too plus the only problem really is the icon but thanks for the help.
Yeah I tested your script in studio with RequireHandle turned off, and it works fine for me. So it might just be roblox jank or someting.
Also, it might be another scripts in your game interfering, check the console by pressing F9 ingame and open client tab. Check if it prints “Changed” there, if it does but nothing changes it might just be a script interfering. Do you have some sort of anti cheat in your game that could be preventing it?
I have the exact same issue regarding Mouse.icon not working in the actual roblox client. Except, whenever I changed my icon to 256x256, it made the cursor massive.