Advertisement
Upscalefanatic3

Vampire Script

Oct 4th, 2016
1,737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.63 KB | None | 0 0
  1.  
  2.  
  3. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  4. pl = "Upscalegaming"
  5. Player = Game:GetService("Players").LocalPlayer
  6. Character = Player.Character
  7. RightArm = Character["Right Arm"]
  8. RightShoulder = Character.Torso["Right Shoulder"]
  9. LeftArm = Character["Left Arm"]
  10. Torso = Character["Torso"]
  11. LeftLeg = Character["Left Leg"]
  12. RightLeg = Character["Right Leg"]
  13. Head = Character["Head"]
  14. -------------------------------------
  15. Workspace.Upscalegaming.Head.face.Texture = "http://www.roblox.com/asset/?id=17058440"
  16.  
  17. function CheckI(Item,Blacklist,Specific)
  18. for _,v in pairs(Item:children()) do
  19. if not Specific then
  20. if v:IsA(Blacklist) or v.Name:match(Blacklist) then
  21. v:Destroy()
  22. end
  23. else
  24. if v:IsA(Blacklist) or v.Name == Blacklist then
  25. v:Destroy()
  26. end
  27. end
  28. end
  29. end
  30.  
  31. CheckI(Character,"Hat")
  32. -------------------------------------
  33.  
  34. Part13 = Instance.new("Part", Character)
  35. Part13.TopSurface = 0
  36. Part13.BottomSurface = 0
  37. Part13.Transparency = 0
  38. Part13.FormFactor = "Custom"
  39. Part13.Size = Vector3.new(1, 1, 1)
  40. Part13.BrickColor = BrickColor.new("Really black")
  41. Part13.CanCollide = false
  42. Weld13 = Instance.new("Weld", Part13)
  43. Weld13.Part0 = Part13
  44. Weld13.Part1 = Head
  45. Weld13.C0 = CFrame.new(0, -0.8, 0)
  46. SHMesh = Instance.new("SpecialMesh")
  47. SHMesh.Parent = Part13
  48. SHMesh.Scale = Vector3.new(1, 1, 1)
  49. SHMesh.MeshId = "http://www.roblox.com/asset/?id=1028713"
  50. SHMesh.TextureId = "http://www.roblox.com/asset/?id=15726328"
  51.  
  52. Part135 = Instance.new("Part", Character)
  53. Part135.TopSurface = 0
  54. Part135.BottomSurface = 0
  55. Part135.Transparency = 1
  56. Part135.Reflectance = 0.8
  57. Part135.FormFactor = "Custom"
  58. Part135.Size = Vector3.new(1, 1, 1)
  59. Part135.BrickColor = BrickColor.new("White")
  60. Part135.CanCollide = false
  61. Weld13 = Instance.new("Weld", Part135)
  62. Weld13.Part0 = Part135
  63. Weld13.Part1 = Head
  64. Weld13.C0 = CFrame.new(0, -3, 0)
  65. SHMesh = Instance.new("SpecialMesh")
  66. SHMesh.Parent = Part135
  67. SHMesh.MeshType = "Sphere"
  68. x = Instance.new("PointLight",Part135)
  69. x.Range = 20
  70. x.Enabled = false
  71.  
  72.  
  73. Part = Instance.new("Part", Character)
  74. Part.TopSurface = 0
  75. Part.BottomSurface = 0
  76. Part.Transparency = 0
  77. Part.FormFactor = "Custom"
  78. Part.Size = Vector3.new(1, 2, 1)
  79. Part.BrickColor = BrickColor.new("Really black")
  80. Part.CanCollide = false
  81. Workspace.SergeantSmokey["Right Leg"].Transparency = 1
  82. Weld = Instance.new("Weld", Part)
  83. Weld.Part0 = Part
  84. Weld.Part1 = RightLeg
  85. Weld.C0 = CFrame.new(0, 0, 0)
  86.  
  87. Part2 = Instance.new("Part", Character)
  88. Part2.TopSurface = 0
  89. Part2.BottomSurface = 0
  90. Part2.Transparency = 0
  91. Part2.FormFactor = "Custom"
  92. Part2.Size = Vector3.new(1, 2, 1)
  93. Part2.BrickColor = BrickColor.new("Really black")
  94. Part2.CanCollide = false
  95. Workspace.SergeantSmokey["Left Leg"].Transparency = 1
  96. Weld2 = Instance.new("Weld", Part2)
  97. Weld2.Part0 = Part2
  98. Weld2.Part1 = LeftLeg
  99. Weld2.C0 = CFrame.new(0, 0, 0)
  100.  
  101. Part7 = Instance.new("Part", Character)
  102. Part7.TopSurface = 0
  103. Part7.BottomSurface = 0
  104. Part7.Transparency = 0
  105. Part7.FormFactor = "Custom"
  106. Part7.Size = Vector3.new(1, 1.7, 1)
  107. Part7.BrickColor = BrickColor.new("White")
  108. Part7.CanCollide = false
  109. Workspace.SergeantSmokey["Right Arm"].Transparency = 1
  110. Weld7 = Instance.new("Weld", Part7)
  111. Weld7.Part0 = Part7
  112. Weld7.Part1 = RightArm
  113. Weld7.C0 = CFrame.new(0, 0.2, 0)
  114.  
  115. Part45 = Instance.new("Part", Character)
  116. Part45.TopSurface = 0
  117. Part45.BottomSurface = 0
  118. Part45.Transparency = 0
  119. Part45.FormFactor = "Custom"
  120. Part45.Size = Vector3.new(1.1, 1, 1.1)
  121. Part45.BrickColor = BrickColor.new("Really black")
  122. Part45.CanCollide = false
  123. Weld3 = Instance.new("Weld", Part45)
  124. Weld3.Part0 = Part45
  125. Weld3.Part1 = RightArm
  126. Weld3.C0 = CFrame.new(0, -0.5, 0)
  127.  
  128. Part8 = Instance.new("Part", Character)
  129. Part8.TopSurface = 0
  130. Part8.BottomSurface = 0
  131. Part8.Transparency = 0
  132. Part8.FormFactor = "Custom"
  133. Part8.Size = Vector3.new(1, 1.7, 1)
  134. Part8.BrickColor = BrickColor.new("White")
  135. Part8.CanCollide = false
  136. Workspace.SergeantSmokey["Left Arm"].Transparency = 1
  137. Weld8 = Instance.new("Weld", Part8)
  138. Weld8.Part0 = Part8
  139. Weld8.Part1 = LeftArm
  140. Weld8.C0 = CFrame.new(0, 0.2, 0)
  141.  
  142. Part45 = Instance.new("Part", Character)
  143. Part45.TopSurface = 0
  144. Part45.BottomSurface = 0
  145. Part45.Transparency = 0
  146. Part45.FormFactor = "Custom"
  147. Part45.Size = Vector3.new(1.1, 1, 1.1)
  148. Part45.BrickColor = BrickColor.new("Really black")
  149. Part45.CanCollide = false
  150. Weld3 = Instance.new("Weld", Part45)
  151. Weld3.Part0 = Part45
  152. Weld3.Part1 = LeftArm
  153. Weld3.C0 = CFrame.new(0, -0.5, 0)
  154.  
  155. Part13 = Instance.new("Part", Character)
  156. Part13.TopSurface = 0
  157. Part13.BottomSurface = 0
  158. Part13.Transparency = 0
  159. Part13.FormFactor = "Custom"
  160. Part13.Size = Vector3.new(2, 2, 1)
  161. Part13.BrickColor = BrickColor.new("Really black")
  162. Part13.CanCollide = false
  163. Workspace.SergeantSmokey["Torso"].Transparency = 1
  164. Weld13 = Instance.new("Weld", Part13)
  165. Weld13.Part0 = Part13
  166. Weld13.Part1 = Torso
  167. Weld13.C0 = CFrame.new(0, 0, 0)
  168.  
  169. Part123 = Instance.new("Part", Character)
  170. Part123.TopSurface = 0
  171. Part123.BottomSurface = 0
  172. Part123.Transparency = 0
  173. Part123.FormFactor = "Custom"
  174. Part123.Size = Vector3.new(1, 1, 1)
  175. Part123.BrickColor = BrickColor.new("White")
  176. Part123.CanCollide = false
  177. Weld13 = Instance.new("Weld", Part123)
  178. Weld13.Part0 = Part123
  179. Weld13.Part1 = Torso
  180. Weld13.C0 = CFrame.new(0, 0.5, -0.8)
  181. SHMesh = Instance.new("SpecialMesh")
  182. SHMesh.Parent = Part123
  183. SHMesh.Scale = Vector3.new(1.5, 1.5, 1.5)
  184. SHMesh.MeshId = "http://www.roblox.com/asset/?id=94820260"
  185. SHMesh.TextureId = "http://www.roblox.com/asset/?id=94820166"
  186.  
  187. sg = Instance.new("ScreenGui")
  188. sg.Parent = game.Players[pl].PlayerGui
  189. button1 = Instance.new("TextButton")
  190. button1.Parent = sg
  191. button1.Text = "Light-On"
  192. button1.Position = UDim2.new(0,0,0.1,0)
  193. button1.Size = UDim2.new(0.1,0,0.1,0)
  194. button1.MouseButton1Click:connect(function()
  195. x.Enabled = true
  196. Part135.Transparency = 0
  197. end)
  198. button2 = Instance.new("TextButton")
  199. button2.Parent = sg
  200. button2.Text = "Light-Off"
  201. button2.Position = UDim2.new(0,0,0.2,0)
  202. button2.Size = UDim2.new(0.1,0,0.1,0)
  203. button2.MouseButton1Click:connect(function()
  204. x.Enabled = false
  205. Part135.Transparency = 1
  206. end)
  207. button3 = Instance.new("TextButton")
  208. button3.Parent = sg
  209. button3.Text = "Slow - 10"
  210. button3.Position = UDim2.new(0,0,0.3,0)
  211. button3.Size = UDim2.new(0.1,0,0.1,0)
  212. button3.MouseButton1Click:connect(function()
  213. Workspace.SergeantSmokey.Humanoid.WalkSpeed = Workspace.SergeantSmokey.Humanoid.WalkSpeed - 10
  214. end)
  215. button4 = Instance.new("TextButton")
  216. button4.Parent = sg
  217. button4.Text = "Fast + 10"
  218. button4.Position = UDim2.new(0,0,0.4,0)
  219. button4.Size = UDim2.new(0.1,0,0.1,0)
  220. button4.MouseButton1Click:connect(function()
  221. Workspace.SergeantSmokey.Humanoid.WalkSpeed = Workspace.SergeantSmokey.Humanoid.WalkSpeed + 10
  222. end)
  223.  
  224. local h = Instance.new("HopperBin")
  225. h.Name = "Magic"
  226. local p = game.Players:findFirstChild(pl)
  227. if (p==nil) then return end
  228. h.Parent = p.Backpack
  229.  
  230. function fast1()
  231. Workspace.SergeantSmokey.Humanoid.WalkSpeed = 100
  232. end
  233.  
  234. function fast2()
  235. Workspace.SergeantSmokey.Humanoid.WalkSpeed = 20
  236. end
  237.  
  238.  
  239.  
  240. function onKey(key, mouse)
  241. if key then
  242. local key = key:lower()
  243. if (key=="q") then
  244. fast1()
  245. if (key=="e") then
  246. fast2()
  247. end
  248. end
  249. end
  250. end
  251. h.Selected:connect(function(mouse)
  252. mouse.KeyDown:connect(function(key) onKey(key, mouse) end)
  253. end)
  254.  
  255. --[[Soul Staff Made By malfact]]--
  256.  
  257.  
  258.  
  259. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  260. local player = game.Players.LocalPlayer
  261. local character = player.Character
  262.  
  263. if (player.Backpack:FindFirstChild("Soul Staff") ~= nil) then
  264. player.Backpack["Soul Staff"].Parent = nil
  265. end
  266. if (character:FindFirstChild("Soul_Staff") ~= nil) then
  267. character.Soul_Staff.Parent = nil
  268. end
  269.  
  270. local RightShoulder = character.Torso["Right Shoulder"]
  271. local ShoulderWeld = nil
  272. local StaffWeld = nil
  273.  
  274. local debounce = false
  275. local debounce2 = false
  276.  
  277. local mode = "hurt"
  278. local orbWeld = {}
  279. local keys = {}
  280.  
  281. local thrown = false
  282. local hold = false
  283. local holdTime = 0
  284.  
  285. local tool = Instance.new("HopperBin", player.Backpack)
  286. tool.Name = "Soul Staff"
  287. tool.Parent = player.Backpack
  288. local model = Instance.new("Model",character)
  289. model.Name = "Soul_Staff"
  290.  
  291. function animateArm(boolean, c0, c1)
  292. if (boolean) then
  293. if (ShoulderWeld == nil) then
  294. ShoulderWeld = weld(character["Torso"],character["Right Arm"],CFrame.new())
  295. end
  296. RightShoulder.Part0 = nil
  297.  
  298. ShoulderWeld.C0 = c0
  299. ShoulderWeld.C1 = c1
  300. else
  301. RightShoulder.Part0 = character.Torso
  302. if (ShoulderWeld ~= nil) then
  303. ShoulderWeld.Parent = nil
  304. end
  305. ShoulderWeld = nil
  306. end
  307. end
  308.  
  309. function animateStaff(boolean, c0, c1)
  310. if (boolean) then
  311. StaffWeld.Part0 = character["Right Arm"]
  312. StaffWeld.Part1 = model:FindFirstChild("Handle")
  313. StaffWeld.C0 = c0
  314. StaffWeld.C1 = c1
  315. else
  316. StaffWeld.Part0 = character["Torso"]
  317. StaffWeld.Part1 = model:FindFirstChild("Handle")
  318. StaffWeld.C0 = CFrame.new(0,0,0.5)
  319. StaffWeld.C1 = CFrame.new()*CFrame.Angles(0, 0, math.pi/4)
  320. end
  321. end
  322.  
  323. function weld(p0, p1, cframe)
  324. local w = Instance.new("ManualWeld", p0)
  325. w.Part0 = p0
  326. w.Part1 = p1
  327. w.C0 = cframe
  328. return w
  329. end
  330.  
  331. function newPart(size, color, parent)
  332. local part = Instance.new("Part")
  333. part.Locked = true
  334. part.FormFactor = 3
  335. part.Size = size
  336. part.BrickColor = color
  337. part.BottomSurface = 0
  338. part.TopSurface = 0
  339. part.Anchored = false
  340. part.CanCollide = false
  341. part.Parent = parent
  342. return part
  343. end
  344.  
  345. function newCylMesh(parent)
  346. local mesh = Instance.new("CylinderMesh", parent)
  347. return parent
  348. end
  349.  
  350. function newSphereMesh(parent)
  351. local mesh = Instance.new("SpecialMesh",parent)
  352. mesh.MeshType = 3
  353. return parent
  354. end
  355.  
  356. function newIdMesh(id, size, parent)
  357. local mesh = Instance.new("SpecialMesh",parent)
  358. mesh.MeshType = 5
  359. mesh.Scale = size
  360. mesh.MeshId = "http://www.roblox.com/Asset/?id="..id
  361. return parent
  362. end
  363.  
  364. function addSoul(count)
  365. for i = 1, count do
  366. local p = newSphereMesh(newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model))
  367. orbWeld[#orbWeld + 1] = weld(model:FindFirstChild("core"),p,CFrame.new(0,0,0))
  368. end
  369. end
  370.  
  371. function removeSoul(count)
  372. for i = 1, count do
  373. orbWeld[#orbWeld].Part1.Parent = nil
  374. orbWeld[#orbWeld] = nil
  375. end
  376. end
  377.  
  378. function getRadius(num)
  379. if (num < 16) then
  380. return 1
  381. else
  382. return num/16
  383. end
  384. end
  385.  
  386. local handle = newCylMesh(newPart(Vector3.new(0.2,6,0.2),BrickColor.new(1,1,1),model))
  387. handle.Name = "Handle"
  388.  
  389. weld(handle,newSphereMesh(newPart(Vector3.new(0.4,0.4,0.4),BrickColor.new(0,0,0),model)),CFrame.new(0,3,0))
  390. weld(handle,newCylMesh(newPart(Vector3.new(0.25,0.25,0.25),BrickColor.new(0,0,0),model)),CFrame.new(0,2.75,0))
  391. weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,2.85,0)*CFrame.Angles(math.pi/2,0,0))
  392. weld(handle,newIdMesh("3270017",Vector3.new(0.22,0.22,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,2.6,0)*CFrame.Angles(math.pi/2,0,0))
  393. weld(handle,newSphereMesh(newPart(Vector3.new(0.4,0.4,0.4),BrickColor.new(0,0,0),model)),CFrame.new(0,-3,0))
  394. weld(handle,newCylMesh(newPart(Vector3.new(0.25,0.25,0.25),BrickColor.new(0,0,0),model)),CFrame.new(0,-2.75,0))
  395. weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,-2.85,0)*CFrame.Angles(math.pi/2,0,0))
  396. weld(handle,newIdMesh("3270017",Vector3.new(0.22,0.22,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,-2.6,0)*CFrame.Angles(math.pi/2,0,0))
  397. weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,0.5,0)*CFrame.Angles(math.pi/2,0,0))
  398. weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,-0.5,0)*CFrame.Angles(math.pi/2,0,0))
  399. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.4,0)*CFrame.Angles(math.pi/2,0,0))
  400. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.3,0)*CFrame.Angles(math.pi/2,0,0))
  401. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.2,0)*CFrame.Angles(math.pi/2,0,0))
  402. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.1,0)*CFrame.Angles(math.pi/2,0,0))
  403. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.0,0)*CFrame.Angles(math.pi/2,0,0))
  404. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.1,0)*CFrame.Angles(math.pi/2,0,0))
  405. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.2,0)*CFrame.Angles(math.pi/2,0,0))
  406. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.3,0)*CFrame.Angles(math.pi/2,0,0))
  407. weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.4,0)*CFrame.Angles(math.pi/2,0,0))
  408.  
  409. local core = newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)
  410. core.Name = "core"
  411. core.Reflectance = 0.5
  412. core.Transparency = 0.25
  413. local coreWeld = weld(handle,newIdMesh("9756362",Vector3.new(0.5,0.5,0.5),core),CFrame.new(0,3.75,0))
  414. Instance.new("PointLight",core)
  415.  
  416. addSoul(8)
  417.  
  418. StaffWeld = weld(character["Torso"],handle,CFrame.new())
  419. animateArm(false, nil, nil)
  420. animateStaff(false, nil, nil)
  421.  
  422. function damage(char)
  423. if (char == nil) then return end
  424. if (char:FindFirstChild("Humanoid") ~= nil) then
  425. if (not char.Humanoid:isA("Humanoid")) then
  426. char.Parent = nil
  427. return
  428. end
  429. local humanoid = char.Humanoid
  430. if (humanoid.Health > 0 and humanoid.Health - (#orbWeld+1) <= 0) then
  431. --addSoul(1)
  432. end
  433. if (char:FindFirstChild("Bubble") ~= nil) then
  434. coroutine.resume(coroutine.create(function()
  435. if (humanoid ~= nil) then
  436. humanoid.WalkSpeed = -16
  437. end
  438. wait(5)
  439. if (humanoid ~= nil) then
  440. humanoid.WalkSpeed = 16
  441. end
  442. end))
  443. humanoid.PlatformStand = false
  444. char.Bubble.Parent = nil
  445. --addSoul(1)
  446. end
  447. humanoid.Health = humanoid.Health - (#orbWeld+1)
  448. end
  449. end
  450.  
  451. function damageDistance(char, distance)
  452. if (char == nil) then return end
  453. if (char:FindFirstChild("Torso") ~= nil) then
  454. local torso = char.Torso
  455. if ((core.Position - torso.Position).magnitude <= distance) then
  456. damage(char)
  457. end
  458. end
  459. end
  460.  
  461. function beam(start, position)
  462. coroutine.resume(coroutine.create(function()
  463. if (position == nil or start == nil) then return end
  464. local distance = (start-position).magnitude
  465. local p = newPart(Vector3.new(0.2,0.2,distance),BrickColor.new(0,0,0),model)
  466. p.Name = "beam012"
  467. p.Anchored = true
  468. p.Transparency = 0.25
  469. p.CFrame = CFrame.new((start + position)/2,start)
  470. for i = 0, 0.75, 0.1 do
  471. p.Transparency = 0.25+i
  472. wait(0.01)
  473. end
  474. p.Parent = nil
  475. end))
  476. end
  477.  
  478. tool.Selected:connect(function(mouse)
  479. if (not throw) then
  480. animateArm(true, CFrame.new(1.5,0.5,0), CFrame.new(0,0.5,0)*CFrame.Angles(-math.pi/2, 0, 0))
  481. animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi + math.pi/2,0,0), CFrame.new())
  482. end
  483.  
  484. mouse.Button1Down:connect(function()
  485. local hit = mouse.Hit
  486. if (debounce) then
  487. return
  488. end
  489. debounce = true
  490. if (mode == "hurt") then
  491. beam(core.Position, hit.p)
  492. if (mouse.Target ~= nil) then
  493. if (mouse.Target.Name == "box") then
  494. mouse.Target.Parent = nil
  495. else
  496. damage(mouse.Target.Parent)
  497. end
  498. end
  499. elseif (mode == "throw") then
  500. animateArm(false, nil, nil)
  501. StaffWeld.Part0 = nil
  502. if (handle:FindFirstChild("BodyPosition") ~= nil) then
  503. handle:FindFirstChild("BodyPosition").Parent = nil
  504. end
  505. if (handle:FindFirstChild("BodyGyro") ~= nil) then
  506. handle:FindFirstChild("BodyGyro").Parent = nil
  507. end
  508. local bp = Instance.new("BodyPosition",handle)
  509. bp.maxForce = Vector3.new(100000,100000,100000)
  510. bp.position = handle.Position + Vector3.new(0,30,0)
  511. local bg = Instance.new("BodyGyro",handle)
  512. bg.cframe = CFrame.new(bp.position,hit.p)*CFrame.Angles(math.pi/2,0,0)
  513. wait(1)
  514. bp.position = hit.p + Vector3.new(0,2,0)
  515. wait(0.3)
  516. bg.cframe = CFrame.new(bp.position,hit.p)*CFrame.Angles(math.pi/2,0,0)
  517. throw = true
  518. elseif (mode == "build") then
  519. beam(core.Position, hit.p)
  520. local p = newPart(Vector3.new(4,4,4),BrickColor.new(0,0,0),Workspace)
  521. p.Name = "box"
  522. p.Anchored = true
  523. p.CanCollide = true
  524. p.Transparency = 0.5
  525. p.CFrame = hit*CFrame.Angles(math.random(0,math.pi*2),math.random(0,math.pi*2),math.random(0,math.pi*2))
  526. Instance.new("PointLight",p)
  527. elseif (mode == "bubble") then
  528. beam(core.Position, hit.p)
  529. if (#orbWeld > 0) then
  530. if (mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil) then
  531. local humanoid = mouse.Target.Parent.Humanoid
  532. if (mouse.Target.Parent:FindFirstChild("Bubble") == nil) then
  533. if (mouse.Target.Parent:FindFirstChild("Torso") ~= nil) then
  534. local torso = mouse.Target.Parent.Torso
  535. local part = newPart(Vector3.new(8,8,8),BrickColor.new(0,0,0),mouse.Target.Parent)
  536. part.Name = "Bubble"
  537. part.Anchored = false
  538. part.CanCollide = true
  539. part.Shape = 0
  540. part.Transparency = 0.5
  541. part.CFrame = torso.CFrame
  542. Instance.new("PointLight",part)
  543. weld(torso,part,CFrame.new())
  544. humanoid.PlatformStand = true
  545. -- removeSoul(1)
  546. end
  547. else
  548. coroutine.resume(coroutine.create(function()
  549. if (humanoid ~= nil) then
  550. humanoid.WalkSpeed = -50
  551. end
  552. wait(5)
  553. if (humanoid ~= nil) then
  554. humanoid.WalkSpeed = 16
  555. end
  556. end))
  557. humanoid.PlatformStand = false
  558. mouse.Target.Parent.Bubble.Parent = nil
  559. --addSoul(1)
  560. end
  561. end
  562. end
  563. elseif (mode == "beam") then
  564. if (not hold and not throw) then
  565. animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi,0,0), CFrame.new())
  566. hold = true
  567. holdTime = 0
  568. end
  569. elseif (mode == "portal") then
  570. handle.Anchored = true
  571. local p = newCylMesh(newPart(Vector3.new(1,0.25,1),BrickColor.new(0,0,0),model))
  572. p.Anchored = true
  573. p.CFrame = CFrame.new(handle.Position) + Vector3.new(0,-2,0)
  574. local c = p.CFrame
  575. for i=1,15,0.5 do
  576. p.Size = p.Size+Vector3.new(0.5,0,0.5)
  577. p.CFrame = c
  578. wait(0.01)
  579. end
  580. local p1 = newCylMesh(newPart(Vector3.new(1,0.25,1),BrickColor.new(0,0,0),model))
  581. p1.Anchored = true
  582. p1.CFrame = CFrame.new(hit.p)
  583. p1.CFrame = CFrame.new(hit.p)
  584. local c1 = p1.CFrame
  585. handle.Anchored = false
  586. for i,v in ipairs(game.Workspace:getChildren()) do
  587. if (v:FindFirstChild("Torso") ~= nil) then
  588. if ((core.Position - v.Torso.Position).magnitude <= 8) then
  589. coroutine.resume(coroutine.create(function()
  590. v.Torso.CFrame = CFrame.new(Vector3.new(v.Torso.Position.x,p.Position.y+3,v.Torso.Position.z),v.Torso.CFrame.lookVector)
  591. v.Torso.Anchored = true
  592. for i=0, 10 do
  593. v.Torso.CFrame = v.Torso.CFrame+Vector3.new(0,-1,0)
  594. wait(0.1)
  595. end
  596. v.Torso.CFrame = CFrame.new(v.Torso.Position - (p.Position - p1.Position),v.Torso.CFrame.lookVector) + Vector3.new(0,4,0)
  597. for i=0, 10 do
  598. v.Torso.CFrame = v.Torso.CFrame+Vector3.new(0,1,0)
  599. wait(0.1)
  600. end
  601. v.Torso.Anchored = false
  602. end))
  603. end
  604. end
  605. end
  606. for i=1,15,0.5 do
  607. p.Size = p.Size+Vector3.new(-0.5,0,-0.5)
  608. p1.Size = p1.Size+Vector3.new(0.5,0,0.5)
  609. p.CFrame = c
  610. p1.CFrame = c1
  611. wait(0.01)
  612. end
  613. p.Parent = nil
  614. wait(1)
  615. for i=1,15,1 do
  616. p1.Size = p1.Size+Vector3.new(-1,0,-1)
  617. p1.CFrame = c1
  618. wait(0.01)
  619. end
  620. p1.Parent = nil
  621. end
  622. debounce = false
  623. end)
  624.  
  625. mouse.Button1Up:connect(function()
  626. if (debounce2) then
  627. return
  628. end
  629. debounce2 = true
  630. if (mode == "beam") then
  631. if (hold and holdTime >= 10) then
  632. if (#orbWeld > 0) then
  633. local p = newSphereMesh(newPart(Vector3.new(4,4,4),BrickColor.new(0,0,0),Workspace))
  634. p.Name = "1"
  635. p.Transparency = 0.5
  636. local point = core.CFrame*CFrame.Angles(math.pi/2, 0, 0)
  637. p.CFrame = CFrame.new(core.Position + point.lookVector*4,core.Position)
  638. Instance.new("PointLight",p)
  639.  
  640. local bs = Instance.new("BodyVelocity",p)
  641. bs.velocity = point.lookVector*(2*holdTime)+Vector3.new(0,0.25,0)
  642. bs.maxForce = Vector3.new(100000,100000,100000)
  643.  
  644. p.Touched:connect(function(part)
  645. if (part.Name ~= "beam012") then
  646. if (p.Name == "3") then
  647. p.Parent = nil
  648. elseif (p.Name == "2") then
  649. p.Name = "3"
  650. elseif (p.Name == "1") then
  651. p.Name = "2"
  652. end
  653. part.Parent = nil
  654. end
  655. end)
  656.  
  657. coroutine.resume(coroutine.create(function()
  658. for i = 1, 5, 0.01 do
  659. if (p.Parent ~= nil) then
  660. beam(p.Position, p.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)))
  661. end
  662. wait(0.01)
  663. end
  664. p.Parent = nil
  665. end))
  666.  
  667. wait(1)
  668. --removeSoul(2)
  669. end
  670. end
  671. hold = false
  672. holdTime = 0
  673. animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi + math.pi/2,0,0), CFrame.new())
  674. end
  675. debounce2 = false
  676. end)
  677.  
  678. mouse.KeyDown:connect(function (key)
  679. keys[key] = true
  680. if (keys["z"]) then
  681. mode = "hurt"
  682. elseif (keys["x"]) then
  683. mode = "bubble"
  684. elseif (keys["q"]) then
  685. mode = "beam"
  686. elseif (keys["c"]) then
  687. mode = "drain"
  688. elseif (keys["v"]) then
  689. mode = "build"
  690. elseif (keys["e"]) then
  691. if (mode ~= "throw") then
  692. mode = "throw"
  693. else
  694. if (debounce) then return end
  695. debounce = true
  696. if (throw) then
  697. handle:FindFirstChild("BodyPosition").Parent = nil
  698. handle:FindFirstChild("BodyGyro").Parent = nil
  699. throw = false
  700. animateArm(true, CFrame.new(1.5,0.5,0), CFrame.new(0,0.5,0)*CFrame.Angles(-math.pi/2, 0, 0))
  701. animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi + math.pi/2,0,0), CFrame.new())
  702. end
  703. debounce = false
  704. end
  705. elseif (keys["b"]) then
  706. if (debounce) then return end
  707. debounce = true
  708. if (throw) then
  709. local p = newCylMesh(newPart(Vector3.new(1,0.25,1),BrickColor.new(0,0,0),model))
  710. p.Anchored = true
  711. p.CFrame = CFrame.new(handle.Position) + Vector3.new(0,-2,0)
  712. local c = p.CFrame
  713. for i=1,30,0.5 do
  714. p.Size = p.Size+Vector3.new(0.5,0,0.5)
  715. p.CFrame = c
  716. wait(0.01)
  717. end
  718. for i,v in ipairs(game.Workspace:getChildren()) do
  719. if (v:FindFirstChild("Torso") ~= nil) then
  720. if ((core.Position - v.Torso.Position).magnitude <= 15) then
  721. coroutine.resume(coroutine.create(function()
  722. v.Torso.CFrame = CFrame.new(Vector3.new(v.Torso.Position.x,p.Position.y+3,v.Torso.Position.z),v.Torso.CFrame.lookVector)
  723. v.Torso.Anchored = true
  724. for i=0, 10 do
  725. v.Torso.CFrame = v.Torso.CFrame+Vector3.new(0,-1,0)
  726. wait(0.1)
  727. end
  728. v:BreakJoints()
  729. end))
  730. end
  731. end
  732. end
  733. for i=1,30,1 do
  734. p.Size = p.Size+Vector3.new(-1,0,-1)
  735. p.CFrame = c
  736. wait(0.01)
  737. end
  738. p.Parent = nil
  739. end
  740. debounce = false
  741. elseif (keys["f"]) then
  742. mode = "portal"
  743. end
  744. end)
  745. mouse.KeyUp:connect(function (key) keys[key] = false end)
  746. end)
  747.  
  748. tool.Deselected:connect(function()
  749. hold = false
  750. holdTime = 0
  751. if (not throw) then
  752. animateArm(false, nil, nil)
  753. animateStaff(false, nil, nil)
  754. end
  755. end)
  756.  
  757. local y = 0
  758. local x = 0
  759. game:getService("RunService").Stepped:connect(function()
  760. if (hold) then
  761. holdTime = holdTime+0.5
  762. if(holdTime >= 10) then
  763. beam(core.Position, core.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)))
  764. end
  765. end
  766.  
  767. if (mode == "drain") then
  768. for q,v in pairs(Workspace:getChildren()) do
  769. if (v ~= character and math.random(1,10) == 1) then
  770. damageDistance(v, 10)
  771. end
  772. end
  773. beam(core.Position, core.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)))
  774. end
  775.  
  776. coreWeld.C0 = CFrame.new(0,3.75,0)+Vector3.new(0,math.sin(y)/4,0)
  777.  
  778. for i,v in ipairs(orbWeld) do
  779. local radius = getRadius(#orbWeld)
  780.  
  781. local index = x + ((math.pi*2)/#orbWeld)*(i-1)
  782.  
  783. orbWeld[i].C0 = CFrame.new(radius*math.sin(index), 0, radius*math.cos(index))
  784. end
  785.  
  786. if (y < math.pi*2) then
  787. y = y + math.pi*2/128
  788. else
  789. y = math.pi*2/128
  790. end
  791.  
  792. if (x < math.pi*2) then
  793. x = x + math.pi*2/128
  794. else
  795. x = math.pi*2/128
  796. end
  797. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement