Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you add a mouseicon to tools?

I've tried to get a mouse icon for my tools, I've tried to look for tutorials but I couldn't find any

I've tried to do the code here it is:

local tool = script.Parent


tool.Equipped:Connect(function()
	local B = tool.Parent.Name wait(0.4)
local e = game.Players:FindFirstChild(B)
local j = e:GetMouse()
J.MouseIcon = "340533"
end)


4 comments

0

The property is Icon, not MouseIcon, and that isn't a valid icon id

0

https://developer.roblox.com/articles/Mouse-Icon-Appearance. Change the mouse icon when the tool is equipped/unequipped.

0

I also suggest you use more descriptive variable names, e and B and J aren't very descriptive

0

What? I was putting this code as a fake code so people could help me but it turned out it actually worked? I just did what you said, put it to Icon and change the ID! Thank you.

1 answer

Well first you gotta work out your variable naming why will you name the mouse variable j? just name it mouse; naming stuff, especially functions' names is imporant, here it's easy but sometimes your script gets crazy complicated.

ok next, its Mouse.Icon, the property name is Icon not MouseIcon, always check this type of stuff. And also, always if it's an image or a texture property you don't just put numbers like that you gotta do rbxassetid://idhere. And i think that's all the problems So this is your script

local tool = script.Parent

tool.Equipped:Connect(function()

   	local check = tool.Parent.Name 
	wait(0.4)
	local plr = game.Players:FindFirstChild(check)
	local mouse = e:GetMouse()
	mouse.Icon = "rbxassetid://340533"
end)

And if you want more info about mouse

This discussion is preserved as it was. New answers, comments, and votes are closed.