Advertisement
Xfer1111

Blood Samurai 2 - Easier Casts (Cast Needed-Controls at end of script)

Jan 21st, 2021
2,087
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.11 KB | None | 0 0
  1. repeat wait() until game.Players ~= nil
  2. repeat wait() until game.Players.LocalPlayer ~= nil
  3. if game.GameId ~= 1968036988 then
  4.     return
  5. end
  6. local Mouse = game.Players.LocalPlayer:GetMouse()
  7. local Casts = {
  8.     fire = "Cast: 燃える刃!";
  9.     lightning = "Cast: ライトニング刃!";
  10.     dark = "Cast: 闇刃!";
  11.     thunder = "Cast: サンダー刃!";
  12.     inferno = "Cast: インフェルノブレード!";
  13.     ice = "Cast: 氷の刃!";
  14. }
  15. local CastCooldowns = {
  16.     fire = false;
  17.     lightning = false;
  18.     dark = false;
  19.     thunder = false;
  20.     inferno = false;
  21.     ice = false;
  22. } -- to stop me from doing stuff twice really fast
  23. local function cast(str)
  24.     game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(str, "To "..game.Players.LocalPlayer.Name)
  25.     game.Players:Chat(str)
  26. end
  27. local function say(msg, target)
  28.     if game.ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents") then
  29.         if game.ReplicatedStorage.DefaultChatSystemChatEvents:FindFirstChild("SayMessageRequest") then
  30.             if target == nil then
  31.                 game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(msg, "All")
  32.                 game.Players:Chat(msg)
  33.             else
  34.                 game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer("/w "..target.." "..msg, "All")
  35.             end
  36.         end
  37.     end
  38. end
  39. game.Players.LocalPlayer.Chatted:Connect(function(msg)
  40.     if string.sub(string.gsub(string.lower(msg), "/e ", ""), 1,4) == "cast" or string.sub(string.gsub(string.lower(msg), "/e ", ""), 1,5) == ":cast" then
  41.         local arg = string.gsub(string.lower(msg), "/e ", "")
  42.         arg = string.gsub(string.lower(arg), ":", "")
  43.         arg = string.gsub(string.lower(arg), "cast ", "")
  44.         arg = string.gsub(string.lower(arg), " ", "")
  45.         for i,v in pairs(Casts) do
  46.             if string.sub(string.lower(i), 1, #arg) == string.lower(arg) and CastCooldowns[i] == false then
  47.                 cast(v)
  48.                 CastCooldowns[i] = true
  49.                 wait(2)
  50.                 CastCooldowns[i] = false
  51.             end
  52.         end
  53.         return
  54.     end
  55.     if not string.find(msg, ":") and not string.find(msg, "/e ") then
  56.         return
  57.     end
  58. end)
  59.  
  60.  
  61. Mouse.KeyDown:Connect(function(key)
  62.     if game.Players.LocalPlayer.Character == nil then
  63.         return
  64.     end
  65.     if not game.Players.LocalPlayer.Character:FindFirstChild("WeaponEquipped") then
  66.         return
  67.     end
  68.     if game.Players.LocalPlayer.Character.WeaponEquipped.Value == false then
  69.         return
  70.     end
  71.     if key == "y" and CastCooldowns["dark"] == false then
  72.         say(Casts["dark"])
  73.         game.Players:Chat(Casts["dark"])
  74.         CastCooldowns["dark"] = true
  75.         wait(2)
  76.         CastCooldowns["dark"] = false
  77.     end
  78.     if key == "j" and CastCooldowns["fire"] == false then
  79.         say(Casts["fire"])
  80.         game.Players:Chat(Casts["fire"])
  81.         CastCooldowns["fire"] = true
  82.         wait(2)
  83.         CastCooldowns["fire"] = false
  84.     end
  85.     if key == "k" and CastCooldowns["inferno"] == false then
  86.         say(Casts["inferno"])
  87.         game.Players:Chat(Casts["inferno"])
  88.         CastCooldowns["inferno"] = true
  89.         wait(2)
  90.         CastCooldowns["inferno"] = false
  91.     end
  92.     if key == "h" and CastCooldowns["ice"] == false then
  93.         say(Casts["ice"])
  94.         game.Players:Chat(Casts["ice"])
  95.         CastCooldowns["ice"] = true
  96.         wait(2)
  97.         CastCooldowns["ice"] = false
  98.     end
  99.     if key == "b" and CastCooldowns["thunder"] == false then
  100.         say(Casts["thunder"])
  101.         game.Players:Chat(Casts["thunder"])
  102.         CastCooldowns["thunder"] = true
  103.         wait(2)
  104.         CastCooldowns["thunder"] = false
  105.     end
  106.     if key == "n" and CastCooldowns["lightning"] == false then
  107.         say(Casts["lightning"])
  108.         game.Players:Chat(Casts["lightning"])
  109.         CastCooldowns["lightning"] = true
  110.         wait(2)
  111.         CastCooldowns["lightning"] = false
  112.     end
  113. end)
  114.  
  115. --[[
  116.  
  117. Y Key: Dark
  118. J Key: Fire
  119. K Key: Inferno
  120. H Key: Ice
  121. B Key: Thunder
  122. N Key: Lightning
  123.  
  124. --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement