Godofadmin1337

xBow

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