Advertisement
Guest User

PETER HULL

a guest
Apr 1st, 2020
1,218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.12 KB | None | 0 0
  1. script.Parent.Equipped:connect(function(Mouse)
  2.     Equipped = true
  3.     game:GetService("ContextActionService"):BindAction("block", Block, true, "q", Enum.KeyCode.ButtonR2)
  4.     game:GetService("ContextActionService"):SetTitle("block", "Block")
  5.     game:GetService("ContextActionService"):SetPosition("block", UDim2.new(0.7, 0, 0.2, 0))
  6.     script.Parent.Wand:FireServer("equipped")
  7.     Mouse.Button1Down:connect(function()
  8.         if player.Clashing.Value == false then
  9.         if not Enabled and Chat ~= "" and Chat:sub(1, 8) ~= "apparate" then --Stupefy type spell
  10.             Enabled = true
  11.            
  12.             if player.Character.HumanoidRootPart:FindFirstChild("CastTurn") then
  13.                 player.Character.HumanoidRootPart.CastTurn:Destroy()
  14.             end
  15.             if Chat:sub(1,8) ~= "propero" then
  16.                 local bg = Instance.new("BodyGyro")
  17.                 game:GetService("Debris"):AddItem(bg,.75)
  18.                 bg.P = 20000
  19.                 bg.Name = "CastTurn"
  20.                 bg.maxTorque = Vector3.new(0, math.huge, 0)
  21.                 bg.cframe = CFrame.new(player.Character.HumanoidRootPart.Position, Mouse.Hit.p)
  22.                 bg.Parent = player.Character.HumanoidRootPart
  23.             end
  24.             script.Parent.Attack:FireServer(Chat, Mouse.Hit.p)
  25.  
  26.             --Chat = ""
  27.            
  28.  
  29.         wait(SpellCooldown)
  30.        
  31.         Enabled = false
  32.            
  33.            
  34.            
  35.         elseif not Enabled and Chat:sub(1, 8) == "apparate" and Chat:sub(1, 9) ~= "apparate " then --Apparate point click
  36.             Enabled = true
  37.            
  38.             script.Parent.Attack:FireServer(Chat:sub(1, 8), Mouse.Hit.p)
  39.            
  40.             Chat = ""
  41.            
  42.             wait(1.5)
  43.            
  44.             Enabled = false
  45.            
  46.     elseif not Enabled and Chat:sub(1, 9) == "apparate " then --Apparate person
  47.             Enabled = true
  48.            
  49.             print(Chat)
  50.             local name = Chat:sub(10)
  51.            
  52.             local target
  53.            
  54.             for _, plr in pairs (game.Players:GetPlayers()) do
  55.                 if name ~= "" and plr.Name:lower():find(name) == 1  then
  56.                     target = plr
  57.                 end
  58.             end
  59.        
  60.             if target == nil or target.Character:FindFirstChild("NotApparatable") then
  61.                 script.Parent.Attack:FireServer(Chat:sub(1, 8), Mouse.Hit.p)
  62.             else
  63.                 script.Parent.Attack:FireServer(Chat:sub(1, 8), target.Character.UpperTorso.Position)
  64.             end
  65.            
  66.             Chat = ""
  67.            
  68.             wait(1.5)
  69.            
  70.             Enabled = false
  71.            
  72.         end
  73.         end
  74.     end)
  75. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement