I want to make a simple change at the cursor just for some “old” vibes but as soon as the mouse is focusing at a gui element (for example a TextButton) it starts to revert back to its original Icon. Even tho’ the script at the bottom looks very small and looks I haven’t tried anything, I used different things like the UserInputService, although didn’t work. I tried to look in the devforums but I didn’t find any solution.
Code (in StarterGui.MouseIcon)
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
mouse.Icon = "rbxassetid://12323309516"
so, I guess every time the cursor over the GUI, the icon changes?
have you tried something like this?
local button = script.Parent -- Assuming the script is a child of the button
local normalCursor = 1 -- Replace with the cursor ID you want to use normally
local customCursor = 2 -- Replace with the cursor ID you want to use when hovering the button
button.MouseEnter:Connect(function()
-- Change cursor to the custom cursor icon
game:GetService("StarterGui"):SetCore("MouseIcon", customCursor)
end)
button.MouseLeave:Connect(function()
-- Change cursor back to the normal cursor icon
game:GetService("StarterGui"):SetCore("MouseIcon", normalCursor)
end)
This might work but idk. Change game:getservice parts to mouse.mouceicon like u did in the start
edit: also forgot to mention but since your using the new script that “i3_6Core” has provided you will have to get the local players mouse again
Unfortunately, button input will forcefully override the cursor’s icon, and there isn’t any trivial way to fix this. You could try creating a custom icon image that displays on top of everything at the cursor’s position, and changes its cursor icon on state change.
One way to do this is disabling the normal icon and replacing with a imagelabel like this:
local UIS = game:GetService("UserInputService")
UIS.MouseIconEnabled = false -- disables mouse icon
local NewMouse = Instance.new("ImageLabel",script.Parent) -- creates imagelabel which acts as your mouse
NewMouse.BackgroundTransparency = 1
NewMouse.Size = UDim2.new(0,75,0,75)
NewMouse.Image = "rbxassetid://12323309516"
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:Connect(function() -- makes ur new mouse follow ur actual mouse
NewMouse.Position = UDim2.new(0,Mouse.X-40,0,Mouse.Y-40)
end)
i put the one u wanted and fixed the offsets so u dont need to edit this
Oh I am so sorry! I overlooked the screenGui and it works perfectly fine now! I thank you very much and I will remember this from now on. Have a great day and a great day to the ones who also were so kind to help me!