astronaut32

Keta protectors

Nov 6th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. -- Keta Protecters Made By kert109
  2. Attacking = false
  3. Health = 300
  4. NorWalkSpeed = 20
  5. RunWalkSpeed = 35
  6. ButtonHold = false
  7. Walking = false
  8. Jumping = false
  9. FastRunning = false
  10. MouseHold = false
  11. Mode = 1
  12. GoToMode = 1
  13. Dmg = {
  14. SlashDamage = math.random(10,20);
  15. MagicDmg = math.random(20,50);
  16. };
  17. Player = game.Players.LocalPlayer
  18. Char = Player.Character
  19. Hum = Char.Humanoid
  20. Head = Char.Head
  21. Torso = Char.Torso
  22. Ra = Char["Right Arm"]
  23. La = Char["Left Arm"]
  24. Rl = Char["Right Leg"]
  25. Ll = Char["Left Leg"]
  26. Mouse = Player:GetMouse()
  27. pcall(function()Char.Mod:Destroy()end)
  28. pcall(function()Char["Suit[1][kert109]"]:Destroy()end)
  29. script.Name = "Suit[1][kert109]"
  30. local Main = Instance.new("Model",Char)
  31. Main.Name = "Mod"
  32. v3 = Vector3.new; mr = math.rad;
  33. cw = coroutine.wrap; mrd = math.random;
  34. cf = CFrame.new; ud2 = UDim2.new;
  35. ca = CFrame.Angles; v2 = Vector2.new
  36. bc = BrickColor.new; inst = Instance.new
  37. function part(par,size,color,tra,can)
  38. local P = Instance.new("Part",par)
  39. P.FormFactor = "Custom"
  40. P.Size = size
  41. P.Anchored = false
  42. P.BrickColor = BrickColor.new(color)
  43. P.Transparency = tra
  44. P.CanCollide = can
  45. P.TopSurface = 0
  46. P.BottomSurface = 0
  47. P:BreakJoints()
  48. return P
  49. end
  50. function w(par,p0,p1,typ,cfz)
  51. local W = Instance.new("Weld",par)
  52. W.Part0 = p0
  53. W.Part1 = p1
  54. if typ == true then
  55. W.C0 = cfz
  56. else
  57. W.C1 = cfz
  58. end
  59. return W
  60. end
  61. function mesh(par,id,tex,typ,scal)
  62. local M = Instance.new("SpecialMesh",par)
  63. M.MeshId = id
  64. M.TextureId = tex
  65. M.MeshType = typ
  66. M.Scale = scal
  67. return M
  68. end
  69. function fj(lim,tor,cf1,cf2)
  70. local j = part(Main,v3(0,0,0),"",.5,true)
  71. local w1 = w(j,j,tor,false,cf1)
  72. local w2 = w(j,j,lim,false,cf2)
  73. return w1
  74. end
  75. function lerp(a,b,c)return a+(b-a)*c end
  76. function clerp(c1,c2,al) --Smooth Animation!
  77. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  78. for i,v in pairs(com1) do com1[i] = lerp(v,com2[i],al)end
  79. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  80. end
  81. function DamageFunc(hit,Damage,timz)
  82. local hum = hit.Parent:FindFirstChild("Humanoid")
  83. if hum and not hum:FindFirstChild("Dmgz:"..Player.Name) and hit.Parent ~= Char and hit.Parent ~= Workspace and Damage and timz then
  84. hum:TakeDamage(Damage)
  85. local a = Instance.new("StringValue",hum)a.Name = "Dmgz:"..Player.Name
  86. game.Debris:AddItem(a,timz)
  87. local b = Instance.new("ObjectValue",hum)b.Name = "creator" b.Value = Player
  88. game.Debris:AddItem(b,10)
  89. end
  90. end
  91. --[[Stuff below:]]
  92. Hum.MaxHealth = Health wait()
  93. Hum.Health = Health
  94. Hum.WalkSpeed = NorWalkSpeed
  95. Hum.Died:connect(function()
  96. local e = Instance.new("Explosion",Torso)
  97. e.Position = Torso.Position
  98. e.BlastPressure = 10000
  99. end)
  100. MainC = "White"
  101. SecC = "Bright red"
  102. function MakeProtector()
  103. local mp = part(Main,v3(2,2,2),MainC,0,false)mesh(mp,"","","Sphere",v3(1,1,1))
  104. mp.CFrame = Head.CFrame
  105. local p = part(Main,v3(2,.5,2),SecC,0,false)w(p,mp,p,true,cf(-.1,0,0))mesh(p,"","","Sphere",v3(1.1,1,1.15))
  106. local p = part(Main,v3(2,.5,2),SecC,0,false)w(p,mp,p,true,cf(-.1,0,0)*ca(mr(90),0,0))mesh(p,"","","Sphere",v3(1.1,1,1.15))
  107. local p = part(Main,v3(.75,.75,.75),SecC,0,false)w(p,mp,p,true,cf(.75,0,0)*ca(mr(0),0,0))mesh(p,"","","Sphere",v3(1,1,1))
  108. local pm = part(Main,v3(.25,.25,.25),MainC,0,false)w(pm,mp,pm,true,cf(1.1,0,0))mesh(pm,"","","Sphere",v3(1,1,1))
  109. local bg = Instance.new("BodyGyro",pm)bg.maxTorque = v3()*math.huge
  110. local bp = Instance.new("BodyPosition",mp)bp.maxForce = v3()*math.huge
  111. mp.Touched:connect(function(hit)
  112. if Mode == 3 then
  113. if hit.Parent:FindFirstChild("Humanoid") then
  114. DamageFunc(hit,10,0)
  115. elseif hit.Name ~= "Base" and hit.Parent.Parent ~= Char then
  116. hit:Destroy()
  117. end
  118. end
  119. end)
  120. return p,bp,bg
  121. end
  122. function Shoot(Obj,Type,Color)
  123. local NewRay = Ray.new(Obj.CFrame.p,(Mouse.Hit.p-Obj.CFrame.p+v3(mrd(-.5,.5),0,mrd(-.5,.5)) ).unit * 300)
  124. local hit, Pos = game.Workspace:FindPartOnRay(NewRay,Char)
  125. if hit ~= nil then
  126. if Type == nil then
  127. DamageFunc(hit,20,0)
  128. elseif Type == 2 and not hit.Name:find("Base") then
  129. hit:Destroy()
  130. elseif Type == 3 then
  131.  
  132. end
  133. end
  134. if Color == nil then
  135. Color = SecC
  136. end
  137. local Distance = (Pos - Obj.CFrame.p).magnitude
  138. local p = part(Main,v3(.2,.2,Distance),Color,0)
  139. cw(function()
  140. for i = 0,1,1/5 do
  141. if p then
  142. p.Transparency = i
  143. wait()
  144. end
  145. end
  146. if p then
  147. p:Destroy()
  148. end
  149. p = nil
  150. end)()
  151. Instance.new("BlockMesh",p).Scale = Vector3.new(.5,.5,1)
  152. p.Anchored = true
  153. p.Size = v3(.2,.2,Distance)
  154. p.CFrame = cf(Pos,Obj.CFrame.p)*cf(0,0,-Distance/2)
  155. cw(function()
  156. local a = game:service("RunService").Stepped:connect(function()
  157. if p ~= nil then
  158. Distance = (Pos - Obj.CFrame.p).magnitude
  159. p.Size = v3(.2,.2,Distance)
  160. p.CFrame = cf(Pos,Obj.CFrame.p)*cf(0,0,-Distance/2)
  161. wait()
  162. else
  163. error()
  164. end
  165. end)
  166. end)()
  167. end
  168. local P1,P1BP,P1BG = MakeProtector()
  169. local P2,P2BP,P2BG = MakeProtector()
  170. local P3,P3BP,P3BG = MakeProtector()
  171. local spin = mr(0)
  172. game:service("RunService").Stepped:connect(function()
  173. if Mode == 1 then
  174. spin = spin + mr(1)
  175. P1BP.position = (Head.CFrame*ca(0,mr(360/3)+spin,0)*cf(0,0,5)).p
  176. P2BP.position = (Head.CFrame*ca(0,mr(360/3)*2+spin,0)*cf(0,0,5)).p
  177. P3BP.position = (Head.CFrame*ca(0,mr(360/3)*3+spin,0)*cf(0,0,5)).p
  178. elseif Mode == 2 then
  179. spin = spin + mr(5)
  180. P1BP.position = (Head.CFrame*cf(0,5,0)).p
  181. P2BP.position = (Head.CFrame*ca(0,mr(180)+spin,0)*cf(0,0,5)).p
  182. P3BP.position = (Head.CFrame*ca(0,mr(360)+spin,0)*cf(0,0,5)).p
  183. elseif Mode == 3 then
  184. spin = spin + mr(10)
  185. P1BP.position = (Head.CFrame*cf(0,3,0)*ca(0,mr(0)+spin,0)*cf(0,0,1)).p
  186. P2BP.position = (Head.CFrame*cf(0,.5,0)*ca(0,mr(0)+-spin,0)*cf(0,0,3)).p
  187. P3BP.position = (Head.CFrame*cf(0,-2,0)*ca(0,mr(0)+spin,0)*cf(0,0,5)).p
  188. end
  189. P1BG.cframe = cf(Mouse.Hit.p,P1.CFrame.p)*ca(0,mr(-90),0)
  190. P2BG.cframe = cf(Mouse.Hit.p,P1.CFrame.p)*ca(0,mr(-90),0)
  191. P3BG.cframe = cf(Mouse.Hit.p,P1.CFrame.p)*ca(0,mr(-90),0)
  192. if spin >= 360000 then
  193. spin = 0
  194. end
  195. end)
  196. Mouse.KeyDown:connect(function(Key)
  197. if Key == "q" and Attacking == false then
  198. if GoToMode == 1 then
  199. Mode = 3
  200. GoToMode = 3
  201. repeat
  202. wait()
  203. if Hum and Mode == 3 then
  204. Hum.Health = Hum.Health + 5
  205. end
  206. until GoToMode ~= 3
  207. else
  208. Mode = 1
  209. GoToMode = 1
  210. end
  211. elseif Key == "e" and Attacking == false then
  212. Mode = 2
  213. wait(.5)
  214. Shoot(P1,2,"Really black")
  215. Shoot(P2,2,"Really black")
  216. Shoot(P3,2,"Really black")
  217. Mode = GoToMode
  218. elseif Key == "r" and Attacking == false then
  219. ButtonHold = true
  220. Mode = 2
  221. while ButtonHold do
  222. Shoot(P1,3,"Bright green")
  223. Shoot(P2,3,"Bright green")
  224. Shoot(P3,3,"Bright green")
  225. local Hum = Mouse.Target.Parent:FindFirstChild("Humanoid")
  226. if Hum then
  227. Hum.Health = Hum.Health + 5
  228. end
  229. wait(.1)
  230. end
  231. Mode = GoToMode
  232. end
  233. end)
  234. Mouse.KeyUp:connect(function(Key)
  235. if Key == "r" then
  236. ButtonHold = false
  237. end
  238. end)
  239. Mouse.Button1Down:connect(function()
  240. MouseHold = true
  241. if Attacking == false then
  242. Mode = 2
  243. while MouseHold do
  244. Shoot(P1)
  245. Shoot(P2)
  246. Shoot(P3)
  247. wait(.1)
  248. end
  249. Mode = GoToMode
  250. end
  251. end)
  252. Mouse.Button1Up:connect(function()
  253. MouseHold = false
  254. end)
Add Comment
Please, Sign In to add comment