Advertisement
Ahtoh13131423144235

Roblox Ice Staff Script

Oct 26th, 2017
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.53 KB | None | 0 0
  1. --Made by Ahtoh13131423144235
  2.  
  3. local player=game.Players.LocalPlayer
  4. local mouse=player:GetMouse()
  5. local char=player.Character
  6. local canAttack=true
  7. local mode=0
  8.  
  9. local gui=Instance.new("ScreenGui")
  10. gui.Parent=player.PlayerGui
  11. gui.Name="StaffGui"
  12. local tip=Instance.new("TextLabel")
  13. tip.Parent=gui
  14. tip.Name="Tip"
  15. tip.Text="Press 'E' to change modes."
  16. tip.BackgroundTransparency=1
  17. tip.TextColor3=Color3.new(0,0,255)
  18. tip.Size=UDim2.new(0,200,0,50)
  19. tip.Position=UDim2.new(0,0,0,200)
  20. local modeText=Instance.new("TextLabel")
  21. modeText.Parent=gui
  22. modeText.Name="Mode"
  23. modeText.Text="Laser"
  24. modeText.BackgroundColor3=Color3.new(0,0,230)
  25. modeText.TextSize=20
  26. modeText.Size=UDim2.new(0,90,0,50)
  27. modeText.Position=UDim2.new(0,40,0,250)
  28.  
  29. local staff=Instance.new("Model")
  30. staff.Parent=char
  31. staff.Name="Staff"
  32. local handle=Instance.new("Part")
  33. handle.Parent=staff
  34. handle.Name="Handle"
  35. handle.BrickColor=BrickColor.new("Black")
  36. handle.Size=Vector3.new(0.5,5,0.5)
  37. handle.Anchored=false
  38. handle.CanCollide=true
  39. handle.Position=Vector3.new(0,1,0)
  40. local handleMesh=Instance.new("SpecialMesh")
  41. handleMesh.Parent=handle
  42. handleMesh.Name="HandleMesh"
  43. local holdPart=Instance.new("Part")
  44. holdPart.Parent=staff
  45. holdPart.Name="HoldPart"
  46. holdPart.BrickColor=BrickColor.new("Cyan")
  47. holdPart.Size=Vector3.new(0.6,0.9,0.6)
  48. holdPart.Anchored=false
  49. holdPart.CanCollide=true
  50. holdPart.Position=Vector3.new(0,1,0)
  51. local holdPartMesh=Instance.new("SpecialMesh")
  52. holdPartMesh.Parent=holdPart
  53. holdPartMesh.Name="HoldPartMesh"
  54. local grip1=Instance.new("Part")
  55. grip1.Parent=staff
  56. grip1.Name="Grip1"
  57. grip1.BrickColor=BrickColor.new("Black")
  58. grip1.Size=Vector3.new(0.7,0.2,0.7)
  59. grip1.Anchored=false
  60. grip1.CanCollide=true
  61. grip1.Position=Vector3.new(0,1,0)
  62. local grip1Mesh=Instance.new("SpecialMesh")
  63. grip1Mesh.Parent=grip1
  64. grip1Mesh.Name="Grip1Mesh"
  65. grip1Mesh.MeshType="Sphere"
  66. local grip2=Instance.new("Part")
  67. grip2.Parent=staff
  68. grip2.Name="Grip2"
  69. grip2.BrickColor=BrickColor.new("Black")
  70. grip2.Size=Vector3.new(0.7,0.2,0.7)
  71. grip2.Anchored=false
  72. grip2.CanCollide=true
  73. grip2.Position=Vector3.new(0,1,0)
  74. local grip2Mesh=Instance.new("SpecialMesh")
  75. grip2Mesh.Parent=grip2
  76. grip2Mesh.Name="Grip2Mesh"
  77. grip2Mesh.MeshType="Sphere"
  78. local grip3=Instance.new("Part")
  79. grip3.Parent=staff
  80. grip3.Name="Grip3"
  81. grip3.BrickColor=BrickColor.new("Black")
  82. grip3.Size=Vector3.new(0.9,0.2,0.9)
  83. grip3.Anchored=false
  84. grip3.CanCollide=true
  85. grip3.Position=Vector3.new(0,1,0)
  86. local grip3Mesh=Instance.new("SpecialMesh")
  87. grip3Mesh.Parent=grip3
  88. grip3Mesh.Name="Grip3Mesh"
  89. grip3Mesh.MeshType="Sphere"
  90. local grip4=Instance.new("Part")
  91. grip4.Parent=staff
  92. grip4.Name="Grip4"
  93. grip4.BrickColor=BrickColor.new("Black")
  94. grip4.Size=Vector3.new(0.7,0.2,0.7)
  95. grip4.Anchored=false
  96. grip4.CanCollide=true
  97. grip4.Position=Vector3.new(0,1,0)
  98. local grip4Mesh=Instance.new("SpecialMesh")
  99. grip4Mesh.Parent=grip4
  100. grip4Mesh.Name="Grip4Mesh"
  101. grip4Mesh.MeshType="Sphere"
  102. local glow=Instance.new("Part")
  103. glow.Parent=staff
  104. glow.Name="Glow"
  105. glow.BrickColor=BrickColor.new("Cyan")
  106. glow.Size=Vector3.new(2,2,2)
  107. glow.Transparency=0.50
  108. glow.Anchored=false
  109. glow.CanCollide=true
  110. glow.Position=Vector3.new(0,1,0)
  111. glow.TopSurface="Smooth"
  112. glow.BottomSurface="Smooth"
  113. local glowMesh=Instance.new("SpecialMesh")
  114. glowMesh.Parent=glow
  115. glowMesh.Name="GlowMesh"
  116. glowMesh.MeshType="Sphere"
  117. local crystal=Instance.new("Part")
  118. crystal.Parent=staff
  119. crystal.Name="Crystal"
  120. crystal.BrickColor=BrickColor.new("Cyan")
  121. crystal.Size=Vector3.new(1,0.4,1)
  122. crystal.Anchored=false
  123. crystal.CanCollide=true
  124. local crystalMesh=Instance.new("SpecialMesh")
  125. crystalMesh.Parent=crystal
  126. crystalMesh.Name="CrystalMesh"
  127. crystalMesh.MeshType="FileMesh"
  128. crystalMesh.MeshId="http://www.roblox.com/Asset/?id=9756362"
  129. local w1=Instance.new("Weld")
  130. w1.Parent=char["Right Arm"]
  131. w1.Name="HandleWeld"
  132. w1.Part0=char["Right Arm"]
  133. w1.Part1=handle
  134. w1.C0=CFrame.new(0,-1.1,0)*CFrame.fromEulerAnglesXYZ(1.57,0,0)
  135. local w2=Instance.new("Weld")
  136. w2.Parent=handle
  137. w2.Name="HoldPartWeld"
  138. w2.Part0=handle
  139. w2.Part1=holdPart
  140. w2.C0=CFrame.new(0,2.1,0)
  141. local w3=Instance.new("Weld")
  142. w3.Parent=handle
  143. w3.Name="Grip1Weld"
  144. w3.Part0=handle
  145. w3.Part1=grip1
  146. w3.C0=CFrame.new(0,2.1,0)
  147. local w4=Instance.new("Weld")
  148. w4.Parent=handle
  149. w4.Name="Grip2Weld"
  150. w4.Part0=handle
  151. w4.Part1=grip2
  152. w4.C0=CFrame.new(0,-1.7,0)
  153. local w5=Instance.new("Weld")
  154. w5.Parent=handle
  155. w5.Name="Grip3Weld"
  156. w5.Part0=handle
  157. w5.Part1=grip3
  158. w5.C0=CFrame.new(0,-2.1,0)
  159. local w6=Instance.new("Weld")
  160. w6.Parent=handle
  161. w6.Name="Grip4Weld"
  162. w6.Part0=handle
  163. w6.Part1=grip4
  164. w6.C0=CFrame.new(0,-2.4,0)
  165. local w7=Instance.new("Weld")
  166. w7.Parent=handle
  167. w7.Name="GlowWeld"
  168. w7.Part0=handle
  169. w7.Part1=glow
  170. w7.C0=CFrame.new(0,-3,0)
  171. local w8=Instance.new("Weld")
  172. w8.Parent=handle
  173. w8.Name="CrystalWeld"
  174. w8.Part0=handle
  175. w8.Part1=crystal
  176. w8.C0=CFrame.new(0,-3,0)
  177. local rs=Instance.new("Weld")
  178. rs.Parent=char.Torso
  179. rs.Name="RightArmWeld"
  180. rs.Part0=char.Torso
  181. rs.Part1=char["Right Arm"]
  182. rs.C0=CFrame.new(1.5,0.5,0)
  183. rs.C1=CFrame.new(0,0.5,0)
  184. local ls=Instance.new("Weld")
  185. ls.Parent=char.Torso
  186. ls.Name="LeftArmWeld"
  187. ls.Part0=char.Torso
  188. ls.Part1=char["Left Arm"]
  189. ls.C0=CFrame.new(-1.5,0.5,0)
  190. ls.C1=CFrame.new(0,0.5,0)
  191.  
  192. mouse.Button1Down:connect(function()
  193. if mode==0 and canAttack==true then
  194. canAttack=false
  195. for i=1,10 do
  196. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
  197. wait()
  198. end
  199. for i=1,10 do
  200. w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
  201. wait()
  202. end
  203. wait(1)
  204. local laser=Instance.new("Part")
  205. laser.Parent=staff
  206. laser.Name="Laser"
  207. laser.BrickColor=BrickColor.new("Cyan")
  208. laser.Size=Vector3.new(1,15,1)
  209. laser.Transparency=0.50
  210. laser.Anchored=false
  211. laser.CanCollide=true
  212. laser.Position=Vector3.new(0,10,0)
  213. local laserMesh=Instance.new("SpecialMesh")
  214. laserMesh.Parent=laser
  215. laserMesh.Name="LaserMesh"
  216. local w9=Instance.new("Weld")
  217. w9.Parent=glow
  218. w9.Name="LaserWeld"
  219. w9.Part0=glow
  220. w9.Part1=laser
  221. w9.C0=CFrame.new(0,-7,0)
  222. laser.Touched:connect(function(hit)
  223. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char then
  224. hit.Anchored=true
  225. for i=1,200 do
  226. hit.Parent:FindFirstChild("Humanoid").Health=hit.Parent:FindFirstChild("Humanoid").Health-0.1
  227. wait()
  228. end
  229. end
  230. end)
  231. wait(0.7)
  232. for i=1,50 do
  233. laser.Transparency=laser.Transparency+0.01
  234. wait()
  235. end
  236. laser:remove()
  237. for i=1,10 do
  238. w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
  239. wait()
  240. end
  241. for i=1,10 do
  242. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
  243. wait()
  244. end
  245. canAttack=true
  246. elseif mode==1 and canAttack==true then
  247. canAttack=false
  248. for i=1,20 do
  249. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
  250. wait()
  251. end
  252. for i=1,10 do
  253. w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
  254. wait()
  255. end
  256. wait(1)
  257. local explosion=Instance.new("Explosion")
  258. explosion.Parent=crystal
  259. explosion.Position=crystal.Position
  260. explosion.BlastPressure=0
  261. explosion.Hit:connect(function(hit)
  262. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char then
  263. hit.Parent:BreakJoints()
  264. end
  265. end)
  266. for i=1,10 do
  267. w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
  268. wait()
  269. end
  270. for i=1,20 do
  271. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
  272. wait()
  273. end
  274. canAttack=true
  275. elseif mode==2 and canAttack==true then
  276. canAttack=false
  277. for i=1,10 do
  278. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
  279. ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
  280. wait()
  281. end
  282. for i=1,5 do
  283. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-20)
  284. ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/20)
  285. wait()
  286. end
  287. for i=1,5 do
  288. rs.C0=rs.C0*CFrame.new(0,math.pi/-20,0)
  289. ls.C0=ls.C0*CFrame.new(0,math.pi/-20,0)
  290. wait()
  291. end
  292. wait(0.5)
  293. glow.BrickColor=BrickColor.new("Bright green")
  294. crystal.BrickColor=BrickColor.new("Bright green")
  295. holdPart.BrickColor=BrickColor.new("Bright green")
  296. char.Humanoid.Health=char.Humanoid.MaxHealth
  297. wait(0.7)
  298. glow.BrickColor=BrickColor.new("Cyan")
  299. crystal.BrickColor=BrickColor.new("Cyan")
  300. holdPart.BrickColor=BrickColor.new("Cyan")
  301. for i=1,5 do
  302. rs.C0=rs.C0*CFrame.new(0,math.pi/20,0)
  303. ls.C0=ls.C0*CFrame.new(0,math.pi/20,0)
  304. wait()
  305. end
  306. for i=1,5 do
  307. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/20)
  308. ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-20)
  309. wait()
  310. end
  311. for i=1,10 do
  312. rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
  313. ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
  314. wait()
  315. end
  316. canAttack=true
  317. end
  318. end)
  319.  
  320. mouse.KeyDown:connect(function(key)
  321. if key=="e" then
  322. if mode<3 then
  323. mode=mode+1
  324. else
  325. mode=0
  326. end
  327. end
  328. end)
  329.  
  330. while wait() do
  331. if mode==0 then
  332. modeText.Text="Laser"
  333. elseif mode==1 then
  334. modeText.Text="Blast"
  335. elseif mode==2 then
  336. modeText.Text="Charge"
  337. end
  338. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement