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

Problem with my hopperbin code?

Asked by 8 years ago

Basically, I want my tool to first start with changing the players mouse icon. But, i'm getting an error whenever I equip the hopperbin. Here is my error: Id is not a valid member of PlayerMouse

Help?

player = game.Players.LocalPlayer
tool = script.Parent

tool.Selected:connect(function(t)
    local mouse = player:GetMouse()
    mouse.Id = "http://www.roblox.com/asset/?id=138624641"

    t.Button1Down:connect(function()

    end)
end)

1 answer

Log in to vote
2
Answered by
funyun 958 Moderation Voter
8 years ago

The error is self explanatory. Mouse objects don't have an "Id" property.

player = game.Players.LocalPlayer
tool = script.Parent

tool.Selected:connect(function(t)
    local mouse = player:GetMouse()
    mouse.Icon = "http://www.roblox.com/asset/?id=138624641" --mouse.Icon, rather than mouse.Id

    t.Button1Down:connect(function()

    end)
end)

Ad

Answer this question