Mouseicon doesnt wanna change

hey everyone!! here i come with another weird mishap that should not be happening.
soo basically this is a not-so-complex script for changing the icon of the mouse to different “spells”
yeaa so for some reason it works in studio and doesnt in the actual game client.
im assuming this is because im not the owner of the game and the images are owned by me. probably the case except that different ui elements, containing images made by me are showing themselves perfectly fine… well, heres my script. perhaps a bit too much info but i wont be hiding anything for safety’s sake.

local plr = game.Players.LocalPlayer
local tool = script.Parent
local inputs = game:GetService("UserInputService")
local currentspell = tool.currentspell
local event = tool.changespell
local gui = tool.spellpage
local mouse
local check1 = tool.check1
local check2 = tool.check2
local check3 = tool.check3
local nospell = "http://www.roblox.com/asset/?id=81591860339725"
local pumpimage = "http://www.roblox.com/asset/?id=93705910540444"
local skelimage = "http://www.roblox.com/asset/?id=111600806633156"
local shieldimage = "http://www.roblox.com/asset/?id=82956532226510"

--summon to pumpkinball to shield "rbxassetid://76568679516657"

function setMousicon(icon)
	inputs.MouseIcon = icon
end

inputs.InputBegan:Connect(function(inp, processed)
	if processed or tool.equipped.Value == false then
		return
	end
	
	if inp.KeyCode == Enum.KeyCode.E then
		if currentspell.Value == "summon" then
			if check2.Value then
				setMousicon(pumpimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("pumpkin")
		end
		if currentspell.Value == "pumpkin" then
			if check3.Value then
				setMousicon(shieldimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("shield")
		end
		if currentspell.Value == "shield" then
			if check1.Value then
				setMousicon(skelimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("summon")
		end
	end
	if inp.KeyCode == Enum.KeyCode.Q then
		if currentspell.Value == "shield" then
			if check2.Value then
				setMousicon(pumpimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("pumpkin")
		end
		if currentspell.Value == "pumpkin" then
			if check1.Value then
				setMousicon(skelimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("summon")
		end
		if currentspell.Value == "summon" then
			if check3.Value  then
				setMousicon(shieldimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("shield")
		end
	end
end)

check1.Changed:Connect(function(val)
	if currentspell.Value == "summon" then
		if not val then
			setMousicon(nospell)
		end
		if val then
			setMousicon(skelimage)
		end
	end
end)
check2.Changed:Connect(function(val)
	if currentspell.Value == "pumpkin" then
		if not val then
			setMousicon(nospell)
		end
		if val then
			setMousicon(pumpimage)
		end
	end
end)
check3.Changed:Connect(function(val)
	if currentspell.Value == "shield" then
		if not val then
			setMousicon(nospell)
		end
		if val then
			setMousicon(shieldimage)
		end
	end
end)


tool.Equipped:Connect(function(maus)
	mouse = maus
	if currentspell.Value == "summon" then
		if check1.Value then
			setMousicon(skelimage)
		else
			setMousicon(nospell)
		end
	end
	if currentspell.Value == "pumpkin" then
		if check2.Value then
			setMousicon(pumpimage)
		else
			setMousicon(nospell)
		end
	end
	if currentspell.Value == "shield" then
		if check3.Value then
			setMousicon(shieldimage)
		else
			setMousicon(nospell)
		end
	end
	gui.Parent = plr.PlayerGui
end)

tool.Unequipped:Connect(function()
	setMousicon("rbxasset://textures\\ArrowFarCursor.png")
	gui.Parent = tool
end)

currentspell.Changed:Connect(function()
	gui.Frame.pagetext.Text = ("<Q "..currentspell.Value.." E>")
end)

*also forgot to mention that i did indeed try doing mouse.Icon = … buut it didnt work too.
**ill probably just ask the owner of the game to upload the images as their own and see if that works.

1 Like

hey everyone!! here i come with another weird mishap that should not be happening.
soo basically this is a not-so-complex script for changing the icon of the mouse to different “spells”
yeaa so for some reason it works in studio and doesnt in the actual game client.
im assuming this is because im not the owner of the game and the images are owned by me. probably the case except that different ui elements, containing images made by me are showing themselves perfectly fine… well, heres my script. perhaps a bit too much info but i wont be hiding anything for safety’s sake.

local plr = game.Players.LocalPlayer
local tool = script.Parent
local inputs = game:GetService("UserInputService")
local currentspell = tool.currentspell
local event = tool.changespell
local gui = tool.spellpage
local mouse
local check1 = tool.check1
local check2 = tool.check2
local check3 = tool.check3
local nospell = "http://www.roblox.com/asset/?id=81591860339725"
local pumpimage = "http://www.roblox.com/asset/?id=93705910540444"
local skelimage = "http://www.roblox.com/asset/?id=111600806633156"
local shieldimage = "http://www.roblox.com/asset/?id=82956532226510"

--summon to pumpkinball to shield "rbxassetid://76568679516657"

function setMousicon(icon)
	inputs.MouseIcon = icon
end

inputs.InputBegan:Connect(function(inp, processed)
	if processed or tool.equipped.Value == false then
		return
	end
	
	if inp.KeyCode == Enum.KeyCode.E then
		if currentspell.Value == "summon" then
			if check2.Value then
				setMousicon(pumpimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("pumpkin")
		end
		if currentspell.Value == "pumpkin" then
			if check3.Value then
				setMousicon(shieldimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("shield")
		end
		if currentspell.Value == "shield" then
			if check1.Value then
				setMousicon(skelimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("summon")
		end
	end
	if inp.KeyCode == Enum.KeyCode.Q then
		if currentspell.Value == "shield" then
			if check2.Value then
				setMousicon(pumpimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("pumpkin")
		end
		if currentspell.Value == "pumpkin" then
			if check1.Value then
				setMousicon(skelimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("summon")
		end
		if currentspell.Value == "summon" then
			if check3.Value  then
				setMousicon(shieldimage)
			else
				setMousicon(nospell)
			end
			event:FireServer("shield")
		end
	end
end)

check1.Changed:Connect(function(val)
	if currentspell.Value == "summon" then
		if not val then
			setMousicon(nospell)
		end
		if val then
			setMousicon(skelimage)
		end
	end
end)
check2.Changed:Connect(function(val)
	if currentspell.Value == "pumpkin" then
		if not val then
			setMousicon(nospell)
		end
		if val then
			setMousicon(pumpimage)
		end
	end
end)
check3.Changed:Connect(function(val)
	if currentspell.Value == "shield" then
		if not val then
			setMousicon(nospell)
		end
		if val then
			setMousicon(shieldimage)
		end
	end
end)


tool.Equipped:Connect(function(maus)
	mouse = maus
	if currentspell.Value == "summon" then
		if check1.Value then
			setMousicon(skelimage)
		else
			setMousicon(nospell)
		end
	end
	if currentspell.Value == "pumpkin" then
		if check2.Value then
			setMousicon(pumpimage)
		else
			setMousicon(nospell)
		end
	end
	if currentspell.Value == "shield" then
		if check3.Value then
			setMousicon(shieldimage)
		else
			setMousicon(nospell)
		end
	end
	gui.Parent = plr.PlayerGui
end)

tool.Unequipped:Connect(function()
	setMousicon("rbxasset://textures\\ArrowFarCursor.png")
	gui.Parent = tool
end)

currentspell.Changed:Connect(function()
	gui.Frame.pagetext.Text = ("<Q "..currentspell.Value.." E>")
end)

*also forgot to mention that i did indeed try doing mouse.Icon = … buut it didnt work too.
**ill probably just ask the owner of the game to upload the images as their own and see if that works.

what? thats literally my older post.

1 Like