Advertisement
Void_scripter0

MC BOW

Jun 6th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.98 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  2. do
  3. script.Parent = owner.Character
  4. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  5. local function NewFakeEvent()
  6. local Bind = Instance.new("BindableEvent")
  7. local Fake;Fake = {Connections = {},
  8. fakeEvent=true;
  9. Connect=function(self,Func)
  10. Bind.Event:connect(Func)
  11. self.Connections[Bind] = true
  12. return setmetatable({Connected = true},{
  13. __index = function (self,Index)
  14. if Index:lower() == "disconnect" then
  15. return function() Fake.Connections[Bind] = false;self.Connected = false end
  16. end
  17. return Fake[Index]
  18. end;
  19. __tostring = function() return "Connection" end;
  20. })
  21. end}
  22. Fake.connect = Fake.Connect;return Fake;
  23. end
  24. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  25. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  26. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  27. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  28. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  29. local function TriggerEvent(self,Event,...)
  30. local Trigger = Mouse[Event]
  31. if Trigger and Trigger.fakeEvent and Trigger.Connections then
  32. for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  33. end
  34. end
  35. Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  36. Event.OnServerEvent:Connect(function(FiredBy,Input)
  37. if FiredBy.Name ~= owner.Name then return end
  38. if Input.MouseEvent then
  39. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  40. else
  41. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  42. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  43. for _,Action in pairs(ContextActionService.Actions) do
  44. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  45. end
  46. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  47. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  48. end
  49. end)
  50. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  51. Event.Parent = NLS([[
  52. local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  53. local Input = function(Input,gameProcessedEvent)
  54. if gameProcessedEvent then return end
  55. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  56. end
  57. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  58. local Hit,Target
  59. while wait(1/30) do
  60. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  61. Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  62. end
  63. end
  64. ]],owner.Character)
  65. end
  66. RealGame = game;game = setmetatable({},{
  67. __index = function (self,Index)
  68. local Sandbox = function (Thing)
  69. if Thing:IsA("Player") then
  70. local RealPlayer = Thing
  71. return setmetatable({},{
  72. __index = function (self,Index)
  73. local Type = type(RealPlayer[Index])
  74. if Type == "function" then
  75. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  76. return function (self)return InternalData["Mouse"] end
  77. end
  78. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  79. end
  80. return RealPlayer[Index]
  81. end;
  82. __tostring = function(self) return RealPlayer.Name end
  83. })
  84. end
  85. end
  86. if RealGame[Index] then
  87. local Type = type(RealGame[Index])
  88. if Type == "function" then
  89. if Index:lower() == "getservice" or Index:lower() == "service" then
  90. return function (self,Service)
  91. local FakeServices = {
  92. ["players"] = function()
  93. return setmetatable({},{
  94. __index = function (self2,Index2)
  95. local RealService = RealGame:GetService(Service)
  96. local Type2 = type(Index2)
  97. if Type2 == "function" then
  98. return function (self,...) return RealService[Index2](RealService,...)end
  99. else
  100. if Index2:lower() == "localplayer" then return Sandbox(owner) end
  101. return RealService[Index2]
  102. end
  103. end;
  104. __tostring = function(self) return RealGame:GetService(Service).Name end
  105. })
  106. end;
  107. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  108. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  109. ["runservice"] = function()
  110. return setmetatable({},{
  111. __index = function(self2,Index2)
  112. local RealService = RealGame:GetService(Service)
  113. local Type2 = type(Index2)
  114. if Type2 == "function" then
  115. return function (self,...) return RealService[Index2](RealService,...) end
  116. else
  117. local RunServices = {
  118. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  119. ["renderstepped"] = function() return RealService["Stepped"] end
  120. }
  121. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  122. return RealService[Index2]
  123. end
  124. end
  125. })
  126. end
  127. }
  128. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  129. return RealGame:GetService(Service)
  130. end
  131. end
  132. return function (self,...) return RealGame[Index](RealGame,...) end
  133. else
  134. if game:GetService(Index) then return game:GetService(Index) end
  135. return RealGame[Index]
  136. end
  137. end
  138. return nil
  139. end
  140. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  141. --Leeked by PointCoded to Romania12x
  142.  
  143. script.Parent = nil
  144. local player = game.Players.LocalPlayer.Name
  145.  
  146. local p = nil
  147. for _,v in pairs(game.Players:GetChildren()) do
  148. if (string.lower(player)==string.lower(v.Name)) then
  149. p = v
  150. end
  151. end
  152. if (p==nil) then return print("Cannot find player "..player) end
  153.  
  154. local equipped = false
  155. local noarrow = false
  156. local delayTime = 1 --editable. Description: The interval of time that passes before a player is enabled to shoot another arrow after shooting one
  157. local damage = 50 --editable. Description: The amount of damage dealt to any found humanoid.
  158. local bowScale = 1 --editable. Description: The WHOLE NUMBER size of the bow. acceptable range is from 1 to Infinity.
  159. local velocityMin,velocityMax = 400,600 --editable. Description: The maximum and minimum allowed velocity for arrows.
  160.  
  161. bu = (bowScale+1)/10
  162. hbu = bu/2
  163. dbu = bu*2
  164. cubevec = Vector3.new(bu, bu, bu)
  165. reczvec = Vector3.new(bu*2, bu, bu)
  166. recxvec = Vector3.new(bu, bu, bu*2)
  167.  
  168. function creczvec(num)
  169. return Vector3.new(bu*num, bu, bu)
  170. end
  171.  
  172. function crecxvec(num)
  173. return Vector3.new(bu, bu, bu*num)
  174. end
  175.  
  176. han = nil
  177. m = nil
  178. rg = nil
  179. bowp = {
  180. add = function(self, ...)
  181. local arg = {...}
  182. for i = 1,#arg do
  183. table.insert(self.dat, arg[i])
  184. end
  185. end;
  186. dat = {}
  187. }
  188. local mid = {"http://www.roblox.com/asset/?id=85561125","http://www.roblox.com/asset/?id=85561640","http://www.roblox.com/asset/?id=85561157","http://www.roblox.com/asset/?id=85643448","http://www.roblox.com/asset/?id=49092825","http://www.roblox.com/asset/?id=36527138"}
  189. local sid = {"http://www.roblox.com/asset/?id=16211041","http://www.roblox.com/asset/?id=16211030"}
  190. for i = 1,#mid do
  191. game:GetService("ContentProvider"):Preload(mid[i])
  192. end
  193. for i = 1,#sid do
  194. game:GetService("ContentProvider"):Preload(sid[i])
  195. end
  196.  
  197. function cp(pa, mo)
  198. local c = pa:clone()
  199. c.Parent = mo
  200. return c
  201. end
  202.  
  203. function xbu(num)
  204. if (type(num)==type(1)) then
  205. return bu*num
  206. end
  207. end
  208.  
  209. if (math.floor(bowScale)<bowScale) and (bowScale<math.floor(bowScale)+1) then
  210. return print("Error: Can not add decimal to whole number scale (NON-WHOLE)")
  211. elseif (math.floor(bowScale)<1) then
  212. return print("Error: Can not have bowScale property below 1 (NON-WHOLE)")
  213. end
  214.  
  215. if (bowScale>5) then
  216. print("You're going to have a pretty big bow")
  217. end
  218.  
  219. function createbow()
  220. if (p.Character==nil) then return end
  221. local char = p.Character
  222. if (char:FindFirstChild("Head")==nil) then return end
  223. local he = char["Head"]
  224. if (char:FindFirstChild("Right Arm")==nil) then return end
  225. local ra = char["Right Arm"]
  226. m = Instance.new("Model")
  227. m.Name = player.."'s bow"
  228. han = Instance.new("Part", m)
  229. Instance.new("BlockMesh", han)
  230. han.BrickColor = BrickColor.New("Silver flip/flop")
  231. han.Name = "Grip"
  232. han.FormFactor = 3
  233. han.Size = cubevec
  234. han.TopSurface = 0
  235. han.BottomSurface = 0
  236. local ha1 = cp(han, m)
  237. ha1.Name = "bowpart"
  238. ha1.CFrame = han.CFrame*CFrame.new(bu, 0, -bu)
  239. local ha2 = cp(ha1, m)
  240. ha2.CFrame = han.CFrame*CFrame.new(-bu, 0, bu)
  241. local ha3 = cp(ha1, m)
  242. ha3.CFrame = han.CFrame*CFrame.new(dbu, 0, 0)
  243. local ha4 = cp(ha1, m)
  244. ha4.CFrame = han.CFrame*CFrame.new(bu, 0, bu)
  245. local ha5 = cp(ha1, m)
  246. ha5.CFrame = han.CFrame*CFrame.new(0, 0, dbu)
  247. local ha6 = cp(ha1, m)
  248. ha6.BrickColor = BrickColor.new("Medium stone grey")
  249. ha6.CFrame = han.CFrame*CFrame.new(bu, 0, 0)
  250. local ha7 = cp(ha6, m)
  251. ha7.CFrame = han.CFrame*CFrame.new(0, 0, bu)
  252. local ha8 = cp(ha1, m)
  253. ha8.BrickColor = BrickColor.new("Brown")
  254. ha8.CFrame = han.CFrame*CFrame.new(dbu, 0, bu)
  255. local ha9 = cp(ha8, m)
  256. ha9.CFrame = han.CFrame*CFrame.new(bu, 0, dbu)
  257. local h10 = cp(ha8, m)
  258. h10.Size = recxvec
  259. h10.CFrame = han.CFrame*CFrame.new(xbu(3), 0, -hbu)
  260. local h11 = cp(ha8, m)
  261. h11.Size = reczvec
  262. h11.CFrame = han.CFrame*CFrame.new(-hbu, 0, xbu(3))
  263. local h12 = cp(ha1, m)
  264. h12.BrickColor = BrickColor.new("Yellow flip/flop")
  265. h12.CFrame = han.CFrame*CFrame.new(dbu, 0, -bu)
  266. local h13 = cp(h12, m)
  267. h13.CFrame = han.CFrame*CFrame.new(-bu, 0, dbu)
  268. local h14 = cp(ha1, m)
  269. h14.BrickColor = BrickColor.new("Light orange brown")
  270. h14.CFrame = han.CFrame*CFrame.new(xbu(3), 0, -dbu)
  271. local h15 = cp(h14, m)
  272. h15.CFrame = han.CFrame*CFrame.new(-dbu, 0, xbu(3))
  273. local h16 = cp(ha8, m)
  274. h16.Size = crecxvec(3)
  275. h16.CFrame = han.CFrame*CFrame.new(xbu(4), 0, -xbu(3))
  276. local h17 = cp(ha8, m)
  277. h17.Size = creczvec(3)
  278. h17.CFrame = han.CFrame*CFrame.new(-xbu(3), 0, xbu(4))
  279. local h18 = cp(h16, m)
  280. h18.BrickColor = BrickColor.new("Reddish brown")
  281. h18.CFrame = han.CFrame*CFrame.new(dbu, 0, -xbu(3))
  282. local h19 = cp(h17, m)
  283. h19.BrickColor = BrickColor.new("Reddish brown")
  284. h19.CFrame = han.CFrame*CFrame.new(-xbu(3), 0, dbu)
  285. local h20 = cp(h12, m)
  286. h20.CFrame = han.CFrame*CFrame.new(xbu(3), 0, -xbu(3))
  287. local h21 = cp(h12, m)
  288. h21.CFrame = han.CFrame*CFrame.new(-xbu(3), 0, xbu(3))
  289. local h22 = cp(h14, m)
  290. h22.CFrame = han.CFrame*CFrame.new(xbu(3), 0, -xbu(4))
  291. local h23 = cp(h14, m)
  292. h23.CFrame = han.CFrame*CFrame.new(-xbu(4), 0, xbu(3))
  293. local h24 = cp(h14, m)
  294. h24.CFrame = han.CFrame*CFrame.new(xbu(4), 0, -xbu(5))
  295. local h25 = cp(h14, m)
  296. h25.CFrame = han.CFrame*CFrame.new(-xbu(5), 0, xbu(4))
  297. local h26 = cp(h12, m)
  298. h26.Size = recxvec
  299. h26.CFrame = han.CFrame*CFrame.new(xbu(4), 0, -xbu(6.5))
  300. local h27 = cp(h12, m)
  301. h27.Size = reczvec
  302. h27.CFrame = han.CFrame*CFrame.new(-xbu(6.5), 0, xbu(4))
  303. local h28 = cp(h14, m)
  304. h28.CFrame = han.CFrame*CFrame.new(xbu(4), 0, -xbu(8))
  305. local h29 = cp(h14, m)
  306. h29.CFrame = han.CFrame*CFrame.new(-xbu(8), 0, xbu(4))
  307. local h30 = cp(ha8, m)
  308. h30.Size = crecxvec(4)
  309. h30.CFrame = han.CFrame*CFrame.new(xbu(5), 0, -xbu(6.5))
  310. local h31 = cp(ha8, m)
  311. h31.Size = creczvec(4)
  312. h31.CFrame = han.CFrame*CFrame.new(-xbu(6.5), 0, xbu(5))
  313. local h32 = cp(h30, m)
  314. h32.BrickColor = BrickColor.new("Reddish brown")
  315. h32.CFrame = han.CFrame*CFrame.new(xbu(3), 0, -xbu(6.5))
  316. local h33 = cp(h31, m)
  317. h33.BrickColor = BrickColor.new("Reddish brown")
  318. h33.CFrame = han.CFrame*CFrame.new(-xbu(6.5), 0, xbu(3))
  319. local h34 = cp(ha1, m)
  320. h34.BrickColor = BrickColor.new("Reddish brown")
  321. h34.CFrame = han.CFrame*CFrame.new(xbu(4), 0, -xbu(9))
  322. local h35 = cp(h34, m)
  323. h35.CFrame = han.CFrame*CFrame.new(-xbu(9), 0, xbu(4))
  324. local h36 = cp(ha1, m)
  325. h36.BrickColor = BrickColor.new("Dark stone grey")
  326. h36.CFrame = han.CFrame*CFrame.new(xbu(2), 0, -xbu(7))
  327. local h37 = cp(h36, m)
  328. h37.CFrame = han.CFrame*CFrame.new(xbu(1), 0, -xbu(6))
  329. local h38 = cp(h36, m)
  330. h38.CFrame = han.CFrame*CFrame.new(0, 0, -xbu(5))
  331. local h39 = cp(h36, m)
  332. h39.CFrame = han.CFrame*CFrame.new(-xbu(1), 0, -xbu(4))
  333. local h40 = cp(h36, m)
  334. h40.CFrame = han.CFrame*CFrame.new(-xbu(2), 0, -xbu(3))
  335. local h41 = cp(h36, m)
  336. h41.CFrame = han.CFrame*CFrame.new(-xbu(3), 0, -xbu(2))
  337. local h42 = cp(h36, m)
  338. h42.CFrame = han.CFrame*CFrame.new(-xbu(4), 0, -xbu(1))
  339. local h43 = cp(h36, m)
  340. h43.CFrame = han.CFrame*CFrame.new(-xbu(5), 0, 0)
  341. local h44 = cp(h36, m)
  342. h44.CFrame = han.CFrame*CFrame.new(-xbu(6), 0, xbu(1))
  343. local h45 = cp(h36, m)
  344. h45.CFrame = han.CFrame*CFrame.new(-xbu(7), 0, xbu(2))
  345. bowp:add(ha1, ha2, ha3, ha4, ha5, ha6, ha7, ha8, ha9, h10, h11, h12, h13, h14, h15, h16, h17, h18, h19, h20, h21, h22, h23, h24, h25, h26, h27, h28, h29, h30, h31, h32, h33, h34, h35, h36, h37, h38, h39, h40, h41, h42, h43, h44, h45)
  346. for i = 1,#bowp.dat do
  347. local w = Instance.new("Weld", bowp.dat[i])
  348. w.Part0 = han
  349. w.Part1 = bowp.dat[i]
  350. w.C0 = han.CFrame:inverse()
  351. w.C1 = bowp.dat[i].CFrame:inverse()
  352. end
  353. local s1 = Instance.new("Sound", han)
  354. s1.Name = "shotsound"
  355. s1.Pitch = 1.2
  356. s1.SoundId = sid[1]
  357. s1.Volume = 1
  358. local s2 = Instance.new("Sound", han)
  359. s2.Name = "arrowsound"
  360. s2.Pitch = 1.2
  361. s2.Volume = 1
  362. s2.SoundId = sid[2]
  363. rg = Instance.new("Weld", ra)
  364. rg.Name = "RightGripC"
  365. rg.Part0 = ra
  366. rg.Part1 = han
  367. rg.C0 = CFrame.new(0, -.75, 0)
  368. rg.C1 = CFrame.new(0, 0, 0)*CFrame.fromEulerAnglesXYZ(-math.rad(90), -math.rad(90),0)
  369. m.Parent = char
  370. end
  371.  
  372. function removebow()
  373. rg:remove()
  374. rg = nil
  375. m:remove()
  376. han = nil
  377. m = nil
  378. end
  379.  
  380. function carrow(head, ms)
  381. if noarrow then return end
  382. noarrow = true
  383. local un = head.Size.z/2
  384. local am = Instance.new("Model")
  385. am.Name = "Arrow"
  386. local a1 = Instance.new("Part", am)
  387. Instance.new("BlockMesh", a1).Scale = Vector3.new(0, 1, 1)
  388. a1.Name = "shaft"
  389. a1.Transparency = 1
  390. a1.FormFactor = 3
  391. a1.TopSurface = 0
  392. a1.BottomSurface = 0
  393. local a1d1 = Instance.new("Decal", a1)
  394. a1d1.Face = "Right"
  395. a1d1.Texture = mid[1]
  396. local a1d2 = Instance.new("Decal", a1)
  397. a1d2.Face = "Left"
  398. a1d2.Texture = mid[2]
  399. a1.Size = Vector3.new(.2, .6, 2)
  400. a1.CFrame = CFrame.new((head.CFrame).p+Vector3.new(0,(head.Size.y/2)+2, 0), ms)*CFrame.fromEulerAnglesXYZ(0, 0, math.rad(45))
  401. local s2 = han:FindFirstChild("arrowsound")
  402. local s2c = nil
  403. if (s2~=nil) then
  404. s2c = s2:clone()
  405. s2c.Parent = a1
  406. s2c.Pitch = math.random(.8,1.2)
  407. end
  408. local s1 = han:FindFirstChild("shotsound")
  409. if (s1~=nil) then
  410. s1.Pitch = math.random(.8,1.2)
  411. s1:Play()
  412. end
  413. local a2 = a1:clone()
  414. a2.CFrame = a1.CFrame*CFrame.fromEulerAnglesXYZ(0, 0, -math.rad(90))
  415. local we = Instance.new("Weld", a2)
  416. we.Part0 = a1
  417. we.Part1 = a2
  418. we.C0 = a1.CFrame:inverse()
  419. we.C1 = a2.CFrame:inverse()
  420. a2.Parent = am
  421. local a3 = Instance.new("Part", am)
  422. Instance.new("BlockMesh", a3).Scale = Vector3.new(1, 1, 0)
  423. a3.Name = "back"
  424. a3.Transparency = 1
  425. a3.FormFactor = 3
  426. a3.TopSurface = 0
  427. a3.BottomSurface = 0
  428. local a3d = Instance.new("Decal", a3)
  429. a3d.Face = "Front"
  430. a3d.Texture = mid[3]
  431. local a3d = Instance.new("Decal", a3)
  432. a3d.Face = "Back"
  433. a3d.Texture = mid[3]
  434. a3.Size = Vector3.new(.6, .6, .2)
  435. a3.CFrame = a1.CFrame*CFrame.new(0, 0, .9)
  436. local w3 = Instance.new("Weld", a3)
  437. w3.Part0 = a1
  438. w3.Part1 = a3
  439. w3.C0 = a1.CFrame:inverse()
  440. w3.C1 = a3.CFrame:inverse()
  441. local alreadyhit = false
  442. con=a1.Touched:connect(function(hit)
  443. if (hit:IsDescendantOf(p.Character)) then return end
  444. if alreadyhit then
  445. con:disconnect()
  446. return
  447. end
  448. if hit.CanCollide then
  449. if (hit~=head) then
  450. if (hit.Parent~=workspace) then
  451. for _,v in pairs(hit.Parent:GetChildren()) do
  452. if (v:IsA("Humanoid")) then
  453. if (v.Health<(damage+1)) then
  454. hit.Parent:BreakJoints()
  455. local tag1 = Instance.new("StringValue", v)
  456. tag1.Name = "DamageTag"
  457. tag1.Value = p.Name
  458. local tag2 = Instance.new("StringValue", v)
  459. tag2.Name = "WeaponTag"
  460. tag2.Value = "Minecraft Bow"
  461. else
  462. v.Health = v.Health-damage
  463. for i,w in pairs(hit.Parent:GetChildren()) do
  464. if (w:IsA("Part")) then
  465. for j = 1,6 do
  466. local nd = Instance.new("Decal", v)
  467. nd.Texture = mid[6]
  468. nd.Transparency = .5
  469. nd.Face = j-1
  470. coroutine.resume(coroutine.create(function()
  471. wait(.7)
  472. nd:remove()
  473. end))
  474. end
  475. end
  476. end
  477. end
  478. end
  479. end
  480. end
  481. a1.CFrame = CFrame.new((a1.CFrame).p, Vector3.new(a1.CFrame.x, hit.CFrame.y, a1.CFrame.z))
  482. local nw = Instance.new("Weld", a1)
  483. nw.Part0 = hit
  484. nw.Part1 = a1
  485. nw.C0 = hit.CFrame:inverse()
  486. nw.C1 = a1.CFrame:inverse()
  487. coroutine.resume(coroutine.create(function()
  488. wait(10)
  489. am:remove()
  490. end))
  491. if (s2c~=nil) then
  492. s2c:Play()
  493. end
  494. alreadyhit = true
  495. con:disconnect()
  496. end
  497. end
  498. end)
  499. con2=a2.Touched:connect(function(hit)
  500. if (hit:IsDescendantOf(p.Character)) then return end
  501. if alreadyhit then
  502. con2:disconnect()
  503. return
  504. end
  505. if hit.CanCollide then
  506. if (hit~=head) then
  507. if (hit.Parent~=workspace) then
  508. for _,v in pairs(hit.Parent:GetChildren()) do
  509. if (v:IsA("Humanoid")) then
  510. if (v.Health<(damage+1)) then
  511. hit.Parent:BreakJoints()
  512. local tag1 = Instance.new("StringValue", v)
  513. tag1.Name = "DamageTag"
  514. tag1.Value = p.Name
  515. local tag2 = Instance.new("StringValue", v)
  516. tag2.Name = "WeaponTag"
  517. tag2.Value = "Minecraft Bow"
  518. else
  519. v.Health = v.Health-damage
  520. for i,w in pairs(hit.Parent:GetChildren()) do
  521. if (w:IsA("Part")) then
  522. for j = 1,6 do
  523. local nd = Instance.new("Decal", w)
  524. nd.Texture = mid[6]
  525. nd.Transparency = .5
  526. nd.Face = j-1
  527. coroutine.resume(coroutine.create(function()
  528. wait(.7)
  529. nd:remove()
  530. end))
  531. end
  532. end
  533. end
  534. end
  535. end
  536. end
  537. end
  538. a1.CFrame = CFrame.new((a1.CFrame).p, Vector3.new(a1.CFrame.x, hit.CFrame.y, a1.CFrame.z))
  539. local nw = Instance.new("Weld", a1)
  540. nw.Part0 = hit
  541. nw.Part1 = a1
  542. nw.C0 = hit.CFrame:inverse()
  543. nw.C1 = a1.CFrame:inverse()
  544. coroutine.resume(coroutine.create(function()
  545. wait(10)
  546. am:remove()
  547. end))
  548. if (s2c~=nil) then
  549. s2c:Play()
  550. end
  551. alreadyhit = true
  552. con2:disconnect()
  553. end
  554. end
  555. end)
  556. coroutine.resume(coroutine.create(function()
  557. wait(12)
  558. if not alreadyhit then
  559. alreadyhit = true
  560. am:remove()
  561. end
  562. end))
  563. local xr = math.random(velocityMin,velocityMax)
  564. a1.Velocity = a1.CFrame.lookVector*xr
  565. a2.Velocity = a1.CFrame.lookVector*xr
  566. a3.Velocity = a1.CFrame.lookVector*xr
  567. am.Parent = workspace
  568. coroutine.resume(coroutine.create(function()
  569. wait(delayTime)
  570. noarrow = false
  571. end))
  572. end
  573.  
  574. local h = Instance.new("HopperBin", p["Backpack"])
  575. h.Name = "MCBow"
  576. h.TextureId = mid[5]
  577.  
  578. h.Selected:connect(function(mos)
  579. equipped = true
  580. mos.Icon = mid[4]
  581. local hed = p.Character:FindFirstChild("Head")
  582. if (hed==nil) then return end
  583. createbow()
  584. mos.Button1Down:connect(function()
  585. carrow(hed, mos.Hit.p)
  586. end)
  587. h.Deselected:connect(function()
  588. mos.Icon = "rbxasset://textures\\ArrowFarCursor.png"
  589. end)
  590. end)
  591.  
  592. h.Deselected:connect(function()
  593. equipped = false
  594. removebow()
  595. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement