Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you add a mouseicon to tools?

Asked by 5 years ago

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)


0
The property is Icon, not MouseIcon, and that isn't a valid icon id User#24403 69 — 5y
0
https://developer.roblox.com/articles/Mouse-Icon-Appearance. Change the mouse icon when the tool is equipped/unequipped. LawlR 182 — 5y
0
I also suggest you use more descriptive variable names, e and B and J aren't very descriptive User#24403 69 — 5y
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. TechGamar 30 — 5y

1 answer

Log in to vote
0
Answered by
starmaq 1290 Moderation Voter
5 years ago

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

Ad

Answer this question