Mouse.Icon not working properly

Hi, I’m not entirely sure if this is the right topic or not but my hit markers seem to only work in the studio, and when I go in the game they don’t work but if I go back into the studio and playtest they work just fine. All I’m doing is changing the Mouse.Icon for when the target is hit by the player.

Gyazo link is what it’s suppose to do in-game (This was taken in studio)
https://gyazo.com/3301b87e7d9fb09cf77d5e6884174c16

My script:

local Marker = function()
	Mouse.Icon = 'rbxassetid://296276685'
	Sounds.Hit:Play()
	delay(0.1, function() Mouse.Icon = 'rbxassetid://57571495' end)
end

LocalScript or ServerScript?

Does Sounds.Hit play? If it does then the function is getting called. If not then check why the function isn’t firing to change the icon.

1 Like

The function is being fired, it work’s in studio and in game it’s also showing the print.

I retract that statement It is showing the print in studio, not in game. The function is only firing in studio and not in game which makes absolutely no sense.

There is no print in your section of script, so that doesn’t explain anything to somebody troubleshooting this.

My first question. Is it local or server?
I might be completely off, but from my understanding LocalScripts will work like ServerScripts in Studio because your computer is handling everything. When you play on a Server the LocalScript only works on your computer, but not on the Server.

I’m sorry, It’s local not server.

Yes, I just added a print after what you first said, and it only prints in studio and not in game.

This might sound like a silly idea (and it is) but have you actually, published the game?

If you have (which I am assuming is the case)
Could you provide more code, like where the function is being called from and how the script works

1 Like

Yes, I have published the game. MULTIPLE TIMES

Then I think we are going to need some more code, because there isn’t anything inherently wrong with the provided script.

Mhm, I agree I don’t see anything wrong with it and I’ve added a print and it’s not printing that in game but it prints fine in studio.

I tried out your script and it works fine in studio, but as you know does not work in a published game.

So, I made a quick simple back and forth script to force it to work (but it doesn’t):

local function marker()
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://296276685'
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://296276685'
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://296276685'
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://296276685'
end
marker()

The above script works in studio but not in a published game. So it seems like there is something wrong with your asset (rbxassetid://296276685)

I’m sorry for the late reply, I don’t think anything is wrong with the asset?

Cut and paste this into a LocalScript inside the StarterCharacterScripts:

local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local function marker()
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://68308747'
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://68308747'
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://68308747'
wait(5)
mouse.Icon = 'rbxassetid://57571495'
wait(5)
mouse.Icon = 'rbxassetid://68308747'
end
marker()

I replaced the asset id with a different one and now it works in studio and in a published game.

Seems like the asset 296276685 is corrupted somehow.

Should I try reuploading the hitmarker cursor? I’m just so confused as how it’s corrupted when it’s loaded fine on the roblox page.

I don’t know. But I do know it’s not working as it is.

This is a super weird bug I’ve came across, I hope someone from the roblox relations can reply with a reasoning behind this.