Advertisement
TheRealAaron
May 8th, 2023
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. In this improved version:
  3. - The `ShiftlockStarterGui` is given additional properties like `DisplayOrder` and `ResetOnSpawn` for better control.
  4. - The shift lock icon image is set using a valid asset ID. Replace it with your own image ID.
  5. - The `ShiftLockController` functionality is moved to a separate module script for better organization and reusability.
  6. - The shift lock functionality is encapsulated within the `ShiftLockController` module.
  7. - The shift lock button's click event is connected directly to the `ToggleShiftLock` function, making the code cleaner.
  8. - The shift lock functionality is bound to the LeftShift key input event for convenience.
  9. - The shift lock button's visibility is updated based on the user's device (touch-enabled or not).
  10.  
  11. Feel free to modify and further enhance the code to fit your specific requirements.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement