Mouse change not working

Super simple, just can’t figure out why mouse won’t switch to the image

local mouse = game.Players.LocalPlayer:GetMouse()
local runService = game:GetService("RunService")

local frame = script.Parent

local entered = false


frame.MouseEnter:Connect(function ()
	mouse.Icon = script.Decal.Texture
end)

frame.MouseLeave:Connect(function ()
	mouse.Icon = "rbxasset://SystemCursors/Arrow"
end)

It might be that the Decal’s texture hasn’t loaded properly yet. Try adding a variable with :WaitForChild() like this, so the script waits until the Decal exists before using it:

local Decal = script:WaitForChild("Decal")

frame.MouseEnter:Connect(function ()
	mouse.Icon = Decal.Texture
end)
1 Like

mouse.Icon = script.Decal.Texture is basically assigning the icon to a full asset url, whereas mouse.Icon doesnt use the full asset url instead it uses rbxassetid://. Instead of getting the texture of the decal you can just assign the mouseicon the asset id, or if u rlly want to use the decal texture then you can extract it

1 Like