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

Can someone explain how to convert a ROBLOX Decal into an rbxasset?

Asked by 9 years ago

I have found a nice decal for a mouse icon but whenever I try to apply the icon, it just becomes the default mouse icon. Here is the code I used:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
if player ~= nil then
    print("Player isn't nil!")
    mouse.Icon = "http://www.roblox.com/Asset?id=48980160"
end

This is in a LocalScript under StarterPack

0
If I recall correctly, you actually can't change the mouse Icon from the instance returned from mouse. jakedies 315 — 9y

2 answers

Log in to vote
1
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
9 years ago

I don't think you can change the Icon property of PlayerMouse (the mouse returned from GetMouse) unless they changed that.

But if they did change that, you would just subtract 1 from the asset's ID.

mouse.Icon = "http://www.roblox.com/Asset?id=48980159" -- I decremented it

If they hadn't changed that, you would have to do a hack to change it: Force equip the tool Set the icon (from the mouse returned by the Equipped event) Remove the tool (not Destroying)

Also be sure to have a reference to the tool (like: local tool = script.Parent) Also, I am not sure if this hack still works but it's worth a try.

0
Thank you very much! I forgot about subracting 1 from the asset's ID. And they did change it, I only had to subtract 1 from the asset ID in my code. SenorPiggy 10 — 9y
0
No problem, I stated that because in the past, the PlayerMouse object had no Icon property (the mouse returned from GetMouse) so I guess roblox changed that :) jakedies 315 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Copy the id of the asset and put it in the id of rbxasset:/

EDIT: Sorry, it's actually "rbxassetid://"

0
Doesn't work. SenorPiggy 10 — 9y

Answer this question