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

How can I give this HopperBin a loading mouse icon? [Answered]

I am working on making a script that duplicates a model inside of a HopperBin, then waits 30 seconds until it can be spawned again. Everything is how I would like it to be, other than the mouse icon. I have tried putting these into the script into several places:

	if enabled then mouse.Icon = "rbxasset://textures\\GunCursor.png"
	if not enabled then mouse.Icon = 'rbxasset://textures/GunWaitCursor.png'

I still haven't made much progress so help would be very much appreciated, here is the script that I need help with

local enabled = true
bin = script.Parent

reloadtime = 30

function onButton1Down(mouse)
	if not enabled then return end
	enabled = false

	local model = bin["Model"]:clone()
	local player = game.Players.LocalPlayer 
	if player == nil then return end 
	local h = game.workspace
	model.Parent = h
	model:MakeJoints()
	model:MoveTo(mouse.hit.p)
wait(30) -- How long untill your next spawn
enabled = true
end

function onSelected(mouse)
		if enabled then mouse.Icon = "rbxasset://textures\\GunCursor.png"
		if not enabled then mouse.Icon = 'rbxasset://textures/GunWaitCursor.png'
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end



bin.Selected:connect(onSelected)

Thank you in advance

1 answer

✓ Accepted answer

Don't use backslashes whilst defining the Icon.

  • AND REMEMBER TO CLOSE YOUR IF STATEMENTS WITH AN END
if enabled then mouse.Icon = "rbxasset://textures//GunCursor.png" end

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