Advertisement
Ak8D

AluStaff v1.6

Mar 6th, 2013
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.14 KB | None | 0 0
  1. --[[
  2. AluStaff v1.6 by Alureon
  3. --]]
  4. local version = 1.6
  5. local player = game.Players.LocalPlayer
  6. local tool = Instance.new("Tool", player.Backpack)
  7. tool.Name = "AluStaff " .. version
  8.  
  9. local mode = 1
  10. --[[
  11. # = MODE = KEY
  12. 1 = KILL = K
  13. 2 = KICK = J
  14. 3 = SAFECHAT = Z
  15. 4 = UNSAFECHAT = C
  16. 5 = FREEZE = F
  17. 6 = THAW = T
  18. --]]
  19.  
  20. --[[
  21. TODO:
  22. Add more modes
  23. --]]
  24.  
  25. local user
  26.  
  27. local staffhandle = Instance.new("Part", tool)
  28. staffhandle.Name = "Handle"
  29. staffhandle.Size = Vector3.new(1, 6, 1)
  30. staffhandle.BrickColor = BrickColor.new(217)
  31. staffhandle.CanCollide = false
  32. local cyl = Instance.new("CylinderMesh", staffhandle)
  33. cyl.Scale = Vector3.new(0.3, 1, 1)
  34. local ball = Instance.new("Part", tool)
  35. ball.Name = "ball"
  36. ball.BrickColor = BrickColor.new("Bright red")
  37. ball.Size = Vector3.new(1, 1, 1)
  38. ball.CanCollide = false
  39. local sph = Instance.new("SpecialMesh", ball)
  40. sph.MeshType = "Sphere"
  41.  
  42. local w1 = Instance.new("Weld", tool.Handle)
  43. w1.Part0 = tool.Handle
  44. w1.Part1 = tool.ball
  45. w1.C1 = CFrame.new(0, -3, 0)
  46.  
  47. function setBallColor(color, tewl)
  48.     tewl.ball.BrickColor = color
  49. end
  50.  
  51. function createRayPart(pos, tewl, dist, color)
  52.     pcall(function()
  53.     local LightningP = Instance.new("Part", user)
  54.     LightningP.Name          = "LightningP"
  55.     LightningP.BrickColor    = color
  56.     LightningP.Anchored      = true
  57.     LightningP.CanCollide    = false
  58.     LightningP.TopSurface    = Enum.SurfaceType.Smooth
  59.     LightningP.BottomSurface = Enum.SurfaceType.Smooth
  60.     LightningP.formFactor    = Enum.FormFactor.Custom
  61.     LightningP.Size          = Vector3.new(0.2, 0.2, dist)
  62.     LightningP.CFrame        = CFrame.new(pos, tewl.ball.CFrame.p) * CFrame.new(0, 0, -dist/2)
  63.     game.Debris:AddItem(LightningP, 0.1)
  64.     end)
  65. end
  66.  
  67. tool.Equipped:connect(function(mouse)
  68.     user = tool.Parent
  69.    
  70.     mouse.KeyDown:connect(function(key)
  71.         if key == "k" then
  72.             mode = 1
  73.             setBallColor(BrickColor.new("Bright red"), tool)
  74.         elseif key == "j" then
  75.             mode = 2
  76.             setBallColor(BrickColor.new("Bright blue"), tool)
  77.         elseif key == "z" then
  78.             mode = 3
  79.             setBallColor(BrickColor.new("Lavender"), tool)
  80.         elseif key == "c" then
  81.             mode = 4
  82.             setBallColor(BrickColor.new("Sand blue"), tool)
  83.         elseif key == "f" then
  84.             mode = 5
  85.             setBallColor(BrickColor.new("Navy blue"), tool)
  86.         elseif key == "t" then
  87.             mode = 6
  88.             setBallColor(BrickColor.new("Br. yellowish orange"), tool)
  89.         end
  90.     end)
  91.    
  92.     mouse.Button1Down:connect(function()
  93.         local ray = Ray.new(tool.ball.CFrame.p, (mouse.Hit.p - tool.ball.CFrame.p).unit*300)
  94.         local hit, position = game.Workspace:FindPartOnRay(ray, user)
  95.         local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
  96.         local brickclr
  97.    
  98.         local distance = (position - tool.ball.CFrame.p).magnitude
  99.         if mode == 1 then
  100.             createRayPart(position, tool, distance, BrickColor.new("Bright red"))
  101.             if humanoid then
  102.                 pcall(function() humanoid:TakeDamage(math.huge) end)
  103.             end
  104.         elseif mode == 2 then
  105.             createRayPart(position, tool, distance, BrickColor.new("Bright blue"))
  106.             if humanoid then
  107.                 pcall(function() game.Players:GetPlayerFromCharacter(humanoid.Parent):destroy() end)
  108.             end
  109.         elseif mode == 3 then
  110.             createRayPart(position, tool, distance, BrickColor.new("Lavender"))
  111.             if humanoid then
  112.                 pcall(function() game.Players:GetPlayerFromCharacter(humanoid.Parent):SetSuperSafeChat(true) end)
  113.             end
  114.         elseif mode == 4 then
  115.             createRayPart(position, tool, distance, BrickColor.new("Sand blue"))
  116.             if humanoid then
  117.                 pcall(function() game.Players:GetPlayerFromCharacter(humanoid.Parent):SetSuperSafeChat(false) end)
  118.             end
  119.         elseif mode == 5 then
  120.             createRayPart(position, tool, distance, BrickColor.new("Navy blue"))
  121.             if humanoid then
  122.                 pcall(function()
  123.                 for _,v in pairs(humanoid.Parent:GetChildren()) do
  124.                     if not v.Anchored then
  125.                         v.Anchored = true
  126.                     end
  127.                 end
  128.                 end)
  129.             end
  130.         elseif mode == 6 then
  131.             createRayPart(position, tool, distance, BrickColor.new("Br. yellowish orange"))
  132.             if humanoid then
  133.                 pcall(function()
  134.                 for _,v in pairs(humanoid.Parent:GetChildren()) do
  135.                     if v.Anchored then
  136.                         v.Anchored = false
  137.                     end
  138.                 end
  139.                 end)
  140.             end
  141.         end
  142.     end)
  143. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement