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

When a player rejoins, the mouse is reset. Fixes?

Asked by 5 years ago

I have a localscript in startergui that changes the mouse icon that works, but when the player rejoins it's auto reset to the default mouse. I tried using game.Players.PlayerAdded:Connect, but that failed. Nothing in the output, etc.

Attempt #1 (works):

    local mouse = game.Players.LocalPlayer:GetMouse()
    mouse.Icon = "rbxassetid://1386173173"

Attempt #2 (failed):

game.Players.PlayerAdded:Connect(function()
    local mouse = game.Players.LocalPlayer:GetMouse()
    mouse.Icon = "rbxassetid://1386173173"
end)

1 answer

Log in to vote
0
Answered by
Mr_Unlucky 1085 Moderation Voter
5 years ago

The reason why is that you're calling the playeradded event in a local script.

local mouse = game:GetService("Players").LocalPlayer:GetMouse()
mouse.Icon = ""rbxassetid://1386173173" 
Ad

Answer this question