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

How can I change the shift lock logo?

Asked by 5 years ago

I want the logo of shift lock to change from the circle to the default mouse. Any ways I can go by doing this?

1 answer

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You can manually impose a new Icon for the Cursor using 'mouse.Icon' to set a new Image ID. You'll have to set and reverse this every time you press Shift to make sure it doesn't follow through permanently. - This can be achieved through UserInputService.

--// Local Script - Preferably located in StarterPlayerScripts

local Player = game:GetService("Players").LocalPlayer
local Cursor = Player:GetMouse() --// Get Cursor from LocalPlayer
local CursorIcon = 'rbxassetid://##ID##' --// Cursor Icon ID

local UserInputService = game:GetService("UserInputService")
local Toggled = false

UserInputService.InputBegan:Connect(function(InputObject, GameProcessed)
    if (InputObject.UserInputType == Enum.UserInputType.Keyboard) then
        if (InputObject.KeyCode == Enum.KeyCode.LeftShift)  then
            if (GameProcessed) then return end
            if not (Toggled) then
                Cursor.Icon = CursorIcon; Toggled = true
            return end
            Toggled = false
            Cursor.Icon = ""
        end
    end
end)

Hope this helps! if so, don't forget to accept this answer!

0
I've amended this answer, it wasn't properly function though is now! Ziffixture 6913 — 5y
Ad

Answer this question