Change mouse if hovering over the object

Will test when I’m back, thanks!

1 Like

No problem :slightly_smiling_face:, I made a small change to the script, so if you didn’t try it yet it’s fine.

1 Like

im at my laptop but im confused. at one point it says to change something to my icon, but idk what to put there?

The IconId variable? It needs to be “rbxassetid://Your Decal Id”
Replace Your Decal Id with the id of the image

You can check if part is member of that folder or you can also use Collection Service, so you don’t need to parent each and every part. Its your wish after all though.

–This is a local script in the StarterPlayerScripts
local mouse = game.Players.LocalPlayer:GetMouse()
local RunService = game:GetService(“RunService”)
local DraggableParts = workspace[“Regen Parts”]
local iconId = 108939221

RunService.RenderStepped:Connect(function() --Every frame:
if(mouse.Target ~= nil) then --If the target isn’t nothing
if(mouse.Target:IsDescendantOf(DraggableParts)) then --If the target is in the folder
mouse.Icon = icon --Set it to your Icon
else
mouse.Icon = [[]]–Set it to default
end
else
mouse.Icon = [[]]–Set it to default
end
end)

at one point it says mouse icon = icon set it to your icon, what goes there

Oh, change icon to IconId, I forgot to rename it.

1 Like

i did that and have 3 things to ask, 1: the id in the script listed above becomes invisible for some reason 2: everytime the mouse becomes invisible and i click, it becomes normal but it should stay that 3: can u make the mouse only change if the player is at a distance of 15 studs away

Maybe iconId should be “rbxassetid://108939221”.
And yes it’s possible, just use magnitude.
Magnitude

1 Like

can you… script it? eh sorry… also how to fix the if i click the mouse becomes normal thing (maybe we can make it so if the mouse hovers over it becomes a decal and if u click it becomes another decal) changing the thing to asset id doesnt work, i tried other things too everything becomes invisible

I don’t know how to fix that, never happened to me before. Make sure nothing else changes it.
That’s with the distance:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local RunService = game:GetService("RunService")
local DraggableParts = workspace["Regen Parts"]
local iconId = “rbxassetid://108939221” 

RunService.RenderStepped:Connect(function() --Every frame:
	if(mouse.Target ~= nil) then --If the target isn't nothing
		if(mouse.Target:IsDescendantOf(DraggableParts) and (mouse.Target.Position - player.Character:WaitForChild("HumanoidRootPart").Position).Magnitude <= 15) then --If the target is in the folder
			mouse.Icon = iconId --Set it to your Icon
		else
			mouse.Icon = [[]]--Set it to default
		end
	else
		mouse.Icon = [[]]--Set it to default
	end
end)
2 Likes

https://gyazo.com/d2ed2fe1f3cc23db2866f17ad746029b mouse problem

Output? Are you sure your id is valid? Also, the quotation marks were different somehow in my script, I changed it, so I suggest you to paste it again.

1 Like

i already changed it. i used two decals already so i dont think theyd be invalid, and nothing in the output (in the video u saw the mouse when i clicked)

I am pretty sure that’s a problem only in your game, the script works perfectly for me. I think your decal is moderated or something, I tried with another decal and worked fine, with yours it was invisible.
And I also don’t experience the mouse becoming normal on click. So I think some of your scripts do it.
Here’s a video:
robloxapp-20200926-2041583.wmv (1.4 MB)

1 Like

the click to change doesnt really bother me, imma test it with other decals brb edit: it works! only like your video, its way too big. is there a way to scale it down

1 Like

Great! If it worked for you, please accept my answer as a solution :slightly_smiling_face:.
And I think it’s the size of the decal that matters, if the decal size is big, then it’ll be big in the mouse as well

1 Like

but isnt it possible to like put it in the script for the decal to be like 2x or something smaller

I don’t think so. I almost almost 100% sure you can’t.

1 Like

thats sad, i see you are a good scripter. i had a new post thats been up for 2 days and i reuploaded it today, mind helping me there too? its a bit more complicated though: Width/depth changing interferes with size changing