Hello, I basically wanted to make when you equip the the tool it will change a decal ID, but i keep getting this error: PlayerGui is not a valid member of Mouse “Instance”
in a local script (that is in either the player gui, tools, or player character,(i might be missing some)) you get the player with Players.LocalPlayer (with players being the player service)
In @56ytr56’s script, it isn’t. It gets the local player, and throws the mouse variable into the deep dark world of nil as it is not used at all, and neither should you.
the best thing i can think of is there is an error, now I’m not 100% sure how to check for errors but try placing it in a pcall to see if it returns any errors
script.Parent.Equipped:Connect(function(mouse)
local s, err = pcall(function()
game:GetService("Players").LocalPlayer.PlayerGui.Stats.ToolIcon.Image = "rbxassetid://6233227834"
end)
if not s then
warn(err)
end
end)
now I’m not 100% sure if this will work but it should warn if there were any errors
alright so i dont see any typos yet so I dont know what exactly is wrong, you could of course add the waitforchild but i dont think it’ll do anything at this point, also you may remove the pcall as its not going to do much
The issue is that you’re trying to load a decal ID onto an image asset. You’ll need to insert a decal onto a random part in workspace, then copy that decal ID and paste it into that decal Instance. Then, grab the new rbxassetid you got and insert it into your script.