Advertisement
HenloMyDude

steve arm test

Aug 28th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.73 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6. tel = Instance.new("Tool",owner.Backpack)
  7. jendle = Instance.new("Part",tel)
  8. jendle.Name = "Handle"
  9.  
  10.  
  11.  
  12. --Converted with ttyyuu12345's model to script plugin v4
  13. function sandbox(var,func)
  14. local env = getfenv(func)
  15. local newenv = setmetatable({},{
  16. __index = function(self,k)
  17. if k=="script" then
  18. return var
  19. else
  20. return env[k]
  21. end
  22. end,
  23. })
  24. setfenv(func,newenv)
  25. return func
  26. end
  27. cors = {}
  28. mas = Instance.new("Model",game:GetService("Lighting"))
  29. Script0 = Instance.new("Script")
  30. ModuleScript1 = Instance.new("ModuleScript")
  31. ModuleScript2 = Instance.new("ModuleScript")
  32. Script0.Name = "GunAnimation"
  33. Script0.Parent = mas
  34. table.insert(cors,sandbox(Script0,function()
  35. --Rescripted by Luckymaxer
  36.  
  37. Tool = script.Parent
  38. Handle = Tool:WaitForChild("Handle")
  39.  
  40. Players = game:GetService("Players")
  41. Debris = game:GetService("Debris")
  42. RunService = game:GetService("RunService")
  43.  
  44. RbxUtility = LoadLibrary("RbxUtility")
  45. Create = RbxUtility.Create
  46.  
  47. BaseUrl = "http://www.roblox.com/asset/?id="
  48.  
  49. CF = CFrame.new
  50. An = CFrame.Angles
  51. V3 = Vector3.new
  52.  
  53. BasePart = Create("Part"){
  54. Material = Enum.Material.Plastic,
  55. FormFactor = Enum.FormFactor.Custom,
  56. TopSurface = Enum.SurfaceType.Smooth,
  57. BottomSurface = Enum.SurfaceType.Smooth,
  58. Size = V3(0.2, 0.2, 0.2),
  59. CanCollide = true,
  60. Locked = true,
  61. }
  62.  
  63. Settings = {
  64. Damage = 10,
  65. EquipTime = 0.4,
  66. IdleSpeed = 5,
  67. AttackSpeed = 0.65,
  68. }
  69.  
  70. StabDamage = 110
  71.  
  72. Sounds = {
  73. Equip = {
  74. Handle:WaitForChild("Equip"),
  75. },
  76. Swing = {
  77. Handle:WaitForChild("Swing1"),
  78. Handle:WaitForChild("Swing2"),
  79. Handle:WaitForChild("Swing3"),
  80. Handle:WaitForChild("Swing4"),
  81. },
  82. Hit = {
  83. Handle:WaitForChild("Hit1"),
  84. Handle:WaitForChild("Hit2"),
  85. Handle:WaitForChild("Hit3"),
  86. },
  87. Death = {
  88. Handle:WaitForChild("Death1"),
  89. Handle:WaitForChild("Death2"),
  90. Handle:WaitForChild("Death3"),
  91. },
  92. }
  93.  
  94. Configuration = require(script:WaitForChild("Configuration"))
  95. Functions = require(script:WaitForChild("Functions"))
  96.  
  97. Animations = Configuration.Animations
  98.  
  99. BaseWeapon = Handle:Clone()
  100. BaseWeapon.Name = "FakeHandle"
  101. BaseWeapon.Size = V3(0.2, 0.2, 0.2)
  102. BaseWeapon.CanCollide = false
  103.  
  104. ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
  105. Name = "ServerControl",
  106. Parent = Tool,
  107. })
  108.  
  109. ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
  110. Name = "ClientControl",
  111. Parent = Tool,
  112. })
  113.  
  114. ToolEquipped = false
  115.  
  116. Handle.Transparency = 0
  117. Tool.Enabled = true
  118.  
  119. for i, v in pairs(Tool:GetChildren()) do
  120. if v:IsA("BasePart") and v ~= Handle then
  121. v:Destroy()
  122. end
  123. end
  124.  
  125. TargetPosition = V3(0, 0, 0)
  126.  
  127. function PlaySound(nm, dl)
  128. Spawn(function()
  129. local CurrentlyEquipped = true
  130. ToolUnequipped = Tool.Unequipped:connect(function()
  131. CurrentlyEquipped = false
  132. end)
  133. if dl then
  134. wait(dl)
  135. end
  136. if ToolUnequipped then
  137. ToolUnequipped:disconnect()
  138. end
  139. if not CurrentlyEquipped then
  140. return
  141. end
  142. local PossibleSounds = Sounds[nm]
  143. local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
  144. Sound:Play()
  145. end)
  146. end
  147.  
  148. function Slash(del)
  149. Spawn(function()
  150. local Hits = {}
  151. local Start = tick()
  152. local function PartTouched(Hit)
  153. if not Hit or not Hit.Parent then
  154. return
  155. end
  156. local character = Hit.Parent
  157. if Functions.CheckTableForInstance(Hits, character) then
  158. return
  159. end
  160. local player = Players:GetPlayerFromCharacter(character)
  161. if player and (player == Player or Functions.IsTeamMate(Player, player)) then
  162. return
  163. end
  164. local humanoid = character:FindFirstChild("Humanoid")
  165. if not humanoid or humanoid.Health == 0 then
  166. return
  167. end
  168. PlaySound("Hit", nil)
  169. local Damage = StabDamage
  170. table.insert(Hits, Hit)
  171. Functions.UntagHumanoid(humanoid)
  172. Functions.TagHumanoid(humanoid, Player)
  173. humanoid:TakeDamage(Damage)
  174. if humanoid.Health <= Damage then
  175. PlaySound("Death", nil)
  176. end
  177. end
  178. if WeaponHit then
  179. WeaponHit:disconnect()
  180. end
  181. WeaponHit = Weapon.Touched:connect(PartTouched)
  182. while (tick() - Start) <= Settings.AttackSpeed and ToolEquipped do
  183. wait()
  184. end
  185. if WeaponHit then
  186. WeaponHit:disconnect()
  187. end
  188. end)
  189. end
  190.  
  191. function Animate(tp, st)
  192. AnimType = tp
  193. AnimState = st
  194. end
  195.  
  196. function StartAnimation()
  197. OriginalJoints = {Neck = Torso:FindFirstChild("Neck"), LeftShoulder = Torso:FindFirstChild("Left Shoulder"), RightShoulder = Torso:FindFirstChild("Right Shoulder")}
  198. for i, v in pairs(OriginalJoints) do
  199. if v then
  200. local Joint = {Joint = v, Properties = {Part0 = v.Part0, Part1 = v.Part1, C0 = v.C0, C1 = v.C1}}
  201. OriginalJoints[i] = Joint
  202. end
  203. end
  204. local Joints = {
  205. LeftWeld = {Name = "LeftWeld", Part0 = Torso, Part1 = LeftArm, C0 = CF(-1.5, 0, 0)},
  206. RightWeld = {Name = "RightWeld", Part0 = Torso, Part1 = RightArm, C0 = CF(1.5, 0, 0)},
  207. HeadWeld = {Name = "Head", Part0 = Torso, Part1 = Head, C0 = CF(0, 1.5, 0)},
  208. }
  209. for i, v in pairs(OriginalJoints) do
  210. if v then
  211. v.Joint.Part1 = nil
  212. end
  213. end
  214. Welds = {}
  215. for i, v in pairs(Joints) do
  216. local Joint = Create("Snap"){
  217. Name = v.Name,
  218. Part0 = v.Part0,
  219. Part1 = v.Part1,
  220. C0 = v.C0,
  221. C1 = CF(0, 0, 0),
  222. Parent = Torso,
  223. }
  224. Welds[i] = Joint
  225. end
  226. end
  227.  
  228. function EndAnimation()
  229. for i, v in pairs(Welds) do
  230. if v and v.Parent then
  231. v.Part0 = nil
  232. v.Part1 = nil
  233. v:Destroy()
  234. end
  235. end
  236. for i, v in pairs(OriginalJoints) do
  237. for ii, vv in pairs(v.Properties) do
  238. pcall(function()
  239. v.Joint[ii] = vv
  240. end)
  241. end
  242. end
  243. if AnimConnection then
  244. AnimConnection:disconnect()
  245. end
  246. for i, v in pairs(Tool:GetChildren()) do
  247. if v:IsA("BasePart") and v ~= Handle then
  248. v:Destroy()
  249. end
  250. end
  251. OriginalJoints = {}
  252. Welds = {}
  253. Weapon:Destroy()
  254. end
  255.  
  256. function ManageAnimation()
  257. LastTick = tick()
  258. AnimEquip = 1
  259. LastAction = tick()
  260. IdleRand = math.random(4, 7)
  261. IdlePerform = 0
  262. IdleType = 1
  263. AttackPerform = 0
  264. AttackType = 1
  265. Animate("Equip", 0)
  266. PlaySound("Equip", 0.1)
  267. if AnimConnection then
  268. AnimConnection:disconnect()
  269. end
  270. AnimConnection = RunService.Stepped:connect(function()
  271. local Delta = (tick() - LastTick)
  272. LastTick = tick()
  273. if AnimEquip > 0 then
  274. AnimEquip = math.max(0, (AnimEquip - (Delta / Settings.EquipTime)))
  275. Animate("Equip", (1 - AnimEquip))
  276. elseif (tick() - AttackPerform) <= Settings.AttackSpeed then
  277. Animate(("Attack" .. AttackType), ((tick() - AttackPerform) / Settings.AttackSpeed))
  278. IdlePerform = 0
  279. elseif (tick() - IdlePerform) <= Settings.IdleSpeed then
  280. Animate(("Idle" .. IdleType), ((tick() - IdlePerform) / Settings.IdleSpeed))
  281. else
  282. Animate("Default", 0)
  283. end
  284. if (tick() - LastAction) >= IdleRand then
  285. IdleRand = math.random(12, 20)
  286. LastAction = tick()
  287. IdlePerform = tick()
  288. IdleType = math.random(1, 2)
  289. end
  290. end)
  291. end
  292.  
  293. function RunAnimation()
  294. Weapon = BaseWeapon:Clone()
  295. Weapon.Parent = Tool
  296. local WepWeld = Create("Snap"){
  297. Part0 = RightArm,
  298. Part1 = Weapon,
  299. C0 = CF(0, 0, 0),
  300. Parent = Weapon,
  301. }
  302.  
  303. local AHorse = Character:findFirstChild("HorseHead")
  304. local HorseDisPlace = {0, 0}
  305. local HorseCF = An(0.0001, 0.0001, 0)
  306. if AHorse then
  307. Spawn(function()
  308. while true do
  309. local rndwait = ((math.random(100, 1000) / 1000) * 4)
  310. wait(rndwait)
  311. local Oldd = {HorseDisPlace[1], HorseDisPlace[2]}
  312. local Disp2 = {math.random(-60, 60), math.random(0, 25)}
  313. local ld = 0
  314. while ld ~= 1 do
  315. local st = tick()
  316. wait()
  317. ld = math.min(1, ld + ((tick() - st) * 4))
  318. local Eff = Functions.EaseIn(ld)
  319. local x = (Oldd[1] - ((Oldd[1] - Disp2[1]) * Eff))
  320. local y = (Oldd[2] - ((Oldd[2] - Disp2[2]) * Eff))
  321. HorseDisPlace = {x, y}
  322. HorseCF = An(math.rad(y), math.rad(x) , 0)
  323. end
  324. end
  325. end)
  326. end
  327.  
  328. local LastVa = 0
  329. local LastVa2 = 0
  330. local ViewVelocity = {0, 0}
  331.  
  332. Spawn(function()
  333. local LastTime = tick()
  334. while Welds.LeftWeld and Welds.LeftWeld.Parent and CheckIfAlive() and ToolEquipped do
  335.  
  336. local Delta = (tick() - LastTime)
  337. LastTime = tick()
  338.  
  339. local BreatheAmp = 2
  340. local BreatheFreq = 0.8
  341. local Breathe = (math.sin(math.rad(tick() * 90 * BreatheFreq)) * BreatheAmp)
  342.  
  343. local pDistance = (Head.Position - TargetPosition).Magnitude
  344. pDistance = ((pDistance == 0 and 0.0001) or pDistance)
  345. local pHeight = (TargetPosition.Y - Head.Position.Y)
  346. local ViewAngle = ((pHeight ~= 0 and math.deg(math.asin(math.abs(pHeight) / pDistance)) * (math.abs(pHeight) / pHeight)) or 0)
  347.  
  348. local Anmtp = AnimType
  349. Anmtp = (((Anmtp and not Animations[Anmtp]) and "Default") or (not Anmtp and "Default") or Anmtp)
  350. local Anmst = (AnimState or 0)
  351.  
  352. local CurrAnim = Configuration.PlayAnimation(Anmtp, Anmst)
  353. local ChestCF = (CF(0, 0.5, 0) * An(math.rad(math.max(-Configuration.RotAmplitudeChest, math.min(Configuration.RotAmplitudeChest, ViewAngle)) + 90 + Breathe), 0, 0))
  354. Welds.LeftWeld.C1 = (ChestCF * CurrAnim[1] * CF(0, -0.5, 0)):inverse()
  355. Welds.RightWeld.C1 = (ChestCF * CurrAnim[2] * CF(0, -0.5, 0)):inverse()
  356. WepWeld.C1 = (CurrAnim[3] * CF(0, 0.0125,0) * An(90, 0, 0)):inverse()
  357. if Configuration.AnimHead then
  358. Welds.HeadWeld.C1 = (CF(0, 0, 0) * An(math.rad(math.max(-Configuration.RotAmplitudeHead, math.min(Configuration.RotAmplitudeHead, ViewAngle))), 0, 0) * HorseCF):inverse()
  359. else
  360. Welds.HeadWeld.C1 = (CF(0, 0, 0)):inverse()
  361. end
  362. Spawn(function()
  363. InvokeClient("CurrentAnimation", {Animations = CurrAnim})
  364. end)
  365. wait()
  366. end
  367. end)
  368.  
  369. end
  370.  
  371. function CheckIfAlive()
  372. return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Head and Head.Parent and Torso and Torso.Parent and LeftArm and LeftArm.Parent and RightArm and RightArm.Parent) and true) or false)
  373. end
  374.  
  375. function Activated()
  376. if AnimEquip > 0 or (tick() - AttackPerform) <= Settings.AttackSpeed then
  377. return
  378. end
  379. AttackPerform = tick()
  380. LastAction = tick()
  381. AttackType = math.random(1, 3)
  382. IdlePerform = 0
  383. PlaySound("Swing", 0.15)
  384. Slash(0.17)
  385. end
  386.  
  387. function Equipped()
  388. Character = Tool.Parent
  389. Humanoid = Character:FindFirstChild("Humanoid")
  390. Head = Character:FindFirstChild("Head")
  391. Torso = Character:FindFirstChild("Torso")
  392. LeftArm = Character:FindFirstChild("Left Arm")
  393. RightArm = Character:FindFirstChild("Right Arm")
  394. Player = Players:GetPlayerFromCharacter(Character)
  395. if not CheckIfAlive() then
  396. return
  397. end
  398. Spawn(function()
  399. Handle.Transparency = 1
  400. Humanoid.WalkSpeed = 19
  401. for i, v in pairs({LeftArm, RightArm}) do
  402. if v then
  403. Spawn(function()
  404. InvokeClient("SetLocalTransparencyModifier", {Object = v, Transparency = 0, AutoUpdate = false})
  405. end)
  406. end
  407. end
  408. StartAnimation()
  409. ManageAnimation()
  410. RunAnimation()
  411. end)
  412. ToolEquipped = true
  413. end
  414.  
  415. function Unequipped()
  416. Handle.Transparency = 0
  417. if CheckIfAlive() then
  418. Humanoid.WalkSpeed = 16
  419. end
  420. EndAnimation()
  421. ToolEquipped = false
  422. end
  423.  
  424. function OnServerInvoke(player, mode, value)
  425. if player ~= Player or not ToolEquipped or not mode or not value or not CheckIfAlive() then
  426. return
  427. end
  428. if mode == "SetTarget" then
  429. local TargetPos = value.TargetPosition
  430. if not TargetPos then
  431. return
  432. end
  433. TargetPosition = TargetPos
  434. end
  435. end
  436.  
  437. function InvokeClient(Mode, Value)
  438. local ClientReturn = nil
  439. pcall(function()
  440. ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
  441. end)
  442. return ClientReturn
  443. end
  444.  
  445. ServerControl.OnServerInvoke = OnServerInvoke
  446.  
  447. Tool.Activated:connect(Activated)
  448. Tool.Equipped:connect(Equipped)
  449. Tool.Unequipped:connect(Unequipped)
  450. end))
  451. Script0.Disabled = true
  452. ModuleScript1.Name = "Configuration"
  453. ModuleScript1.Parent = Script0
  454. table.insert(cors,sandbox(ModuleScript1,function()
  455. --Rescripted by Luckymaxer
  456.  
  457. CF = CFrame.new
  458. An = CFrame.Angles
  459.  
  460. Configuration = {
  461.  
  462. AnimType = "Default",
  463. AnimState = 0,
  464.  
  465. AnimHead = false,
  466.  
  467. RotAmplitudeHead = 20,
  468. RotAmplitudeChest = 15,
  469.  
  470. Animations = {
  471. Default = {
  472. {{}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)}
  473. },
  474. Equip = {
  475. {{}, 0, CFrame.new(0, 0, 0) * CFrame.Angles(-1.571, 0, 0), CFrame.new(0, 0, 0) * CFrame.Angles(-1.571, 0, 0), CFrame.new(0, -1.3, -0.5) * CFrame.Angles(-2.618, 0, 0)},
  476. {{0.8, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.024, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(0, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  477. {{0.2, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  478. },
  479. Idle1 = {
  480. {{}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  481. {{0.3, 2}, 0, CFrame.new(0.8, -0.301, 0.2) * CFrame.Angles(-0.05, 0, 0.872), CFrame.new(-0.201, 0, 0) * CFrame.Angles(0.523, 1.221, -0.699), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 1.221, 0)},
  482. {{0.55, 2}, 0, CFrame.new(0.2, -0.5, 0.2) * CFrame.Angles(-0.04, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(0, 1.221, -0.175), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.746, 1.221, 0.174)},
  483. {{0.15, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  484. },
  485. Idle2 = {
  486. {{}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  487. {{0.3, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.024, 0, 0.872), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, -0.175, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0.523, 0)},
  488. {{0.3, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(0.049, 0, 0.523), CFrame.new(-0.201, 0, 0) * CFrame.Angles(0.174, 0.698, -0.524), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, -1.222, 0)},
  489. {{0.2, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(0.01, 0, 0.349), CFrame.new(-0.201, 0, 0) * CFrame.Angles(0.139, 0.663, -0.489), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, -1.222, 0)},
  490. {{0.2, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)}
  491. },
  492. Attack1 = {
  493. {{}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  494. {{0.25, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-1.048, 0, 0.349), CFrame.new(-0.201, 0, 0) * CFrame.Angles(0.872, 0.349, 0.087), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  495. {{0.15, 2}, 0, CFrame.new(0.4, -0.101, 0.1) * CFrame.Angles(-1.571, 0, -0.35), CFrame.new(-0.301, -0.301, 0.1) * CFrame.Angles(-1.048, -0.175, -0.524), CFrame.new(0, -1.201, -0.801) * CFrame.Angles(-2.095, 0, 0)},
  496. {{0.6, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)}
  497. },
  498. Attack2 = {
  499. {{}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  500. {{0.25, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.099, 0, 0.872), CFrame.new(-0.401, 0.3, 0.1) * CFrame.Angles(1.919, 2.443, -1.222), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  501. {{0.15, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-1.048, 0, -0.524), CFrame.new(-0.5, -0.201, -0.101) * CFrame.Angles(0.523, 1.396, -0.873), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  502. {{0.6, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)}
  503. },
  504. Attack3 = {
  505. {{}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)},
  506. {{0.25, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-1.397, 0, 0.174), CFrame.new(-0.401, -0.201, 0) * CFrame.Angles(1.396, 0.698, -1.571), CFrame.new(0, -1.3, -0.401) * CFrame.Angles(-2.444, 0, 0)},
  507. {{0.15, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-1.397, 0, 0.174), CFrame.new(-0.401, 0.1, 0) * CFrame.Angles(0.349, 2.094, -0.524), CFrame.new(0, -1.3, 0.1) * CFrame.Angles(-3.84, 0, 0)},
  508. {{0.6, 2}, 0, CFrame.new(0.4, -0.201, 0.2) * CFrame.Angles(-0.073, 0, 0.698), CFrame.new(-0.201, 0, 0) * CFrame.Angles(-0.175, 0.349, -0.262), CFrame.new(0, -0.95, -0.801) * CFrame.Angles(-1.571, 0, 0)} --Psst. Create a dummy, try setting position and angles of limbs and the weapon, save CFrame data to code. Easy? Yes. When making a single knife tool, it was all you needed.
  509. }
  510. }
  511. }
  512.  
  513. function Configuration.EaseIn(x)
  514. return math.sin(math.rad(x * 90))
  515. end
  516.  
  517. function Configuration.CFrameTrans(GetCFrame1, GetCFrame2, GetNumber)
  518. local Diff2 = (GetCFrame2.p - GetCFrame1.p)
  519. local GetCFrame1s = (GetCFrame1 - GetCFrame1.p)
  520. local GetCFrame2 = (GetCFrame2 - GetCFrame2.p)
  521. local Diff = (GetCFrame1s:inverse() * GetCFrame2)
  522. local x1, y1, z1 = Diff:toEulerAnglesXYZ()
  523. return (GetCFrame1 + (Diff2 * GetNumber)) * An(x1 * GetNumber, y1 * GetNumber, z1 * GetNumber)
  524. end
  525.  
  526. function Configuration.TransEff(x, type)
  527. local Types = {
  528. [1] = x,
  529. [2] = (x * x * (3 - 2 * x)),
  530. [3] = math.sin(math.rad(x * 90)),
  531. [4] = (1 - math.sin(math.rad((1 - x) * 90))),
  532. }
  533. return (Types[type] or nil)
  534. end
  535.  
  536. function Configuration.NumTrans(n1, n2, x)
  537. return (n1 + ((n2 - n1) * x))
  538. end
  539.  
  540. function Configuration.PlayAnimation(animname, tm) --return {Left, Right, Wep, Trans}
  541. local tm = math.min(1, math.max(0, tm))
  542. local Animd = Configuration.Animations[animname]
  543. if #Animd == 1 then
  544. return {Animd[1][3], Animd[1][4], Animd[1][5], Animd[1][2]}
  545. else
  546. local TransFrom = 1
  547. local TransTo = 1
  548. local TmLeft = tm
  549. for i = 2, #Animd do
  550. TmLeft = (TmLeft - Animd[i][1][1])
  551. if TmLeft <= 0 then
  552. TransFrom = (i - 1)
  553. TransTo = i
  554. break
  555. end
  556. end
  557. local TransAmm = Configuration.TransEff((Animd[TransTo][1][1] + TmLeft) / Animd[TransTo][1][1], Animd[TransTo][1][2])
  558. return {
  559. Configuration.CFrameTrans(Animd[TransFrom][3], Animd[TransTo][3], TransAmm),
  560. Configuration.CFrameTrans(Animd[TransFrom][4], Animd[TransTo][4], TransAmm),
  561. Configuration.CFrameTrans(Animd[TransFrom][5], Animd[TransTo][5], TransAmm),
  562. Configuration.NumTrans(Animd[TransFrom][2], Animd[TransTo][2], TransAmm)
  563. }
  564. end
  565. end
  566.  
  567. return Configuration
  568. end))
  569. ModuleScript2.Name = "Functions"
  570. ModuleScript2.Parent = Script0
  571. table.insert(cors,sandbox(ModuleScript2,function()
  572. --Rescripted by Luckymaxer
  573.  
  574. Players = game:GetService("Players")
  575. Debris = game:GetService("Debris")
  576.  
  577. RbxUtility = LoadLibrary("RbxUtility")
  578. Create = RbxUtility.Create
  579.  
  580. Functions = {}
  581.  
  582. function Functions.Clamp(Number, Min, Max)
  583. return math.max(math.min(Max, Number), Min)
  584. end
  585.  
  586. function Functions.GetPercentage(Start, End, Number)
  587. return (((Number - Start) / (End - Start)) * 100)
  588. end
  589.  
  590. function Functions.Round(Number, RoundDecimal)
  591. local WholeNumber, Decimal = math.modf(Number)
  592. return ((Decimal >= RoundDecimal and math.ceil(Number)) or (Decimal < RoundDecimal and math.floor(Number)))
  593. end
  594.  
  595. function Functions.IsTeamMate(Player1, Player2)
  596. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  597. end
  598.  
  599. function Functions.TagHumanoid(humanoid, player)
  600. local Creator_Tag = Create("ObjectValue"){
  601. Name = "creator",
  602. Value = player,
  603. }
  604. Debris:AddItem(Creator_Tag, 2)
  605. Creator_Tag.Parent = humanoid
  606. end
  607.  
  608. function Functions.UntagHumanoid(humanoid)
  609. for i, v in pairs(humanoid:GetChildren()) do
  610. if v:IsA("ObjectValue") and v.Name == "creator" then
  611. v:Destroy()
  612. end
  613. end
  614. end
  615.  
  616. function Functions.CheckTableForString(Table, String)
  617. for i, v in pairs(Table) do
  618. if string.find(string.lower(String), string.lower(v)) then
  619. return true
  620. end
  621. end
  622. return false
  623. end
  624.  
  625. function Functions.CheckTableForInstance(Table, Instance)
  626. for i, v in pairs(Table) do
  627. if v == Instance then
  628. return true
  629. end
  630. end
  631. return false
  632. end
  633.  
  634. function Functions.CheckIntangible(Hit)
  635. local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Bullet"}
  636. if Hit and Hit.Parent then
  637. if ((not Hit.CanCollide or Functions.CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then
  638. return true
  639. end
  640. end
  641. return false
  642. end
  643.  
  644. function Functions.CastRay(StartPos, Vec, Length, Ignore, DelayIfHit)
  645. local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
  646. local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore)
  647. if RayHit and Functions.CheckIntangible(RayHit) then
  648. if DelayIfHit then
  649. wait()
  650. end
  651. RayHit, RayPos, RayNormal = Functions.CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
  652. end
  653. return RayHit, RayPos, RayNormal
  654. end
  655.  
  656. return Functions
  657. end))
  658. for i,v in pairs(mas:GetChildren()) do
  659. v.Parent = tel
  660. pcall(function() v:MakeJoints() end)
  661. end
  662. mas:Destroy()
  663. for i,v in pairs(cors) do
  664. spawn(function()
  665. pcall(v)
  666. end)
  667. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement