Advertisement
TaylorsRus

Casting Controller

Jan 3rd, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. return function (ModuleName, Char, ExtraArgs)
  2.     local ModuleVar = game:GetService("ServerStorage").Modules.Movesets:FindFirstChild(Char:GetAttribute("Type")):FindFirstChild(ModuleName.Name)
  3.  
  4.     if ModuleVar then
  5.      
  6.         local Mouse = ExtraArgs[1]
  7.        
  8.         local UsingMove = ModuleVar:GetAttribute("UsingMove")
  9.         local Cooldown = ModuleVar:GetAttribute("Cooldown")
  10.        
  11.         local Module = require(ModuleVar)
  12.        
  13.         if not UsingMove then
  14.            
  15.             ModuleVar:SetAttribute("UsingMove", true)
  16.            
  17.             task.delay(Cooldown, function()
  18.                 ModuleVar:SetAttribute("UsingMove", false)
  19.             end)
  20.            
  21.             if ModuleVar:GetAttribute("RequiresMouse") then
  22.                 Module(Char, Mouse)
  23.             else           
  24.                 Module(Char)
  25.             enda
  26.                    
  27.         else
  28.             print("Is already using move")
  29.         end
  30.     else
  31.         print("No module exists.")
  32.     end
  33.    
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement