Advertisement
mathmasterphil

BloodSword

Mar 21st, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.50 KB | None | 0 0
  1. ply = game.Players.LocalPlayer
  2. char = ply.Character
  3. torso = char.Torso
  4. shoulder = nil
  5. body = {}
  6. body.A = {["L"] = char["Left Arm"],["R"] = char["Right Arm"]}
  7. body.L = {["L"] = char["Left Leg"],["R"] = char["Right Leg"]}
  8. body.S = {["L"] = torso["Left Shoulder"],["R"] = torso["Right Shoulder"]}
  9. body.H = {["H"] = torso["Left Shoulder"],["H"] = torso["Right Shoulder"]}
  10. local normposR = body.S.R.C0
  11. local normposL = body.S.L.C0
  12. body.Head = char.Head
  13. rw,lw = Instance.new("Weld"),Instance.new("Weld")
  14. rhw,lhw = Instance.new("Weld"),Instance.new("Weld")
  15. list = {
  16. ["RS"] = rw,
  17. ["LS"]=lw,
  18. ["RH"]=rhw,
  19. ["LH"]=lhw
  20. }
  21. function lock(arm,a)
  22. if a == 1 then
  23. b,c = arm:sub(1,1),arm:sub(2,2)
  24. shoulder = body[c][b]
  25. we = list[arm]
  26. we.Parent = torso
  27. we.C0,we.C1 = shoulder.C0 ,shoulder.C1
  28. we.Part0,we.Part1 = shoulder.Part0 ,shoulder.Part1
  29. shoulder.Parent = nil
  30. elseif a == 0 then
  31. we.Parent = nil
  32. shoulder.Parent = torso
  33. end
  34. end
  35. m = Instance.new("Model",char)
  36. meshids = {["blast"] = 20329976, ["penguin"] = 15853464, ["ring"] = 3270017,
  37. ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761,
  38. ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605,
  39. ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,
  40. ["fish"] = 31221717, ["coffee"] = 15929962}---some meshids
  41. textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,
  42. ["monster"] = 33366441}
  43. ------TOOOOOLS------
  44. T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent)
  45. c = Instance.new("Part",m)
  46. c.TopSurface,c.BottomSurface = 0,0
  47. c.formFactor = "Custom"
  48. c.Size = Vector3.new(x,y,z)
  49. c.BrickColor = BrickColor.new(color)
  50. c.Transparency = transparency
  51. c.CanCollide = cancollide
  52. if anchored ~= nil then c.Anchored = anchored end
  53. if parent ~= nil then c.Parent = parent end
  54. return c
  55. end
  56. ,
  57. ["C"] = function(func) coroutine.resume(coroutine.create(func)) end
  58. ,
  59. ["W"] = function(part0,part1,x,y,z,rx,ry,rz)
  60. w = Instance.new("Weld",m)
  61. w.Part0,w.Part1 = part0,part1
  62. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz)
  63. return w
  64. end
  65. ,
  66. ["BG"] = function(parent)
  67. local c = Instance.new("BodyGyro",parent)
  68. c.P = 20e+003
  69. c.cframe = parent.CFrame
  70. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  71. return c
  72. end
  73. ,
  74. ["BP"] = function(parent,position)
  75. local bp = Instance.new("BodyPosition",parent)
  76. bp.maxForce = Vector3.new()*math.huge
  77. bp.position = position
  78. return bp
  79. end
  80. ,
  81. ["F"] = function(parent,size,heat,color,secondcolor)
  82. f = Instance.new("Fire",parent)
  83. f.Size = size
  84. f.Heat = heat
  85. if color ~= nil then f.Color = BrickColor.new(color).Color end
  86. if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end
  87. return f
  88. end
  89. ,
  90. ["Track"] = function(obj,s,t,lt)
  91. coroutine.resume(coroutine.create(function()
  92. while track do
  93. old = obj.Position
  94. wait()
  95. new = obj.Position
  96. mag = (old-new).magnitude
  97. dist = (old+new)/2
  98. ray = T.P(s,mag+.2,s,obj.Color,t,false,true)
  99. Instance.new("CylinderMesh",ray)
  100. ray.CFrame = CFrame.new(dist,old)*ang(math.pi/2,0,0)
  101. game:GetService("Debris"):AddItem(ray,lt)
  102. end
  103. end)) end,
  104. ["D"] = function(hit) if hit.Parent:findFirstChild("Humanoid") then h=hit.Parent.Humanoid h.Health = h.Health -dmg end end
  105. ,
  106. ["FM"] = function(parent,meshid,x,y,z,meshtexture)
  107. if meshid == "cylinder" then
  108. mesh = Instance.new("CylinderMesh",parent)
  109. mesh.Scale = Vector3.new(x,y,z)
  110. return mesh
  111. else
  112. mesh = Instance.new("SpecialMesh",parent)
  113. if meshid ~= "sphere" then
  114. if type(meshid) == "number" then mesh.MeshId = "rbxassetid://"..meshid else
  115. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  116. end
  117. else mesh.MeshType = 3 end
  118. mesh.Scale = Vector3.new(x,y,z)
  119. if meshtexture ~= nil then
  120. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  121. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  122. end
  123. return mesh
  124. end
  125. end
  126. }
  127. --------------------------------------------------
  128. ---MATH SHORTENINGS---
  129. M = {["R"] = function(a,b) return math.random(a,b) end,
  130. ["Cos"] = function(a) return math.cos(a) end,
  131. ["Sin"] = function(a) return math.sin(a) end,
  132. ["D"] = function(a) return math.rad(a) end
  133. }
  134. ---------------------------
  135. cfn,ang = CFrame.new,CFrame.Angles
  136. v3n = Vector3.new
  137. m = Instance.new("Model",char)
  138. function damage(hit,amount)
  139. for i,v in pairs(hit:GetChildren()) do
  140. if v:IsA("Humanoid") and v.Parent ~= char then
  141. v.Health = v.Health - amount
  142. amo = 0
  143. for i,o in pairs(v.Parent:GetChildren()) do
  144. if o:IsA("BillboardGui") and o.Name == "satuttava" then
  145. amo = amo+1
  146. end end
  147. local bbg = Instance.new("BillboardGui",v.Parent)
  148. bbg.Adornee = v.Torso
  149. bbg.Name = "satuttava"
  150. bbg.Size = UDim2.new(2,0,2,0)
  151. bbg.StudsOffset = Vector3.new(0,6+amo*2,0)
  152. box = Instance.new("TextLabel",bbg)
  153. box.Size = UDim2.new(1,0,1,0)
  154. box.BackgroundColor = BrickColor.new("White")
  155. box.Text = amount
  156. box.Position = UDim2.new(0,0,0,0)
  157. box.TextScaled = true
  158. game:GetService("Debris"):AddItem(bbg,.5)
  159. end
  160. end
  161. end
  162.  
  163. hop = Instance.new("HopperBin",ply.Backpack)
  164. holding = false
  165. function attack1(mouse)
  166. r = 20
  167. bp = T.BP(torso,torso.Position + v3n(0,20,0))
  168. bg = T.BG(torso)
  169. bg.cframe = mouse.hit
  170. while (bp.position-torso.Position).magnitude > 3 do wait() end
  171. holding=true
  172. while holding do
  173. for i = 1,360,60 do
  174. wait()
  175. local pos = torso.CFrame * cfn(M.Cos(M.D(i))*r,M.Sin(M.D(i))*r,-5)
  176.  
  177. local dragon = T.P(10,10,10,"White",.5,false,true)
  178. T.FM(dragon,"dragon",dragon.Size.x,dragon.Size.y,dragon.Size.z)
  179. dragon.CFrame = pos
  180. T.C(function()
  181. for i = 1,50,5 do
  182. wait()
  183. bg.cframe = mouse.hit
  184. dragon.CFrame = cfn(pos.p,mouse.hit.p) * cfn(0,0,-i)
  185. dragon.Transparency = i/50
  186. T.C(function()
  187. for i,v in pairs(Workspace:GetChildren()) do
  188. if v:IsA("Model") then
  189. local torso = v:FindFirstChild("Torso")
  190. if torso ~= nil then
  191. if (v.PrimaryPart.Position-dragon.Position).magnitude < 5 then damage(v,2) end
  192. end end
  193. end
  194. end)
  195. end
  196. dragon:Remove()
  197. end)
  198. end
  199. end
  200. bg:Remove() bp:Remove()
  201. end
  202. function spear(mouse)
  203. local portal = T.P(1,1,1,"Magenta",.5,false,true)
  204. local msh = T.FM(portal,"sphere",1,1,1)
  205. portal.CFrame = cfn(mouse.hit.p)
  206. local pos = cfn(portal.Position)
  207. local p = T.P(1,1,1,"White",0,false,true)
  208. p.CFrame = pos
  209. T.FM(p,"crown",5,1,5)
  210. T.C(function()
  211. while true do
  212. wait()
  213. p.CFrame = p.CFrame * ang(0,M.D(20),0)
  214. end
  215. end)
  216. for i = 1,10 do
  217. wait()
  218. msh.Scale = v3n(i,1,i)
  219. end
  220. local stick = T.P(.5,1,.5,"Nougat",0,true,true)
  221. stick.CFrame = pos
  222. T.FM(stick,"cylinder",1,1,1)
  223. stick.Touched:connect(function(hit) damage(hit.Parent,10) end)
  224. local tip = T.P(1,2,1,"Black",0,true,true)
  225. T.FM(tip,"spike",.5,2,.5)
  226. tip.CFrame = pos
  227. local fish = T.P(1,1,1,"White",0,false,true)
  228. fish.CFrame = pos
  229. T.FM(fish,"fish",1,1,1,"fish").VertexColor = v3n(.5,1,.5)
  230.  
  231. for i = 1,10 do
  232. wait()
  233. stick.Size = v3n(stick.Size.x,i,stick.Size.z)
  234. stick.CFrame = pos + v3n(0,stick.Size.y/2,0)
  235. tip.CFrame = stick.CFrame * cfn(0,stick.Size.y/2+.75,0)
  236. fish.CFrame = tip.CFrame * cfn(0,-1.5,0) * ang(M.D(85),0,0)
  237. end
  238. wait(1)
  239. for i = 10,1,-1 do
  240. wait()
  241. stick.Size = v3n(stick.Size.x,i,stick.Size.z)
  242. stick.CFrame = pos + v3n(0,stick.Size.y/2,0)
  243. tip.CFrame = stick.CFrame * cfn(0,stick.Size.y/2+.75,0)
  244. fish.CFrame = tip.CFrame * cfn(0,-1.5,0) * ang(M.D(85),0,0)
  245. end
  246. for i,v in pairs({stick,tip,fish}) do v:Remove() end
  247. for i = 10,1,-1 do
  248. wait()
  249. msh.Scale = v3n(i,1,i)
  250. end
  251. portal:Remove()
  252. p:Remove()
  253. end
  254. suit = nil
  255. function suitme()
  256. if suit == nil then
  257. for i,v in pairs(char:GetChildren()) do
  258. if v:IsA("Hat") then v:Remove() end
  259. end
  260. suit = Instance.new("Model",char)
  261. local head = T.P(1,1,1,"Black",0,false,false,suit)
  262. T.FM(head,"skull",1,1,1,"rainbow")
  263. T.W(head,body.Head,0,0,0,0,0,0)
  264. r = .2
  265. for i = 1,360,120 do
  266. T.W(T.FM(T.P(1,1,1,"Black",0,false,false,suit),"spike",.2,2,.2).Parent,head,M.Cos(M.D(i))*r,1.5,M.Sin(M.D(i))*r,0,0,0)
  267. end
  268. allowed = true
  269. for i = 1,360,60 do
  270. wait()
  271. p = T.P(1,1,1,"Magenta",.5,false,false,suit)
  272. T.FM(p,"penguin",.5,.5,.5)
  273. local wld = T.W(p,body.Head,M.Cos(M.D(i))*.7,2,M.Sin(M.D(i))*.7,0,0,0)
  274. T.C(function()
  275. while true do
  276. wait()
  277. if allowed == true then
  278. for o = .7,1,.05 do
  279. wait()
  280. wld.C1 = cfn(M.Cos(M.D(i))*o,2,M.Sin(M.D(i))*o)
  281. end
  282. for o = 1,.7,-.05 do
  283. wait()
  284. wld.C1 = cfn(M.Cos(M.D(i))*o,2,M.Sin(M.D(i))*o)
  285. end
  286. end
  287. end
  288. end)
  289. end
  290. local glove = T.P(2,.5,2,"White",0,false,false,suit)
  291. T.FM(glove,"cylinder",1,1,1)
  292. T.W(glove,body.A.R,0,-.7,0,0,0,0)
  293. local ball = T.P(2,2,2,"Bright red",0,false,false,suit)
  294. T.FM(ball,"sphere",1,1,1)
  295. T.W(ball,body.A.R,0,-1.5,0,0,0,0)
  296. lock("RS",1)
  297. rw.C0 = rw.C0 * ang(0,0,M.D(85))
  298. ball.Touched:connect(function(hit) damage(hit.Parent,20) end)
  299. else suit:Remove() lock("RS",0) suit = nil
  300. end
  301. end
  302. function punch(mouse)
  303. rw.C0 = normposR*ang(0,0,math.pi)
  304. fir = T.F(ball,5,1,"Deep blue","Cyan")
  305. bp = T.BP(torso,torso.Position + v3n(0,10,0))
  306. while (torso.Position-bp.position).magnitude > 3 do wait() end
  307. holding = true
  308. gyro = T.BG(torso)
  309. allowed = false
  310. while holding do
  311. wait()
  312. gyro.cframe = mouse.hit
  313. end
  314. gyro.cframe = cfn(torso.Position,mouse.hit.p)*ang(math.pi/2,0,0)
  315. bp.position = mouse.hit.p + v3n(0,5,0)
  316. while (torso.Position-bp.position).magnitude > 3 do wait() gyro.cframe = gyro.cframe * ang(0,M.D(100),0) end
  317. gyro:Remove() bp:Remove() fir:Remove()
  318. rw.C0 = normposR*ang(0,0,math.pi/2)
  319. allowed = true
  320. end
  321. hop.Selected:connect(function(mouse)
  322. mouse.Button1Up:connect(function() holding = false end)
  323. mouse.Button1Down:connect(function() if suit == nil then attack1(mouse) else punch(mouse) end end)
  324. mouse.KeyDown:connect(function(key)
  325. if key == "f" then spear(mouse)
  326. elseif key == "r" then suitme()
  327. end
  328. end)
  329. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement