Advertisement
memberhero

Super Epic Wizard Script Real This Time

Jan 11th, 2017
675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.39 KB | None | 0 0
  1. ---Edit By Memberhero15 basstracker1970s alt
  2. math.randomseed(tick())
  3.  
  4.  
  5. -- Wait for character
  6. repeat wait() until game.Players.LocalPlayer.Character ~= nil
  7.  
  8.  
  9. -- Useful shortcuts
  10. local a = Instance.new("Part")
  11. a.BrickColor = BrickColor.new("White")
  12. a.Material = "Sand"
  13. a.Size = Vector3.new(2048, 5, 2048)
  14. a.Position = Vector3.new(0, 0, 0)
  15. a.Anchored = true
  16. a.Archivable = true
  17. a.CanCollide = true
  18. a.Parent = game.Workspace
  19. local m = Instance.new("SpecialMesh")
  20. m.Parent = a
  21. m.MeshType = "Brick"
  22. m.Scale = Vector3.new(10, 1, 10)
  23.  
  24. local l = game.Lighting
  25. local sky = Instance.new("Sky",l)
  26. l.TimeOfDay = "12:00:00"
  27. l.Brightness = 1
  28. l.Ambient = Color3.new(0.25, 0.5, 0.75)
  29. sky.CelestialBodiesShown = false
  30. sky.SkyboxBk = "http://www.roblox.com/asset/?id=1010388"
  31. sky.SkyboxDn = "http://www.roblox.com/asset/?id=1010389"
  32. sky.SkyboxFt = "http://www.roblox.com/asset/?id=1010386"
  33. sky.SkyboxLf = "http://www.roblox.com/asset/?id=1010387"
  34. sky.SkyboxRt = "http://www.roblox.com/asset/?id=1010385"
  35. sky.SkyboxUp = "http://www.roblox.com/asset/?id=1010390"
  36. sky.StarCount = 0
  37. sky.Name = "IcySkies"
  38.  
  39. p = game.Players.LocalPlayer
  40. char = p.Character
  41. local char = p.Character
  42. torso = char.Torso
  43. neck = char.Torso.Neck
  44. hum = char.Humanoid
  45. hum.MaxHealth = 6250
  46. wait()
  47. hum.Health =hum.MaxHealth
  48.  
  49. local s = Instance.new("Sound",char)
  50. s.SoundId = "http://www.roblox.com/asset/?id=340106355"
  51. s.Pitch = 1
  52. s.Volume = 1
  53. s.Looped = true
  54. wait(0)
  55. s:play()
  56.  
  57. CV="Hot pink"
  58.  
  59. local txt = Instance.new("BillboardGui", char)
  60. txt.Adornee = char .Head
  61. txt.Name = "_status"
  62. txt.Size = UDim2.new(2, 0, 1.2, 0)
  63. txt.StudsOffset = Vector3.new(-9, 8, 0)
  64. local text = Instance.new("TextLabel", txt)
  65. text.Size = UDim2.new(10, 0, 7, 0)
  66. text.FontSize = "Size24"
  67. text.TextScaled = true
  68. text.TextTransparency = 0
  69. text.BackgroundTransparency = 1
  70. text.TextTransparency = 0
  71. text.TextStrokeTransparency = 0
  72. text.Font = "SciFi"
  73. text.TextStrokeColor3 = Color3.new(1,1,1)
  74.  
  75. v=Instance.new("Part")
  76. v.Name = "ColorBrick"
  77. v.Parent=p.Character
  78. v.FormFactor="Symmetric"
  79. v.Anchored=true
  80. v.CanCollide=false
  81. v.BottomSurface="Smooth"
  82. v.TopSurface="Smooth"
  83. v.Size=Vector3.new(10,5,3)
  84. v.Transparency=1
  85. v.CFrame=char.Torso.CFrame
  86. v.BrickColor=BrickColor.new(CV)
  87. v.Transparency=1
  88. text.TextColor3 = Color3.new(0.5,0.75,1)
  89. v.Shape="Block"
  90. text.Text = "Super Epic Wizard"
  91. local plr = game:GetService("Players").LocalPlayer
  92. local char = plr.Character
  93. local plrgui = plr.PlayerGui
  94. local backpack = plr.Backpack
  95. local torso = char.Torso
  96. local head = char.Head
  97. local hum = char.Humanoid
  98. local larm = char["Left Arm"]
  99. local lleg = char["Left Leg"]
  100. local rarm = char["Right Arm"]
  101. local rleg = char["Right Leg"]
  102. local LS = torso["Left Shoulder"]
  103. local LH = torso["Left Hip"]
  104. local RS = torso["Right Shoulder"]
  105. local RH = torso["Right Hip"]
  106. local neck = torso.Neck
  107. local it = Instance.new
  108. local vt = Vector3.new
  109. local cf = CFrame.new
  110. local euler = CFrame.fromEulerAnglesXYZ
  111. local angles = CFrame.Angles
  112. local neckC0 = cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  113. local neckC1 = cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  114. local LSC0 = cf(-1.5,.5,0)
  115. local LSC1 = cf(0,.5,0)
  116. local RSC0 = cf(1.5,.5,0)
  117. local RSC1 = cf(0,.5,0)
  118. local LHC0 = cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  119. local LHC1 = cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  120. local RHC0 = cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  121. local RHC1 = cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  122. local RP = char.HumanoidRootPart
  123. local RJ = RP.RootJoint
  124. local RJC0 = euler(-1.57,0,3.14)
  125.  
  126.  
  127. -- Build the weapon
  128. local build = function()
  129. local model = Instance.new("Model")
  130. model.Name = "Cane"
  131. local handle = Instance.new("Part", model)
  132. handle.FormFactor = Enum.FormFactor.Symmetric
  133. handle.CanCollide = false
  134. handle.Size = Vector3.new(1,1,3)
  135. handle.Name = "Handle"
  136. local mesh = Instance.new("SpecialMesh",handle)
  137. mesh.Scale = Vector3.new(1,1,0.69999998807907)
  138. mesh.MeshId = "http://www.roblox.com/asset/?id=25628815"
  139. mesh.TextureId = "http://www.roblox.com/asset/?id=25629094"
  140. mesh.MeshType = Enum.MeshType.FileMesh
  141. return model
  142. end
  143.  
  144.  
  145. -- Wait for mouse
  146. local mouse
  147. while true do
  148. mouse = plr:GetMouse()
  149. if mouse then break end
  150. wait(.1)
  151. end
  152.  
  153.  
  154. -- Create welds
  155. local RW, LW = Instance.new("Weld",torso), Instance.new("Weld",torso)
  156. RW.Name = "Right Weld" LW.Name = "Left Weld"
  157. RW.Part0 = torso LW.Part0 = torso
  158. RW.C0 = RSC0 RW.C1 = RSC1 LW.C0 = LSC0 LW.C1 = LSC1
  159.  
  160.  
  161. -- Attach weapon
  162. local canemodel = build()
  163. local cane = canemodel:FindFirstChild("Handle")
  164. canemodel.Parent = char
  165. local caneweld = Instance.new("Weld", rarm)
  166. caneweld.Part0 = rarm
  167. caneweld.Part1 = cane
  168. caneweldC0 = caneweld.C0 * CFrame.new(0,-1,1) * CFrame.Angles(math.rad(180),0,math.rad(90))
  169. caneweld.C0 = caneweldC0
  170.  
  171.  
  172. -- Weapon variables
  173. local caneEnd = cf(-.225,0,-1.5)
  174.  
  175.  
  176. -- Sound effects
  177. local sounds = {}
  178. sounds.explosion = "http://www.roblox.com/asset/?id=87784452"
  179. sounds.bewm = "http://www.roblox.com/asset/?id=2767090"
  180. sounds.slice = "http://www.roblox.com/asset/?id=161006195"
  181. sounds.charge = "http://roblox.com/asset/?id=2101137"
  182. sounds.sharpblast = "http://roblox.com/asset/?id=2248511"
  183. sounds.woosh = "http://roblox.com/asset/?id=147722227"
  184. sounds.metalhit = "http://roblox.com/asset/?id=153092348"
  185. sounds.mechblast = "http://roblox.com/asset/?id=169380505"
  186. sounds.chargepulse = "http://roblox.com/asset/?id=10209296"
  187. sounds.heal = "http://roblox.com/asset/?id=2101144"
  188. sounds.zap = "http://roblox.com/asset/?id=10756104"
  189. sounds.powernote = "http://roblox.com/asset/?id=192603389"
  190. sounds.swing = "http://roblox.com/asset/?id=10209640"
  191. sounds.hit = "http://roblox.com/asset/?id=10209590"
  192.  
  193.  
  194. -- Base functions
  195. local wait = function(t)
  196. if t ~= nil then
  197. return wait(t)
  198. else
  199. local t = tick()
  200. game:GetService("RunService").RenderStepped:wait()
  201. return tick() - t, time()
  202. end
  203. end
  204. local nolines = function(p)
  205. p.TopSurface, p.BottomSurface, p.LeftSurface, p.RightSurface, p.FrontSurface, p.BackSurface = 10, 10, 10, 10, 10, 10
  206. end
  207. local part = function(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  208. local fp = it("Part")
  209. fp.formFactor = formfactor
  210. fp.Parent = parent
  211. fp.Reflectance = reflectance
  212. fp.Transparency = transparency
  213. fp.CanCollide = false
  214. fp.Locked = true
  215. fp.BrickColor = brickcolor
  216. fp.Name = name
  217. fp.Size = size
  218. fp.Position = torso.Position
  219. fp.Material = "SmoothPlastic"
  220. fp:BreakJoints()
  221. nolines(fp)
  222. return fp
  223. end
  224. local mesh = function(instance,part,meshtype,meshid,offset,scale)
  225. local mesh = it(instance)
  226. mesh.Parent = part
  227. if instance == "SpecialMesh" then
  228. mesh.MeshType = meshtype
  229. if meshid ~= nil then
  230. mesh.MeshId = "http://www.roblox.com/asset/?id="..meshid
  231. end
  232. end
  233. mesh.Offset=offset
  234. mesh.Scale=scale
  235. return mesh
  236. end
  237. local weld = function(parent,part0,part1,c0)
  238. local weld = it("Weld")
  239. weld.Parent = parent
  240. weld.Part0 = part0
  241. weld.Part1 = part1
  242. weld.C0 = c0
  243. return weld
  244. end
  245. local rayCast = function(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  246. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  247. end
  248. local rad = function(x,y,z)
  249. return euler(math.rad(x or 0),math.rad(y or 0),math.rad(z or 0))
  250. end
  251. local random = function(a, b)
  252. local num = math.random(a*100, b*100)
  253. return num/100
  254. end
  255. local randomRot = function()
  256. return rad(random(0,360),random(0,360),random(0,360))
  257. end
  258. local sound = function(id, par, vol, pit)
  259. coroutine.resume(coroutine.create(function()
  260. local sou = Instance.new("Sound", par or workspace)
  261. sou.Volume = vol
  262. sou.Pitch = pit or 1
  263. sou.SoundId = id
  264. wait()
  265. sou:play()
  266. game:GetService("Debris"):AddItem(sou, 6)
  267. end))
  268. end
  269. local damage = function(hit, minim, maxim, knockback, Type, Property, Delay, KnockbackType, incstun, stagger, staghit, ranged)
  270. -- Fen's nasty and messy damage function
  271. if hit.Parent == nil then
  272. return
  273. end
  274. local h = hit.Parent:FindFirstChild("Humanoid")
  275. for _, v in pairs(hit.Parent:children()) do
  276. if v:IsA("Humanoid") then
  277. h = v
  278. end
  279. end
  280. if hit.Parent.Parent:FindFirstChild("Torso") ~= nil then
  281. h = hit.Parent.Parent:FindFirstChild("Humanoid")
  282. end
  283. if hit.Parent.className == "Hat" then
  284. hit = hit.Parent.Parent:findFirstChild("Head")
  285. end
  286. if h ~= nil and hit.Parent.Name ~= char.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
  287. if hit.Parent:findFirstChild("DebounceHit") ~= nil then
  288. if hit.Parent.DebounceHit.Value == true then
  289. return
  290. end
  291. end
  292. local c = Instance.new("ObjectValue")
  293. c.Name = "creator"
  294. c.Value = game:service("Players").LocalPlayer
  295. c.Parent = h
  296. game:GetService("Debris"):AddItem(c, .5)
  297. local Damage = random(minim, maxim)
  298. local blocked = false
  299. local enblock = nil
  300. local Stats = hit.Parent:findFirstChild("Stats")
  301. if Stats ~= nil then
  302. enblock = Stats:findFirstChild("Block")
  303. if Stats:findFirstChild("Defense") ~= nil then
  304. Damage = Damage / Stats.Defense.Value
  305. end
  306. if Stats:findFirstChild("Stun") ~= nil then
  307. Stats.Stun.Value = Stats.Stun.Value + incstun
  308. end
  309. if Stats:findFirstChild("Stagger") ~= nil then
  310. if stagger == true then
  311. Stats.Stagger.Value = true
  312. end
  313. end
  314. end
  315. if enblock ~= nil then
  316. if enblock.Value == true then
  317. blocked = true
  318. end
  319. end
  320. if blocked == true then
  321. if ranged ~= true then
  322. enblock.Value = false
  323. end
  324. else
  325. Damage = math.floor(Damage)
  326. print("dam"..Damage)
  327. sound(sounds.hit, hit, 1, 1)
  328. h.Health = h.Health - Damage
  329. if Type == "Knockdown" then
  330. local hum = hit.Parent.Humanoid
  331. hum.PlatformStand = true
  332. coroutine.resume(coroutine.create(function(HHumanoid)
  333. wait()
  334. HHumanoid.PlatformStand = false
  335. end), hum)
  336. local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit
  337. local bodvol = Instance.new("BodyVelocity")
  338. bodvol.velocity = angle * knockback
  339. bodvol.P = 5000
  340. bodvol.maxForce = Vector3.new(8e+003, 8e+003, 8e+003)
  341. bodvol.Parent = hit
  342. local rl = Instance.new("BodyAngularVelocity")
  343. rl.P = 3000
  344. rl.maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000
  345. rl.angularvelocity = Vector3.new(random(-10, 10), random(-10, 10), random(-10, 10))
  346. rl.Parent = hit
  347. game:GetService("Debris"):AddItem(bodvol, .5)
  348. game:GetService("Debris"):AddItem(rl, .5)
  349. elseif Type == "Knockdown2" then
  350. local hum = hit.Parent.Humanoid
  351. local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit
  352. local bodvol = Instance.new("BodyVelocity")
  353. bodvol.velocity = angle * knockback
  354. bodvol.P = 5000
  355. bodvol.maxForce = Vector3.new(8e+003, 8e+003, 8e+003)
  356. bodvol.Parent = hit
  357. game:GetService("Debris"):AddItem(bodvol, .5)
  358. elseif Type == "Normal" or Type == "NormalDecreaseMvmt1" then
  359. local vp = Instance.new("BodyVelocity")
  360. vp.P = 500
  361. vp.maxForce = Vector3.new(math.huge, 0, math.huge)
  362. if KnockbackType == 1 then
  363. vp.velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05
  364. elseif KnockbackType == 2 then
  365. vp.velocity = Property.CFrame.lookVector * knockback
  366. end
  367. game:GetService("Debris"):AddItem(vp, .5)
  368. if knockback > 0 then
  369. vp.Parent = hit.Parent.Torso
  370. end
  371. end
  372. end
  373. local debounce = Instance.new("BoolValue")
  374. debounce.Name = "DebounceHit"
  375. debounce.Parent = hit.Parent
  376. debounce.Value = true
  377. game:GetService("Debris"):AddItem(debounce, Delay)
  378. c = Instance.new("ObjectValue")
  379. c.Name = "creator"
  380. c.Value = plr
  381. c.Parent = h
  382. game:GetService("Debris"):AddItem(c, .5)
  383. end
  384. end
  385. local fade = function(prt, t)
  386. coroutine.resume(coroutine.create(function()
  387. for i = 0, 1, t do
  388. wait(0)
  389. prt.Transparency = i
  390. end
  391. wait(0)
  392. prt:destroy()
  393. end))
  394. end
  395. local block1 = function(prt, delay, x, y, z, msh)
  396. coroutine.resume(coroutine.create(function()
  397. for i = 0, 1, delay do
  398. wait(0)
  399. prt.CFrame = prt.CFrame * euler(random(-50, 50), random(-50, 50), random(-50, 50))
  400. local Mesh = msh
  401. Mesh.Scale = Mesh.Scale + vt(x, y, z)
  402. prt.Transparency = i
  403. end
  404. wait(0)
  405. prt:destroy()
  406. end))
  407. end
  408. local block2 = function(prt, delay, x, y, z, msh)
  409. coroutine.resume(coroutine.create(function()
  410. for i = 0, 1, delay do
  411. wait(0)
  412. local Mesh = msh
  413. Mesh.Scale = Mesh.Scale + vt(x, y, z)
  414. prt.Transparency = i
  415. end
  416. wait(0)
  417. prt:destroy()
  418. end))
  419. end
  420. local cyleffect = function(prt, delay, x, y, z, msh)
  421. coroutine.resume(coroutine.create(function()
  422. for i = 0, 1, delay do
  423. wait(0)
  424. local Mesh = msh
  425. Mesh.Scale = Mesh.Scale + vt(x, y, z)
  426. prt.Transparency = i
  427. end
  428. wait(0)
  429. prt:destroy()
  430. end))
  431. end
  432. local CFrameFromTopBack = function(at, top, back)
  433. local right = top:Cross(back)
  434. return CFrame.new(at.x, at.y, at.z,
  435. right.x, top.x, back.x,
  436. right.y, top.y, back.y,
  437. right.z, top.z, back.z)
  438. end
  439. local triangle = function(a, b, c)
  440. local edg1 = (c - a):Dot((b - a).unit)
  441. local edg2 = (a - b):Dot((c - b).unit)
  442. local edg3 = (b - c):Dot((a - c).unit)
  443. if edg1 <= (b - a).magnitude and edg1 >= 0 then
  444. a, b, c = a, b, c
  445. elseif edg2 <= (c - b).magnitude and edg2 >= 0 then
  446. a, b, c = b, c, a
  447. elseif edg3 <= (a - c).magnitude and edg3 >= 0 then
  448. a, b, c = c, a, b
  449. else
  450. assert(false, "unreachable")
  451. end
  452. local len1 = (c - a):Dot((b - a).unit)
  453. local len2 = (b - a).magnitude - len1
  454. local width = (a + (b - a).unit * len1 - c).magnitude
  455. local maincf = CFrameFromTopBack(a, (b - a):Cross(c - b).unit, -(b - a).unit)
  456. local list = {}
  457. if len1 > 0.01 then
  458. local w1 = Instance.new('WedgePart', m)
  459. game:GetService("Debris"):AddItem(w1, 5)
  460. w1.Material = "SmoothPlastic"
  461. w1.FormFactor = 'Custom'
  462. w1.BrickColor = BrickColor.new("Bright red")
  463. w1.Transparency = 0
  464. w1.Reflectance = 0
  465. w1.Material = "SmoothPlastic"
  466. w1.CanCollide = false
  467. nolines(w1)
  468. local sz = Vector3.new(0.2, width, len1)
  469. w1.Size = sz
  470. local sp = Instance.new("SpecialMesh", w1)
  471. sp.MeshType = "Wedge"
  472. sp.Scale = Vector3.new(0, 1, 1) * sz / w1.Size
  473. w1:BreakJoints()
  474. w1.Anchored = true
  475. w1.Parent = workspace
  476. w1.Transparency = 0.7
  477. fade(w1)
  478. w1.CFrame = maincf * CFrame.Angles(math.pi, 0, math.pi / 2) * CFrame.new(0, width / 2, len1 / 2)
  479. table.insert(list, w1)
  480. end
  481. if len2 > 0.01 then
  482. local w2 = Instance.new('WedgePart', m)
  483. game:GetService("Debris"):AddItem(w2, 5)
  484. w2.Material = "SmoothPlastic"
  485. w2.FormFactor = 'Custom'
  486. w2.BrickColor = BrickColor.new("Bright red")
  487. w2.Transparency = 0
  488. w2.Reflectance = 0
  489. w2.Material = "SmoothPlastic"
  490. w2.CanCollide = false
  491. nolines(w2)
  492. local sz = Vector3.new(0.2, width, len2)
  493. w2.Size = sz
  494. local sp = Instance.new("SpecialMesh", w2)
  495. sp.MeshType = "Wedge"
  496. sp.Scale = Vector3.new(0, 1, 1) * sz / w2.Size
  497. w2:BreakJoints()
  498. w2.Anchored = true
  499. w2.Parent = workspace
  500. w2.Transparency = 0.7
  501. fade(w2)
  502. w2.CFrame = maincf * CFrame.Angles(math.pi, math.pi, -math.pi / 2) * CFrame.new(0, width / 2, -len1 - len2 / 2)
  503. table.insert(list, w2)
  504. end
  505. return unpack(list)
  506. end
  507.  
  508.  
  509. -- Magic effects
  510. local magic = {}
  511. magic.stravant = function(brickcolor, cframe, x, y, z, x1, y1, z1, delay)
  512. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt(0.5, 0.5, 0.5))
  513. prt.Anchored = true
  514. prt.CFrame = cframe * cf(x, y, z)
  515. local msh = mesh("SpecialMesh", prt, "FileMesh", "rbxassetid://168892363", vt(0, 0, 0), vt(x1, y1, z1))
  516. game:GetService("Debris"):AddItem(prt, 5)
  517. coroutine.resume(coroutine.create(function(Part, Mesh, ex, why, zee)
  518. local num = random()
  519. local num2 = random(-3, 2) + random()
  520. local numm = 0
  521. for i = 0, 1, delay * 2 do
  522. wait()
  523. Part.CFrame = cframe * euler(0, numm * num * 10, 0) * cf(ex, why, zee) * cf(-i * 10, num2, 0)
  524. Part.Transparency = i
  525. numm = numm + 0.01
  526. end
  527. Part.Parent = nil
  528. Mesh.Parent = nil
  529. end), prt, msh, x, y, z)
  530. end
  531. magic.block = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type, par)
  532. local prt = part(3, par or workspace, 0, 0, brickcolor, "Effect", vt())
  533. prt.Anchored = true
  534. prt.CFrame = cframe
  535. local msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  536. game:GetService("Debris"):AddItem(prt, 5)
  537. if Type == 1 or Type == nil then
  538. block1(prt, delay, x3, y3, z3, msh)
  539. elseif Type == 2 then
  540. block2(prt, delay, x3, y3, z3, msh)
  541. end
  542. end
  543. magic.circle = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, par)
  544. local prt = part(3, par or workspace, 0, 0, brickcolor, "Effect", vt())
  545. prt.Anchored = true
  546. prt.CFrame = cframe
  547. local msh = mesh("SpecialMesh", prt, "Sphere", nil, vt(0, 0, 0), vt(x1, y1, z1))
  548. game:GetService("Debris"):AddItem(prt, 2)
  549. cyleffect(prt, delay, x3, y3, z3, msh)
  550. end
  551. magic.cylinder = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  552. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  553. prt.Anchored = true
  554. prt.CFrame = cframe
  555. local msh = mesh("CylinderMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  556. game:GetService("Debris"):AddItem(prt, 2)
  557. cyleffect(prt, delay, x3, y3, z3, msh)
  558. end
  559. magic.head = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  560. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  561. prt.Anchored = true
  562. prt.CFrame = cframe
  563. local msh = mesh("SpecialMesh", prt, "Head", nil, vt(0, 0, 0), vt(x1, y1, z1))
  564. game:GetService("Debris"):AddItem(prt, 2)
  565. cyleffect(prt, delay, x3, y3, z3, msh)
  566. end
  567. magic.wave = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  568. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  569. prt.Anchored = true
  570. prt.CFrame = cframe
  571. local msh = mesh("SpecialMesh", prt, "FileMesh", "http://www.roblox.com/asset/?id=20329976", vt(0, 0, 0), vt(x1, y1, z1))
  572. game:GetService("Debris"):AddItem(prt, 5)
  573. cyleffect(prt, delay, x3, y3, z3, msh)
  574. end
  575. magic.lightning = function(p0, p1, tym, ofs, col, th, tra, last, par)
  576. local magz = (p0 - p1).magnitude
  577. local curpos = p0
  578. local trz = {
  579. -ofs,
  580. ofs
  581. }
  582. for i = 1, tym do
  583. local li = Instance.new("Part", par or workspace)
  584. li.TopSurface = 0
  585. li.BottomSurface = 0
  586. li.Anchored = true
  587. li.Transparency = tra or 0.4
  588. li.BrickColor = BrickColor.new(col)
  589. li.Material = "Neon"
  590. li.formFactor = "Custom"
  591. li.CanCollide = false
  592. li.Size = Vector3.new(th, th, magz / tym)
  593. local ofz = Vector3.new(random(trz[1],trz[2]), random(trz[1],trz[2]), random(trz[1],trz[2]))
  594. local trolpos = CFrame.new(curpos, p1) * CFrame.new(0, 0, magz / tym).p + ofz
  595. if tym == i then
  596. local magz2 = (curpos - p1).magnitude
  597. li.Size = Vector3.new(th, th, magz2)
  598. li.CFrame = CFrame.new(curpos, p1) * CFrame.new(0, 0, -magz2 / 2)
  599. else
  600. li.CFrame = CFrame.new(curpos, trolpos) * CFrame.new(0, 0, magz / tym / 2)
  601. end
  602. curpos = li.CFrame * CFrame.new(0, 0, magz / tym / 2).p
  603. game.Debris:AddItem(li, last)
  604. end
  605. end
  606.  
  607.  
  608. -- Logic variables
  609. local equipped = false
  610. local attacking = false
  611.  
  612. -- Effect handling
  613. local charfx = Instance.new("Model", char)
  614. charfx.Name = "Effects"
  615. local toggles = {
  616. snow = false;
  617. lmagic = false;
  618. rmagic = false;
  619. canemagic = false;
  620. }
  621. local snowTick = 0
  622. local lmagicTick = 0
  623. local rmagicTick = 0
  624. local canemagicTick = 0
  625. local snowMeshes = {
  626. "http://www.roblox.com/asset?id=187687161";
  627. "http://www.roblox.com/asset?id=187687175";
  628. "http://www.roblox.com/asset?id=187687193";
  629.  
  630. }
  631.  
  632. -- Pose system
  633. local poses = {
  634. none = {
  635. larm = euler(0, 0, 0);
  636. rarm = euler(0, 0, 0);
  637. lleg = euler(0, 0, 0);
  638. rleg = euler(0, 0, 0);
  639. torso = euler(0, 0, 0);
  640. head = euler(0, 0, 0);
  641. cane = euler(0, 0, 0);
  642. }
  643. }
  644. local pose = "none"
  645. local posespeed = .1
  646. local newpose = function(name, larm, rarm, torso, head, lleg, rleg, cane)
  647. poses[name] = {
  648. larm = larm or rad();
  649. rarm = rarm or rad();
  650. lleg = lleg or rad();
  651. rleg = rleg or rad();
  652. torso = torso or rad();
  653. head = head or rad();
  654. cane = cane or rad();
  655. }
  656. end
  657. local setpose = function(name, speed)
  658. posespeed = speed or 1
  659. pose = name or "none"
  660. end
  661. game:GetService("RunService").RenderStepped:connect(function()
  662. local vel = (RP.Velocity*Vector3.new(1,0,1)).magnitude
  663. local yvel = RP.Velocity.y
  664. local hitfloor,posfloor=rayCast(RP.Position,(CFrame.new(RP.Position,RP.Position - Vector3.new(0,1,0))).lookVector,4,char)
  665. if yvel > 1 and hitfloor == nil and equipped and not attacking then
  666. setpose("jumping",.2)
  667. elseif yvel < -1 and hitfloor == nil and equipped and not attacking then
  668. setpose ("falling",.075)
  669. elseif vel < 1 and hitfloor ~= nil and equipped and not attacking then
  670. setpose("idle",.1)
  671. elseif vel > 2 and vel < 22 and hitfloor ~= nil and equipped and not attacking then
  672. setpose("walking",.1)
  673. end
  674. if poses[pose] ~= nil then
  675. local pose = poses[pose]
  676. LW.C0 = LW.C0:lerp(LSC0 * pose.larm, posespeed)
  677. RW.C0 = RW.C0:lerp(RSC0 * pose.rarm, posespeed)
  678. LH.C0 = LH.C0:lerp(LHC0 * pose.lleg, posespeed)
  679. RH.C0 = RH.C0:lerp(RHC0 * pose.rleg, posespeed)
  680. RJ.C0 = RJ.C0:lerp(RJC0 * pose.torso, posespeed)
  681. neck.C0 = neck.C0:lerp(neckC0 * pose.head, posespeed)
  682. caneweld.C0 = caneweld.C0:lerp(caneweldC0 * pose.cane, posespeed)
  683. end
  684. if toggles.snow == true then
  685. if snowTick % 15 == 0 then
  686. local p = Instance.new("Part")
  687. local m = Instance.new("SpecialMesh", p)
  688. m.MeshId = snowMeshes[math.random(1, #snowMeshes)]
  689. m.Scale = Vector3.new(2,2,2)
  690. local q = Instance.new("BodyVelocity")
  691. p.BrickColor = BrickColor.new("White")
  692. p.Parent = charfx
  693. p.Shape = 1
  694. p.Size = Vector3.new(.5, .5, .5)
  695. p.Transparency = .3
  696. p.Locked = true
  697. p.Anchored = false
  698. p.CanCollide = false
  699. p.formFactor = "Plate"
  700. p.CFrame = torso.CFrame * cf(Vector3.new((random(-75, 75)),50,(random(-75,75)))) * randomRot()
  701. q.velocity = Vector3.new(0, -10, 0)
  702. q.Parent = p
  703. p.Touched:connect(function()
  704. p:destroy()
  705. end)
  706. end
  707. snowTick = snowTick + 1
  708. end
  709. if toggles.lmagic then
  710. if lmagicTick % 15 == 0 then
  711. magic.block(BrickColor.new("Institutional white"),larm.CFrame*cf(0,-1,0),1,1,1,.5,.5,.5,.065,nil,charfx)
  712. end
  713. lmagicTick = lmagicTick + 1
  714. end
  715. if toggles.rmagic then
  716. if rmagicTick % 15 == 0 then
  717. magic.block(BrickColor.new("Institutional white"),rarm.CFrame*cf(0,-1,0),1,1,1,.5,.5,.5,.065,nil,charfx)
  718. end
  719. rmagicTick = rmagicTick + 1
  720. end
  721. if toggles.canemagic then
  722. if canemagicTick % 15 == 0 then
  723. magic.block(BrickColor.new("Institutional white"),cane.CFrame*caneEnd,1,1,1,.5,.5,.5,.065,nil,charfx)
  724. end
  725. canemagicTick = canemagicTick + 1
  726. end
  727. end)
  728.  
  729.  
  730. -- Weapon setup
  731. local bin = Instance.new("HopperBin",backpack)
  732. bin.Name = "Cane"
  733. script.Parent = bin
  734.  
  735. -- Weapon poses
  736. newpose("idle", rad(-5,5,0), rad(0,0,50), rad(0,-2,-15), rad(0,-3,15), rad(0,15,0), rad(0,15,0), rad(90,-45,170)*CFrame.new(0,-1,-1.5))
  737. newpose("jumping", rad(-20, 0, -10), rad(-20, 0, 10), rad(-10, 0, 0), rad(0, 0, 0), rad(0, 0, 15), rad(0, 0, 0)*CFrame.new(.35,.35,0))
  738. newpose("falling", rad(0, 0, -50), rad(0, 0, 50), rad(0, 0, 0), rad(20, 0, 0), rad(0, 0, 0), rad(0, 0, 0)*CFrame.new(.15,.15,0))
  739. newpose("walking", rad(-5,5,-15), rad(-20,0,20), rad(5,0,0), rad(0,0,0), rad(0,0,0), rad(0,0,0))
  740.  
  741. -- Attack poses
  742. newpose("larmcharge", rad(0,-15,-135), rad(0,0,50), rad(0,-2,-15), rad(-15,-15,50), rad(0,15,0), rad(0,15,0), rad(90,-45,170)*CFrame.new(0,-1,-1.5))
  743. newpose("canecharge", rad(45,0,30), rad(0,0,150), rad(0,0,-35), rad(-20,0,0), rad(0,35,0), rad(0,35,0), rad(90,-135,170)*CFrame.new(0,-1,-1.5))
  744. newpose("clickattack1_1", rad(20,0,15), rad(0,-15,125), rad(0,-2,-35), rad(0,-3,35), rad(0,35,0), rad(0,35,0), rad(90,-165,180)*CFrame.new(0,-1,-1.5))
  745. newpose("clickattack1_2", rad(-20,0,-15), rad(0,100,65), rad(0,-2,45), rad(10,-10,-25), rad(0,-45,0), rad(0,-45,0), rad(90,-110,180)*CFrame.new(0,-1,-1.5))
  746. newpose("clickattack2_1", rad(-45,0,-45), rad(0,150,65), rad(0,-2,65), rad(10,-10,-45), rad(0,-65,0), rad(0,-65,0), rad(90,-135,180)*CFrame.new(0,-1,-1.5))
  747. newpose("clickattack2_2", rad(-15,0,-60), rad(0,-15,70), rad(0,-2,-35), rad(0,-3,35), rad(0,35,0), rad(0,35,0), rad(90,-110,180)*CFrame.new(0,-1,-1.5))
  748. newpose("clickattack3_1", rad(-15,0,-60), rad(0,-15,125), rad(0,-2,-45), rad(0,-3,45), rad(0,45,0), rad(0,45,0), rad(90,-165,180)*CFrame.new(0,-1,-1.5))
  749. newpose("clickattack3_2", rad(-20,0,-75), rad(-90,0,110), rad(0,0,75), rad(10,-10,-60), rad(0,-80,30), rad(0,-80,0), rad(90,-90,180)*CFrame.new(0,-1,-1.5))
  750. newpose("clickattack4_1", rad(0,0,-90), rad(0,0,125), rad(0,0,-90), rad(0,0,90), rad(0,35,0), rad(0,35,0), rad(90,-165,180)*CFrame.new(0,-1,-1.5))
  751. newpose("clickattack4_2", rad(0,0,-135), rad(0,0,125), rad(0,0,-90), rad(0,0,90), rad(0,35,0), rad(0,35,0), rad(90,-165,180)*CFrame.new(0,-1,-1.5))
  752.  
  753. -- Weapon usage (edit to liking)
  754. local equip = function()
  755. equipped = true
  756. if attacking then
  757. repeat
  758. wait()
  759. until not attacking
  760. end
  761. attacking = true
  762. if not equipped then
  763. attacking = false
  764. return
  765. end
  766. LW.Part1 = larm
  767. RW.Part1 = rarm
  768. LS.Part1 = nil
  769. RS.Part1 = nil
  770. attacking = false
  771. setpose("idle", .085)
  772. end
  773. local unequip = function()
  774. equipped = false
  775. if attacking then
  776. repeat
  777. wait()
  778. until not attacking
  779. end
  780. if equipped then
  781. return
  782. end
  783. setpose("none", .1)
  784. wait(.65)
  785. if equipped then
  786. return
  787. end
  788. LS.Part1 = larm
  789. RS.Part1 = rarm
  790. LW.Part1 = nil
  791. RW.Part1 = nil
  792. end
  793. local keypress = function(key)
  794. if attacking or not equipped then return end
  795. if key == "q" then
  796. attacking = true
  797. print("q")
  798. hum.WalkSpeed = 0
  799. setpose("larmcharge", .1)
  800. wait(.3)
  801. toggles.lmagic = true
  802. sound(sounds.chargepulse, larm, .75, .8)
  803. wait(1.5)
  804. toggles.lmagic = false
  805. magic.circle(BrickColor.new("Institutional white"), larm.CFrame*CFrame.new(0,-1,0), 1, 1, 1, 1.2, 1.2, 1.2, .04, charfx)
  806. sound(sounds.bewm, cane, .9, .6)
  807. toggles.snow = not toggles.snow
  808. print("snow "..(toggles.snow and "yes" or "no"))
  809. wait(.5)
  810. hum.WalkSpeed = 16
  811. attacking = false
  812. elseif key == "x" then
  813. attacking = true
  814. print("x")
  815. hum.WalkSpeed = 12
  816. toggles.canemagic = true
  817. setpose("canecharge", .1)
  818. sound(sounds.charge,char.Torso,.5,1.1)
  819. wait(.5)
  820. setpose("clickattack3_2", .175)
  821. wait(.3)
  822. magic.circle(BrickColor.new("Institutional white"), cane.CFrame*caneEnd, .2, .2, .3, 6, 6, 0, .075)
  823. hum.WalkSpeed = 0
  824. sound(sounds.sharpblast,cane,1,.35)
  825. print("pewwwwwww")
  826. for i = 1, 50 do
  827. local prt,hit = rayCast(cane.CFrame*caneEnd.p,((cane.CFrame*caneEnd).p - (cane.CFrame*(caneEnd*CFrame.new(0,0,1))).p).unit, 100, char)
  828. magic.lightning((cane.CFrame*caneEnd).p, hit, 20, 1, "Institutional white", .1, .2, .15, charfx)
  829. sound(sounds.zap,cane,random(.75,1),random(.75,1.25))
  830. if prt and prt.Parent:FindFirstChild("Humanoid") then
  831. damage(prt, 35, 50, 2, "Knockdown", RP, .5, 1, random(3, 10), nil, true)
  832. sound(sounds.zap,prt,random(.75,1),random(.75,1.25))
  833. sound(sounds.sharpblast,prt,.3,.5)
  834. sound(sounds.bewm,prt,1,.75)
  835. end
  836. wait(.02)
  837. end
  838. toggles.canemagic = false
  839. hum.WalkSpeed = 16
  840. attacking = false
  841. end
  842. end
  843. local combo = 0
  844. local clicked = function(hit)
  845. if attacking or not equipped then return end
  846. if combo == 0 then
  847. attacking = true
  848. combo = combo + 1
  849. print("swing"..combo)
  850. setpose("clickattack1_1", .165)
  851. wait(.125)
  852. local dam1 = cane.Touched:connect(function(hit)
  853. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= char then
  854. damage(hit, 10, 15, .25, "Normal", RP, .5, 1, random(3, 10), nil, true)
  855. end
  856. end)
  857. local dam2 = rarm.Touched:connect(function(hit)
  858. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= char then
  859. damage(hit, 10, 15, .25, "Normal", RP, .5, 1, random(3, 10), nil, true)
  860. end
  861. end)
  862. setpose("clickattack1_2", .185)
  863. sound(sounds.swing,cane,.5,random(1,1.5))
  864. wait(.35)
  865. dam1:disconnect()
  866. dam2:disconnect()
  867. attacking = false
  868. wait(1)
  869. if combo == 1 then
  870. combo = 0
  871. print("ded")
  872. end
  873. elseif combo == 1 then
  874. attacking = true
  875. combo = combo + 1
  876. print("swing"..combo)
  877. setpose("clickattack2_1", .15)
  878. wait(.125)
  879. local dam1 = cane.Touched:connect(function(hit)
  880. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= char then
  881. damage(hit, 10, 15, .25, "Normal", RP, .5, 1, random(3, 10), nil, true)
  882. end
  883. end)
  884. local dam2 = rarm.Touched:connect(function(hit)
  885. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= char then
  886. damage(hit, 10, 15, .25, "Normal", RP, .5, 1, random(3, 10), nil, true)
  887. end
  888. end)
  889. setpose("clickattack2_2", .14)
  890. sound(sounds.swing,cane,.5,random(1,1.5))
  891. for i = 1, 5 do
  892. torso.Velocity = RP.CFrame.lookVector * 45
  893. wait()
  894. end
  895. wait(.25)
  896. dam1:disconnect()
  897. dam2:disconnect()
  898. attacking = false
  899. wait(1)
  900. if combo == 2 then
  901. combo = 0
  902. print("ded")
  903. end
  904. elseif combo == 2 then
  905. attacking = true
  906. combo = combo + 1
  907. print("swing"..combo)
  908. setpose("clickattack3_1", .15)
  909. wait(.2)
  910. local dam1 = cane.Touched:connect(function(hit)
  911. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= char then
  912. damage(hit, 10, 15, .25, "Normal", RP, .5, 1, random(3, 10), nil, true)
  913. end
  914. end)
  915. local dam2 = rarm.Touched:connect(function(hit)
  916. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= char then
  917. damage(hit, 10, 15, .25, "Normal", RP, .5, 1, random(3, 10), nil, true)
  918. end
  919. end)
  920. setpose("clickattack3_2", .2)
  921. sound(sounds.swing,cane,.5,random(.5,1))
  922. for i = 1, 5 do
  923. torso.Velocity = RP.CFrame.lookVector * 55
  924. wait()
  925. end
  926. wait(.3)
  927. dam1:disconnect()
  928. dam2:disconnect()
  929. attacking = false
  930. wait(.5)
  931. if combo == 3 then
  932. combo = 0
  933. print("ded")
  934. end
  935. elseif combo == 3 then
  936. attacking = true
  937. combo = combo + 1
  938. print("swing"..combo)
  939. setpose("clickattack4_1", .18)
  940. sound(sounds.swing,cane,.5,random(1,1.5))
  941. wait(.3)
  942. local bewmcf = larm.CFrame*cf(0,-3,0)
  943. local bewmrange = 7.5
  944. for i = 1, 2 do
  945. magic.block(BrickColor.new("Institutional white"), bewmcf, 1, 1, 1, 2, 2, 2, .075)
  946. end
  947. for _,v in pairs(game.Workspace:GetChildren()) do
  948. if v:FindFirstChild("Torso") and v.Torso:IsA("Part") then
  949. local vtor = v.Torso
  950. local dist = (bewmcf.p - vtor.Position).magnitude
  951. if dist <= bewmrange then
  952. damage(vtor, 20, 30, .5, "Normal", RP, .5, 1, random(3, 10), nil, true)
  953. end
  954. end
  955. end
  956. sound(sounds.bewm,rarm,1,random(1,2))
  957. print("bewm")
  958. setpose("clickattack4_2", .165)
  959. wait(.175)
  960. attacking = false
  961. --wait(.5)
  962. if combo == 4 then
  963. combo = 0
  964. print("ded")
  965. end
  966. end
  967. end
  968. bin.Selected:connect(equip)
  969. bin.Deselected:connect(unequip)
  970. mouse.Button1Down:connect(clicked)
  971. mouse.KeyDown:connect(keypress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement