Advertisement
A-X-O-L-O-T-L

Bow for Void Script Builder (unreliable version)

Dec 14th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.93 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("UnreliableRemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. -- Bow Script
  88.  
  89. function weld(p0,p1,c0,c1,par)
  90. local w = Instance.new("Weld",p0 or par)
  91. w.Part0 = p0
  92. w.Part1 = p1
  93. w.C0 = c0 or CFrame.new()
  94. w.C1 = c1 or CFrame.new()
  95. return w
  96. end
  97.  
  98. do -- Credit to Stravant...
  99. local function QuaternionFromCFrame(cf) local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() local trace = m00 + m11 + m22 if trace > 0 then local s = math.sqrt(1 + trace) local recip = 0.5/s return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 else local i = 0 if m11 > m00 then i = 1 end if m22 > (i == 0 and m00 or m11) then i = 2 end if i == 0 then local s = math.sqrt(m00-m11-m22+1) local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip elseif i == 1 then local s = math.sqrt(m11-m22-m00+1) local recip = 0.5/s return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip elseif i == 2 then local s = math.sqrt(m22-m00-m11+1) local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip end end end
  100.  
  101. local function QuaternionToCFrame(px, py, pz, x, y, z, w) local xs, ys, zs = x + x, y + y, z + z local wx, wy, wz = w*xs, w*ys, w*zs local xx = x*xs local xy = x*ys local xz = x*zs local yy = y*ys local yz = y*zs local zz = z*zs return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) end
  102.  
  103. local function QuaternionSlerp(a, b, t) local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] local startInterp, finishInterp; if cosTheta >= 0.0001 then if (1 - cosTheta) > 0.0001 then local theta = math.acos(cosTheta) local invSinTheta = 1/math.sin(theta) startInterp = math.sin((1-t)*theta)*invSinTheta finishInterp = math.sin(t*theta)*invSinTheta else startInterp = 1-t finishInterp = t end else if (1+cosTheta) > 0.0001 then local theta = math.acos(-cosTheta) local invSinTheta = 1/math.sin(theta) startInterp = math.sin((t-1)*theta)*invSinTheta finishInterp = math.sin(t*theta)*invSinTheta else startInterp = t-1 finishInterp = t end end return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp end
  104.  
  105. function clerp(a,b,t)
  106. if not a or not b then print(a,b,"is missing") return end
  107. local qa = {QuaternionFromCFrame(a)}
  108. local qb = {QuaternionFromCFrame(b)}
  109. local ax, ay, az = a.x, a.y, a.z
  110. local bx, by, bz = b.x, b.y, b.z
  111.  
  112. local _t = 1-t
  113. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  114. end
  115. end
  116.  
  117. local oc = oc or function(...) return ... end
  118.  
  119. pcall(function() script.Parent.bScript:Destroy() end)
  120. script.Name = "bScript"
  121.  
  122. local plr = owner
  123. local char = plr.Character
  124.  
  125. local tor,ra,la,rl,ll,hd,hum = char.Torso,char["Right Arm"],char["Left Arm"],char["Right Leg"],char["Left Leg"],char.Head,char.Humanoid
  126. local rrs,rls,nk = tor["Right Shoulder"],tor["Left Shoulder"],tor.Neck
  127. local nk0 = nk.C0
  128. local rc0,rc1 = rrs.C0,rrs.C1
  129. local lc0,lc1 = rls.C0,rls.C0
  130. local rs,ls = rrs:Clone(),rls:Clone()
  131. rs.Name,ls.Name = "rs","ls"
  132. rs.DesiredAngle,rs.CurrentAngle = 0,0
  133. ls.DesiredAngle,ls.CurrentAngle = 0,0
  134.  
  135. local model = Instance.new("Model",char)
  136. pcall(function() char.bModel:Destroy() end)
  137. model.Name = "bModel"
  138.  
  139. local part = Instance.new("Part")
  140. part.BrickColor = BrickColor.new("Really red")
  141. part.Reflectance = 0.15
  142. part.FormFactor = "Custom"
  143. part.TopSurface,part.BottomSurface = 0,0
  144. part.Size = Vector3.new(.2,.2,.2)
  145. part:BreakJoints()
  146. part.CanCollide = false
  147.  
  148. function clone(t)
  149. local p = t:Clone()
  150. p.Parent = t.Parent or model
  151. return p
  152. end
  153.  
  154. local han = clone(part)
  155. han.Size = Vector3.new(.3,.5,.3)
  156. han.Transparency = 1
  157. local hold = weld(la,han,CFrame.new(0,-1,0) * CFrame.Angles(math.rad(-90),math.rad(23),0),CFrame.new())
  158.  
  159. for i=1,14 do
  160. local gr = clone(part)
  161. gr.BrickColor = BrickColor.new("Dark stone grey")
  162. gr.Size = Vector3.new(.3,.2,.3)
  163. local m = Instance.new("SpecialMesh",gr)
  164. m.MeshType = "Sphere"
  165. m.Scale = Vector3.new(1,.75,1) * math.max(.85,math.abs(i-7)/5)
  166. weld(han,gr,CFrame.new(0,-.6+i*.085,0) * CFrame.Angles(math.rad(15),math.rad(0),math.rad(23)),CFrame.new())
  167. end
  168.  
  169. local p = clone(part)
  170. p.Size = Vector3.new(.45,.2,.32)
  171. local m = Instance.new("BlockMesh",p)
  172. m.Scale = Vector3.new(1,.5,1)
  173.  
  174. weld(han,p,CFrame.new(0,-.62,.125) * CFrame.Angles(math.rad(10),0,0))
  175.  
  176. local p = clone(part)
  177. p.Size = Vector3.new(.45,.2,.3)
  178. local m = Instance.new("BlockMesh",p)
  179. m.Scale = Vector3.new(1,.5,1)
  180.  
  181. weld(han,p,CFrame.new(0,-.62,-.125) * CFrame.Angles(math.rad(-10),0,0))
  182.  
  183. local b1 = clone(part)
  184. b1.Size = Vector3.new(.2,1,.3)
  185. local m = Instance.new("BlockMesh",b1)
  186. m.Scale = Vector3.new(1,1,1)
  187.  
  188. local bw1 = weld(han,b1,CFrame.new(0,-.6,0) * CFrame.Angles(math.rad(-10),0,0),CFrame.new(0,.5,0))
  189.  
  190. local b2 = clone(part)
  191. b2.Size = Vector3.new(.2,1,.25)
  192. local m = Instance.new("BlockMesh",b2)
  193. m.Scale = Vector3.new(.9,1,1)
  194.  
  195. local bw2 = weld(b1,b2,CFrame.new(0,-.5,-.15) * CFrame.Angles(math.rad(-25),0,0),CFrame.new(0,.5,-.125))
  196.  
  197. local b3 = clone(part)
  198. b3.Size = Vector3.new(.2,1,.2)
  199. local m = Instance.new("BlockMesh",b3)
  200. m.Scale = Vector3.new(.75,1,1)
  201.  
  202. local bw3 = weld(b2,b3,CFrame.new(0,-.5,-.125) * CFrame.Angles(math.rad(-25),0,0),CFrame.new(0,.5,-.1))
  203.  
  204. local bt = clone(part)
  205. bt.BrickColor = BrickColor.new("Black")
  206. bt.Size = Vector3.new(.2,.3,.2)
  207. local m = Instance.new("BlockMesh",bt)
  208. m.Scale = Vector3.new(.5,1,1) * .5
  209.  
  210. local btw = weld(b3,bt,CFrame.new(0,-.5,.1) * CFrame.Angles(math.rad(-25),0,0),CFrame.new(0,0,.05))
  211.  
  212.  
  213.  
  214. local p = clone(part)
  215. p.Size = Vector3.new(.45,.2,.32)
  216. local m = Instance.new("BlockMesh",p)
  217. m.Scale = Vector3.new(1,.5,1)
  218.  
  219. weld(han,p,CFrame.new(0,.67,.125) * CFrame.Angles(math.rad(15),0,0))
  220.  
  221. local p = clone(part)
  222. p.Size = Vector3.new(.45,.2,.3)
  223. local m = Instance.new("BlockMesh",p)
  224. m.Scale = Vector3.new(1,.5,1)
  225.  
  226. weld(han,p,CFrame.new(0,.67,-.125) * CFrame.Angles(math.rad(-15),0,0))
  227.  
  228. local p = clone(part)
  229. p.Size = Vector3.new(.4,.2,.3)
  230. local m = Instance.new("BlockMesh",p)
  231. m.Scale = Vector3.new(1,.5,1)
  232.  
  233. weld(han,p,CFrame.new(0,.75,0) * CFrame.Angles(math.rad(0),0,0))
  234.  
  235. local p = clone(part)
  236. p.Size = Vector3.new(.2,.3,.35)
  237. local m = Instance.new("BlockMesh",p)
  238. m.Scale = Vector3.new(1,1,1)
  239.  
  240. weld(han,p,CFrame.new(-.1,.8,0) * CFrame.Angles(math.rad(0),0,0))
  241.  
  242. local p = clone(part)
  243. p.Size = Vector3.new(.45,.2,.32)
  244. local m = Instance.new("BlockMesh",p)
  245. m.Scale = Vector3.new(1,.5,1)
  246.  
  247. weld(han,p,CFrame.new(0,1,.125) * CFrame.Angles(math.rad(-5),0,0))
  248.  
  249. local p = clone(part)
  250. p.Size = Vector3.new(.45,.2,.25)
  251. local m = Instance.new("BlockMesh",p)
  252. m.Scale = Vector3.new(1,.5,1)
  253.  
  254. weld(han,p,CFrame.new(0,1,-.125) * CFrame.Angles(math.rad(5),0,0))
  255.  
  256. local t1 = clone(part)
  257. t1.Size = Vector3.new(.2,1,.3)
  258. local m = Instance.new("BlockMesh",t1)
  259. m.Scale = Vector3.new(1,1,1)
  260.  
  261. local tw1 = weld(han,t1,CFrame.new(0,.975,0) * CFrame.Angles(math.rad(10),0,0),CFrame.new(0,-.5,0))
  262.  
  263. local t2 = clone(part)
  264. t2.Size = Vector3.new(.2,1,.25)
  265. local m = Instance.new("BlockMesh",t2)
  266. m.Scale = Vector3.new(.9,1,1)
  267.  
  268. local tw2 = weld(t1,t2,CFrame.new(0,.5,-.15) * CFrame.Angles(math.rad(25),0,0),CFrame.new(0,-.5,-.125))
  269.  
  270. local t3 = clone(part)
  271. t3.Size = Vector3.new(.2,1,.2)
  272. local m = Instance.new("BlockMesh",t3)
  273. m.Scale = Vector3.new(.75,1,1)
  274.  
  275. local tw3 = weld(t2,t3,CFrame.new(0,.5,-.125) * CFrame.Angles(math.rad(25),0,0),CFrame.new(0,-.5,-.1))
  276.  
  277. local tt = clone(part)
  278. tt.BrickColor = BrickColor.new("Black")
  279. tt.Size = Vector3.new(.2,.3,.2)
  280. local m = Instance.new("BlockMesh",tt)
  281. m.Scale = Vector3.new(.5,1,1) * .5
  282.  
  283. local ttw = weld(t3,tt,CFrame.new(0,.5,.1) * CFrame.Angles(math.rad(25),0,0),CFrame.new(0,0,.05))
  284.  
  285. local W = {bw1,bw2,bw3,tw1,tw2,tw3}
  286. local W0 = {bw1.C0,bw2.C0,bw3.C0,tw1.C0,tw2.C0,tw3.C0}
  287.  
  288. local l1 = clone(part)
  289. l1.BrickColor = BrickColor.new("Really red")
  290. l1.Size = Vector3.new(.2,.2,.2)
  291. local m = Instance.new("CylinderMesh",l1)
  292. local l1w = weld(bt,l1)
  293.  
  294. local l2 = clone(l1)
  295. local l2w = weld(tt,l2)
  296.  
  297.  
  298. local amodel = Instance.new("Model")
  299. local arrow = clone(part)
  300. arrow.Parent = amodel
  301. arrow.BrickColor = BrickColor.new("Brown")
  302. arrow.Size = Vector3.new(.2,3,.2)
  303. arrow.Name = "main"
  304. local m = Instance.new("CylinderMesh",arrow)
  305. m.Scale = Vector3.new(.5,1,.5)
  306.  
  307. local arrw = weld(han,arrow)
  308.  
  309. local tip = clone(part)
  310. tip.Parent = amodel
  311. tip.BrickColor = BrickColor.new("Dark stone grey")
  312. tip.Size = Vector3.new(.2,.4,.2)
  313. tip.Name = "tip"
  314. local m = Instance.new("SpecialMesh",tip)
  315. m.MeshId = "rbxassetid://1033714"
  316. m.Scale = Vector3.new(.1,.45,.1)
  317.  
  318. weld(arrow,tip,CFrame.new(0,1.6,0))
  319.  
  320.  
  321. local walkspeed = 16
  322.  
  323. local hpos_i = CFrame.new(0,.8,1.3)
  324. local hpos_l = CFrame.new(0,.8,1.55)
  325. local hpos = hpos_i
  326.  
  327. local keeper = Vector3.new(0.07,0.82,0)
  328.  
  329. mouse.Button1Up:connect(function()
  330. mup = true
  331. end)
  332.  
  333. function ragJoint(hit,r,d)
  334. Spawn(oc(function()
  335. d = d or 0
  336. local rpar,r0,r1 = r.Parent,r.Part0,r.Part1
  337. if d > 0 then wait(d) end
  338.  
  339. local p = hit:Clone()
  340. p:BreakJoints()
  341. p:ClearAllChildren()
  342. p.FormFactor = "Custom"
  343. p.Size = p.Size/2
  344. p.Transparency = 1
  345. p.CanCollide = true
  346. p.Name = "Colliduh"
  347. p.Parent = hit
  348. local w = Instance.new("Weld",p)
  349. w.Part0 = hit
  350. w.Part1 = p
  351. w.C0 = CFrame.new(0,-p.Size.Y/2,0)
  352.  
  353. local rot = Instance.new("Rotate",rpar)
  354. rot.Name = r.Name
  355. rot.Part0 = r0
  356. rot.Part1 = r1
  357. rot.C0 = r.C0
  358. rot.C1 = r.C1
  359. r0.Velocity = Vector3.new()
  360. r1.Velocity = Vector3.new()
  361. r:Destroy()
  362. end))
  363. end
  364.  
  365.  
  366. function ShootArrow(a,to,spd)
  367. Spawn(oc(function()
  368. local from = a.main.CFrame
  369. a:Destroy()
  370. local a = amodel:Clone()
  371. for i,v in pairs(a:GetChildren()) do
  372. if v:IsA("BasePart") then
  373. v.Anchored = true
  374. end
  375. end
  376. a:MakeJoints()
  377. a.Parent = workspace
  378. local m = a.main
  379. --local from = m.CFrame
  380. local t = {}
  381. local function move(cf)
  382. for i,v in pairs(a:GetChildren()) do
  383. if v ~= m and v:IsA("BasePart") then
  384. t[v] = t[v] or m.CFrame:toObjectSpace(v.CFrame)
  385. v.CFrame = cf * t[v]
  386. end
  387. end
  388. m.CFrame = cf
  389. end
  390. move(from)
  391. local velocity = (to.p-from.p).unit * spd * 500
  392. local con
  393. local t = tick()
  394. con = game:GetService("RunService").Stepped:connect(function()
  395. if tick()-t > 25 then
  396. con:disconnect()
  397. a:Destroy()
  398. return
  399. end
  400. velocity = velocity - Vector3.new(0,196.2/30,0)
  401. local newcf = clerp(m.CFrame,CFrame.new(m.Position,m.Position+velocity) * CFrame.Angles(-math.pi/2,0,0),.5) + velocity / 30
  402. local hit,ray
  403. local rayo = Ray.new(m.Position,newcf.p-m.Position)
  404. local ign = {a,char}
  405. repeat
  406. hit,ray = workspace:FindPartOnRayWithIgnoreList(rayo,ign)
  407. if not hit then break end
  408. if hit.CanCollide or game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) then
  409. break
  410. else
  411. table.insert(ign,hit)
  412. hit = nil
  413. end
  414. until false
  415. if hit then
  416. move(newcf-newcf.p+ray)
  417. con:disconnect()
  418. game:GetService("Debris"):AddItem(a,300)
  419. local char = hit.Parent
  420. if not hit.Anchored then
  421. local b = hit.CFrame:toObjectSpace(m.CFrame)
  422. for i,v in pairs(a:GetChildren()) do
  423. pcall(function() v.Anchored = false v.CanCollide = true end)
  424. end
  425. weld(hit,m,b)
  426. end
  427. if game:service'Players':GetPlayerFromCharacter(char) and char:FindFirstChild("Torso") then
  428. if hit.Name:match("Arm") then
  429. local r = char.Torso:FindFirstChild(hit.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
  430. if r then
  431. ragJoint(hit,r)
  432. end
  433. elseif hit.Name:match("Head") then
  434. for i,v in pairs(char:GetChildren()) do
  435. local r = char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
  436. if v:IsA("BasePart") and r then
  437. ragJoint(v,r,.1)
  438. elseif v:IsA("Humanoid") then
  439. v.PlatformStand = true
  440. v.Changed:connect(function()
  441. v.PlatformStand = true
  442. end)
  443. end
  444. end
  445. Delay(8,function()
  446. char:BreakJoints()
  447. end)
  448. end
  449. end
  450. return
  451. else
  452. move(newcf)
  453. end
  454. end)
  455. end))
  456. end
  457.  
  458. mouse.Button1Down:connect(oc(function()
  459. if mb then return end
  460. mb = true
  461. mup = false
  462. rls.Part0,rls.Part1 = nil,nil
  463. ls.Part0,ls.Part1 = tor,la
  464. ls.Parent = tor
  465. ls.C0 = ls.C0 * CFrame.Angles(0,0,rls.CurrentAngle)
  466. rrs.Part0,rrs.Part1 = nil,nil
  467. rs.Part0,rs.Part1 = tor,ra
  468. rs.Parent = tor
  469. rs.C0 = rs.C0 * CFrame.Angles(0,0,rrs.CurrentAngle)
  470. local hc0 = hold.C0
  471. local bg = Instance.new("BodyGyro",tor)
  472. bg.maxTorque = Vector3.new(1,1,1)*9e7
  473. local ltar = 0
  474. local rtar = rrs.C0 * CFrame.Angles(0,0,math.rad(90)) * CFrame.Angles(math.rad(70),0,0) + Vector3.new(-.65,.25,-.25)
  475. local ntar = nk0 * CFrame.Angles(0,0,math.rad(70))
  476. local htar = hc0 * CFrame.Angles(0,math.rad(10),0)
  477. local t = tick()
  478. local iam = 0
  479. local ham = .3
  480. local lend = false
  481. local ended
  482. local arr = amodel:Clone()
  483. arr.Parent = model
  484. arr:MakeJoints()
  485. hum.WalkSpeed = walkspeed/1.5
  486. local aw = weld(ra,arr.main,CFrame.new(0,-1,0)*CFrame.Angles(-math.pi/2,0,0),CFrame.new(0,-1.5,0))
  487. func = function()
  488. local a = (mouse.Hit.p-tor.CFrame:toWorldSpace(ls.C0).p).unit
  489. bg.cframe = CFrame.new(tor.Position,mouse.Hit.p*Vector3.new(1,0,1)+tor.Position*Vector3.new(0,1,0)) * CFrame.Angles(0,math.rad(-75),0)
  490. local b = math.min(.7,math.max(-.7,a.Y))
  491. ls.C0 = clerp(ls.C0,rls.C0 * CFrame.Angles(math.rad(-90),math.rad(90),math.rad(b*-90)) * CFrame.Angles(math.rad(40),math.rad(0),0) + Vector3.new(math.abs(b)*0,-.25,-.6),.3)
  492. local c = tor.CFrame:toObjectSpace(han.CFrame*hpos) * CFrame.new(0,0,0)
  493. local d = Vector3.new(1,.6,0)
  494. rs.C1 = CFrame.new()
  495. rs.C0 = clerp(rs.C0,CFrame.new(d,c.p) * CFrame.new(0,0,-(c.p-d).magnitude+.95) * CFrame.Angles(math.pi/2,math.pi/2,0),.3)
  496. nk.C0 = clerp(nk.C0,ntar * CFrame.Angles(math.rad(math.floor(b*-90)),0,0),.3)
  497. hold.C0 = clerp(hold.C0,htar,.3)
  498. for i,v in pairs(W) do
  499. -- v.C0 = clerp(v.C0,W0[i] * CFrame.Angles((not mup and (i>3 and 1 or -1)*iam or 0)*.1,0,0),.6)
  500. v.C0 = clerp(v.C0,W0[i] * CFrame.Angles((not mup and (i>3 and 1 or -1)*iam or 0)*.1,0,0),.6)
  501. end
  502. if not mup then
  503. hpos = clerp(hpos,hpos_l * CFrame.new(0,0,iam),.2)
  504. if aw then aw.C0 = CFrame.new(Vector3.new(0,-1,0),ra.CFrame:toObjectSpace(han.CFrame*CFrame.new(keeper)).p) * CFrame.Angles(-math.pi/2,0,0) end
  505. if tick()-t > .5 and iam < 1 then
  506. iam = iam + math.max(0.003,.03-(tick()-t-.5)/70)
  507. ham = iam
  508. if aw then
  509. aw:Destroy()
  510. arrw.Parent = han
  511. arrw.Part0 = han
  512. arrw.Part1 = arr.main
  513. aw = nil
  514. end
  515. end
  516. else
  517.  
  518. hpos = clerp(hpos,hpos_l,ham/math.max(0.01,(hpos.p-hpos_l.p).magnitude))
  519. ham = ham * .7
  520. if not ended then
  521. ended = true
  522. if iam > 0 then
  523. arrw.Part1 = nil
  524. ShootArrow(arr,mouse.Hit,iam)
  525. iam = iam + .2
  526. wait(.5)
  527. lend = true
  528. else
  529. wait(.1)
  530. arr:Destroy()
  531. lend = true
  532. end
  533. end
  534. end
  535. end
  536. repeat wait() until lend or tick()-t > 45
  537. mup = nil
  538. func = nil
  539. hum.WalkSpeed = walkspeed
  540. ls.Part0,ls.Part1 = nil,nil
  541. ls.Parent = nil
  542. rls.Part0,rls.Part1 = tor,la
  543. ls.C0 = rls.C0
  544. rs.Part0,rs.Part1 = nil,nil
  545. rs.Parent = nil
  546. rrs.Part0,rrs.Part1 = tor,ra
  547. rs.C0 = rrs.C0
  548. nk.C0 = nk0
  549. bg:Destroy()
  550. hold.C0 = hc0
  551. hpos = hpos_i
  552. mb = false
  553. end))
  554.  
  555. rcon = game:GetService("RunService").Stepped:connect(oc(function()
  556. if not model:IsDescendantOf(workspace) then rcon:disconnect() error() return end
  557. --local tc = bt.CFrame:toObjectSpace(tt.CFrame)
  558. --local bc = tt.CFrame:toObjectSpace(bt.CFrame)
  559. local bm = bt.CFrame:toObjectSpace(han.CFrame*hpos)
  560. local tm = tt.CFrame:toObjectSpace(han.CFrame*hpos)
  561. l1w.C0 = CFrame.new(bm.p/2,bm.p) * CFrame.Angles(math.pi/2,0,0)
  562. l1.Mesh.Scale = Vector3.new(.2,bm.p.magnitude*5,.2)
  563.  
  564. l2w.C0 = CFrame.new(tm.p/2,tm.p) * CFrame.Angles(math.pi/2,0,0)
  565. l2.Mesh.Scale = Vector3.new(.2,tm.p.magnitude*5,.2)
  566.  
  567. arrw.C0 = CFrame.new(hpos.p,keeper)*CFrame.new(0,0,-arrow.Size.Y/2) * CFrame.Angles(-math.pi/2,0,0)
  568. if func then
  569. func()
  570. end
  571. end))
  572.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement