Mryeetmemes

MouseIcon for the Sword Script

Apr 11th, 2024
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  2. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  3.  
  4. Tool = script.Parent
  5.  
  6. Mouse = nil
  7.  
  8. function UpdateIcon()
  9.     if Mouse then
  10.         Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  11.     end
  12. end
  13.  
  14. function OnEquipped(ToolMouse)
  15.     Mouse = ToolMouse
  16.     UpdateIcon()
  17. end
  18.  
  19. function OnChanged(Property)
  20.     if Property == "Enabled" then
  21.         UpdateIcon()
  22.     end
  23. end
  24.  
  25. Tool.Equipped:Connect(OnEquipped)
  26. Tool.Changed:Connect(OnChanged)
Add Comment
Please, Sign In to add comment