Advertisement
Namoo546

.d

Oct 30th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 251.54 KB | None | 0 0
  1. wait(1)--this was so much work i did not change the animations from the last stand sorry...
  2. warn "Slenercat5's"
  3. warn "Dirty Deeds Done Dirt Cheep"
  4. warn "Q to call stand"
  5. warn "E to do far range attack"
  6. warn "R to make Enemy clone"
  7. warn "T to jump to other dimension"
  8. warn "Y to Make Clone"
  9. warn "F to use love train"
  10. warn "moveset based on project jojo's d4c"
  11. warn "Model by JojofMer"
  12. warn"sorry currently 1 color"
  13. warn "Avatar clothing and hair by Masterofroblox1206"
  14. plr = game.Players.LocalPlayer
  15. sound = Instance.new("Sound", game.Workspace)
  16. sound.SoundId = "https://www.roblox.com/asset/?id=274698941"
  17. sound.Volume = 10
  18. canworld = true
  19. BeeSpeed = 50
  20.  
  21. chr=plr.Character
  22. tors=torso
  23. --[[
  24. for _,v in pairs(plr.Character:GetChildren())do
  25. if v:IsA('Shirt') or v:IsA('Pants') or v:IsA('Accessory') then
  26. v:remove()
  27. end
  28. end
  29. local sh = Instance.new("Shirt",chr)
  30. sh.ShirtTemplate = "http://www.roblox.com/asset/?id=394790364"
  31. p=Instance.new('Pants',chr)
  32. p.PantsTemplate='http://www.roblox.com/asset/?id=394795102'--]]
  33.  
  34. chr['Left Arm'].BrickColor=BrickColor.new('Pastel brown')
  35. chr['Right Arm'].BrickColor=BrickColor.new('Pastel brown')
  36. chr['Torso'].BrickColor=BrickColor.new('Pastel brown')
  37. chr.Head.BrickColor=BrickColor.new('Pastel brown')
  38.  
  39.  
  40.  
  41.  
  42. local Players=game:service'Players'
  43. local Player=Players.LocalPlayer
  44. local Mouse=Player:GetMouse''
  45. Character=Player.Character
  46.  
  47. local RenderStepped=game:service'RunService'.RenderStepped
  48.  
  49. local MeshId='http://www.roblox.com/asset?id=779592805'
  50. local TextureId='http://www.roblox.com/asset/?id=775493027'
  51.  
  52.  
  53. local QHold=false
  54. local EHold=false
  55.  
  56. cut = Instance.new("Sound", chr)
  57. cut.SoundId = "https://www.roblox.com/asset/?id=0"
  58. cut.Volume = 1.5
  59. thri = Instance.new("Sound", chr)
  60. thri.SoundId = "https://www.roblox.com/asset/?id=186311262"
  61. thri.Volume = 2.5
  62.  
  63.  
  64. Sound2=Instance.new('Sound')
  65. Sound2.SoundId='rbxassetid://616594063'
  66. Sound2.Parent=Player.Character.Head
  67.  
  68.  
  69. Effects = {}
  70. local Player = game.Players.localPlayer
  71. local Character = Player.Character
  72. Character.Archivable = true
  73. AdvancingFortress = Character:Clone()
  74. --[[
  75. Hair=Instance.new('Part',Character)
  76. Hair.Size=Vector3.new(1,1,1)
  77. M=Instance.new('FileMesh',Hair)
  78. M.Scale=Vector3.new(.028,.028,.028)
  79. M.MeshId='rbxassetid://1450916371'
  80. M.TextureId='rbxassetid://1450916523'
  81. WARF=Instance.new('Weld',Hair)
  82. WARF.Part0=Hair
  83. WARF.Part1=Character.Head
  84. WARF.C0=CFrame.new(0,-.2,0)--]]
  85.  
  86.  
  87. --//D4cCostume
  88.  
  89. function eclone(targetPart)
  90.  
  91. --Converted with ttyyuu12345's model to script plugin v4
  92. function sandbox(var,func)
  93. local env = getfenv(func)
  94. local newenv = setmetatable({},{
  95. __index = function(self,k)
  96. if k=="script" then
  97. return var
  98. else
  99. return env[k]
  100. end
  101. end,
  102. })
  103. setfenv(func,newenv)
  104. return func
  105. end
  106. cors = {}
  107. mas = Instance.new("Model",game:GetService("Lighting"))
  108. Model0 = Instance.new("Model")
  109. Part1 = Instance.new("Part")
  110. SpecialMesh2 = Instance.new("SpecialMesh")
  111. Decal3 = Instance.new("Decal")
  112. Part4 = Instance.new("Part")
  113. Decal5 = Instance.new("Decal")
  114. Motor6 = Instance.new("Motor")
  115. Motor7 = Instance.new("Motor")
  116. Motor8 = Instance.new("Motor")
  117. Motor9 = Instance.new("Motor")
  118. Motor10 = Instance.new("Motor")
  119. Part11 = Instance.new("Part")
  120. Part12 = Instance.new("Part")
  121. Part13 = Instance.new("Part")
  122. Part14 = Instance.new("Part")
  123. Humanoid15 = Instance.new("Humanoid")
  124. Humanoid15.WalkToPart=targetPart
  125. BodyColors16 = Instance.new("BodyColors")
  126. Script17 = Instance.new("Script")
  127. Model0.Name = "Clone"
  128. Model0.Parent = mas
  129. Model0.PrimaryPart = Part1
  130. Part1.Name = "Head"
  131. Part1.Parent = Model0
  132. Part1.BrickColor = BrickColor.new("Bright yellow")
  133. Part1.FormFactor = Enum.FormFactor.Symmetric
  134. Part1.Size = Vector3.new(2, 1, 1)
  135. Part1.CFrame = CFrame.new(6.34995413, 4.50001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  136. Part1.TopSurface = Enum.SurfaceType.Smooth
  137. Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
  138. Part1.Position = Vector3.new(6.34995413, 4.50001717, 23.1599998)
  139. Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
  140. SpecialMesh2.Parent = Part1
  141. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  142. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  143. Decal3.Name = "face"
  144. Decal3.Parent = Part1
  145. Decal3.Texture = "rbxasset://textures/face.png"
  146. Part4.Name = "Torso"
  147. Part4.Parent = Model0
  148. Part4.BrickColor = BrickColor.new("Bright blue")
  149. Part4.FormFactor = Enum.FormFactor.Symmetric
  150. Part4.Size = Vector3.new(2, 2, 1)
  151. Part4.CFrame = CFrame.new(6.34995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  152. Part4.LeftSurface = Enum.SurfaceType.Weld
  153. Part4.RightSurface = Enum.SurfaceType.Weld
  154. Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  155. Part4.Position = Vector3.new(6.34995413, 3.00001717, 23.1599998)
  156. Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  157. Decal5.Name = "roblox"
  158. Decal5.Parent = Part4
  159. Motor6.Name = "Right Shoulder"
  160. Motor6.Parent = Part4
  161. Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  162. Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  163. Motor6.Part0 = Part4
  164. Motor6.Part1 = Part12
  165. Motor6.MaxVelocity = 0.15000000596046
  166. Motor7.Name = "Left Shoulder"
  167. Motor7.Parent = Part4
  168. Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  169. Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  170. Motor7.Part0 = Part4
  171. Motor7.Part1 = Part11
  172. Motor7.MaxVelocity = 0.15000000596046
  173. Motor8.Name = "Right Hip"
  174. Motor8.Parent = Part4
  175. Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  176. Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  177. Motor8.Part0 = Part4
  178. Motor8.Part1 = Part14
  179. Motor8.MaxVelocity = 0.10000000149012
  180. Motor9.Name = "Left Hip"
  181. Motor9.Parent = Part4
  182. Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  183. Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  184. Motor9.Part0 = Part4
  185. Motor9.Part1 = Part13
  186. Motor9.MaxVelocity = 0.10000000149012
  187. Motor10.Name = "Neck"
  188. Motor10.Parent = Part4
  189. Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  190. Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  191. Motor10.Part0 = Part4
  192. Motor10.Part1 = Part1
  193. Motor10.MaxVelocity = 0.10000000149012
  194. Part11.Name = "Left Arm"
  195. Part11.Parent = Model0
  196. Part11.BrickColor = BrickColor.new("Bright yellow")
  197. Part11.CanCollide = false
  198. Part11.FormFactor = Enum.FormFactor.Symmetric
  199. Part11.Size = Vector3.new(1, 2, 1)
  200. Part11.CFrame = CFrame.new(4.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  201. Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
  202. Part11.Position = Vector3.new(4.84995413, 3.00001717, 23.1599998)
  203. Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
  204. Part12.Name = "Right Arm"
  205. Part12.Parent = Model0
  206. Part12.BrickColor = BrickColor.new("Bright yellow")
  207. Part12.CanCollide = false
  208. Part12.FormFactor = Enum.FormFactor.Symmetric
  209. Part12.Size = Vector3.new(1, 2, 1)
  210. Part12.CFrame = CFrame.new(7.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  211. Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
  212. Part12.Position = Vector3.new(7.84995413, 3.00001717, 23.1599998)
  213. Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
  214. Part13.Name = "Left Leg"
  215. Part13.Parent = Model0
  216. Part13.BrickColor = BrickColor.new("Br. yellowish green")
  217. Part13.CanCollide = false
  218. Part13.FormFactor = Enum.FormFactor.Symmetric
  219. Part13.Size = Vector3.new(1, 2, 1)
  220. Part13.CFrame = CFrame.new(5.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  221. Part13.BottomSurface = Enum.SurfaceType.Smooth
  222. Part13.TopSurface = Enum.SurfaceType.Inlet
  223. Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
  224. Part13.Position = Vector3.new(5.84995413, 1.00001717, 23.1599998)
  225. Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
  226. Part14.Name = "Right Leg"
  227. Part14.Parent = Model0
  228. Part14.BrickColor = BrickColor.new("Br. yellowish green")
  229. Part14.CanCollide = false
  230. Part14.FormFactor = Enum.FormFactor.Symmetric
  231. Part14.Size = Vector3.new(1, 2, 1)
  232. Part14.CFrame = CFrame.new(6.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  233. Part14.BottomSurface = Enum.SurfaceType.Smooth
  234. Part14.TopSurface = Enum.SurfaceType.Inlet
  235. Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
  236. Part14.Position = Vector3.new(6.84995413, 1.00001717, 23.1599998)
  237. Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
  238. Humanoid15.Parent = Model0
  239. Humanoid15.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  240. Humanoid15.RightLeg = Part14
  241. Humanoid15.LeftLeg = Part13
  242. Humanoid15.Torso = Part4
  243. Humanoid15.WalkToPoint=Vector3.new(0,20,0)
  244. BodyColors16.Parent = Model0
  245. BodyColors16.HeadColor = BrickColor.new("Bright yellow")
  246. BodyColors16.LeftArmColor = BrickColor.new("Bright yellow")
  247. BodyColors16.LeftLegColor = BrickColor.new("Br. yellowish green")
  248. BodyColors16.RightArmColor = BrickColor.new("Bright yellow")
  249. BodyColors16.RightLegColor = BrickColor.new("Br. yellowish green")
  250. BodyColors16.TorsoColor = BrickColor.new("Bright blue")
  251. Script17.Name = "Full Animation"
  252. Script17.Parent = Model0
  253. table.insert(cors,sandbox(Script17,function()
  254. --[[Made by Jammer622 @[http://www.roblox.com/Advanced-Player-AI-item?id=59391730],
  255. This is the ORIGINAL model, if you see others, they are stolen.
  256. Scripts mixed from vanilla Animate, Health, and Sound,
  257. with much custom content by myself, making them great AIs.
  258. No help from Miked's scripts, I made my own joint script.
  259. If you find any glitches, bugs, or just want to suggest an idea, please message me.
  260. My team works hard on these AIs, please don't make attempts to steal them.
  261. Your feedback is extremely appreciated!
  262.  
  263. _---=CREDITS=---_
  264. The Roblox Team Without them, none of this would be possible.
  265. Vanilla Sound
  266. Vanilla Health
  267. Vanilla Animate
  268. Jammer622 That's me, main programmer and weapon publisher.
  269. Main Developer
  270. Health GUI Script
  271. Animation Work
  272. Relationship Work
  273. Wandering
  274. Pathing (Map Generation)
  275. Weapon Usage
  276. Weapon (Re)Publishing
  277. Sonypony458
  278. McDonalds Drink
  279. Customization
  280. Teamwork AI
  281. Model Variables
  282. Setting Wiki [Below]
  283. Macdeath I owe it to him for keeping me on track during this.
  284. Feature Inspiration
  285. Problem Solving
  286. Suggestions
  287. lah30303 Amazing pathing work goes to this fine sir.
  288. Pathing (Pathing Generation/System)
  289.  
  290. _---=SETTINGS=---_
  291. Inside this model's file, you'll find several values that can be changed.
  292. DropWeapon -This sets whether or not the bot will drop any equipped weapon upon dying.
  293. Force_Pants -This must be set through Spawners.
  294. Force_Shirt -This must be set through Spawners.
  295. Force_Weapon -This must be set through Spawners.
  296. Force_Hat -This must be set through Spawners.
  297. IgnoreCombatFF -This sets whether or not the bot will allow friendly fire during combat.
  298. IsAPlayer -This is a tag to specify this bot's existance to other AIs.
  299. IsOnTeam -This sets whether or not the bot is on a team.
  300. ShowTag -This sets whether or not the bot's team color name shows up beside its own.
  301. Team -This sets the bot's team color.
  302. PathTo -This is an experimental pathfinding engine. Use at your own risk!
  303. PrintMap -This prints maps generated when using PathTo. Use at your own risk!
  304. Respawn -This sets whether the bot will respawn or not upon death.
  305. Custom_Name -This must be set through Spawners.
  306. Wander -This sets whether the bot is stationary or if it moves, but not if it uses weapons or not.
  307. ]]
  308. print("Player Bot Loading")
  309. Delay(0, function() --Vanilla Sound
  310. function waitForChild(parent, childName)
  311. local child = parent:findFirstChild(childName)
  312. if child then return child end
  313. while true do
  314. child = parent.ChildAdded:wait()
  315. if child.Name==childName then return child end
  316. end
  317. end
  318. function newSound(id)
  319. local sound = Instance.new("Sound")
  320. sound.SoundId = id
  321. sound.archivable = false
  322. sound.Parent = script.Parent.Head
  323. return sound
  324. end
  325. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  326. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  327. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  328. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  329. local sJumping = newSound("rbxasset://sounds/button.wav")
  330. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  331. sRunning.Looped = true
  332. local Figure = script.Parent
  333. local Head = waitForChild(Figure, "Head")
  334. local Humanoid = waitForChild(Figure, "Humanoid")
  335. function onDied()
  336. sDied:Play()
  337. end
  338. function onState(state, sound)
  339. if state then
  340. sound:Play()
  341. else
  342. sound:Pause()
  343. end
  344. end
  345. function onRunning(speed)
  346. if speed>0 then
  347. sRunning:Play()
  348. else
  349. sRunning:Pause()
  350. end
  351. end
  352.  
  353. Humanoid.Died:connect(onDied)
  354. Humanoid.Running:connect(onRunning)
  355. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  356. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  357. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  358. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  359. end)
  360. Delay(0, function() --Vanilla Health
  361. function waitForChild(parent, childName)
  362. local child = parent:findFirstChild(childName)
  363. if child then return child end
  364. while true do
  365. child = parent.ChildAdded:wait()
  366. if child.Name==childName then return child end
  367. end
  368. end
  369. local Figure = script.Parent
  370. local Humanoid = waitForChild(Figure, "Humanoid")
  371. local regening = false
  372. function regenHealth()
  373. if regening then return end
  374. regening = true
  375. while Humanoid.Health < Humanoid.MaxHealth do
  376. local s = wait(1)
  377. local health = Humanoid.Health
  378. if health > 0 and health < Humanoid.MaxHealth then
  379. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  380. health = health + newHealthDelta
  381. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  382. end
  383. end
  384. if Humanoid.Health > Humanoid.MaxHealth then
  385. Humanoid.Health = Humanoid.MaxHealth
  386. end
  387. regening = false
  388. end
  389. Humanoid.HealthChanged:connect(regenHealth)
  390. end)
  391. Delay(0, function() --Vanilla Animate, Multiple Additions
  392. function waitForChild(parent, childName)
  393. local child = parent:findFirstChild(childName)
  394. if child then return child end
  395. while true do
  396. child = parent.ChildAdded:wait()
  397. if child.Name==childName then return child end
  398. end
  399. end
  400. local Figure = script.Parent
  401. local Clone = Figure:Clone()
  402. local Torso = waitForChild(Figure, "Torso")
  403. local Joints = Torso:GetChildren()
  404. for All = 1, #Joints do
  405. if Joints.className == "Motor" or Joints.className == "Motor6D" then
  406. Joints[All]:Remove()
  407. end
  408. end
  409. local RightShoulder = Instance.new("Motor")
  410. local LeftShoulder = Instance.new("Motor")
  411. local RightHip = Instance.new("Motor")
  412. local LeftHip = Instance.new("Motor")
  413. local Neck = Instance.new("Motor")
  414. local Humanoid = waitForChild(Figure, "Humanoid")
  415. ZStat = 1
  416. ZStat2 = 0
  417. local pose = "Standing"
  418. RightShoulder.Part0 = Torso
  419. RightShoulder.Part1 = Figure["Right Arm"]
  420. RightShoulder.MaxVelocity = 0.15
  421. RightShoulder.Name = "Right Shoulder"
  422. RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  423. RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  424. RightShoulder.Parent = Torso
  425. LeftShoulder.Part0 = Torso
  426. LeftShoulder.Part1 = Figure["Left Arm"]
  427. LeftShoulder.MaxVelocity = 0.15
  428. LeftShoulder.Name = "Left Shoulder"
  429. LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  430. LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  431. LeftShoulder.Parent = Torso
  432. RightHip.Part0 = Torso
  433. RightHip.Part1 = Figure["Right Leg"]
  434. RightHip.MaxVelocity = 0.1
  435. RightHip.Name = "Right Hip"
  436. RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  437. RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  438. RightHip.Parent = Torso
  439. LeftHip.Part0 = Torso
  440. LeftHip.Part1 = Figure["Left Leg"]
  441. LeftHip.MaxVelocity = 0.1
  442. LeftHip.Name = "Left Hip"
  443. LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  444. LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  445. LeftHip.Parent = Torso
  446. Neck.Part0 = Torso
  447. Neck.Part1 = Figure["Head"]
  448. Neck.MaxVelocity = 0.1
  449. Neck.Name = "Neck"
  450. Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  451. Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  452. Neck.Parent = Torso
  453. local toolAnim = "None"
  454. local toolAnimTime = 0
  455. SpawnModel = Instance.new("Model")
  456. function onRunning(speed)
  457. if speed>0 then
  458. pose = "Running"
  459. else
  460. pose = "Standing"
  461. end
  462. end
  463. function CheckTag(Tag)
  464. if script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  465. if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then
  466. if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == Tag.Value.TeamColor) or script.Parent.IsOnTeam.Value == false then
  467. local Tag2 = Instance.new("CFrameValue", Tag.Value.Character)
  468. Tag2.Name = "IsLocalEnemy"
  469. print(Tag.Value.Character.Name .." Has Become An Outlaw")
  470. end
  471. end
  472. if Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  473. Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  474. end
  475. local Found = Instance.new("CFrameValue", Tag.Value.Character)
  476. Found.Name = "Loc" ..script.Parent.Name
  477. game:GetService("Debris"):AddItem(Found, 3)
  478. elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Players:FindFirstChild(Tag.Value) ~= nil and game.Players[Tag.Value].Character ~= nil then
  479. if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then
  480. if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or script.Parent.IsOnTeam.Value == false then
  481. local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  482. Tag2.Name = "IsLocalEnemy"
  483. print(Tag.Value .." Has Become An Outlaw")
  484. end
  485. end
  486. if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  487. game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  488. end
  489. local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  490. Found.Name = "Loc" ..script.Parent.Name
  491. game:GetService("Debris"):AddItem(Found, 3)
  492. elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
  493. if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then
  494. if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and Workspace[Tag.Value].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value == Workspace[Tag.Value].IsOnTeam.Team.Value) or script.Parent.IsOnTeam.Value == false or Workspace[Tag.Value].IsOnTeam.Value == false then
  495. local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  496. Tag2.Name = "IsLocalEnemy"
  497. print(Tag.Value .." Has Become An Outlaw")
  498. end
  499. end
  500. if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  501. game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  502. end
  503. local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  504. Found.Name = "Loc" ..script.Parent.Name
  505. game:GetService("Debris"):AddItem(Found, 3)
  506. elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  507. local Found = Instance.new("CFrameValue", Tag.Value.Character)
  508. Found.Name = "Loc" ..script.Parent.Name
  509. game:GetService("Debris"):AddItem(Found, 3)
  510. elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
  511. local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  512. Found.Name = "Loc" ..script.Parent.Name
  513. game:GetService("Debris"):AddItem(Found, 3)
  514. end
  515. end
  516. function CheckSpawns(Object)
  517. local Parts = Object:GetChildren()
  518. for Check = 1, #Parts do
  519. if Parts[Check].className == "SpawnLocation" then
  520. local I = Instance.new("Vector3Value", SpawnModel)
  521. I.Value = Parts[Check].Position
  522. end
  523. CheckSpawns(Parts[Check])
  524. end
  525. end
  526. function onDied()
  527. pose = "Dead"
  528. Delay(5, function()
  529. if script.Parent.Respawn.Value == true then
  530. CheckSpawns(Workspace)
  531. local Spawn = SpawnModel:GetChildren()
  532. Clone.Parent = game.Workspace
  533. if #Spawn > 0 then
  534. Spawn = Spawn[math.random(1, #Spawn)].Value
  535. Clone:MoveTo(Spawn)
  536. else
  537. Clone:MoveTo(Vector3.new(0, 50, 0))
  538. end
  539. end
  540. Figure:Remove()
  541. return
  542. end)
  543. end
  544. function onJumping()
  545. pose = "Jumping"
  546. end
  547. function onClimbing()
  548. pose = "Climbing"
  549. end
  550. function onGettingUp()
  551. pose = "GettingUp"
  552. end
  553. function onFreeFall()
  554. pose = "FreeFall"
  555. end
  556. function onFallingDown()
  557. pose = "FallingDown"
  558. end
  559. function onSeated()
  560. pose = "Seated"
  561. end
  562. function onPlatformStanding()
  563. pose = "PlatformStanding"
  564. end
  565. function moveJump()
  566. RightShoulder.MaxVelocity = 0.5
  567. LeftShoulder.MaxVelocity = 0.5
  568. RightShoulder.DesiredAngle = (3.14/ZStat)
  569. LeftShoulder.DesiredAngle = (-3.14/ZStat)
  570. RightHip.DesiredAngle = (0)
  571. LeftHip.DesiredAngle = (0)
  572. end
  573. function moveFreeFall()
  574. RightShoulder.MaxVelocity = 0.5
  575. LeftShoulder.MaxVelocity = 0.5
  576. RightShoulder.DesiredAngle = (3.14/ZStat)
  577. LeftShoulder.DesiredAngle = (-3.14/ZStat)
  578. RightHip.DesiredAngle = (0)
  579. LeftHip.DesiredAngle = (0)
  580. end
  581. function moveSit()
  582. RightShoulder.MaxVelocity = 0.15
  583. LeftShoulder.MaxVelocity = 0.15
  584. RightShoulder.DesiredAngle = (3.14 /2)
  585. LeftShoulder.DesiredAngle = (-3.14 /2)
  586. RightHip.DesiredAngle = (3.14 /2)
  587. LeftHip.DesiredAngle = (-3.14 /2)
  588. end
  589. function getTool()
  590. for _, kid in ipairs(Figure:GetChildren()) do
  591. if kid.className == "Tool" then return kid end
  592. end
  593. return nil
  594. end
  595. function getToolAnim(tool)
  596. for _, c in ipairs(tool:GetChildren()) do
  597. if c.Name == "toolanim" and c.className == "StringValue" then
  598. return c
  599. end
  600. end
  601. return nil
  602. end
  603. function animateTool()
  604. if (toolAnim == "None") then
  605. RightShoulder.DesiredAngle = (1.57)
  606. return
  607. end
  608. if (toolAnim == "Slash") then
  609. RightShoulder.MaxVelocity = 0.5
  610. RightShoulder.DesiredAngle = (0)
  611. return
  612. end
  613. if (toolAnim == "Lunge") then
  614. RightShoulder.MaxVelocity = 0.5
  615. LeftShoulder.MaxVelocity = 0.5
  616. RightHip.MaxVelocity = 0.5
  617. LeftHip.MaxVelocity = 0.5
  618. RightShoulder.DesiredAngle = (1.57)
  619. LeftShoulder.DesiredAngle = (1.0)
  620. RightHip.DesiredAngle = (1.57)
  621. LeftHip.DesiredAngle = (1.0)
  622. return
  623. end
  624. end
  625. function move(time)
  626. local amplitude
  627. local frequency
  628. if (pose == "Jumping") then
  629. moveJump()
  630. return
  631. end
  632. if (pose == "FreeFall") then
  633. moveFreeFall()
  634. return
  635. end
  636. if (pose == "Seated") then
  637. moveSit()
  638. return
  639. end
  640. local climbFudge = 0
  641. if (pose == "Running") then
  642. RightShoulder.MaxVelocity = 0.15
  643. LeftShoulder.MaxVelocity = 0.15
  644. amplitude = 1
  645. frequency = 9
  646. elseif (pose == "Climbing") then
  647. RightShoulder.MaxVelocity = 0.5
  648. LeftShoulder.MaxVelocity = 0.5
  649. amplitude = 1
  650. frequency = 9
  651. climbFudge = 3.14
  652. else
  653. amplitude = 0.1
  654. frequency = 1
  655. end
  656. desiredAngle = amplitude * math.sin(time*frequency)
  657. RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2
  658. LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2
  659. RightHip.DesiredAngle = (-desiredAngle)
  660. LeftHip.DesiredAngle = (-desiredAngle)
  661. local tool = getTool()
  662. if tool then
  663. animStringValueObject = getToolAnim(tool)
  664. if animStringValueObject then
  665. toolAnim = animStringValueObject.Value
  666. animStringValueObject.Parent = nil
  667. toolAnimTime = time + .3
  668. end
  669. if time > toolAnimTime then
  670. toolAnimTime = 0
  671. toolAnim = "None"
  672. end
  673. animateTool()
  674. else
  675. toolAnim = "None"
  676. toolAnimTime = 0
  677. end
  678. end
  679. Humanoid.Died:connect(onDied)
  680. Humanoid.Running:connect(onRunning)
  681. Humanoid.Jumping:connect(onJumping)
  682. Humanoid.Climbing:connect(onClimbing)
  683. Humanoid.GettingUp:connect(onGettingUp)
  684. Humanoid.FreeFalling:connect(onFreeFall)
  685. Humanoid.FallingDown:connect(onFallingDown)
  686. Humanoid.Seated:connect(onSeated)
  687. Humanoid.PlatformStanding:connect(onPlatformStanding)
  688. Humanoid.ChildAdded:connect(CheckTag)
  689. OriginalTime = 0.1
  690. Time = OriginalTime
  691. while Figure.Parent~=nil do
  692. Time = Time + 0.1
  693. wait(OriginalTime)
  694. move(Time)
  695. end
  696. end)
  697. Delay(0, function() --lah30303's Pathing Script
  698. function CalcMoves(map, px, py, tx, ty)
  699. if map[ty][tx] ~= 0 then
  700. return nil
  701. end
  702. local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {}
  703. openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1}
  704. local nodenumber = 0
  705. while listk > 0 do
  706. nodenumber = nodenumber + 1
  707. if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then
  708. wait()
  709. if DebugPathing == true then
  710. print("Node", nodenumber)
  711. end
  712. end
  713. closedk = closedk + 1
  714. table.insert(closedlist, closedk, openlist[1])
  715. curbase = closedlist[closedk]
  716. if closedlist[closedk].x == tx and closedlist[closedk].y == ty then
  717. return closedlist
  718. end
  719. openlist[1] = openlist[listk]
  720. table.remove(openlist, listk)
  721. listk = listk - 1
  722. local v = 1
  723. while true do
  724. local u = v
  725. if 2 * u + 1 <= listk then
  726. if openlist[u].f >= openlist[2 * u].f then
  727. v = 2 * u
  728. end
  729. if openlist[v].f >= openlist[2 * u + 1].f then
  730. v = 2 * u + 1
  731. end
  732. elseif 2 * u <= listk then
  733. if openlist[u].f >= openlist[2 * u].f then
  734. v = 2 * u
  735. end
  736. end
  737. if u ~= v then
  738. local temp = openlist[u]
  739. openlist[u] = openlist[v]
  740. openlist[v] = temp
  741. else
  742. break
  743. end
  744. end
  745.  
  746. local tocheck = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} --[1]Right, [2]Left, [3]Down, [4]Up, [5]UpLeft, [6]UpRight, [7]DownLeft, [8]DownRight
  747. if closedk > 0 then
  748. for k = 1, closedk do
  749. for i, v in pairs(tocheck) do
  750. if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then
  751. tocheck[i] = nil
  752. end
  753. end
  754. end
  755. end
  756. for i, v in pairs(tocheck) do
  757. local a = curbase.x + v[1]
  758. local b = curbase.y + v[2]
  759. if a > xsize or a < 1 or b > ysize or b < 1 then
  760. tocheck[i] = nil
  761. end
  762. end
  763. for i, v in pairs(tocheck) do
  764. local a, b = curbase.x + v[1], curbase.y + v[2]
  765. if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then
  766. tocheck[i] = nil
  767. end
  768. end
  769. tempG = curbase.g + 1
  770. tempDiagG = curbase.g + 1.4
  771. for k = 1, listk do
  772. for i, v in pairs(tocheck) do
  773. if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then
  774. tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty)
  775. table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk})
  776. local m = k
  777. while m ~= 1 do
  778. if openlist[m].f <= openlist[math.floor(m/2)].f then
  779. temp = openlist[math.floor(m/2)]
  780. openlist[math.floor(m/2)] = openlist[m]
  781. openlist[m] = temp
  782. m = math.floor(m/2)
  783. else
  784. break
  785. end
  786. tocheck[i] = nil
  787. end
  788. end
  789. end
  790. end
  791. for i, v in pairs(tocheck) do
  792. listk = listk + 1
  793. tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty)
  794. table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk})
  795. m = listk
  796. while m ~= 1 do
  797. if openlist[m].f <= openlist[math.floor(m/2)].f then
  798. temp = openlist[math.floor(m/2)]
  799. openlist[math.floor(m/2)] = openlist[m]
  800. openlist[m] = temp
  801. m = math.floor(m/2)
  802. else
  803. break
  804. end
  805. end
  806. end
  807. end
  808. return nil
  809. end
  810.  
  811.  
  812. function CalcPath(closedlist)
  813.  
  814. if closedlist == nil or table.getn(closedlist) == 1 then
  815. return nil
  816. end
  817. local path = {}
  818. local pathIndex = {}
  819. local last = table.getn(closedlist)
  820. table.insert(pathIndex,1,last)
  821.  
  822. local i = 1
  823. while pathIndex[i] > 1 do
  824. i = i + 1
  825. table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par)
  826. end
  827.  
  828. for n = table.getn(pathIndex) - 1, 1, -1 do
  829. table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y})
  830. end
  831.  
  832. closedlist = nil
  833. return path
  834. end
  835. end)
  836. Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator
  837. local Base
  838. if script.Parent:FindFirstChild("BASE") == nil then
  839. Base = Instance.new("Part")
  840. Base.Transparency = 1
  841. Base.TopSurface = "Smooth"
  842. Base.BottomSurface = "Smooth"
  843. Base.CanCollide = false
  844. Base.Anchored = true
  845. Base.Locked = true
  846. Base.BrickColor = BrickColor.new(0, 0, 0)
  847. Base.Name = "BASE"
  848. Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
  849. Base.Parent = script.Parent
  850. else
  851. Base = script.Parent.BASE
  852. Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
  853. end
  854. function Jump()
  855. script.Parent.Humanoid.Jump = true
  856. end
  857. function Check(Hit)
  858. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then
  859. if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  860. Jump()
  861. end
  862. end
  863. end
  864. script.Parent.Torso.Touched:connect(Check)
  865. function Prep(Target, Current, Attempts)
  866. if Attempts == nil then
  867. Attempts = 1000
  868. end
  869. local Hit = false
  870. local Tag = Base:Clone()
  871. Tag.Position = Target
  872. Tag.Parent = script.Parent
  873. local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40)
  874. local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, script.Parent)
  875. if TRHit ~= nil then
  876. Hit = true
  877. end
  878. if Tag.Parent ~= nil then
  879. Tag:Remove()
  880. end
  881. if Hit == false and Attempts > 0 and script.Parent.Wander.Value == true then
  882. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1)
  883. elseif script.Parent.Wander.Value == true then
  884. local TargetRay = Ray.new(script.Parent.Torso.CFrame.p, (CFrame.new(Target).p - script.Parent.Torso.CFrame.p).Unit * ((Target - script.Parent.Torso.Position).Magnitude - 3))
  885. local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, script.Parent)
  886. local TrueTarget = script.Parent.Torso.Position
  887. if THit ~= nil then
  888. for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - TPos).Magnitude) do
  889. local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (TPos - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3)
  890. local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
  891. if TH2 ~= nil and TH2.Name ~= "Lava" then
  892. TrueTarget = TP2
  893. else
  894. break
  895. end
  896. end
  897. else
  898. for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - Target).Magnitude) do
  899. local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (Target - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3)
  900. local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
  901. if TH2 ~= nil and TH2.Name ~= "Lava" then
  902. TrueTarget = TP2
  903. else
  904. break
  905. end
  906. end
  907. end
  908. script.Parent.Humanoid:MoveTo(TrueTarget, Current)
  909. end
  910. end
  911. function ZHit(Part)
  912. if script.Parent:FindFirstChild("IsAZombie") ~= nil and script.Parent.Humanoid.Health > 0 and Part ~= nil and Part.Parent ~= nil and Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent:FindFirstChild("IsAZombie") == nil then
  913. Part.Parent.Humanoid:TakeDamage(2)
  914. script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + 1
  915. script.Parent.Humanoid:TakeDamage(-1)
  916. end
  917. end
  918. script.Parent["Right Arm"].Touched:connect(ZHit)
  919. script.Parent["Left Arm"].Touched:connect(ZHit)
  920. CurrentMap = {}
  921. MapMask = {}
  922. MapVar = {0, 0, 0, 0, 0}
  923. BlockScanned = 0
  924. ScanSkip = 5
  925. DebugPathing = true
  926. function GenerateMap(PathPos)
  927. CurrentMap = {}
  928. MapMask = {}
  929. MapVar = {0, 0, 0, 0, 0}
  930. BlockScanned = 0
  931. MapVariables = ScanParts(Workspace, 1)
  932. for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do
  933. CurrentMap[MapX] = {}
  934. for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do
  935. CurrentMap[MapX][MapY] = 0
  936. end
  937. end
  938. for MaskX = 1, #CurrentMap do
  939. MapMask[MaskX] = {}
  940. for MaskY = 1, #CurrentMap[MaskX] do
  941. MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5}
  942. end
  943. end
  944. ScanParts(Workspace, 2, MapVariables)
  945. wait(1)
  946. if script.Parent.PrintMap.Value == true then
  947. print("Printing Map...")
  948. for ClearPrint = 1, 250 do
  949. wait()
  950. print()
  951. end
  952. for PrintX = 1, #CurrentMap do
  953. local PrintZ = ""
  954. for PrintY = 1, #CurrentMap[PrintX] do
  955. PrintZ = PrintZ ..CurrentMap[PrintX][PrintY]
  956. end
  957. print(PrintZ)
  958. wait(0.1)
  959. end
  960. end
  961. local MapCoords = {0, 0, 0, 0}
  962. local Distance = math.huge
  963. for MPX = 1, #CurrentMap do
  964. for MPY = 1, #CurrentMap[MPX] do
  965. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude < Distance then
  966. MapCoords = {MPX, MPY, 0, 0}
  967. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude
  968. end
  969. end
  970. end
  971. local Distance = math.huge
  972. for MPX = 1, #CurrentMap do
  973. for MPY = 1, #CurrentMap[MPX] do
  974. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude < Distance then
  975. MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)}
  976. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude
  977. end
  978. end
  979. end
  980. for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do
  981. local Timer = 20
  982. local pX = v["x"]
  983. local pY = v["y"]
  984. local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2])
  985. pTo = pTo + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit
  986. while (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do
  987. script.Parent.Humanoid:MoveTo(pTo, Base)
  988. Timer = Timer - 1
  989. if Timer == 10 then
  990. script.Parent.Humanoid.Jump = true
  991. end
  992. wait(0.1)
  993. end
  994. if Timer == 0 then
  995. if (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude <= 5 then
  996. script.Parent.Torso.CFrame = script.Parent.Torso.CFrame + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit * (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude
  997. else
  998. break
  999. end
  1000. end
  1001. end
  1002. end
  1003. function ScanParts(CurrentModel, CurrentStage, Variables)
  1004. local X = CurrentModel:GetChildren()
  1005. for I = 1, #X do
  1006. if #X[I]:GetChildren() > 0 then
  1007. ScanParts(X[I], 1, Variables)
  1008. end
  1009. if X[I].ClassName == "Part" or X[I].ClassName == "WedgePart" or X[I].ClassName == "CornerWedgePart" or X[I].ClassName == "TrussPart" or X[I].ClassName == "SpawnLocation" or X[I].ClassName == "Seat" or X[I].ClassName == "VehicleSeat" or X[I].ClassName == "SkateboardPlatform" then
  1010. BlockScanned = BlockScanned + 1
  1011. if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then
  1012. wait()
  1013. if DebugPathing == true then
  1014. print("Block", BlockScanned)
  1015. end
  1016. end
  1017. if CurrentStage == 1 then
  1018. MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1])
  1019. MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2])
  1020. MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3])
  1021. MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4])
  1022. elseif CurrentStage == 2 and ((X[I].Position.Y + X[I].Size.Y / 2 > script.Parent.Torso.Position.Y + 2 and X[I].Position.Y - X[I].Size.Y / 2 < script.Parent.Torso.Position.Y + 2) or X[I].Position.Y + X[I].Size.Y / 2 < script.Parent.Torso.Position.Y - 8) then
  1023. local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2}
  1024. local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2}
  1025. local BlockCoords = {0, 0, 0, 0}
  1026. local Distance = math.huge
  1027. for MPX = 1, #CurrentMap do
  1028. for MPY = 1, #CurrentMap[MPX] do
  1029. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then
  1030. BlockCoords = {MPX, MPY, 0, 0}
  1031. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude
  1032. end
  1033. end
  1034. end
  1035. local Distance = math.huge
  1036. for MPX = 1, #CurrentMap do
  1037. for MPY = 1, #CurrentMap[MPX] do
  1038. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then
  1039. BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY}
  1040. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude
  1041. end
  1042. end
  1043. end
  1044. for XGrid = BlockCoords[2], BlockCoords[4] do
  1045. for YGrid = BlockCoords[1], BlockCoords[3] do
  1046. CurrentMap[XGrid][YGrid] = 1
  1047. end
  1048. end
  1049. end
  1050. end
  1051. end
  1052. if CurrentStage == 1 then
  1053. MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2}
  1054. return MapVar
  1055. end
  1056. end
  1057. IsInCombat = false
  1058. while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") == nil do
  1059. local Distance = 100
  1060. local Target = nil
  1061. IsInCombat = false
  1062. local Players = Workspace:GetChildren()
  1063. for Check = 1, #Players do
  1064. if Players[Check] ~= script.Parent and ((Players[Check]:FindFirstChild("Humanoid") ~= nil and (Players[Check]:FindFirstChild("IsAZombie") ~= nil or Players[Check]:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or (script.Parent.IsOnTeam.Value == true and Players[Check]:FindFirstChild("IsOnTeam") ~= nil and Players[Check].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value ~= Players[Check].IsOnTeam.Team.Value) or (game.Players:GetPlayerFromCharacter(Players[Check]) ~= nil and script.Parent.IsOnTeam.Value == true and game.Players:GetPlayerFromCharacter(Players[Check]).Neutral == false and game.Players:GetPlayerFromCharacter(Players[Check]).TeamColor ~= script.Parent.IsOnTeam.Team.Value)) and Players[Check].Humanoid.Health > 0) or (Players[Check]:FindFirstChild("Zombie") ~= nil and Players[Check].Zombie.ClassName == "Humanoid" and Players[Check].Zombie.Health > 0)) and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then
  1065. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  1066. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  1067. if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then
  1068. local TeamTag = nil
  1069. local Parts = Players[Check]:GetChildren()
  1070. for X = 1, #Parts do
  1071. if Parts[X].Name == "TeamLoc" then
  1072. if Parts[X].Value == script.Parent.IsOnTeam.Team.Value then
  1073. TeamTag = Parts[X]
  1074. end
  1075. end
  1076. end
  1077. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil or Parts[X] ~= nil or (Players[Check].Torso.Position - (script.Parent.Torso.Position + script.Parent.Torso.CFrame.lookVector * 50)).Magnitude <= 52 then
  1078. if script.Parent.IsOnTeam.Value == false then
  1079. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  1080. Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  1081. end
  1082. local Found = Instance.new("CFrameValue", Players[Check])
  1083. Found.Name = "Loc" ..script.Parent.Name
  1084. game:GetService("Debris"):AddItem(Found, 3)
  1085. else
  1086. if Parts[X] ~= nil then
  1087. Parts[X]:Remove()
  1088. end
  1089. local Found = Instance.new("BrickColorValue", Players[Check])
  1090. Found.Name = "TeamLoc"
  1091. Found.Value = script.Parent.IsOnTeam.Team.Value
  1092. game:GetService("Debris"):AddItem(Found, 3)
  1093. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  1094. Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  1095. end
  1096. local Found = Instance.new("CFrameValue", Players[Check])
  1097. Found.Name = "Loc" ..script.Parent.Name
  1098. game:GetService("Debris"):AddItem(Found, 3)
  1099. end
  1100. end
  1101. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  1102. Target = Players[Check].Torso
  1103. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  1104. end
  1105. end
  1106. end
  1107. end
  1108. if Target == nil then
  1109. local HasTool = false
  1110. local ToolCheck = script.Parent:GetChildren()
  1111. for Check = 1, #ToolCheck do
  1112. if ToolCheck[Check].ClassName == "Tool" then
  1113. HasTool = true
  1114. end
  1115. end
  1116. if HasTool == false then
  1117. Distance = 100
  1118. for Check = 1, #Players do
  1119. if Players[Check].ClassName == "Tool" and Players[Check]:FindFirstChild("Handle") ~= nil and Players[Check]:FindFirstChild("Active") ~= nil and Players[Check]:FindFirstChild("TargetPos") ~= nil and Players[Check]:FindFirstChild("Type") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  1120. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  1121. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  1122. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
  1123. Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
  1124. Target = Players[Check]
  1125. end
  1126. end
  1127. end
  1128. if Target ~= nil and Target.ClassName == "Tool" then
  1129. if Distance <= 5 and HasTool == false then
  1130. Target.Parent = script.Parent
  1131. HasTool = true
  1132. else
  1133. Prep(Target.Handle.Position, Base)
  1134. end
  1135. else
  1136. for Check = 1, #Players do
  1137. if Players[Check].Name == "Crate" and Players[Check]:FindFirstChild("OpenCrate") ~= nil and Players[Check].OpenCrate.Value == false and (Players[Check].Position - script.Parent.Torso.Position).Magnitude <= Distance then
  1138. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  1139. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  1140. if Hit ~= nil and Hit == Players[Check] then
  1141. Target = Players[Check]
  1142. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  1143. end
  1144. end
  1145. end
  1146. if Target ~= nil then
  1147. script.Parent.Humanoid:MoveTo(Target.Position, Target)
  1148. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
  1149. Target.OpenCrate.Value = true
  1150. end
  1151. else
  1152. local HasHat = false
  1153. local HatCheck = script.Parent:GetChildren()
  1154. for Check = 1, #HatCheck do
  1155. if ToolCheck[Check].ClassName == "Hat" then
  1156. HasHat = true
  1157. end
  1158. end
  1159. if HasHat == false then
  1160. Distance = 100
  1161. for Check = 1, #Players do
  1162. if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  1163. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  1164. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  1165. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
  1166. Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
  1167. Target = Players[Check]
  1168. end
  1169. end
  1170. end
  1171. if Target ~= nil and Target.ClassName == "Hat" then
  1172. if Distance <= 5 and HasHat == false then
  1173. Target.Parent = script.Parent
  1174. HasHat = true
  1175. else
  1176. Prep(Target.Handle.Position, Base)
  1177. end
  1178. else
  1179. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  1180. if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
  1181. GenerateMap(script.Parent.PathTo.Value)
  1182. script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
  1183. elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  1184. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1185. end
  1186. else
  1187. Jump()
  1188. end
  1189. end
  1190. end
  1191. end
  1192. end
  1193. else
  1194. if Target == nil then
  1195. local Distance = 80
  1196. local Players = Workspace:GetChildren()
  1197. for Check = 1, #Players do
  1198. if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check] ~= script.Parent and Players[Check]:FindFirstChild("IsLocalEnemy") == nil and Players[Check]:FindFirstChild("Leader") ~= nil and Players[Check].Humanoid.Health > 0 and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  1199. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  1200. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  1201. if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then
  1202. Target = Players[Check].Torso
  1203. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  1204. end
  1205. end
  1206. end
  1207. if Target ~= nil then
  1208. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 10
  1209. Prep(Position, Base)
  1210. else
  1211. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  1212. if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
  1213. GenerateMap(script.Parent.PathTo.Value)
  1214. script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
  1215. elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  1216. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1217. end
  1218. else
  1219. Jump()
  1220. end
  1221. end
  1222. else
  1223. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  1224. if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
  1225. GenerateMap(script.Parent.PathTo.Value)
  1226. script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
  1227. elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  1228. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1229. end
  1230. else
  1231. Jump()
  1232. end
  1233. end
  1234. end
  1235. else
  1236. local Weapon = nil
  1237. local ToolCheck = script.Parent:GetChildren()
  1238. for Check = 1, #ToolCheck do
  1239. if ToolCheck[Check].ClassName == "Tool" then
  1240. Weapon = ToolCheck[Check]
  1241. end
  1242. end
  1243. if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  1244. if Weapon.Type.Value == "Melee" then
  1245. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1246. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
  1247. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1248. Weapon.Active.Value = true
  1249. end
  1250. elseif Weapon.Type.Value == "Melee/Ranged" then
  1251. if Distance <= 10 then
  1252. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1253. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1254. Weapon.Active.Value = true
  1255. else
  1256. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Base)
  1257. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 50 then
  1258. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1259. Weapon.Active.Value = true
  1260. end
  1261. end
  1262. elseif Weapon.Type.Value == "Melee/RangedMed" then
  1263. if Distance <= 10 then
  1264. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1265. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1266. Weapon.Active.Value = true
  1267. else
  1268. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
  1269. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 40 then
  1270. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1271. Weapon.Active.Value = true
  1272. end
  1273. end
  1274. elseif Weapon.Type.Value == "Melee/RangedClose" then
  1275. if Distance <= 10 then
  1276. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1277. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1278. Weapon.Active.Value = true
  1279. else
  1280. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Base)
  1281. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 30 then
  1282. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1283. Weapon.Active.Value = true
  1284. end
  1285. end
  1286. elseif Weapon.Type.Value == "Ranged" then
  1287. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
  1288. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1289. wait()
  1290. Weapon.Active.Value = true
  1291. elseif Weapon.Type.Value == "RangedMed" then
  1292. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 60, Base)
  1293. if Distance <= 70 then
  1294. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1295. wait()
  1296. Weapon.Active.Value = true
  1297. end
  1298. elseif Weapon.Type.Value == "RangedClose" then
  1299. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
  1300. if Distance <= 40 then
  1301. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1302. wait()
  1303. Weapon.Active.Value = true
  1304. end
  1305. elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then
  1306. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * (script.Parent.Torso.Position - Target.Position).Magnitude + Target.Velocity
  1307. script.Parent.Humanoid:MoveTo(Position, Base)
  1308. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1309. wait()
  1310. Weapon.Active.Value = true
  1311. elseif Weapon.Type.Value == "RangedTactical" then
  1312. if Distance <= 30 then
  1313. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 50
  1314. Prep(Position, Base)
  1315. elseif Distance >= 50 then
  1316. Prep(Target.Position, Target)
  1317. end
  1318. if Distance <= 50 and Distance >= 30 then
  1319. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso)
  1320. end
  1321. if Distance <= 60 then
  1322. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1323. wait()
  1324. Weapon.Active.Value = true
  1325. end
  1326. elseif Weapon.Type.Value == "Shuriken" then
  1327. if Distance <= 15 then
  1328. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20
  1329. Prep(Position, Base)
  1330. elseif Distance >= 30 then
  1331. Prep(Target.Position, Target)
  1332. end
  1333. if Distance <= 30 and Distance >= 15 then
  1334. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso)
  1335. end
  1336. if Distance <= 50 then
  1337. Weapon.TargetPos.Value = (Target.Position + Target.Velocity / 2) + Vector3.new(math.random(-2, 2), math.random(-2, 2) + ((Target.Position + Target.Velocity / 2) - script.Parent.Torso.Position).Magnitude / 8, math.random(-2, 2))
  1338. wait()
  1339. Weapon.Active.Value = true
  1340. end
  1341. elseif Weapon.Type.Value == "HealDrink" then
  1342. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
  1343. Prep(Position, Base)
  1344. if script.Parent.Humanoid.Health < script.Parent.Humanoid.MaxHealth then
  1345. Weapon.Active.Value = true
  1346. end
  1347. elseif Weapon.Type.Value == "GrenadeDirect" then
  1348. if Distance >= 80 and Distance <= 100 then
  1349. Prep(Target.Position, Target)
  1350. wait(0.5)
  1351. Weapon.Active.Value = true
  1352. wait(0.5)
  1353. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
  1354. Prep(Position, Base)
  1355. else
  1356. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
  1357. Prep(Position, Base)
  1358. end
  1359. elseif Weapon.Type.Value == "Bomb" then
  1360. if Distance > 10 then
  1361. Prep(Target.Position, Target)
  1362. elseif Distance <= 10 then
  1363. Weapon.Active.Value = true
  1364. wait(2)
  1365. while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do
  1366. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
  1367. wait(0.5)
  1368. end
  1369. end
  1370. elseif Weapon.Type.Value == "Backstab" then
  1371. if Distance >= 10 then
  1372. if (script.Parent.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then
  1373. Prep(Target.Position, Target)
  1374. else
  1375. if (script.Parent.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then
  1376. Prep(Target.Position, Base)
  1377. local backstab_time = 20
  1378. while backstab_time > 1 and (script.Parent.Torso.Position - Target.Position).Magnitude >= 4 do
  1379. wait(0.1)
  1380. backstab_time = backstab_time - 1
  1381. end
  1382. if (script.Parent.Torso.Position - Target.Position).Magnitude < 4 then
  1383. Weapon.Active.Value = true
  1384. end
  1385. else
  1386. Prep(Target.Position - Target.CFrame.lookVector * 15, Base)
  1387. end
  1388. end
  1389. else
  1390. Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
  1391. if Distance <= 5 then
  1392. Weapon.Active.Value = true
  1393. end
  1394. end
  1395. elseif Weapon.Type.Value == "Crossbow" then
  1396. if Distance > 80 then
  1397. Prep(Target.Position, Target)
  1398. elseif Distance < 40 then
  1399. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100, Base)
  1400. elseif Distance <= 80 and Distance >= 40 then
  1401. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * ((script.Parent.Torso.Position - Target.Position).Magnitude - 5), Base)
  1402. wait(0.2)
  1403. Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1404. Weapon.Active.Value = true
  1405. end
  1406. end
  1407. IsInCombat = true
  1408. elseif Distance <= 100 then
  1409. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
  1410. Prep(Position, Base)
  1411. end
  1412. end
  1413. if IsInCombat == true then
  1414. wait(0.2)
  1415. else
  1416. wait(0.6)
  1417. end
  1418. end
  1419. local Weapon = nil
  1420. local ToolCheck = script.Parent:GetChildren()
  1421. for Check = 1, #ToolCheck do
  1422. if ToolCheck[Check].ClassName == "Tool" then
  1423. Weapon = ToolCheck[Check]
  1424. end
  1425. end
  1426. if Weapon ~= nil and script.Parent.DropWeapon.Value == true then
  1427. Weapon.Parent = Workspace
  1428. elseif Weapon ~= nil then
  1429. Weapon:Remove()
  1430. end
  1431. if script.Parent:FindFirstChild("IsAZombie") ~= nil then
  1432. script.Parent.Name = "New Zombie"
  1433. script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100)))
  1434. wait()
  1435. script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
  1436. script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100
  1437. ZStat = 2
  1438. ZStat2 = 1.57
  1439. Delay(1, function()
  1440. while script.Parent:FindFirstChild("Humanoid") ~= nil and script.Parent.Humanoid.Health > 0 do
  1441. script.Parent.Humanoid.MaxHealth = math.max(0, script.Parent.Humanoid.MaxHealth - 1)
  1442. script.Parent.Humanoid.Health = math.min(script.Parent.Humanoid.Health, script.Parent.Humanoid.MaxHealth)
  1443. wait(1)
  1444. end
  1445. end)
  1446. while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") ~= nil do
  1447. local Distance = 100
  1448. local Target = nil
  1449. local Players = Workspace:GetChildren()
  1450. for Check = 1, #Players do
  1451. if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check]:FindFirstChild("Torso") ~= nil and Players[Check]:FindFirstChild("IsAZombie") == nil and Players[Check].Humanoid.Health > 0 and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then
  1452. local ZRay = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  1453. local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, script.Parent)
  1454. if Players[Check]:FindFirstChild("ZFound") ~= nil or (ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check])) then
  1455. if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then
  1456. if Players[Check]:FindFirstChild("ZFound") ~= nil then
  1457. Players[Check].ZFound:Remove()
  1458. end
  1459. local ZTag = Instance.new("CFrameValue", Players[Check])
  1460. ZTag.Name = "ZFound"
  1461. game:GetService("Debris"):AddItem(ZTag, 5)
  1462. end
  1463. if (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  1464. Target = Players[Check].Torso
  1465. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  1466. end
  1467. end
  1468. end
  1469. end
  1470. if Target == nil then
  1471. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  1472. if math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  1473. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1474. end
  1475. else
  1476. Jump()
  1477. end
  1478. elseif script.Parent.Wander.Value == true then
  1479. script.Parent.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
  1480. end
  1481. wait(0.8)
  1482. end
  1483. end
  1484. end)
  1485. Delay(0, function() --Random Tool Usage Script
  1486. while true do
  1487. wait(math.random(40, 70 + math.random(30, 120)) / 10)
  1488. local Weapon = nil
  1489. local ToolCheck = script.Parent:GetChildren()
  1490. for Check = 1, #ToolCheck do
  1491. if ToolCheck[Check].ClassName == "Tool" then
  1492. Weapon = ToolCheck[Check]
  1493. end
  1494. end
  1495. if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  1496. if Weapon.Type.Value == "HealDrink" then
  1497. Weapon.Active.Value = true
  1498. end
  1499. end
  1500. end
  1501. end)
  1502. Delay(1, function() --Player Customization Script
  1503. if script.Parent["Custom_Name"].Value == "" then
  1504. script.Parent.Name = "Player" ..math.random(1, 999)
  1505. else
  1506. script.Parent.Name = script.Parent["Custom_Name"].Value
  1507. end
  1508. BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226}
  1509. SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200}
  1510. PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030}
  1511. BColor = BrickColor.new(BColors[math.random(1, #BColors)])
  1512. SColor = BrickColor.new(SColors[math.random(1, #SColors)])
  1513. PColor = BrickColor.new(PColors[math.random(1, #PColors)])
  1514. if script.Parent.IsOnTeam.Value == true then
  1515. SColor = script.Parent.IsOnTeam.Team.Value
  1516. PColor = SColor
  1517. if script.Parent.IsOnTeam.ShowTag.Value == true then
  1518. script.Parent.Name = script.Parent.Name .." [" ..script.Parent.IsOnTeam.Team.Value.Name .."]"
  1519. end
  1520. end
  1521. if script.Parent["Body Colors"].ForceColors.Value ~= true then
  1522. script.Parent["Body Colors"].HeadColor = BColor
  1523. script.Parent["Body Colors"].LeftArmColor = BColor
  1524. script.Parent["Body Colors"].LeftLegColor = PColor
  1525. script.Parent["Body Colors"].RightArmColor = BColor
  1526. script.Parent["Body Colors"].RightLegColor = PColor
  1527. script.Parent["Body Colors"].TorsoColor = SColor
  1528. end
  1529. script.Parent.Head.BrickColor = script.Parent["Body Colors"].HeadColor
  1530. script.Parent["Left Arm"].BrickColor = script.Parent["Body Colors"].LeftArmColor
  1531. script.Parent["Left Leg"].BrickColor = script.Parent["Body Colors"].LeftLegColor
  1532. script.Parent["Right Arm"].BrickColor = script.Parent["Body Colors"].RightArmColor
  1533. script.Parent["Right Leg"].BrickColor = script.Parent["Body Colors"].RightLegColor
  1534. script.Parent.Torso.BrickColor = script.Parent["Body Colors"].TorsoColor
  1535. if script.Parent["Force_Weapon"].Value ~= 0 then
  1536. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Weapon"].Value)
  1537. local c = x:GetChildren()
  1538. for i = 1, #c do
  1539. if c[i].ClassName == "Tool" and c[i]:FindFirstChild("AIProgram") ~= nil and c[i]:FindFirstChild("Active") ~= nil and c[i]:FindFirstChild("TargetPos") ~= nil and c[i]:FindFirstChild("Type") ~= nil and c[i]:FindFirstChild("Handle") ~= nil then
  1540. c[i].Parent = script.Parent
  1541. script.Parent.DropWeapon.Value = false
  1542. end
  1543. end
  1544. end
  1545. if script.Parent["Force_Hat"].Value ~= 0 then
  1546. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Hat"].Value)
  1547. local c = x:GetChildren()
  1548. for i = 1, #c do
  1549. if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then
  1550. c[i].Parent = script.Parent
  1551. end
  1552. end
  1553. end
  1554. if script.Parent["Force_Shirt"].Value ~= 0 then
  1555. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Shirt"].Value)
  1556. local c = x:GetChildren()
  1557. for i = 1, #c do
  1558. if c[i].ClassName == "Shirt" then
  1559. c[i].Parent = script.Parent
  1560. end
  1561. end
  1562. end
  1563. if script.Parent["Force_Pants"].Value ~= 0 then
  1564. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Pants"].Value)
  1565. local c = x:GetChildren()
  1566. for i = 1, #c do
  1567. if c[i].ClassName == "Pants" then
  1568. c[i].Parent = script.Parent
  1569. end
  1570. end
  1571. end
  1572. end)
  1573. wait()
  1574. print("Player Bot Loaded")
  1575. end))
  1576. Model0.Name=targetPart.Parent.Name
  1577. Model0.Torso.Touched:connect(function(h)
  1578. if h.Parent.Name==Model0.Name then
  1579. h.Parent:BreakJoints()
  1580. Model0:remove()
  1581. end
  1582. end)
  1583. Model0.Torso.Position=Character.Torso.Position
  1584. for i,v in pairs(mas:GetChildren()) do
  1585. v.Parent = game:GetService("Players").LocalPlayer.Character
  1586. pcall(function() v:MakeJoints() end)
  1587. end
  1588. mas:Destroy()
  1589. for i,v in pairs(cors) do
  1590. spawn(function()
  1591. pcall(v)
  1592. end)
  1593. end
  1594. end
  1595.  
  1596. function yclone()
  1597.  
  1598. --Converted with ttyyuu12345's model to script plugin v4
  1599. function sandbox(var,func)
  1600. local env = getfenv(func)
  1601. local newenv = setmetatable({},{
  1602. __index = function(self,k)
  1603. if k=="script" then
  1604. return var
  1605. else
  1606. return env[k]
  1607. end
  1608. end,
  1609. })
  1610. setfenv(func,newenv)
  1611. return func
  1612. end
  1613. cors = {}
  1614. mas = Instance.new("Model",game:GetService("Lighting"))
  1615. Model0 = Instance.new("Model")
  1616. Model0.Name =Player.Name .."'s clone"
  1617. Part1 = Instance.new("Part")
  1618. SpecialMesh2 = Instance.new("SpecialMesh")
  1619. Decal3 = Instance.new("Decal")
  1620. Part4 = Instance.new("Part")
  1621. Decal5 = Instance.new("Decal")
  1622. Motor6 = Instance.new("Motor")
  1623. Motor7 = Instance.new("Motor")
  1624. Motor8 = Instance.new("Motor")
  1625. Motor9 = Instance.new("Motor")
  1626. Motor10 = Instance.new("Motor")
  1627. Part11 = Instance.new("Part")
  1628. Part12 = Instance.new("Part")
  1629. Part13 = Instance.new("Part")
  1630. Part14 = Instance.new("Part")
  1631. Humanoid15 = Instance.new("Humanoid")
  1632. BodyColors16 = Instance.new("BodyColors")
  1633. Script17 = Instance.new("Script")
  1634. Model0.Name = "Clone"
  1635. Model0.Parent = mas
  1636. Model0.PrimaryPart = Part1
  1637. Part1.Name = "Head"
  1638. Part1.Parent = Model0
  1639. Part1.BrickColor = BrickColor.new("Bright yellow")
  1640. Part1.FormFactor = Enum.FormFactor.Symmetric
  1641. Part1.Size = Vector3.new(2, 1, 1)
  1642. Part1.CFrame = CFrame.new(6.34995413, 4.50001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1643. Part1.TopSurface = Enum.SurfaceType.Smooth
  1644. Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
  1645. Part1.Position = Vector3.new(6.34995413, 4.50001717, 23.1599998)
  1646. Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
  1647. SpecialMesh2.Parent = Part1
  1648. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  1649. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  1650. Decal3.Name = "face"
  1651. Decal3.Parent = Part1
  1652. Decal3.Texture = "rbxasset://textures/face.png"
  1653. Part4.Name = "Torso"
  1654. Part4.Parent = Model0
  1655. Part4.BrickColor = BrickColor.new("Bright blue")
  1656. Part4.FormFactor = Enum.FormFactor.Symmetric
  1657. Part4.Size = Vector3.new(2, 2, 1)
  1658. Part4.CFrame = CFrame.new(6.34995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1659. Part4.LeftSurface = Enum.SurfaceType.Weld
  1660. Part4.RightSurface = Enum.SurfaceType.Weld
  1661. Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  1662. Part4.Position = Vector3.new(6.34995413, 3.00001717, 23.1599998)
  1663. Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  1664. Decal5.Name = "roblox"
  1665. Decal5.Parent = Part4
  1666. Motor6.Name = "Right Shoulder"
  1667. Motor6.Parent = Part4
  1668. Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1669. Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1670. Motor6.Part0 = Part4
  1671. Motor6.Part1 = Part12
  1672. Motor6.MaxVelocity = 0.15000000596046
  1673. Motor7.Name = "Left Shoulder"
  1674. Motor7.Parent = Part4
  1675. Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1676. Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1677. Motor7.Part0 = Part4
  1678. Motor7.Part1 = Part11
  1679. Motor7.MaxVelocity = 0.15000000596046
  1680. Motor8.Name = "Right Hip"
  1681. Motor8.Parent = Part4
  1682. Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1683. Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1684. Motor8.Part0 = Part4
  1685. Motor8.Part1 = Part14
  1686. Motor8.MaxVelocity = 0.10000000149012
  1687. Motor9.Name = "Left Hip"
  1688. Motor9.Parent = Part4
  1689. Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1690. Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1691. Motor9.Part0 = Part4
  1692. Motor9.Part1 = Part13
  1693. Motor9.MaxVelocity = 0.10000000149012
  1694. Motor10.Name = "Neck"
  1695. Motor10.Parent = Part4
  1696. Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1697. Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1698. Motor10.Part0 = Part4
  1699. Motor10.Part1 = Part1
  1700. Motor10.MaxVelocity = 0.10000000149012
  1701. Part11.Name = "Left Arm"
  1702. Part11.Parent = Model0
  1703. Part11.BrickColor = BrickColor.new("Bright yellow")
  1704. Part11.CanCollide = false
  1705. Part11.FormFactor = Enum.FormFactor.Symmetric
  1706. Part11.Size = Vector3.new(1, 2, 1)
  1707. Part11.CFrame = CFrame.new(4.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1708. Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
  1709. Part11.Position = Vector3.new(4.84995413, 3.00001717, 23.1599998)
  1710. Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
  1711. Part12.Name = "Right Arm"
  1712. Part12.Parent = Model0
  1713. Part12.BrickColor = BrickColor.new("Bright yellow")
  1714. Part12.CanCollide = false
  1715. Part12.FormFactor = Enum.FormFactor.Symmetric
  1716. Part12.Size = Vector3.new(1, 2, 1)
  1717. Part12.CFrame = CFrame.new(7.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1718. Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
  1719. Part12.Position = Vector3.new(7.84995413, 3.00001717, 23.1599998)
  1720. Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
  1721. Part13.Name = "Left Leg"
  1722. Part13.Parent = Model0
  1723. Part13.BrickColor = BrickColor.new("Br. yellowish green")
  1724. Part13.CanCollide = false
  1725. Part13.FormFactor = Enum.FormFactor.Symmetric
  1726. Part13.Size = Vector3.new(1, 2, 1)
  1727. Part13.CFrame = CFrame.new(5.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1728. Part13.BottomSurface = Enum.SurfaceType.Smooth
  1729. Part13.TopSurface = Enum.SurfaceType.Inlet
  1730. Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
  1731. Part13.Position = Vector3.new(5.84995413, 1.00001717, 23.1599998)
  1732. Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
  1733. Part14.Name = "Right Leg"
  1734. Part14.Parent = Model0
  1735. Part14.BrickColor = BrickColor.new("Br. yellowish green")
  1736. Part14.CanCollide = false
  1737. Part14.FormFactor = Enum.FormFactor.Symmetric
  1738. Part14.Size = Vector3.new(1, 2, 1)
  1739. Part14.CFrame = CFrame.new(6.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1740. Part14.BottomSurface = Enum.SurfaceType.Smooth
  1741. Part14.TopSurface = Enum.SurfaceType.Inlet
  1742. Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
  1743. Part14.Position = Vector3.new(6.84995413, 1.00001717, 23.1599998)
  1744. Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
  1745. Humanoid15.Parent = Model0
  1746. Humanoid15.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  1747. Humanoid15.RightLeg = Part14
  1748. Humanoid15.LeftLeg = Part13
  1749. Humanoid15.Torso = Part4
  1750. BodyColors16.Parent = Model0
  1751. BodyColors16.HeadColor = BrickColor.new("Bright yellow")
  1752. BodyColors16.LeftArmColor = BrickColor.new("Bright yellow")
  1753. BodyColors16.LeftLegColor = BrickColor.new("Br. yellowish green")
  1754. BodyColors16.RightArmColor = BrickColor.new("Bright yellow")
  1755. BodyColors16.RightLegColor = BrickColor.new("Br. yellowish green")
  1756. BodyColors16.TorsoColor = BrickColor.new("Bright blue")
  1757. Script17.Name = "Full Animation"
  1758. Script17.Parent = Model0
  1759. table.insert(cors,sandbox(Script17,function()
  1760. --[[Made by Jammer622 @[http://www.roblox.com/Advanced-Player-AI-item?id=59391730],
  1761. This is the ORIGINAL model, if you see others, they are stolen.
  1762. Scripts mixed from vanilla Animate, Health, and Sound,
  1763. with much custom content by myself, making them great AIs.
  1764. No help from Miked's scripts, I made my own joint script.
  1765. If you find any glitches, bugs, or just want to suggest an idea, please message me.
  1766. My team works hard on these AIs, please don't make attempts to steal them.
  1767. Your feedback is extremely appreciated!
  1768.  
  1769. _---=CREDITS=---_
  1770. The Roblox Team Without them, none of this would be possible.
  1771. Vanilla Sound
  1772. Vanilla Health
  1773. Vanilla Animate
  1774. Jammer622 That's me, main programmer and weapon publisher.
  1775. Main Developer
  1776. Health GUI Script
  1777. Animation Work
  1778. Relationship Work
  1779. Wandering
  1780. Pathing (Map Generation)
  1781. Weapon Usage
  1782. Weapon (Re)Publishing
  1783. Sonypony458
  1784. McDonalds Drink
  1785. Customization
  1786. Teamwork AI
  1787. Model Variables
  1788. Setting Wiki [Below]
  1789. Macdeath I owe it to him for keeping me on track during this.
  1790. Feature Inspiration
  1791. Problem Solving
  1792. Suggestions
  1793. lah30303 Amazing pathing work goes to this fine sir.
  1794. Pathing (Pathing Generation/System)
  1795.  
  1796. _---=SETTINGS=---_
  1797. Inside this model's file, you'll find several values that can be changed.
  1798. DropWeapon -This sets whether or not the bot will drop any equipped weapon upon dying.
  1799. Force_Pants -This must be set through Spawners.
  1800. Force_Shirt -This must be set through Spawners.
  1801. Force_Weapon -This must be set through Spawners.
  1802. Force_Hat -This must be set through Spawners.
  1803. IgnoreCombatFF -This sets whether or not the bot will allow friendly fire during combat.
  1804. IsAPlayer -This is a tag to specify this bot's existance to other AIs.
  1805. IsOnTeam -This sets whether or not the bot is on a team.
  1806. ShowTag -This sets whether or not the bot's team color name shows up beside its own.
  1807. Team -This sets the bot's team color.
  1808. PathTo -This is an experimental pathfinding engine. Use at your own risk!
  1809. PrintMap -This prints maps generated when using PathTo. Use at your own risk!
  1810. Respawn -This sets whether the bot will respawn or not upon death.
  1811. Custom_Name -This must be set through Spawners.
  1812. Wander -This sets whether the bot is stationary or if it moves, but not if it uses weapons or not.
  1813. ]]
  1814. print("Player Bot Loading")
  1815. Delay(0, function() --Vanilla Sound
  1816. function waitForChild(parent, childName)
  1817. local child = parent:findFirstChild(childName)
  1818. if child then return child end
  1819. while true do
  1820. child = parent.ChildAdded:wait()
  1821. if child.Name==childName then return child end
  1822. end
  1823. end
  1824. function newSound(id)
  1825. local sound = Instance.new("Sound")
  1826. sound.SoundId = id
  1827. sound.archivable = false
  1828. sound.Parent = script.Parent.Head
  1829. return sound
  1830. end
  1831. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  1832. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  1833. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  1834. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  1835. local sJumping = newSound("rbxasset://sounds/button.wav")
  1836. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  1837. sRunning.Looped = true
  1838. local Figure = script.Parent
  1839. local Head = waitForChild(Figure, "Head")
  1840. local Humanoid = waitForChild(Figure, "Humanoid")
  1841. function onDied()
  1842. sDied:Play()
  1843. end
  1844. function onState(state, sound)
  1845. if state then
  1846. sound:Play()
  1847. else
  1848. sound:Pause()
  1849. end
  1850. end
  1851. function onRunning(speed)
  1852. if speed>0 then
  1853. sRunning:Play()
  1854. else
  1855. sRunning:Pause()
  1856. end
  1857. end
  1858.  
  1859. Humanoid.Died:connect(onDied)
  1860. Humanoid.Running:connect(onRunning)
  1861. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  1862. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  1863. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  1864. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  1865. end)
  1866. Delay(0, function() --Vanilla Health
  1867. function waitForChild(parent, childName)
  1868. local child = parent:findFirstChild(childName)
  1869. if child then return child end
  1870. while true do
  1871. child = parent.ChildAdded:wait()
  1872. if child.Name==childName then return child end
  1873. end
  1874. end
  1875. local Figure = script.Parent
  1876. local Humanoid = waitForChild(Figure, "Humanoid")
  1877. local regening = false
  1878. function regenHealth()
  1879. if regening then return end
  1880. regening = true
  1881. while Humanoid.Health < Humanoid.MaxHealth do
  1882. local s = wait(1)
  1883. local health = Humanoid.Health
  1884. if health > 0 and health < Humanoid.MaxHealth then
  1885. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  1886. health = health + newHealthDelta
  1887. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  1888. end
  1889. end
  1890. if Humanoid.Health > Humanoid.MaxHealth then
  1891. Humanoid.Health = Humanoid.MaxHealth
  1892. end
  1893. regening = false
  1894. end
  1895. Humanoid.HealthChanged:connect(regenHealth)
  1896. end)
  1897. Delay(0, function() --Vanilla Animate, Multiple Additions
  1898. function waitForChild(parent, childName)
  1899. local child = parent:findFirstChild(childName)
  1900. if child then return child end
  1901. while true do
  1902. child = parent.ChildAdded:wait()
  1903. if child.Name==childName then return child end
  1904. end
  1905. end
  1906. local Figure = script.Parent
  1907. local Clone = Figure:Clone()
  1908. local Torso = waitForChild(Figure, "Torso")
  1909. local Joints = Torso:GetChildren()
  1910. for All = 1, #Joints do
  1911. if Joints.className == "Motor" or Joints.className == "Motor6D" then
  1912. Joints[All]:Remove()
  1913. end
  1914. end
  1915. local RightShoulder = Instance.new("Motor")
  1916. local LeftShoulder = Instance.new("Motor")
  1917. local RightHip = Instance.new("Motor")
  1918. local LeftHip = Instance.new("Motor")
  1919. local Neck = Instance.new("Motor")
  1920. local Humanoid = waitForChild(Figure, "Humanoid")
  1921. ZStat = 1
  1922. ZStat2 = 0
  1923. local pose = "Standing"
  1924. RightShoulder.Part0 = Torso
  1925. RightShoulder.Part1 = Figure["Right Arm"]
  1926. RightShoulder.MaxVelocity = 0.15
  1927. RightShoulder.Name = "Right Shoulder"
  1928. RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1929. RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1930. RightShoulder.Parent = Torso
  1931. LeftShoulder.Part0 = Torso
  1932. LeftShoulder.Part1 = Figure["Left Arm"]
  1933. LeftShoulder.MaxVelocity = 0.15
  1934. LeftShoulder.Name = "Left Shoulder"
  1935. LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1936. LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1937. LeftShoulder.Parent = Torso
  1938. RightHip.Part0 = Torso
  1939. RightHip.Part1 = Figure["Right Leg"]
  1940. RightHip.MaxVelocity = 0.1
  1941. RightHip.Name = "Right Hip"
  1942. RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1943. RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1944. RightHip.Parent = Torso
  1945. LeftHip.Part0 = Torso
  1946. LeftHip.Part1 = Figure["Left Leg"]
  1947. LeftHip.MaxVelocity = 0.1
  1948. LeftHip.Name = "Left Hip"
  1949. LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1950. LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1951. LeftHip.Parent = Torso
  1952. Neck.Part0 = Torso
  1953. Neck.Part1 = Figure["Head"]
  1954. Neck.MaxVelocity = 0.1
  1955. Neck.Name = "Neck"
  1956. Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  1957. Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  1958. Neck.Parent = Torso
  1959. local toolAnim = "None"
  1960. local toolAnimTime = 0
  1961. SpawnModel = Instance.new("Model")
  1962. function onRunning(speed)
  1963. if speed>0 then
  1964. pose = "Running"
  1965. else
  1966. pose = "Standing"
  1967. end
  1968. end
  1969. function CheckTag(Tag)
  1970. if script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  1971. if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then
  1972. if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == Tag.Value.TeamColor) or script.Parent.IsOnTeam.Value == false then
  1973. local Tag2 = Instance.new("CFrameValue", Tag.Value.Character)
  1974. Tag2.Name = "IsLocalEnemy"
  1975. print(Tag.Value.Character.Name .." Has Become An Outlaw")
  1976. end
  1977. end
  1978. if Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  1979. Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  1980. end
  1981. local Found = Instance.new("CFrameValue", Tag.Value.Character)
  1982. Found.Name = "Loc" ..script.Parent.Name
  1983. game:GetService("Debris"):AddItem(Found, 3)
  1984. elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Players:FindFirstChild(Tag.Value) ~= nil and game.Players[Tag.Value].Character ~= nil then
  1985. if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then
  1986. if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or script.Parent.IsOnTeam.Value == false then
  1987. local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  1988. Tag2.Name = "IsLocalEnemy"
  1989. print(Tag.Value .." Has Become An Outlaw")
  1990. end
  1991. end
  1992. if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  1993. game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  1994. end
  1995. local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  1996. Found.Name = "Loc" ..script.Parent.Name
  1997. game:GetService("Debris"):AddItem(Found, 3)
  1998. elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
  1999. if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then
  2000. if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and Workspace[Tag.Value].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value == Workspace[Tag.Value].IsOnTeam.Team.Value) or script.Parent.IsOnTeam.Value == false or Workspace[Tag.Value].IsOnTeam.Value == false then
  2001. local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  2002. Tag2.Name = "IsLocalEnemy"
  2003. print(Tag.Value .." Has Become An Outlaw")
  2004. end
  2005. end
  2006. if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  2007. game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  2008. end
  2009. local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  2010. Found.Name = "Loc" ..script.Parent.Name
  2011. game:GetService("Debris"):AddItem(Found, 3)
  2012. elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  2013. local Found = Instance.new("CFrameValue", Tag.Value.Character)
  2014. Found.Name = "Loc" ..script.Parent.Name
  2015. game:GetService("Debris"):AddItem(Found, 3)
  2016. elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
  2017. local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  2018. Found.Name = "Loc" ..script.Parent.Name
  2019. game:GetService("Debris"):AddItem(Found, 3)
  2020. end
  2021. end
  2022. function CheckSpawns(Object)
  2023. local Parts = Object:GetChildren()
  2024. for Check = 1, #Parts do
  2025. if Parts[Check].className == "SpawnLocation" then
  2026. local I = Instance.new("Vector3Value", SpawnModel)
  2027. I.Value = Parts[Check].Position
  2028. end
  2029. CheckSpawns(Parts[Check])
  2030. end
  2031. end
  2032. function onDied()
  2033. pose = "Dead"
  2034. Delay(5, function()
  2035. if script.Parent.Respawn.Value == true then
  2036. CheckSpawns(Workspace)
  2037. local Spawn = SpawnModel:GetChildren()
  2038. Clone.Parent = game.Workspace
  2039. if #Spawn > 0 then
  2040. Spawn = Spawn[math.random(1, #Spawn)].Value
  2041. Clone:MoveTo(Spawn)
  2042. else
  2043. Clone:MoveTo(Vector3.new(0, 50, 0))
  2044. end
  2045. end
  2046. Figure:Remove()
  2047. return
  2048. end)
  2049. end
  2050. function onJumping()
  2051. pose = "Jumping"
  2052. end
  2053. function onClimbing()
  2054. pose = "Climbing"
  2055. end
  2056. function onGettingUp()
  2057. pose = "GettingUp"
  2058. end
  2059. function onFreeFall()
  2060. pose = "FreeFall"
  2061. end
  2062. function onFallingDown()
  2063. pose = "FallingDown"
  2064. end
  2065. function onSeated()
  2066. pose = "Seated"
  2067. end
  2068. function onPlatformStanding()
  2069. pose = "PlatformStanding"
  2070. end
  2071. function moveJump()
  2072. RightShoulder.MaxVelocity = 0.5
  2073. LeftShoulder.MaxVelocity = 0.5
  2074. RightShoulder.DesiredAngle = (3.14/ZStat)
  2075. LeftShoulder.DesiredAngle = (-3.14/ZStat)
  2076. RightHip.DesiredAngle = (0)
  2077. LeftHip.DesiredAngle = (0)
  2078. end
  2079. function moveFreeFall()
  2080. RightShoulder.MaxVelocity = 0.5
  2081. LeftShoulder.MaxVelocity = 0.5
  2082. RightShoulder.DesiredAngle = (3.14/ZStat)
  2083. LeftShoulder.DesiredAngle = (-3.14/ZStat)
  2084. RightHip.DesiredAngle = (0)
  2085. LeftHip.DesiredAngle = (0)
  2086. end
  2087. function moveSit()
  2088. RightShoulder.MaxVelocity = 0.15
  2089. LeftShoulder.MaxVelocity = 0.15
  2090. RightShoulder.DesiredAngle = (3.14 /2)
  2091. LeftShoulder.DesiredAngle = (-3.14 /2)
  2092. RightHip.DesiredAngle = (3.14 /2)
  2093. LeftHip.DesiredAngle = (-3.14 /2)
  2094. end
  2095. function getTool()
  2096. for _, kid in ipairs(Figure:GetChildren()) do
  2097. if kid.className == "Tool" then return kid end
  2098. end
  2099. return nil
  2100. end
  2101. function getToolAnim(tool)
  2102. for _, c in ipairs(tool:GetChildren()) do
  2103. if c.Name == "toolanim" and c.className == "StringValue" then
  2104. return c
  2105. end
  2106. end
  2107. return nil
  2108. end
  2109. function animateTool()
  2110. if (toolAnim == "None") then
  2111. RightShoulder.DesiredAngle = (1.57)
  2112. return
  2113. end
  2114. if (toolAnim == "Slash") then
  2115. RightShoulder.MaxVelocity = 0.5
  2116. RightShoulder.DesiredAngle = (0)
  2117. return
  2118. end
  2119. if (toolAnim == "Lunge") then
  2120. RightShoulder.MaxVelocity = 0.5
  2121. LeftShoulder.MaxVelocity = 0.5
  2122. RightHip.MaxVelocity = 0.5
  2123. LeftHip.MaxVelocity = 0.5
  2124. RightShoulder.DesiredAngle = (1.57)
  2125. LeftShoulder.DesiredAngle = (1.0)
  2126. RightHip.DesiredAngle = (1.57)
  2127. LeftHip.DesiredAngle = (1.0)
  2128. return
  2129. end
  2130. end
  2131. function move(time)
  2132. local amplitude
  2133. local frequency
  2134. if (pose == "Jumping") then
  2135. moveJump()
  2136. return
  2137. end
  2138. if (pose == "FreeFall") then
  2139. moveFreeFall()
  2140. return
  2141. end
  2142. if (pose == "Seated") then
  2143. moveSit()
  2144. return
  2145. end
  2146. local climbFudge = 0
  2147. if (pose == "Running") then
  2148. RightShoulder.MaxVelocity = 0.15
  2149. LeftShoulder.MaxVelocity = 0.15
  2150. amplitude = 1
  2151. frequency = 9
  2152. elseif (pose == "Climbing") then
  2153. RightShoulder.MaxVelocity = 0.5
  2154. LeftShoulder.MaxVelocity = 0.5
  2155. amplitude = 1
  2156. frequency = 9
  2157. climbFudge = 3.14
  2158. else
  2159. amplitude = 0.1
  2160. frequency = 1
  2161. end
  2162. desiredAngle = amplitude * math.sin(time*frequency)
  2163. RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2
  2164. LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2
  2165. RightHip.DesiredAngle = (-desiredAngle)
  2166. LeftHip.DesiredAngle = (-desiredAngle)
  2167. local tool = getTool()
  2168. if tool then
  2169. animStringValueObject = getToolAnim(tool)
  2170. if animStringValueObject then
  2171. toolAnim = animStringValueObject.Value
  2172. animStringValueObject.Parent = nil
  2173. toolAnimTime = time + .3
  2174. end
  2175. if time > toolAnimTime then
  2176. toolAnimTime = 0
  2177. toolAnim = "None"
  2178. end
  2179. animateTool()
  2180. else
  2181. toolAnim = "None"
  2182. toolAnimTime = 0
  2183. end
  2184. end
  2185. Humanoid.Died:connect(onDied)
  2186. Humanoid.Running:connect(onRunning)
  2187. Humanoid.Jumping:connect(onJumping)
  2188. Humanoid.Climbing:connect(onClimbing)
  2189. Humanoid.GettingUp:connect(onGettingUp)
  2190. Humanoid.FreeFalling:connect(onFreeFall)
  2191. Humanoid.FallingDown:connect(onFallingDown)
  2192. Humanoid.Seated:connect(onSeated)
  2193. Humanoid.PlatformStanding:connect(onPlatformStanding)
  2194. Humanoid.ChildAdded:connect(CheckTag)
  2195. OriginalTime = 0.1
  2196. Time = OriginalTime
  2197. while Figure.Parent~=nil do
  2198. Time = Time + 0.1
  2199. wait(OriginalTime)
  2200. move(Time)
  2201. end
  2202. end)
  2203. Delay(0, function() --lah30303's Pathing Script
  2204. function CalcMoves(map, px, py, tx, ty)
  2205. if map[ty][tx] ~= 0 then
  2206. return nil
  2207. end
  2208. local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {}
  2209. openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1}
  2210. local nodenumber = 0
  2211. while listk > 0 do
  2212. nodenumber = nodenumber + 1
  2213. if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then
  2214. wait()
  2215. if DebugPathing == true then
  2216. print("Node", nodenumber)
  2217. end
  2218. end
  2219. closedk = closedk + 1
  2220. table.insert(closedlist, closedk, openlist[1])
  2221. curbase = closedlist[closedk]
  2222. if closedlist[closedk].x == tx and closedlist[closedk].y == ty then
  2223. return closedlist
  2224. end
  2225. openlist[1] = openlist[listk]
  2226. table.remove(openlist, listk)
  2227. listk = listk - 1
  2228. local v = 1
  2229. while true do
  2230. local u = v
  2231. if 2 * u + 1 <= listk then
  2232. if openlist[u].f >= openlist[2 * u].f then
  2233. v = 2 * u
  2234. end
  2235. if openlist[v].f >= openlist[2 * u + 1].f then
  2236. v = 2 * u + 1
  2237. end
  2238. elseif 2 * u <= listk then
  2239. if openlist[u].f >= openlist[2 * u].f then
  2240. v = 2 * u
  2241. end
  2242. end
  2243. if u ~= v then
  2244. local temp = openlist[u]
  2245. openlist[u] = openlist[v]
  2246. openlist[v] = temp
  2247. else
  2248. break
  2249. end
  2250. end
  2251.  
  2252. local tocheck = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} --[1]Right, [2]Left, [3]Down, [4]Up, [5]UpLeft, [6]UpRight, [7]DownLeft, [8]DownRight
  2253. if closedk > 0 then
  2254. for k = 1, closedk do
  2255. for i, v in pairs(tocheck) do
  2256. if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then
  2257. tocheck[i] = nil
  2258. end
  2259. end
  2260. end
  2261. end
  2262. for i, v in pairs(tocheck) do
  2263. local a = curbase.x + v[1]
  2264. local b = curbase.y + v[2]
  2265. if a > xsize or a < 1 or b > ysize or b < 1 then
  2266. tocheck[i] = nil
  2267. end
  2268. end
  2269. for i, v in pairs(tocheck) do
  2270. local a, b = curbase.x + v[1], curbase.y + v[2]
  2271. if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then
  2272. tocheck[i] = nil
  2273. end
  2274. end
  2275. tempG = curbase.g + 1
  2276. tempDiagG = curbase.g + 1.4
  2277. for k = 1, listk do
  2278. for i, v in pairs(tocheck) do
  2279. if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then
  2280. tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty)
  2281. table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk})
  2282. local m = k
  2283. while m ~= 1 do
  2284. if openlist[m].f <= openlist[math.floor(m/2)].f then
  2285. temp = openlist[math.floor(m/2)]
  2286. openlist[math.floor(m/2)] = openlist[m]
  2287. openlist[m] = temp
  2288. m = math.floor(m/2)
  2289. else
  2290. break
  2291. end
  2292. tocheck[i] = nil
  2293. end
  2294. end
  2295. end
  2296. end
  2297. for i, v in pairs(tocheck) do
  2298. listk = listk + 1
  2299. tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty)
  2300. table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk})
  2301. m = listk
  2302. while m ~= 1 do
  2303. if openlist[m].f <= openlist[math.floor(m/2)].f then
  2304. temp = openlist[math.floor(m/2)]
  2305. openlist[math.floor(m/2)] = openlist[m]
  2306. openlist[m] = temp
  2307. m = math.floor(m/2)
  2308. else
  2309. break
  2310. end
  2311. end
  2312. end
  2313. end
  2314. return nil
  2315. end
  2316.  
  2317.  
  2318. function CalcPath(closedlist)
  2319.  
  2320. if closedlist == nil or table.getn(closedlist) == 1 then
  2321. return nil
  2322. end
  2323. local path = {}
  2324. local pathIndex = {}
  2325. local last = table.getn(closedlist)
  2326. table.insert(pathIndex,1,last)
  2327.  
  2328. local i = 1
  2329. while pathIndex[i] > 1 do
  2330. i = i + 1
  2331. table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par)
  2332. end
  2333.  
  2334. for n = table.getn(pathIndex) - 1, 1, -1 do
  2335. table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y})
  2336. end
  2337.  
  2338. closedlist = nil
  2339. return path
  2340. end
  2341. end)
  2342. Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator
  2343. local Base
  2344. if script.Parent:FindFirstChild("BASE") == nil then
  2345. Base = Instance.new("Part")
  2346. Base.Transparency = 1
  2347. Base.TopSurface = "Smooth"
  2348. Base.BottomSurface = "Smooth"
  2349. Base.CanCollide = false
  2350. Base.Anchored = true
  2351. Base.Locked = true
  2352. Base.BrickColor = BrickColor.new(0, 0, 0)
  2353. Base.Name = "BASE"
  2354. Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
  2355. Base.Parent = script.Parent
  2356. else
  2357. Base = script.Parent.BASE
  2358. Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
  2359. end
  2360. function Jump()
  2361. script.Parent.Humanoid.Jump = true
  2362. end
  2363. function Check(Hit)
  2364. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then
  2365. if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  2366. Jump()
  2367. end
  2368. end
  2369. end
  2370. script.Parent.Torso.Touched:connect(Check)
  2371. function Prep(Target, Current, Attempts)
  2372. if Attempts == nil then
  2373. Attempts = 1000
  2374. end
  2375. local Hit = false
  2376. local Tag = Base:Clone()
  2377. Tag.Position = Target
  2378. Tag.Parent = script.Parent
  2379. local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40)
  2380. local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, script.Parent)
  2381. if TRHit ~= nil then
  2382. Hit = true
  2383. end
  2384. if Tag.Parent ~= nil then
  2385. Tag:Remove()
  2386. end
  2387. if Hit == false and Attempts > 0 and script.Parent.Wander.Value == true then
  2388. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1)
  2389. elseif script.Parent.Wander.Value == true then
  2390. local TargetRay = Ray.new(script.Parent.Torso.CFrame.p, (CFrame.new(Target).p - script.Parent.Torso.CFrame.p).Unit * ((Target - script.Parent.Torso.Position).Magnitude - 3))
  2391. local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, script.Parent)
  2392. local TrueTarget = script.Parent.Torso.Position
  2393. if THit ~= nil then
  2394. for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - TPos).Magnitude) do
  2395. local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (TPos - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3)
  2396. local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
  2397. if TH2 ~= nil and TH2.Name ~= "Lava" then
  2398. TrueTarget = TP2
  2399. else
  2400. break
  2401. end
  2402. end
  2403. else
  2404. for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - Target).Magnitude) do
  2405. local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (Target - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3)
  2406. local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
  2407. if TH2 ~= nil and TH2.Name ~= "Lava" then
  2408. TrueTarget = TP2
  2409. else
  2410. break
  2411. end
  2412. end
  2413. end
  2414. script.Parent.Humanoid:MoveTo(TrueTarget, Current)
  2415. end
  2416. end
  2417. function ZHit(Part)
  2418. if script.Parent:FindFirstChild("IsAZombie") ~= nil and script.Parent.Humanoid.Health > 0 and Part ~= nil and Part.Parent ~= nil and Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent:FindFirstChild("IsAZombie") == nil then
  2419. Part.Parent.Humanoid:TakeDamage(2)
  2420. script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + 1
  2421. script.Parent.Humanoid:TakeDamage(-1)
  2422. end
  2423. end
  2424. script.Parent["Right Arm"].Touched:connect(ZHit)
  2425. script.Parent["Left Arm"].Touched:connect(ZHit)
  2426. CurrentMap = {}
  2427. MapMask = {}
  2428. MapVar = {0, 0, 0, 0, 0}
  2429. BlockScanned = 0
  2430. ScanSkip = 5
  2431. DebugPathing = true
  2432. function GenerateMap(PathPos)
  2433. CurrentMap = {}
  2434. MapMask = {}
  2435. MapVar = {0, 0, 0, 0, 0}
  2436. BlockScanned = 0
  2437. MapVariables = ScanParts(Workspace, 1)
  2438. for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do
  2439. CurrentMap[MapX] = {}
  2440. for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do
  2441. CurrentMap[MapX][MapY] = 0
  2442. end
  2443. end
  2444. for MaskX = 1, #CurrentMap do
  2445. MapMask[MaskX] = {}
  2446. for MaskY = 1, #CurrentMap[MaskX] do
  2447. MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5}
  2448. end
  2449. end
  2450. ScanParts(Workspace, 2, MapVariables)
  2451. wait(1)
  2452. if script.Parent.PrintMap.Value == true then
  2453. print("Printing Map...")
  2454. for ClearPrint = 1, 250 do
  2455. wait()
  2456. print()
  2457. end
  2458. for PrintX = 1, #CurrentMap do
  2459. local PrintZ = ""
  2460. for PrintY = 1, #CurrentMap[PrintX] do
  2461. PrintZ = PrintZ ..CurrentMap[PrintX][PrintY]
  2462. end
  2463. print(PrintZ)
  2464. wait(0.1)
  2465. end
  2466. end
  2467. local MapCoords = {0, 0, 0, 0}
  2468. local Distance = math.huge
  2469. for MPX = 1, #CurrentMap do
  2470. for MPY = 1, #CurrentMap[MPX] do
  2471. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude < Distance then
  2472. MapCoords = {MPX, MPY, 0, 0}
  2473. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude
  2474. end
  2475. end
  2476. end
  2477. local Distance = math.huge
  2478. for MPX = 1, #CurrentMap do
  2479. for MPY = 1, #CurrentMap[MPX] do
  2480. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude < Distance then
  2481. MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)}
  2482. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude
  2483. end
  2484. end
  2485. end
  2486. for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do
  2487. local Timer = 20
  2488. local pX = v["x"]
  2489. local pY = v["y"]
  2490. local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2])
  2491. pTo = pTo + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit
  2492. while (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do
  2493. script.Parent.Humanoid:MoveTo(pTo, Base)
  2494. Timer = Timer - 1
  2495. if Timer == 10 then
  2496. script.Parent.Humanoid.Jump = true
  2497. end
  2498. wait(0.1)
  2499. end
  2500. if Timer == 0 then
  2501. if (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude <= 5 then
  2502. script.Parent.Torso.CFrame = script.Parent.Torso.CFrame + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit * (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude
  2503. else
  2504. break
  2505. end
  2506. end
  2507. end
  2508. end
  2509. function ScanParts(CurrentModel, CurrentStage, Variables)
  2510. local X = CurrentModel:GetChildren()
  2511. for I = 1, #X do
  2512. if #X[I]:GetChildren() > 0 then
  2513. ScanParts(X[I], 1, Variables)
  2514. end
  2515. if X[I].ClassName == "Part" or X[I].ClassName == "WedgePart" or X[I].ClassName == "CornerWedgePart" or X[I].ClassName == "TrussPart" or X[I].ClassName == "SpawnLocation" or X[I].ClassName == "Seat" or X[I].ClassName == "VehicleSeat" or X[I].ClassName == "SkateboardPlatform" then
  2516. BlockScanned = BlockScanned + 1
  2517. if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then
  2518. wait()
  2519. if DebugPathing == true then
  2520. print("Block", BlockScanned)
  2521. end
  2522. end
  2523. if CurrentStage == 1 then
  2524. MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1])
  2525. MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2])
  2526. MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3])
  2527. MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4])
  2528. elseif CurrentStage == 2 and ((X[I].Position.Y + X[I].Size.Y / 2 > script.Parent.Torso.Position.Y + 2 and X[I].Position.Y - X[I].Size.Y / 2 < script.Parent.Torso.Position.Y + 2) or X[I].Position.Y + X[I].Size.Y / 2 < script.Parent.Torso.Position.Y - 8) then
  2529. local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2}
  2530. local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2}
  2531. local BlockCoords = {0, 0, 0, 0}
  2532. local Distance = math.huge
  2533. for MPX = 1, #CurrentMap do
  2534. for MPY = 1, #CurrentMap[MPX] do
  2535. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then
  2536. BlockCoords = {MPX, MPY, 0, 0}
  2537. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude
  2538. end
  2539. end
  2540. end
  2541. local Distance = math.huge
  2542. for MPX = 1, #CurrentMap do
  2543. for MPY = 1, #CurrentMap[MPX] do
  2544. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then
  2545. BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY}
  2546. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude
  2547. end
  2548. end
  2549. end
  2550. for XGrid = BlockCoords[2], BlockCoords[4] do
  2551. for YGrid = BlockCoords[1], BlockCoords[3] do
  2552. CurrentMap[XGrid][YGrid] = 1
  2553. end
  2554. end
  2555. end
  2556. end
  2557. end
  2558. if CurrentStage == 1 then
  2559. MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2}
  2560. return MapVar
  2561. end
  2562. end
  2563. IsInCombat = false
  2564. while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") == nil do
  2565. local Distance = 100
  2566. local Target = nil
  2567. IsInCombat = false
  2568. local Players = Workspace:GetChildren()
  2569. for Check = 1, #Players do
  2570. if Players[Check] ~= script.Parent and ((Players[Check]:FindFirstChild("Humanoid") ~= nil and (Players[Check]:FindFirstChild("IsAZombie") ~= nil or Players[Check]:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or (script.Parent.IsOnTeam.Value == true and Players[Check]:FindFirstChild("IsOnTeam") ~= nil and Players[Check].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value ~= Players[Check].IsOnTeam.Team.Value) or (game.Players:GetPlayerFromCharacter(Players[Check]) ~= nil and script.Parent.IsOnTeam.Value == true and game.Players:GetPlayerFromCharacter(Players[Check]).Neutral == false and game.Players:GetPlayerFromCharacter(Players[Check]).TeamColor ~= script.Parent.IsOnTeam.Team.Value)) and Players[Check].Humanoid.Health > 0) or (Players[Check]:FindFirstChild("Zombie") ~= nil and Players[Check].Zombie.ClassName == "Humanoid" and Players[Check].Zombie.Health > 0)) and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then
  2571. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  2572. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  2573. if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then
  2574. local TeamTag = nil
  2575. local Parts = Players[Check]:GetChildren()
  2576. for X = 1, #Parts do
  2577. if Parts[X].Name == "TeamLoc" then
  2578. if Parts[X].Value == script.Parent.IsOnTeam.Team.Value then
  2579. TeamTag = Parts[X]
  2580. end
  2581. end
  2582. end
  2583. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil or Parts[X] ~= nil or (Players[Check].Torso.Position - (script.Parent.Torso.Position + script.Parent.Torso.CFrame.lookVector * 50)).Magnitude <= 52 then
  2584. if script.Parent.IsOnTeam.Value == false then
  2585. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  2586. Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  2587. end
  2588. local Found = Instance.new("CFrameValue", Players[Check])
  2589. Found.Name = "Loc" ..script.Parent.Name
  2590. game:GetService("Debris"):AddItem(Found, 3)
  2591. else
  2592. if Parts[X] ~= nil then
  2593. Parts[X]:Remove()
  2594. end
  2595. local Found = Instance.new("BrickColorValue", Players[Check])
  2596. Found.Name = "TeamLoc"
  2597. Found.Value = script.Parent.IsOnTeam.Team.Value
  2598. game:GetService("Debris"):AddItem(Found, 3)
  2599. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
  2600. Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
  2601. end
  2602. local Found = Instance.new("CFrameValue", Players[Check])
  2603. Found.Name = "Loc" ..script.Parent.Name
  2604. game:GetService("Debris"):AddItem(Found, 3)
  2605. end
  2606. end
  2607. if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  2608. Target = Players[Check].Torso
  2609. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  2610. end
  2611. end
  2612. end
  2613. end
  2614. if Target == nil then
  2615. local HasTool = false
  2616. local ToolCheck = script.Parent:GetChildren()
  2617. for Check = 1, #ToolCheck do
  2618. if ToolCheck[Check].ClassName == "Tool" then
  2619. HasTool = true
  2620. end
  2621. end
  2622. if HasTool == false then
  2623. Distance = 100
  2624. for Check = 1, #Players do
  2625. if Players[Check].ClassName == "Tool" and Players[Check]:FindFirstChild("Handle") ~= nil and Players[Check]:FindFirstChild("Active") ~= nil and Players[Check]:FindFirstChild("TargetPos") ~= nil and Players[Check]:FindFirstChild("Type") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  2626. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  2627. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  2628. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
  2629. Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
  2630. Target = Players[Check]
  2631. end
  2632. end
  2633. end
  2634. if Target ~= nil and Target.ClassName == "Tool" then
  2635. if Distance <= 5 and HasTool == false then
  2636. Target.Parent = script.Parent
  2637. HasTool = true
  2638. else
  2639. Prep(Target.Handle.Position, Base)
  2640. end
  2641. else
  2642. for Check = 1, #Players do
  2643. if Players[Check].Name == "Crate" and Players[Check]:FindFirstChild("OpenCrate") ~= nil and Players[Check].OpenCrate.Value == false and (Players[Check].Position - script.Parent.Torso.Position).Magnitude <= Distance then
  2644. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  2645. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  2646. if Hit ~= nil and Hit == Players[Check] then
  2647. Target = Players[Check]
  2648. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  2649. end
  2650. end
  2651. end
  2652. if Target ~= nil then
  2653. script.Parent.Humanoid:MoveTo(Target.Position, Target)
  2654. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
  2655. Target.OpenCrate.Value = true
  2656. end
  2657. else
  2658. local HasHat = false
  2659. local HatCheck = script.Parent:GetChildren()
  2660. for Check = 1, #HatCheck do
  2661. if ToolCheck[Check].ClassName == "Hat" then
  2662. HasHat = true
  2663. end
  2664. end
  2665. if HasHat == false then
  2666. Distance = 100
  2667. for Check = 1, #Players do
  2668. if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  2669. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  2670. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  2671. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
  2672. Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
  2673. Target = Players[Check]
  2674. end
  2675. end
  2676. end
  2677. if Target ~= nil and Target.ClassName == "Hat" then
  2678. if Distance <= 5 and HasHat == false then
  2679. Target.Parent = script.Parent
  2680. HasHat = true
  2681. else
  2682. Prep(Target.Handle.Position, Base)
  2683. end
  2684. else
  2685. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  2686. if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
  2687. GenerateMap(script.Parent.PathTo.Value)
  2688. script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
  2689. elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  2690. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  2691. end
  2692. else
  2693. Jump()
  2694. end
  2695. end
  2696. end
  2697. end
  2698. end
  2699. else
  2700. if Target == nil then
  2701. local Distance = 80
  2702. local Players = Workspace:GetChildren()
  2703. for Check = 1, #Players do
  2704. if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check] ~= script.Parent and Players[Check]:FindFirstChild("IsLocalEnemy") == nil and Players[Check]:FindFirstChild("Leader") ~= nil and Players[Check].Humanoid.Health > 0 and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  2705. local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  2706. local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
  2707. if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then
  2708. Target = Players[Check].Torso
  2709. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  2710. end
  2711. end
  2712. end
  2713. if Target ~= nil then
  2714. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 10
  2715. Prep(Position, Base)
  2716. else
  2717. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  2718. if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
  2719. GenerateMap(script.Parent.PathTo.Value)
  2720. script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
  2721. elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  2722. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  2723. end
  2724. else
  2725. Jump()
  2726. end
  2727. end
  2728. else
  2729. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  2730. if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
  2731. GenerateMap(script.Parent.PathTo.Value)
  2732. script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
  2733. elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  2734. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  2735. end
  2736. else
  2737. Jump()
  2738. end
  2739. end
  2740. end
  2741. else
  2742. local Weapon = nil
  2743. local ToolCheck = script.Parent:GetChildren()
  2744. for Check = 1, #ToolCheck do
  2745. if ToolCheck[Check].ClassName == "Tool" then
  2746. Weapon = ToolCheck[Check]
  2747. end
  2748. end
  2749. if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  2750. if Weapon.Type.Value == "Melee" then
  2751. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  2752. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
  2753. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2754. Weapon.Active.Value = true
  2755. end
  2756. elseif Weapon.Type.Value == "Melee/Ranged" then
  2757. if Distance <= 10 then
  2758. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  2759. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2760. Weapon.Active.Value = true
  2761. else
  2762. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Base)
  2763. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 50 then
  2764. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2765. Weapon.Active.Value = true
  2766. end
  2767. end
  2768. elseif Weapon.Type.Value == "Melee/RangedMed" then
  2769. if Distance <= 10 then
  2770. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  2771. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2772. Weapon.Active.Value = true
  2773. else
  2774. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
  2775. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 40 then
  2776. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2777. Weapon.Active.Value = true
  2778. end
  2779. end
  2780. elseif Weapon.Type.Value == "Melee/RangedClose" then
  2781. if Distance <= 10 then
  2782. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  2783. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2784. Weapon.Active.Value = true
  2785. else
  2786. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Base)
  2787. if (Target.Position - script.Parent.Torso.Position).Magnitude <= 30 then
  2788. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2789. Weapon.Active.Value = true
  2790. end
  2791. end
  2792. elseif Weapon.Type.Value == "Ranged" then
  2793. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
  2794. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2795. wait()
  2796. Weapon.Active.Value = true
  2797. elseif Weapon.Type.Value == "RangedMed" then
  2798. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 60, Base)
  2799. if Distance <= 70 then
  2800. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2801. wait()
  2802. Weapon.Active.Value = true
  2803. end
  2804. elseif Weapon.Type.Value == "RangedClose" then
  2805. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
  2806. if Distance <= 40 then
  2807. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2808. wait()
  2809. Weapon.Active.Value = true
  2810. end
  2811. elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then
  2812. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * (script.Parent.Torso.Position - Target.Position).Magnitude + Target.Velocity
  2813. script.Parent.Humanoid:MoveTo(Position, Base)
  2814. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2815. wait()
  2816. Weapon.Active.Value = true
  2817. elseif Weapon.Type.Value == "RangedTactical" then
  2818. if Distance <= 30 then
  2819. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 50
  2820. Prep(Position, Base)
  2821. elseif Distance >= 50 then
  2822. Prep(Target.Position, Target)
  2823. end
  2824. if Distance <= 50 and Distance >= 30 then
  2825. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso)
  2826. end
  2827. if Distance <= 60 then
  2828. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2829. wait()
  2830. Weapon.Active.Value = true
  2831. end
  2832. elseif Weapon.Type.Value == "Shuriken" then
  2833. if Distance <= 15 then
  2834. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20
  2835. Prep(Position, Base)
  2836. elseif Distance >= 30 then
  2837. Prep(Target.Position, Target)
  2838. end
  2839. if Distance <= 30 and Distance >= 15 then
  2840. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso)
  2841. end
  2842. if Distance <= 50 then
  2843. Weapon.TargetPos.Value = (Target.Position + Target.Velocity / 2) + Vector3.new(math.random(-2, 2), math.random(-2, 2) + ((Target.Position + Target.Velocity / 2) - script.Parent.Torso.Position).Magnitude / 8, math.random(-2, 2))
  2844. wait()
  2845. Weapon.Active.Value = true
  2846. end
  2847. elseif Weapon.Type.Value == "HealDrink" then
  2848. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
  2849. Prep(Position, Base)
  2850. if script.Parent.Humanoid.Health < script.Parent.Humanoid.MaxHealth then
  2851. Weapon.Active.Value = true
  2852. end
  2853. elseif Weapon.Type.Value == "GrenadeDirect" then
  2854. if Distance >= 80 and Distance <= 100 then
  2855. Prep(Target.Position, Target)
  2856. wait(0.5)
  2857. Weapon.Active.Value = true
  2858. wait(0.5)
  2859. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
  2860. Prep(Position, Base)
  2861. else
  2862. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
  2863. Prep(Position, Base)
  2864. end
  2865. elseif Weapon.Type.Value == "Bomb" then
  2866. if Distance > 10 then
  2867. Prep(Target.Position, Target)
  2868. elseif Distance <= 10 then
  2869. Weapon.Active.Value = true
  2870. wait(2)
  2871. while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do
  2872. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
  2873. wait(0.5)
  2874. end
  2875. end
  2876. elseif Weapon.Type.Value == "Backstab" then
  2877. if Distance >= 10 then
  2878. if (script.Parent.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then
  2879. Prep(Target.Position, Target)
  2880. else
  2881. if (script.Parent.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then
  2882. Prep(Target.Position, Base)
  2883. local backstab_time = 20
  2884. while backstab_time > 1 and (script.Parent.Torso.Position - Target.Position).Magnitude >= 4 do
  2885. wait(0.1)
  2886. backstab_time = backstab_time - 1
  2887. end
  2888. if (script.Parent.Torso.Position - Target.Position).Magnitude < 4 then
  2889. Weapon.Active.Value = true
  2890. end
  2891. else
  2892. Prep(Target.Position - Target.CFrame.lookVector * 15, Base)
  2893. end
  2894. end
  2895. else
  2896. Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
  2897. if Distance <= 5 then
  2898. Weapon.Active.Value = true
  2899. end
  2900. end
  2901. elseif Weapon.Type.Value == "Crossbow" then
  2902. if Distance > 80 then
  2903. Prep(Target.Position, Target)
  2904. elseif Distance < 40 then
  2905. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100, Base)
  2906. elseif Distance <= 80 and Distance >= 40 then
  2907. Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * ((script.Parent.Torso.Position - Target.Position).Magnitude - 5), Base)
  2908. wait(0.2)
  2909. Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  2910. Weapon.Active.Value = true
  2911. end
  2912. end
  2913. IsInCombat = true
  2914. elseif Distance <= 100 then
  2915. local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
  2916. Prep(Position, Base)
  2917. end
  2918. end
  2919. if IsInCombat == true then
  2920. wait(0.2)
  2921. else
  2922. wait(0.6)
  2923. end
  2924. end
  2925. local Weapon = nil
  2926. local ToolCheck = script.Parent:GetChildren()
  2927. for Check = 1, #ToolCheck do
  2928. if ToolCheck[Check].ClassName == "Tool" then
  2929. Weapon = ToolCheck[Check]
  2930. end
  2931. end
  2932. if Weapon ~= nil and script.Parent.DropWeapon.Value == true then
  2933. Weapon.Parent = Workspace
  2934. elseif Weapon ~= nil then
  2935. Weapon:Remove()
  2936. end
  2937. if script.Parent:FindFirstChild("IsAZombie") ~= nil then
  2938. script.Parent.Name = "New Zombie"
  2939. script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100)))
  2940. wait()
  2941. script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
  2942. script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100
  2943. ZStat = 2
  2944. ZStat2 = 1.57
  2945. Delay(1, function()
  2946. while script.Parent:FindFirstChild("Humanoid") ~= nil and script.Parent.Humanoid.Health > 0 do
  2947. script.Parent.Humanoid.MaxHealth = math.max(0, script.Parent.Humanoid.MaxHealth - 1)
  2948. script.Parent.Humanoid.Health = math.min(script.Parent.Humanoid.Health, script.Parent.Humanoid.MaxHealth)
  2949. wait(1)
  2950. end
  2951. end)
  2952. while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") ~= nil do
  2953. local Distance = 100
  2954. local Target = nil
  2955. local Players = Workspace:GetChildren()
  2956. for Check = 1, #Players do
  2957. if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check]:FindFirstChild("Torso") ~= nil and Players[Check]:FindFirstChild("IsAZombie") == nil and Players[Check].Humanoid.Health > 0 and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then
  2958. local ZRay = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
  2959. local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, script.Parent)
  2960. if Players[Check]:FindFirstChild("ZFound") ~= nil or (ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check])) then
  2961. if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then
  2962. if Players[Check]:FindFirstChild("ZFound") ~= nil then
  2963. Players[Check].ZFound:Remove()
  2964. end
  2965. local ZTag = Instance.new("CFrameValue", Players[Check])
  2966. ZTag.Name = "ZFound"
  2967. game:GetService("Debris"):AddItem(ZTag, 5)
  2968. end
  2969. if (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
  2970. Target = Players[Check].Torso
  2971. Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
  2972. end
  2973. end
  2974. end
  2975. end
  2976. if Target == nil then
  2977. if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
  2978. if math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
  2979. Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  2980. end
  2981. else
  2982. Jump()
  2983. end
  2984. elseif script.Parent.Wander.Value == true then
  2985. script.Parent.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
  2986. end
  2987. wait(0.8)
  2988. end
  2989. end
  2990. end)
  2991. Delay(0, function() --Random Tool Usage Script
  2992. while true do
  2993. wait(math.random(40, 70 + math.random(30, 120)) / 10)
  2994. local Weapon = nil
  2995. local ToolCheck = script.Parent:GetChildren()
  2996. for Check = 1, #ToolCheck do
  2997. if ToolCheck[Check].ClassName == "Tool" then
  2998. Weapon = ToolCheck[Check]
  2999. end
  3000. end
  3001. if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  3002. if Weapon.Type.Value == "HealDrink" then
  3003. Weapon.Active.Value = true
  3004. end
  3005. end
  3006. end
  3007. end)
  3008. Delay(1, function() --Player Customization Script
  3009. if script.Parent["Custom_Name"].Value == "" then
  3010. script.Parent.Name = "Player" ..math.random(1, 999)
  3011. else
  3012. script.Parent.Name = script.Parent["Custom_Name"].Value
  3013. end
  3014. BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226}
  3015. SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200}
  3016. PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030}
  3017. BColor = BrickColor.new(BColors[math.random(1, #BColors)])
  3018. SColor = BrickColor.new(SColors[math.random(1, #SColors)])
  3019. PColor = BrickColor.new(PColors[math.random(1, #PColors)])
  3020. if script.Parent.IsOnTeam.Value == true then
  3021. SColor = script.Parent.IsOnTeam.Team.Value
  3022. PColor = SColor
  3023. if script.Parent.IsOnTeam.ShowTag.Value == true then
  3024. script.Parent.Name = script.Parent.Name .." [" ..script.Parent.IsOnTeam.Team.Value.Name .."]"
  3025. end
  3026. end
  3027. if script.Parent["Body Colors"].ForceColors.Value ~= true then
  3028. script.Parent["Body Colors"].HeadColor = BColor
  3029. script.Parent["Body Colors"].LeftArmColor = BColor
  3030. script.Parent["Body Colors"].LeftLegColor = PColor
  3031. script.Parent["Body Colors"].RightArmColor = BColor
  3032. script.Parent["Body Colors"].RightLegColor = PColor
  3033. script.Parent["Body Colors"].TorsoColor = SColor
  3034. end
  3035. script.Parent.Head.BrickColor = script.Parent["Body Colors"].HeadColor
  3036. script.Parent["Left Arm"].BrickColor = script.Parent["Body Colors"].LeftArmColor
  3037. script.Parent["Left Leg"].BrickColor = script.Parent["Body Colors"].LeftLegColor
  3038. script.Parent["Right Arm"].BrickColor = script.Parent["Body Colors"].RightArmColor
  3039. script.Parent["Right Leg"].BrickColor = script.Parent["Body Colors"].RightLegColor
  3040. script.Parent.Torso.BrickColor = script.Parent["Body Colors"].TorsoColor
  3041. if script.Parent["Force_Weapon"].Value ~= 0 then
  3042. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Weapon"].Value)
  3043. local c = x:GetChildren()
  3044. for i = 1, #c do
  3045. if c[i].ClassName == "Tool" and c[i]:FindFirstChild("AIProgram") ~= nil and c[i]:FindFirstChild("Active") ~= nil and c[i]:FindFirstChild("TargetPos") ~= nil and c[i]:FindFirstChild("Type") ~= nil and c[i]:FindFirstChild("Handle") ~= nil then
  3046. c[i].Parent = script.Parent
  3047. script.Parent.DropWeapon.Value = false
  3048. end
  3049. end
  3050. end
  3051. if script.Parent["Force_Hat"].Value ~= 0 then
  3052. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Hat"].Value)
  3053. local c = x:GetChildren()
  3054. for i = 1, #c do
  3055. if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then
  3056. c[i].Parent = script.Parent
  3057. end
  3058. end
  3059. end
  3060. if script.Parent["Force_Shirt"].Value ~= 0 then
  3061. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Shirt"].Value)
  3062. local c = x:GetChildren()
  3063. for i = 1, #c do
  3064. if c[i].ClassName == "Shirt" then
  3065. c[i].Parent = script.Parent
  3066. end
  3067. end
  3068. end
  3069. if script.Parent["Force_Pants"].Value ~= 0 then
  3070. local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Pants"].Value)
  3071. local c = x:GetChildren()
  3072. for i = 1, #c do
  3073. if c[i].ClassName == "Pants" then
  3074. c[i].Parent = script.Parent
  3075. end
  3076. end
  3077. end
  3078. end)
  3079. wait()
  3080. print("Player Bot Loaded")
  3081. end))
  3082. Model0.Humanoid.Died:connect(function()
  3083. Model0:remove()
  3084. YOURCLONE=nil
  3085. end)
  3086.  
  3087. Model0.Torso.Position=Vector3.new(Character.Torso.Position.X,Character.Torso.Position.Y+3,Character.Torso.Position.Z)
  3088. Model0.Name=Character.Name.."'s clone"
  3089. Model0.Humanoid.WalkToPart=torso
  3090. YOURCLONE=Model0
  3091. for i,v in pairs(mas:GetChildren()) do
  3092. v.Parent = workspace
  3093. pcall(function() v:MakeJoints() end)
  3094. end
  3095. mas:Destroy()
  3096. for i,v in pairs(cors) do
  3097. spawn(function()
  3098. pcall(v)
  3099. end)
  3100. end
  3101. end
  3102.  
  3103. --Converted with ttyyuu12345's model to script plugin v4
  3104. function sandbox(var,func)
  3105. local env = getfenv(func)
  3106. local newenv = setmetatable({},{
  3107. __index = function(self,k)
  3108. if k=="script" then
  3109. return var
  3110. else
  3111. return env[k]
  3112. end
  3113. end,
  3114. })
  3115. setfenv(func,newenv)
  3116. return func
  3117. end
  3118. cors = {}
  3119. mas = Instance.new("Model",game:GetService("Lighting"))
  3120. Model0 = Instance.new("Model")
  3121. MEF=Model0
  3122. Part1 = Instance.new("Part")
  3123. SpecialMesh2 = Instance.new("SpecialMesh")
  3124. Part3 = Instance.new("Part")
  3125. SpecialMesh4 = Instance.new("SpecialMesh")
  3126. Part5 = Instance.new("Part")
  3127. SpecialMesh6 = Instance.new("SpecialMesh")
  3128. Part7 = Instance.new("Part")
  3129. SpecialMesh8 = Instance.new("SpecialMesh")
  3130. Part9 = Instance.new("Part")
  3131. SpecialMesh10 = Instance.new("SpecialMesh")
  3132. Part11 = Instance.new("Part")
  3133. SpecialMesh12 = Instance.new("SpecialMesh")
  3134. Model0.Parent = mas
  3135. Part1.Name = "Right Arm"
  3136. Part1.Parent = Model0
  3137. Part1.Material = Enum.Material.Glass
  3138. Part1.BrickColor = BrickColor.new("Pastel blue-green")
  3139. Part1.Rotation = Vector3.new(-180, 0, -90)
  3140. Part1.Size = Vector3.new(4, 1, 2)
  3141. Part1.CFrame = CFrame.new(-12.3300028, 0.500003994, -1.11000025, 0, 1, 0, 1, 0, 0, 0, 0, -1)
  3142. Part1.BottomSurface = Enum.SurfaceType.Smooth
  3143. Part1.TopSurface = Enum.SurfaceType.Smooth
  3144. Part1.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3145. Part1.Position = Vector3.new(-12.3300028, 0.500003994, -1.11000025)
  3146. Part1.Orientation = Vector3.new(0, 180, 90)
  3147. Part1.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3148. SpecialMesh2.Parent = Part1
  3149. SpecialMesh2.MeshId = "rbxassetid://1563415862"
  3150. SpecialMesh2.Offset = Vector3.new(0, 4, 0)
  3151. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  3152. Part3.Name = "Right Leg"
  3153. Part3.Parent = Model0
  3154. Part3.Material = Enum.Material.Glass
  3155. Part3.BrickColor = BrickColor.new("Pastel blue-green")
  3156. Part3.Rotation = Vector3.new(-180, 0, -90)
  3157. Part3.Size = Vector3.new(4, 1, 2)
  3158. Part3.CFrame = CFrame.new(-14.3400002, 0.500003994, -0.0500001721, 0, 1, 0, 1, 0, 0, 0, 0, -1)
  3159. Part3.BottomSurface = Enum.SurfaceType.Smooth
  3160. Part3.TopSurface = Enum.SurfaceType.Smooth
  3161. Part3.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3162. Part3.Position = Vector3.new(-14.3400002, 0.500003994, -0.0500001721)
  3163. Part3.Orientation = Vector3.new(0, 180, 90)
  3164. Part3.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3165. SpecialMesh4.Parent = Part3
  3166. SpecialMesh4.MeshId = "rbxassetid://1563410216"
  3167. SpecialMesh4.Offset = Vector3.new(0, 4, 0)
  3168. SpecialMesh4.MeshType = Enum.MeshType.FileMesh
  3169. Part5.Name = "Left Leg"
  3170. Part5.Parent = Model0
  3171. Part5.Material = Enum.Material.Glass
  3172. Part5.BrickColor = BrickColor.new("Pastel blue-green")
  3173. Part5.Rotation = Vector3.new(-180, 0, -90)
  3174. Part5.Size = Vector3.new(4, 1, 2)
  3175. Part5.CFrame = CFrame.new(-14.3299971, 0.500003994, 1.17999947, 0, 1, 0, 1, 0, 0, 0, 0, -1)
  3176. Part5.BottomSurface = Enum.SurfaceType.Smooth
  3177. Part5.TopSurface = Enum.SurfaceType.Smooth
  3178. Part5.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3179. Part5.Position = Vector3.new(-14.3299971, 0.500003994, 1.17999947)
  3180. Part5.Orientation = Vector3.new(0, 180, 90)
  3181. Part5.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3182. SpecialMesh6.Parent = Part5
  3183. SpecialMesh6.MeshId = "rbxassetid://1563408982"
  3184. SpecialMesh6.Offset = Vector3.new(0, 4, 0)
  3185. SpecialMesh6.MeshType = Enum.MeshType.FileMesh
  3186. Part7.Name = "Left Arm"
  3187. Part7.Parent = Model0
  3188. Part7.Material = Enum.Material.Glass
  3189. Part7.BrickColor = BrickColor.new("Pastel blue-green")
  3190. Part7.Rotation = Vector3.new(0, 0, -90)
  3191. Part7.Size = Vector3.new(4, 1, 2)
  3192. Part7.CFrame = CFrame.new(-12.2099981, 0.490003794, 2.1400013, 0, 1, 0, -1, 0, 0, 0, 0, 1)
  3193. Part7.BottomSurface = Enum.SurfaceType.Smooth
  3194. Part7.TopSurface = Enum.SurfaceType.Smooth
  3195. Part7.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3196. Part7.Position = Vector3.new(-12.2099981, 0.490003794, 2.1400013)
  3197. Part7.Orientation = Vector3.new(0, 0, -90)
  3198. Part7.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3199. SpecialMesh8.Parent = Part7
  3200. SpecialMesh8.MeshId = "rbxassetid://1563407350"
  3201. SpecialMesh8.Offset = Vector3.new(0, 4, 0)
  3202. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  3203. Part9.Name = "Torso"
  3204. Part9.Parent = Model0
  3205. Part9.Material = Enum.Material.Glass
  3206. Part9.BrickColor = BrickColor.new("Pastel blue-green")
  3207. Part9.Rotation = Vector3.new(-180, 0, -90)
  3208. Part9.Size = Vector3.new(4, 1, 2)
  3209. Part9.CFrame = CFrame.new(-12.6299973, 0.500003994, 0.519999921, 0, 1, 0, 1, 0, 0, 0, 0, -1)
  3210. Part9.BottomSurface = Enum.SurfaceType.Smooth
  3211. Part9.TopSurface = Enum.SurfaceType.Smooth
  3212. Part9.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3213. Part9.Position = Vector3.new(-12.6299973, 0.500003994, 0.519999921)
  3214. Part9.Orientation = Vector3.new(0, 180, 90)
  3215. Part9.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3216. SpecialMesh10.Parent = Part9
  3217. SpecialMesh10.MeshId = "rbxassetid://1563386325"
  3218. SpecialMesh10.MeshType = Enum.MeshType.FileMesh
  3219. Part11.Name = "Head"
  3220. Part11.Parent = Model0
  3221. Part11.Material = Enum.Material.Glass
  3222. Part11.BrickColor = BrickColor.new("Pastel blue-green")
  3223. Part11.Rotation = Vector3.new(-180, 0, -90)
  3224. Part11.Size = Vector3.new(4, 1, 2)
  3225. Part11.CFrame = CFrame.new(-10.1799965, 0.500003994, 0.519999921, 0, 1, 0, 1, 0, 0, 0, 0, -1)
  3226. Part11.BottomSurface = Enum.SurfaceType.Smooth
  3227. Part11.TopSurface = Enum.SurfaceType.Smooth
  3228. Part11.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3229. Part11.Position = Vector3.new(-10.1799965, 0.500003994, 0.519999921)
  3230. Part11.Orientation = Vector3.new(0, 180, 90)
  3231. Part11.Color = Color3.new(0.623529, 0.952941, 0.913726)
  3232. SpecialMesh12.Parent = Part11
  3233. SpecialMesh12.MeshId = "rbxassetid://1563390192"
  3234. SpecialMesh12.MeshType = Enum.MeshType.FileMesh
  3235. for i,v in pairs(mas:GetChildren()) do
  3236. v.Parent = AdvancingFortress
  3237. pcall(function() v:MakeJoints() end)
  3238. end
  3239. mas:Destroy()
  3240. for i,v in pairs(cors) do
  3241. spawn(function()
  3242. pcall(v)
  3243. end)
  3244. end
  3245. --end of costume
  3246.  
  3247.  
  3248. AdvancingFortress.Parent = Character
  3249. torso = AdvancingFortress.Torso
  3250. hum = AdvancingFortress.Humanoid
  3251. AdvancingFortress.Name = "Advancing Fortress"
  3252. pl = AdvancingFortress
  3253. for i, v in pairs(AdvancingFortress:GetChildren()) do
  3254. if v:IsA("BasePart") then
  3255. v.Transparency = 1
  3256. end
  3257. end
  3258. local Humanoid = AdvancingFortress.Humanoid
  3259. local Mouse = Player:GetMouse()
  3260. local LeftArm = AdvancingFortress["Left Arm"]
  3261. local RightArm = AdvancingFortress["Right Arm"]
  3262. local LeftLeg = AdvancingFortress["Left Leg"]
  3263. local RightLeg = AdvancingFortress["Right Leg"]
  3264. local Head = AdvancingFortress.Head
  3265. local Torso = AdvancingFortress.Torso
  3266. local Camera = game.Workspace.CurrentCamera
  3267. local RootPart = AdvancingFortress.HumanoidRootPart
  3268. local RootJoint = RootPart.RootJoint
  3269. local attack = false
  3270. local Anim = "Idle"
  3271. local attacktype = 1
  3272. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  3273. local velocity = RootPart.Velocity.y
  3274. local sine = 0
  3275. local change = 1
  3276. local Create = LoadLibrary("RbxUtility").Create
  3277. local TimeStop = false
  3278. local m = Create("Model")({
  3279. Parent = AdvancingFortress,
  3280. Name = "WeaponModel"
  3281. })
  3282. --for _,v in pairs(KQ) do
  3283. --v.Transparency=1
  3284. --end
  3285. KQ={
  3286.  
  3287. }
  3288.  
  3289. AdvancingFortress.Head.Name = "FHead"
  3290. AdvancingFortress.Torso.Name = "FTorso"
  3291.  
  3292.  
  3293. shirt = Instance.new("Shirt", Character)
  3294. shirt.Name = "Shirt"
  3295. pants = Instance.new("Pants", Character)
  3296. pants.Name = "Pants"
  3297. Character.Shirt.ShirtTemplate = "rbxassetid://609199174"
  3298. Character.Pants.PantsTemplate = "rbxassetid://1079566963"
  3299.  
  3300. for i, v in pairs(Character:GetChildren()) do
  3301. if v.ClassName == "Accessory" then
  3302. v:Remove()
  3303. end
  3304. end
  3305.  
  3306. Hat3 = Instance.new("Model")
  3307. Hat3.Parent = Character
  3308. Hat3.Name = "Hat3"
  3309. rh = Instance.new("Part")
  3310. rh.Parent = Hat3
  3311. rh.BrickColor = BrickColor.new("Cool yellow")
  3312. rh.Locked = true
  3313. rh.CanCollide = false
  3314. mesh = Instance.new("SpecialMesh")
  3315. rh.formFactor = "Symmetric"
  3316. mesh.MeshType = "FileMesh"
  3317. mesh.MeshId = "rbxassetid://495152230"
  3318. mesh.Parent = rh
  3319. local weld = Instance.new("Weld")
  3320. weld.Parent = rh
  3321. weld.Part0 = rh
  3322. weld.Part1 =Character.Head
  3323. weld.C0 = CFrame.new(0, 0.4, 0)*CFrame.Angles(0, 0, 0)
  3324. mesh.Scale = Vector3.new(1,1,1)
  3325. Hat3.Part.Transparency = 0
  3326.  
  3327. for _,v in pairs(AdvancingFortress:GetChildren()) do
  3328. if v:IsA('Part') then
  3329. v.BrickColor=BrickColor.new('Pastel blue-green')
  3330. end
  3331. end
  3332. for _,v in pairs(MEF:GetChildren()) do
  3333. table.insert(KQ,v)
  3334. v.CanCollide=false
  3335. if v.Name=='Head' or v.Name=='Torso' then
  3336. g=AdvancingFortress['F'..v.Name]
  3337. else
  3338. g=AdvancingFortress[v.Name]
  3339. end
  3340. v.Parent=AdvancingFortress
  3341. v.Transparency=1
  3342. weld=Instance.new('Weld',v)
  3343. if v.Name=='Head' then
  3344. weld.C0=CFrame.new(0,-1,0)*CFrame.Angles(0,-1.5,0)
  3345. elseif v.Name=='Torso' then
  3346. weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
  3347. elseif v.Name=='Left Arm' then
  3348. weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,1.5,0)
  3349. elseif v.Name=='Left Leg' then
  3350. weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
  3351. elseif v.Name=='Right Arm' then
  3352. weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
  3353. elseif v.Name=='Right Leg' then
  3354. weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
  3355. end
  3356. weld.Part0=v
  3357. weld.Part1=g
  3358. end-- apply costume
  3359. AdvancingFortress.FTorso.BrickColor=BrickColor.new('Pastel blue-green')
  3360.  
  3361. AdvancingFortress.HumanoidRootPart.Name = "FHumanoidRootPart"
  3362. Humanoid.Animator.Parent = nil
  3363. AdvancingFortress.Animate.Parent = nil
  3364.  
  3365. base = Instance.new("ScreenGui",plr.PlayerGui)
  3366. bbg = Instance.new("BillboardGui",plr.Character.Head)
  3367. bbg.Size = UDim2.new(0,200,0,50)
  3368. bbg.StudsOffset = Vector3.new(0,3,0)
  3369.  
  3370. bbgTl = Instance.new("TextLabel",bbg)
  3371. bbgTl.BackgroundTransparency = 1
  3372. bbgTl.Size = UDim2.new(10,0,1,0)
  3373. bbgTl.Position = UDim2.new(-4.5,0,0,0)
  3374. bbgTl.Font = "Code"
  3375. bbgTl.Text = " "
  3376. bbgTl.TextSize = 25
  3377. bbgTl.TextStrokeColor3 = Color3.new(1,1,1)
  3378. bbgTl.TextColor3 = Color3.new(0,0,0)
  3379. bbgTl.TextStrokeTransparency = 0
  3380. bbgTl.TextWrapped = true
  3381.  
  3382. function Chat(msg)
  3383. if msg=='NANI' then
  3384. CFuncs.Sound.Create(948494432, Torso, 1, 1)
  3385. end
  3386. ff=game.Chat:FilterStringAsync(msg,Player,Player)
  3387. bbgTl.Text = ff
  3388. wait(1)
  3389. if bbgTl.Text == ff then
  3390. bbgTl.Text = " "
  3391. end
  3392. end
  3393. lknives=false
  3394.  
  3395.  
  3396. -- Fired when client sends a request to write on the sign
  3397. -- Called when button is clicked
  3398.  
  3399.  
  3400. plr.Chatted:connect(function(msg)-- local messageObject = getTextObject(msg, Player.UserId)
  3401. Chat(msg)
  3402. end)
  3403.  
  3404.  
  3405. local function newMotor(part0, part1, c0, c1)
  3406. local w = Create("Weld")({
  3407. Parent = part0,
  3408. Part0 = part0,
  3409. Part1 = part1,
  3410. C0 = c0,
  3411. C1 = c1
  3412. })
  3413. return w
  3414. end
  3415. function clerp(a, b, t)
  3416. return a:lerp(b, t)
  3417. end
  3418. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  3419. NeckCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  3420. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  3421. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  3422. local RH = newMotor(Torso, RightLeg, CFrame.new(0.5, -2, 0), CFrame.new(0, 0, 0))
  3423. local LH = newMotor(Torso, LeftLeg, CFrame.new(-0.5, -2, 0), CFrame.new(0, 0, 0))
  3424. RootJoint.C1 = CFrame.new(0, 0, 0)
  3425. RootJoint.C0 = CFrame.new(0, 0, 0)
  3426. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  3427. Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
  3428. local rarmc1 = RW.C1
  3429. local larmc1 = LW.C1
  3430. local rlegc1 = RH.C1
  3431. local llegc1 = LH.C1
  3432. local resetc1 = false
  3433. function PlayAnimationFromTable(table, speed, bool)
  3434. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  3435. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  3436. RW.C0 = clerp(RW.C0, table[3], speed)
  3437. LW.C0 = clerp(LW.C0, table[4], speed)
  3438. RH.C0 = clerp(RH.C0, table[5], speed)
  3439. LH.C0 = clerp(LH.C0, table[6], speed)
  3440. if bool == true and resetc1 == false then
  3441. resetc1 = true
  3442. RootJoint.C1 = RootJoint.C1
  3443. Torso.Neck.C1 = Torso.Neck.C1
  3444. RW.C1 = rarmc1
  3445. LW.C1 = larmc1
  3446. RH.C1 = rlegc1
  3447. LH.C1 = llegc1
  3448. end
  3449. end
  3450. ArtificialHB = Create("BindableEvent", script)({Parent = script, Name = "Heartbeat"})
  3451. script:WaitForChild("Heartbeat")
  3452. frame = 0.03333333333333333
  3453. tf = 0
  3454. allowframeloss = false
  3455. tossremainder = false
  3456. lastframe = tick()
  3457. script.Heartbeat:Fire()
  3458. game:GetService("RunService").Heartbeat:connect(function(s, p)
  3459. tf = tf + s
  3460. if tf >= frame then
  3461. if allowframeloss then
  3462. script.Heartbeat:Fire()
  3463. lastframe = tick()
  3464. else
  3465. for i = 1, math.floor(tf / frame) do
  3466. script.Heartbeat:Fire()
  3467. end
  3468. lastframe = tick()
  3469. end
  3470. if tossremainder then
  3471. tf = 0
  3472. else
  3473. tf = tf - frame * math.floor(tf / frame)
  3474. end
  3475. end
  3476. end)
  3477. function swait(num)
  3478. if num == 0 or num == nil then
  3479. ArtificialHB.Event:wait()
  3480. else
  3481. for i = 0, num do
  3482. ArtificialHB.Event:wait()
  3483. end
  3484. end
  3485. end
  3486. function RemoveOutlines(part)
  3487. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  3488. end
  3489. CFuncs = {
  3490. Part = {
  3491. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  3492. local Part = Create("Part")({
  3493. Parent = Parent,
  3494. Reflectance = Reflectance,
  3495. Transparency = Transparency,
  3496. CanCollide = false,
  3497. Locked = true,
  3498. BrickColor = BrickColor.new(tostring(BColor)),
  3499. Name = Name,
  3500. Size = Size,
  3501. Material = Material
  3502. })
  3503. RemoveOutlines(Part)
  3504. return Part
  3505. end
  3506. },
  3507. Mesh = {
  3508. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  3509. local Msh = Create(Mesh)({
  3510. Parent = Part,
  3511. Offset = OffSet,
  3512. Scale = Scale
  3513. })
  3514. if Mesh == "SpecialMesh" then
  3515. Msh.MeshType = MeshType
  3516. Msh.MeshId = MeshId
  3517. end
  3518. return Msh
  3519. end
  3520. },
  3521. Weld = {
  3522. Create = function(Parent, Part0, Part1, C0, C1)
  3523. local Weld = Create("Weld")({
  3524. Parent = Parent,
  3525. Part0 = Part0,
  3526. Part1 = Part1,
  3527. C0 = C0,
  3528. C1 = C1
  3529. })
  3530. return Weld
  3531. end
  3532. },
  3533. Sound = {
  3534. Create = function(id, par, vol, pit)
  3535. local Sound = Create("Sound")({
  3536. Volume = vol,
  3537. Pitch = pit or 1,
  3538. SoundId = "rbxassetid://" .. id,
  3539. Parent = par or workspace
  3540. })
  3541. Sound:play()
  3542. game:GetService("Debris"):AddItem(Sound, 130)
  3543. return Sound
  3544. end
  3545. },
  3546. Decal = {
  3547. Create = function(Color, Texture, Transparency, Name, Parent)
  3548. local Decal = Create("Decal")({
  3549. Color3 = Color,
  3550. Texture = "rbxassetid://" .. Texture,
  3551. Transparency = Transparency,
  3552. Name = Name,
  3553. Parent = Parent
  3554. })
  3555. return Decal
  3556. end
  3557. },
  3558. BillboardGui = {
  3559. Create = function(Parent, Image, Position, Size)
  3560. local BillPar = CFuncs.Part.Create(Parent, "SmoothPlastic", 0, 1, BrickColor.new("Black"), "BillboardGuiPart", Vector3.new(1, 1, 1))
  3561. BillPar.CFrame = CFrame.new(Position)
  3562. local Bill = Create("BillboardGui")({
  3563. Parent = BillPar,
  3564. Adornee = BillPar,
  3565. Size = UDim2.new(1, 0, 1, 0),
  3566. SizeOffset = Vector2.new(Size, Size)
  3567. })
  3568. local d = Create("ImageLabel", Bill)({
  3569. Parent = Bill,
  3570. BackgroundTransparency = 1,
  3571. Size = UDim2.new(1, 0, 1, 0),
  3572. Image = "rbxassetid://" .. Image
  3573. })
  3574. return BillPar
  3575. end
  3576. },
  3577. ParticleEmitter = {
  3578. Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  3579. local Particle = Create("ParticleEmitter")({
  3580. Parent = Parent,
  3581. Color = ColorSequence.new(Color1, Color2),
  3582. LightEmission = LightEmission,
  3583. Size = Size,
  3584. Texture = Texture,
  3585. Transparency = Transparency,
  3586. ZOffset = ZOffset,
  3587. Acceleration = Accel,
  3588. Drag = Drag,
  3589. LockedToPart = LockedToPart,
  3590. VelocityInheritance = VelocityInheritance,
  3591. EmissionDirection = EmissionDirection,
  3592. Enabled = Enabled,
  3593. Lifetime = LifeTime,
  3594. Rate = Rate,
  3595. Rotation = Rotation,
  3596. RotSpeed = RotSpeed,
  3597. Speed = Speed,
  3598. VelocitySpread = VelocitySpread
  3599. })
  3600. return Particle
  3601. end
  3602. },
  3603. CreateTemplate = {}
  3604. }
  3605. function rayCast(Position, Direction, Range, Ignore)
  3606. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  3607. end
  3608. function FindNearestTorso(pos)
  3609. local list = game.Workspace:children()
  3610. local torso
  3611. local dist = 1000
  3612. local temp, human, temp2
  3613. for x = 1, #list do
  3614. temp2 = list[x]
  3615. if temp2.className == "Model" and temp2.Name ~= Character.Name then
  3616. temp = temp2:findFirstChild("Torso")
  3617. human = temp2:findFirstChild("Humanoid")
  3618. if temp ~= nil and human ~= nil and human.Health > 0 and dist > (temp.Position - pos).magnitude then
  3619. local dohit = true
  3620. if dohit == true then
  3621. torso = temp
  3622. dist = (temp.Position - pos).magnitude
  3623. end
  3624. end
  3625. end
  3626. end
  3627. return torso, dist
  3628. end
  3629. function Damage(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
  3630. if hit.Parent == nil then
  3631. return
  3632. end
  3633. local h = hit.Parent:FindFirstChild("Humanoid")
  3634. for _, v in pairs(hit.Parent:children()) do
  3635. c=hit.Parent:findFirstChild('HumanoidRootPart')
  3636. if v:IsA("Humanoid") then
  3637. h = v
  3638. if c~=nil then
  3639. end
  3640. end
  3641. end
  3642. if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
  3643. if hit.Parent:findFirstChild("DebounceHit") ~= nil and hit.Parent.DebounceHit.Value == true then
  3644. return
  3645. end
  3646. local c = Create("ObjectValue")({
  3647. Name = "creator",
  3648. Value = game:service("Players").LocalPlayer,
  3649. Parent = h
  3650. })
  3651. game:GetService("Debris"):AddItem(c, 0.5)
  3652. CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
  3653. local Damage = math.random(minim, maxim)
  3654. local blocked = false
  3655. local block = hit.Parent:findFirstChild("Block")
  3656. if block ~= nil and block.className == "IntValue" and block.Value > 0 then
  3657. blocked = true
  3658. block.Value = block.Value - 1
  3659. print(block.Value)
  3660. end
  3661. if TimeStop == false then
  3662. h.Health = h.Health - Damage
  3663. ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, BrickColor.new("Pastel blue-green").Color)
  3664. elseif TimeStop == true then
  3665. repeat
  3666. wait()
  3667. until TimeStop == false
  3668. h.Health = h.Health - Damage / 2
  3669. ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, BrickColor.new("Pastel blue-green").Color)
  3670. end
  3671. if Type == "Knockdown" then
  3672. local hum = hit.Parent.Humanoid
  3673. hum.PlatformStand = true
  3674. coroutine.resume(coroutine.create(function(HHumanoid)
  3675. swait(1)
  3676. HHumanoid.PlatformStand = false
  3677. end), hum)
  3678. local angle = hit.Position - (Property.Position + Vector3.new(0, 0, 0)).unit
  3679. local bodvol = Create("BodyVelocity")({
  3680. velocity = angle * knockback,
  3681. P = 5000,
  3682. maxForce = Vector3.new(8000, 8000, 8000),
  3683. Parent = hit
  3684. })
  3685. local rl = Create("BodyAngularVelocity")({
  3686. P = 3000,
  3687. maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
  3688. angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
  3689. Parent = hit
  3690. })
  3691. game:GetService("Debris"):AddItem(bodvol, 0.5)
  3692. game:GetService("Debris"):AddItem(rl, 0.5)
  3693. elseif Type == "Normal" then
  3694. local vp = Create("BodyVelocity")({
  3695. P = 500,
  3696. maxForce = Vector3.new(math.huge, 0, math.huge),
  3697. velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05
  3698. })
  3699. if knockback > 0 then
  3700. vp.Parent = hit.Parent.Torso
  3701. end
  3702. game:GetService("Debris"):AddItem(vp, 0.5)
  3703. elseif Type == "Up" then
  3704. local bodyVelocity = Create("BodyVelocity")({
  3705. velocity = Vector3.new(0, 20, 0),
  3706. P = 5000,
  3707. maxForce = Vector3.new(8000, 8000, 8000),
  3708. Parent = hit
  3709. })
  3710. game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
  3711. elseif Type == "DarkUp" then
  3712. coroutine.resume(coroutine.create(function()
  3713. for i = 0, 1, 0.1 do
  3714. swait()
  3715. Effects.Block.Create(BrickColor.new("Black"), hit.Parent.Torso.CFrame, 5, 5, 5, 1, 1, 1, 0.08, 1)
  3716. end
  3717. end))
  3718. local bodyVelocity = Create("BodyVelocity")({
  3719. velocity = Vector3.new(0, 20, 0),
  3720. P = 5000,
  3721. maxForce = Vector3.new(8000, 8000, 8000),
  3722. Parent = hit
  3723. })
  3724. game:GetService("Debris"):AddItem(bodyVelocity, 1)
  3725. elseif Type == "Snare" then
  3726. local bp = Create("BodyPosition")({
  3727. P = 2000,
  3728. D = 100,
  3729. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  3730. position = hit.Parent.Torso.Position,
  3731. Parent = hit.Parent.Torso
  3732. })
  3733. game:GetService("Debris"):AddItem(bp, 1)
  3734. elseif Type == "Freeze" then
  3735. local BodPos = Create("BodyPosition")({
  3736. P = 50000,
  3737. D = 1000,
  3738. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  3739. position = hit.Parent.Torso.Position,
  3740. Parent = hit.Parent.Torso
  3741. })
  3742. local BodGy = Create("BodyGyro")({
  3743. maxTorque = Vector3.new(400000, 400000, 400000) * math.huge,
  3744. P = 20000,
  3745. Parent = hit.Parent.Torso,
  3746. cframe = hit.Parent.Torso.CFrame
  3747. })
  3748. hit.Parent.Torso.Anchored = true
  3749. coroutine.resume(coroutine.create(function(Part)
  3750. swait(1.5)
  3751. Part.Anchored = false
  3752. end), hit.Parent.Torso)
  3753. game:GetService("Debris"):AddItem(BodPos, 3)
  3754. game:GetService("Debris"):AddItem(BodGy, 3)
  3755. end
  3756. local debounce = Create("BoolValue")({
  3757. Name = "DebounceHit",
  3758. Parent = hit.Parent,
  3759. Value = true
  3760. })
  3761. game:GetService("Debris"):AddItem(debounce, Delay)
  3762. c = Create("ObjectValue")({
  3763. Name = "creator",
  3764. Value = Player,
  3765. Parent = h
  3766. })
  3767. game:GetService("Debris"):AddItem(c, 0.5)
  3768. end
  3769. end
  3770. function ShowDamage(Pos, Text, Time, Color)
  3771. local Rate = 0.03333333333333333
  3772. local Pos = Pos or Vector3.new(0, 0, 0)
  3773. local Text = Text or ""
  3774. local Time = Time or 2
  3775. local Color = Color or Color3.new(1, 0, 1)
  3776. local EffectPart = CFuncs.Part.Create(workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0))
  3777. EffectPart.Anchored = true
  3778. local BillboardGui = Create("BillboardGui")({
  3779. Size = UDim2.new(3, 0, 3, 0),
  3780. Adornee = EffectPart,
  3781. Parent = EffectPart
  3782. })
  3783. local TextLabel = Create("TextLabel")({
  3784. BackgroundTransparency = 1,
  3785. Size = UDim2.new(1, 0, 1, 0),
  3786. Text = Text,
  3787. Font = "SciFi",
  3788. TextColor3 = Color,
  3789. TextScaled = true,
  3790. Parent = BillboardGui
  3791. })
  3792. game.Debris:AddItem(EffectPart, Time)
  3793. EffectPart.Parent = game:GetService("Workspace")
  3794. delay(0, function()
  3795. local Frames = Time / Rate
  3796. for Frame = 1, Frames do
  3797. wait(Rate)
  3798. local Percent = Frame / Frames
  3799. EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
  3800. TextLabel.TextTransparency = Percent
  3801. end
  3802. if EffectPart and EffectPart.Parent then
  3803. EffectPart:Destroy()
  3804. end
  3805. end)
  3806. end
  3807. local STDamage = false
  3808. function MagnitudeDamage(Part, Magnitude, MinimumDamage, MaximumDamage, KnockBack, Type, HitSound, HitPitch)
  3809. for _, c in pairs(workspace:children()) do
  3810. local hum = c:findFirstChild("Humanoid")
  3811. if hum ~= nil then
  3812. local head = c:findFirstChild("Torso")
  3813. if head ~= nil then
  3814. local targ = head.Position - Part.Position
  3815. local mag = targ.magnitude
  3816. if Magnitude >= mag and c.Name ~= Player.Name then
  3817. Damage(head, head, MinimumDamage, MaximumDamage, KnockBack, Type, RootPart, 0.1, HitSound, HitPitch)
  3818. if STDamage == true then
  3819. for i = 1, 3 do
  3820. Effects.Block.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 1, 1, 1, 4, 4, 4, 0.07, 1)
  3821. end
  3822. for i = 1, 10 do
  3823. CamShake(1, 70000)
  3824. Effects.Break.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 1, 1, 1)
  3825. end
  3826. elseif STDamage == false then
  3827. CamShake(1, 90000)
  3828. Effects.Block.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.07, 1)
  3829. for i = 1, 2 do
  3830. Effects.Break.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 0.4, 0.4, 0.4)
  3831. end
  3832. end
  3833. end
  3834. end
  3835. end
  3836. end
  3837. end
  3838. --[[
  3839. HHandle = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HHandle", Vector3.new(1.09999979, 0.299999923, 1.0999999))
  3840. HHandleWeld = CFuncs.Weld.Create(m, Head, HHandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0646438599, -0.0500068665, -0.0646400452, -0.707107365, -3.21031663E-8, 0.707106411, -8.19564079E-8, 1.00000119, -1.41561088E-7, -0.707106352, 1.38630043E-7, -0.707107484))
  3841. Eye1 = CFuncs.Part.Create(m, Enum.Material.Neon, 0, 1, "White", "Eye1", Vector3.new(0.400000006, 0.200000003, 0.200000003))
  3842. PartWeld = CFuncs.Weld.Create(m, HHandle, Eye1, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0381011963, -0.0574798584, 0.471725464, -2.89082527E-6, 0.173647985, -0.984807968, -6.2584877E-7, 0.984808922, 0.173648104, 1.00000012, 1.02902288E-6, -2.77161598E-6))
  3843. CFuncs.Mesh.Create("SpecialMesh", Eye1, Enum.MeshType.Sphere, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3844. Eye2 = CFuncs.Part.Create(m, Enum.Material.Neon, 0, 1, "White", "Eye2", Vector3.new(0.400000006, 0.200000003, 0.200000003))
  3845. PartWeld = CFuncs.Weld.Create(m, HHandle, Eye2, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0115432739, -0.0487277508, 0.482452393, -0.981060266, -0.173648134, -0.0858327746, -0.172987267, 0.984808922, -0.0151339322, 0.0871568322, 3.96735317E-7, -0.996194839))
  3846. CFuncs.Mesh.Create("SpecialMesh", Eye2, Enum.MeshType.Sphere, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3847. THandle = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Medium stone grey", "THandle", Vector3.new(1, 0.799999893, 1))
  3848. THandleWeld = CFuncs.Weld.Create(m, Torso, THandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3849. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.80000019, 0.300000012, 1.80000007))
  3850. PartWeld = CFuncs.Weld.Create(m, THandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-6.10351563E-5, -1.04342794, -0.404396057, 1, -8.19564079E-8, 5.96046519E-8, -1.01078633E-7, 0.939694166, -0.342019171, 1.52638329E-8, 0.34201926, 0.939693213))
  3851. CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3852. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 1.10000002, 0.300000012))
  3853. PartWeld = CFuncs.Weld.Create(m, THandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-5.34057617E-5, -0.943422318, -1.35441589, 1, -8.19564079E-8, 5.96046519E-8, -1.01078633E-7, 0.939694166, -0.342019171, 1.52638329E-8, 0.34201926, 0.939693213))
  3854. CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3855. --]]
  3856. AHandleR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "AHandleR", Vector3.new(0.799999952, 0.800000012, 1.22000003))
  3857. AHandleRWeld = CFuncs.Weld.Create(m, RightArm, AHandleR, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.209915161, 0.00999641418, -3.81469727E-6, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3858. --[[
  3859.  
  3860. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.899999976, 1.01999998))
  3861. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0999984741, 0.550004005, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3862. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3863. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.150001526, 0.200003624, -0.359994888, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3864. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3865. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149993896, 0.20000267, 0.359992981, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3866. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.20000005, 0.800000012, 1.20000005))
  3867. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.209899902, -0.809997559, 5.7220459E-6, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024))
  3868. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999988, 1.01999998))
  3869. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.300003052, 0.650004387, 1.71661377E-5, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3870. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.699999988, 1.01999998))
  3871. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149993896, 0.650003433, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3872. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999928, 0.520000041))
  3873. PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.199996948, -0.049996376, -3.81469727E-6, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3874. --]]
  3875. HitboxR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HitboxR", Vector3.new(0.799999952, 0.800000012, 1.22000003))
  3876.  
  3877. HitboxRWeld = CFuncs.Weld.Create(m, AHandleR, HitboxR, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.700003624, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024))
  3878. AHandleL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "AHandleL", Vector3.new(0.800000072, 0.800000012, 1.22000003))
  3879. AHandleLWeld = CFuncs.Weld.Create(m, LeftArm, AHandleL, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.210014343, 0.00999736786, 1.14440918E-5, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024))
  3880. HitboxL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HitboxL", Vector3.new(0.800000072, 0.800000012, 1.22000003))
  3881. HitboxLWeld = CFuncs.Weld.Create(m, AHandleL, HitboxL, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.700003624, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3882.  
  3883.  
  3884. --[[
  3885. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3886. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149986267, 0.200001717, -0.360012054, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3887. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999928, 0.520000041))
  3888. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.199989319, -0.0499982834, -9.53674316E-6, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3889. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3890. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149986267, 0.200001717, 0.359992981, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3891. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.20000005, 0.800000012, 1.20000005))
  3892. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.21005249, -0.81000042, 2.28881836E-5, -1, -8.19564079E-8, -5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, -5.96046519E-8, -1.41561088E-7, -1.00000024))
  3893. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.899999976, 1.01999998))
  3894. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0999984741, 0.550003052, -5.7220459E-6, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3895. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999988, 1.01999998))
  3896. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.299995422, 0.650003433, -3.81469727E-6, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3897. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.699999988, 1.01999998))
  3898. PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149993896, 0.65000248, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3899. LHandleR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "LHandleR", Vector3.new(1.02999997, 1.00999999, 1.19000006))
  3900. LHandleRWeld = CFuncs.Weld.Create(m, RightLeg, LHandleR, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00498962402, -0.0950021744, 0.00499534607, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024))
  3901. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000012, 0.800000012, 0.200000003))
  3902. PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00498962402, -0.00499916077, -0.604999542, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3903. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 1.00999999, 1.19000006))
  3904. PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.600002289, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3905. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 0.699999928, 1.19000006))
  3906. PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -0.454998016, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3907. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.400000006, 1.20000005, 0.200000003))
  3908. PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00499725342, -0.00499916077, -0.604999542, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3909. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000131, 1.20000005, 0.800000012))
  3910. PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00499725342, 0.0149993896, 0.00500297546, 2.28095047E-7, 1.00000775, 2.99581131E-7, -1.00000417, 5.63755016E-8, -4.06898749E-7, -2.98379774E-7, 2.07959161E-8, 1.0000037))
  3911. CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3912. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
  3913. WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.604999542, -0.504998207, 0.29499054, -2.98023224E-8, -6.70552254E-8, -1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8))
  3914. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3915. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
  3916. WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.60499382, -0.495001793, 0.305000305, -5.96046519E-8, -1.41561088E-7, -1.00000024, -8.19564079E-8, -1.00000119, -1.41561088E-7, -1, -8.19564079E-8, -5.96046519E-8))
  3917. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3918. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
  3919. WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.604999542, -0.495001793, 0.29499054, 2.98023224E-8, 6.70552254E-8, 1.00000012, -3.7252903E-8, -1.0000006, -7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8))
  3920. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3921. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
  3922. WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.604999542, -0.504998207, 0.305000305, 2.98023224E-8, 6.70552254E-8, 1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, -1, -4.47034836E-8, -2.98023224E-8))
  3923. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3924. LHandleL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "LHandleL", Vector3.new(1.02999997, 1.00999999, 1.19000006))
  3925. LHandleLWeld = CFuncs.Weld.Create(m, LeftLeg, LHandleL, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00498199463, -0.095000267, 0.00502204895, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024))
  3926. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 1.00999999, 1.19000006))
  3927. PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.600001335, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3928. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.400000006, 1.20000005, 0.300000012))
  3929. PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00499725342, -0.00500106812, -0.554998398, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3930. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 0.699999928, 1.19000006))
  3931. PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -0.454999924, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3932. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000131, 1.20000005, 0.800000012))
  3933. PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00499534607, 0.0149993896, 0.00500297546, 2.28095047E-7, 1.00000775, 2.99581131E-7, -1.00000417, 5.63755016E-8, -4.06898749E-7, -2.98379774E-7, 2.07959161E-8, 1.0000037))
  3934. CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3935. Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000012, 0.800000012, 0.300000012))
  3936. PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00498962402, -0.00500106812, -0.554998398, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024))
  3937. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3938. WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.554998398, -0.505000114, 0.305000305, 2.98023224E-8, 6.70552254E-8, 1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, -1, -4.47034836E-8, -2.98023224E-8))
  3939. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3940. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3941. WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.554998398, -0.505000114, 0.29499054, -2.98023224E-8, -6.70552254E-8, -1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8))
  3942. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3943. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3944. WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.554998398, -0.494999886, 0.29499054, 2.98023224E-8, 6.70552254E-8, 1.00000012, -3.7252903E-8, -1.0000006, -7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8))
  3945. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3946. Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
  3947. WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.554998398, -0.494999886, 0.305000305, -5.96046519E-8, -1.41561088E-7, -1.00000024, -8.19564079E-8, -1.00000119, -1.41561088E-7, -1, -8.19564079E-8, -5.96046519E-8))
  3948. CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
  3949. --]]
  3950. Shield = CFuncs.Part.Create(m, "Neon", 0, 0.5, "Pastle brown", "Part", Vector3.new(9.1, 8.5, 0.2))
  3951. CFuncs.Mesh.Create("SpecialMesh", Shield, "FileMesh", "rbxassetid://708292865", Vector3.new(0, 0, 0), Vector3.new(0.04, 0.04, 0.04))
  3952. Shield.Parent = nil
  3953.  
  3954. EffectModel = Create("Model")({Parent = Character, Name = "Effects"})
  3955. Effects = {
  3956. Block = {
  3957. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
  3958. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  3959. prt.Anchored = true
  3960. prt.CFrame = cframe
  3961. local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  3962. game:GetService("Debris"):AddItem(prt, 10)
  3963. if Type == 1 or Type == nil then
  3964. table.insert(Effects, {
  3965. prt,
  3966. "Block1",
  3967. delay,
  3968. x3,
  3969. y3,
  3970. z3,
  3971. msh
  3972. })
  3973. elseif Type == 2 then
  3974. table.insert(Effects, {
  3975. prt,
  3976. "Block2",
  3977. delay,
  3978. x3,
  3979. y3,
  3980. z3,
  3981. msh
  3982. })
  3983. end
  3984. end
  3985. },
  3986. Cylinder = {
  3987. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  3988. local prt = CFuncs.Part .. Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.2, 0.2, 0.2))
  3989. prt.Anchored = true
  3990. prt.CFrame = cframe
  3991. local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  3992. game:GetService("Debris"):AddItem(prt, 2)
  3993. Effects[#Effects + 1] = {
  3994. prt,
  3995. "Cylinder",
  3996. delay,
  3997. x3,
  3998. y3,
  3999. z3
  4000. }
  4001. end
  4002. },
  4003. Head = {
  4004. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  4005. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  4006. prt.Anchored = true
  4007. prt.CFrame = cframe
  4008. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Head", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4009. game:GetService("Debris"):AddItem(prt, 10)
  4010. table.insert(Effects, {
  4011. prt,
  4012. "Cylinder",
  4013. delay,
  4014. x3,
  4015. y3,
  4016. z3,
  4017. msh
  4018. })
  4019. end
  4020. },
  4021. Sphere = {
  4022. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  4023. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  4024. prt.Anchored = true
  4025. prt.CFrame = cframe
  4026. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4027. game:GetService("Debris"):AddItem(prt, 10)
  4028. table.insert(Effects, {
  4029. prt,
  4030. "Cylinder",
  4031. delay,
  4032. x3,
  4033. y3,
  4034. z3,
  4035. msh
  4036. })
  4037. end
  4038. },
  4039. Sphere2 = {
  4040. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  4041. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  4042. prt.Anchored = true
  4043. prt.CFrame = cframe
  4044. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4045. game:GetService("Debris"):AddItem(prt, 10)
  4046. table.insert(Effects, {
  4047. prt,
  4048. "Cylinder",
  4049. delay,
  4050. x3,
  4051. y3,
  4052. z3,
  4053. msh
  4054. })
  4055. end
  4056. },
  4057. Elec = {
  4058. Create = function(cff, x, y, z)
  4059. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, BrickColor.new("Pastel blue-green"), "Part", Vector3.new(1, 1, 1))
  4060. prt.Anchored = true
  4061. prt.CFrame = cff * CFrame.new(math.random(-x, x), math.random(-y, y), math.random(-z, z))
  4062. prt.CFrame = CFrame.new(prt.Position)
  4063. game:GetService("Debris"):AddItem(prt, 2)
  4064. local xval = math.random() / 2
  4065. local yval = math.random() / 2
  4066. local zval = math.random() / 2
  4067. local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(xval, yval, zval))
  4068. table.insert(Effects, {
  4069. prt,
  4070. "Elec",
  4071. 0.1,
  4072. x,
  4073. y,
  4074. z,
  4075. xval,
  4076. yval,
  4077. zval
  4078. })
  4079. end
  4080. },
  4081. Ring = {
  4082. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  4083. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  4084. prt.Anchored = true
  4085. prt.CFrame = cframe
  4086. local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4087. game:GetService("Debris"):AddItem(prt, 10)
  4088. table.insert(Effects, {
  4089. prt,
  4090. "Cylinder",
  4091. delay,
  4092. x3,
  4093. y3,
  4094. z3,
  4095. msh
  4096. })
  4097. end
  4098. },
  4099. Wave = {
  4100. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  4101. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  4102. prt.Anchored = true
  4103. prt.CFrame = cframe
  4104. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4105. game:GetService("Debris"):AddItem(prt, 10)
  4106. table.insert(Effects, {
  4107. prt,
  4108. "Cylinder",
  4109. delay,
  4110. x3,
  4111. y3,
  4112. z3,
  4113. msh
  4114. })
  4115. end
  4116. },
  4117. Break = {
  4118. Create = function(brickcolor, cframe, x1, y1, z1)
  4119. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
  4120. prt.Anchored = true
  4121. prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  4122. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4123. local num = math.random(10, 50) / 1000
  4124. game:GetService("Debris"):AddItem(prt, 10)
  4125. table.insert(Effects, {
  4126. prt,
  4127. "Shatter",
  4128. num,
  4129. prt.CFrame,
  4130. math.random() - math.random(),
  4131. 0,
  4132. math.random(50, 100) / 100
  4133. })
  4134. end
  4135. },
  4136. Fire = {
  4137. Create = function(brickcolor, cframe, x1, y1, z1, delay)
  4138. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  4139. prt.Anchored = true
  4140. prt.CFrame = cframe
  4141. msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4142. game:GetService("Debris"):AddItem(prt, 10)
  4143. table.insert(Effects, {
  4144. prt,
  4145. "Fire",
  4146. delay,
  4147. 1,
  4148. 1,
  4149. 1,
  4150. msh
  4151. })
  4152. end
  4153. },
  4154. FireWave = {
  4155. Create = function(brickcolor, cframe, x1, y1, z1)
  4156. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 1, brickcolor, "Effect", Vector3.new())
  4157. prt.Anchored = true
  4158. prt.CFrame = cframe
  4159. msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  4160. local d = Create("Decal")({
  4161. Parent = prt,
  4162. Texture = "rbxassetid://26356434",
  4163. Face = "Top"
  4164. })
  4165. local d = Create("Decal")({
  4166. Parent = prt,
  4167. Texture = "rbxassetid://26356434",
  4168. Face = "Bottom"
  4169. })
  4170. game:GetService("Debris"):AddItem(prt, 10)
  4171. table.insert(Effects, {
  4172. prt,
  4173. "FireWave",
  4174. 1,
  4175. 30,
  4176. math.random(400, 600) / 100,
  4177. msh
  4178. })
  4179. end
  4180. },
  4181. Lightning = {
  4182. Create = function(p0, p1, tym, ofs, col, th, tra, last)
  4183. local magz = (p0 - p1).magnitude
  4184. local curpos = p0
  4185. local trz = {
  4186. -ofs,
  4187. ofs
  4188. }
  4189. for i = 1, tym do
  4190. local li = CFuncs.Part.Create(EffectModel, "Neon", 0, tra or 0.4, col, "Ref", Vector3.new(th, th, magz / tym))
  4191. local ofz = Vector3.new(trz[math.random(1, 2)], trz[math.random(1, 2)], trz[math.random(1, 2)])
  4192. local trolpos = CFrame.new(curpos, p1) * CFrame.new(0, 0, magz / tym).p + ofz
  4193. li.Material = "Neon"
  4194. if tym == i then
  4195. local magz2 = (curpos - p1).magnitude
  4196. li.Size = Vector3.new(th, th, magz2)
  4197. li.CFrame = CFrame.new(curpos, p1) * CFrame.new(0, 0, -magz2 / 2)
  4198. table.insert(Effects, {
  4199. li,
  4200. "Disappear",
  4201. last
  4202. })
  4203. else
  4204. li.CFrame = CFrame.new(curpos, trolpos) * CFrame.new(0, 0, magz / tym / 2)
  4205. curpos = li.CFrame * CFrame.new(0, 0, magz / tym / 2).p
  4206. game.Debris:AddItem(li, 10)
  4207. table.insert(Effects, {
  4208. li,
  4209. "Disappear",
  4210. last
  4211. })
  4212. end
  4213. end
  4214. end
  4215. },
  4216. EffectTemplate = {}
  4217. }
  4218. local Invisible = true
  4219. function Reappear()
  4220. for _, i in pairs(AdvancingFortress:children()) do
  4221. if i:IsA("BasePart") then
  4222. coroutine.resume(coroutine.create(function(Part)
  4223. for i = 0, 1, 0.3 do
  4224. swait()
  4225. Part.Transparency = -i
  4226. end
  4227. Part.Transparency = 0
  4228. end), i)
  4229. end
  4230. end
  4231. for _, i in pairs(m:children()) do
  4232. if i:IsA("BasePart") then
  4233. coroutine.resume(coroutine.create(function(Part)
  4234. for i = 0, 1, 0.3 do
  4235. swait()
  4236. Part.Transparency = i
  4237. end
  4238. Part.Transparency = 0
  4239. end), i)
  4240. end
  4241. end
  4242. end
  4243. function ReappearArmorOnly()
  4244. for _, i in pairs(m:children()) do
  4245. if i:IsA("BasePart") then
  4246. coroutine.resume(coroutine.create(function(Part)
  4247. for i = 0, 1, 0.3 do
  4248. swait()
  4249. Part.Transparency = i
  4250. end
  4251. Part.Transparency = 0
  4252. for _,v in pairs(KQ) do
  4253. St=v.Weld.Part1.Name
  4254. if St=='FHead' then
  4255. St='Head'
  4256. end
  4257. v.Weld.Part1=Character[St]
  4258. end
  4259. end), i)
  4260. end
  4261. end
  4262. end
  4263. function Disappear()
  4264. for _, i in pairs(AdvancingFortress:children()) do
  4265. if i:IsA("BasePart") then
  4266. coroutine.resume(coroutine.create(function(Part)
  4267. for i = 0, 1, 0.3 do
  4268. swait()
  4269. Part.Transparency = i
  4270. end
  4271. Part.Transparency = 1
  4272. end), i)
  4273. end
  4274. end
  4275. for _, i in pairs(m:children()) do
  4276. if i:IsA("BasePart") then
  4277. coroutine.resume(coroutine.create(function(Part)
  4278. for i = 0, 1, 0.3 do
  4279. swait()
  4280. Part.Transparency = i
  4281. end
  4282. Part.Transparency = 1
  4283. end), i)
  4284. end
  4285. end
  4286. end
  4287. function DisappearArmorOnly()
  4288. for _, i in pairs(m:children()) do
  4289. if i:IsA("BasePart") then
  4290. coroutine.resume(coroutine.create(function(Part)
  4291. for i = 0, 1, 0.3 do
  4292. swait()
  4293. Part.Transparency = i
  4294. end
  4295. Part.Transparency = 1
  4296. for _,v in pairs(KQ) do
  4297. St=v.Weld.Part1.Name
  4298. if St=='Head' then
  4299. St='FHead'
  4300. end
  4301. v.Weld.Part1=AdvancingFortress[St]
  4302. end
  4303. end), i)
  4304. end
  4305. end
  4306. end
  4307. function CamShake(time, freq)
  4308. coroutine.resume(coroutine.create(function()
  4309. local cam = game:GetService("Workspace").CurrentCamera
  4310. local time = 10
  4311. local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
  4312. if math.random(1, 2) == 1 then
  4313. seed = Vector3.new(-seed.x, seed.y, 0)
  4314. end
  4315. if math.random(1, 2) == 1 then
  4316. seed = Vector3.new(seed.x, -seed.y, 0)
  4317. end
  4318. cam.CoordinateFrame = CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
  4319. for i = 1, time do
  4320. cam.CoordinateFrame = CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
  4321. wait()
  4322. end
  4323. end))
  4324. end
  4325. local ora = false
  4326. function ORA()
  4327. attack = true
  4328. local S = CFuncs.Sound.Create("", Torso, 3, 1)
  4329. S.Looped = true
  4330. if ora == true then
  4331. while ora == true do
  4332. CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
  4333. MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1)
  4334. for i = 0, 1, 0.8 do
  4335. swait()
  4336. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
  4337. PlayAnimationFromTable({
  4338. CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4339. CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4340. CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4341. CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4342. CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4343. CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4344. }, 0.8, false)
  4345. end
  4346. CFuncs.Sound.Create("200632136", HitboxR, 0.3, math.random(1, 1.2))
  4347. MagnitudeDamage(HitboxR, 5, 4, 10, 0, "Normal", "260430117", 1)
  4348. for i = 0, 1, 0.8 do
  4349. swait()
  4350. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
  4351. PlayAnimationFromTable({
  4352. CFrame.new(1.1920929E-6, -0.0170394331, -0.52941519, 0.70710516, -2.21270369E-7, -0.707108498, 0.18301405, 0.965925574, 0.183012888, 0.683014154, -0.258820117, 0.683010995) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4353. CFrame.new(-1.22189522E-6, 1.49999356, 1.04308128E-6, 0.707110465, 0.122788236, 0.696360528, -1.4748274E-6, 0.98480773, -0.173648238, -0.707103193, 0.122787461, 0.696368098) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4354. CFrame.new(1.44562268, 0.333473027, -0.475224167, 0.907739162, 0.217196256, 0.358959734, 0.40125221, -0.199453548, -0.893991232, -0.122576535, 0.955528319, -0.268199235) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4355. CFrame.new(-1.884794, 0.881342709, -0.770847201, 0.0912726, 0.688403964, -0.719562054, -0.91795665, -0.221949756, -0.328776807, -0.386037856, 0.690535009, 0.611666858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4356. CFrame.new(0.789779902, -1.8586235, 0.161380947, 0.965926766, -0.258817255, -8.10623169E-6, 0.243211254, 0.907672405, 0.342022836, -0.0885141194, -0.330371499, 0.939691722) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4357. CFrame.new(-0.73783946, -1.45406294, -0.215006173, 0.882573366, -0.0180292428, 0.469829261, -0.163172901, 0.925412893, 0.342031717, -0.440952569, -0.378531486, 0.813802838) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4358. }, 0.8, false)
  4359. end
  4360. CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
  4361. MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1)
  4362. for i = 0, 1, 0.8 do
  4363. swait()
  4364. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
  4365. PlayAnimationFromTable({
  4366. CFrame.new(0.215482175, -0.0393944569, -0.126133978, 0.259671897, -0.351393819, 0.8994959, -0.075478971, 0.921212733, 0.381667405, -0.962742627, -0.167001322, 0.212690249) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4367. CFrame.new(-1.26510859E-5, 1.49999118, -2.16066837E-7, 0.420251548, -0.0215960592, -0.90715003, -0.100918382, 0.992402375, -0.0703775883, 0.901778162, 0.12112467, 0.414879382) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4368. CFrame.new(1.81840861, 0.705381036, -0.347923756, -0.236346364, -0.883376777, 0.404705286, 0.945798516, -0.113677993, 0.304209948, -0.222726092, 0.454668403, 0.862362981) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4369. CFrame.new(-1.21960759, 0.420275182, -0.728423595, -0.57802856, -0.255150676, 0.775100708, 0.665436089, -0.697164714, 0.266751111, 0.472311139, 0.669969678, 0.572767615) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4370. CFrame.new(0.620917439, -1.53014767, -0.12091887, 0.707106113, 0.241845652, -0.66446346, -1.2293458E-6, 0.939692676, 0.342019886, 0.707107484, -0.241843566, 0.664462805) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4371. CFrame.new(-0.873213649, -1.89646459, -0.100004375, 0.933012128, 0.353242815, -0.0686147735, -0.258823931, 0.791241407, 0.554028153, 0.249997303, -0.499155849, 0.829665601) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4372. }, 0.8, false)
  4373. end
  4374. CFuncs.Sound.Create("200632136", HitboxR, 0.3, math.random(1, 1.2))
  4375. MagnitudeDamage(HitboxR, 5, 4, 10, 0, "Normal", "260430117", 1)
  4376. for i = 0, 1, 0.8 do
  4377. swait()
  4378. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
  4379. PlayAnimationFromTable({
  4380. CFrame.new(0.299998224, -0.0468490347, -0.211314023, 0.642786682, -2.87348001E-7, -0.766045272, 0.323744863, 0.906307757, 0.271653205, 0.694272637, -0.42261824, 0.582562685) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4381. CFrame.new(2.71201134E-6, 1.4999969, 8.94069672E-7, 0.642777503, 0.133020476, 0.754416466, 4.31999706E-6, 0.984809279, -0.173647597, -0.766052961, 0.111620098, 0.633012772) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4382. CFrame.new(1.27057993, 0.327670783, -0.599993467, 0.638493001, 0.280156553, -0.716825664, -0.769049883, 0.196164608, -0.608343422, -0.0298155248, 0.939697862, 0.340704083) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4383. CFrame.new(-1.86040878, 1.02262986, -0.452570885, 0.386218816, 0.717701018, -0.579433978, -0.403004408, -0.433759809, -0.805879354, -0.829712272, 0.544763446, 0.121709965) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4384. CFrame.new(0.779964924, -1.75316048, -0.0263362825, 0.826099217, -0.36394459, 0.43023771, 0.181541473, 0.894650102, 0.40822047, -0.533481896, -0.259124577, 0.805140793) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4385. CFrame.new(-0.724003315, -1.47219872, -0.266945302, 0.766038954, -0.166370958, 0.620890498, 4.09781933E-6, 0.965925932, 0.258819997, -0.642794192, -0.198263675, 0.739937425) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4386. }, 0.8, false)
  4387. end
  4388. CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
  4389. MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1)
  4390. end
  4391. end
  4392. S:Stop()
  4393. local S2 = CFuncs.Sound.Create("", Torso, 1.5, 1)
  4394. for i = 0, 1, 0.13 do
  4395. swait()
  4396. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -3), 0.5)
  4397. PlayAnimationFromTable({
  4398. CFrame.new(2.68220901E-6, -0.0739577487, 0.0232374109, 0.707105994, -3.47710994E-7, -0.707107604, -0.122787997, 0.98480767, -0.122788213, 0.696364999, 0.173648596, 0.696363389) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4399. CFrame.new(-5.36441803E-7, 1.49999356, -1.28149986E-6, 0.707105994, -0.122788511, 0.696365297, -3.47710994E-7, 0.984808028, 0.173649326, -0.707107604, -0.122788727, 0.696363688) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4400. CFrame.new(1.13747835, 0.382733107, -0.729447305, 0.579597414, 0.772029877, -0.260839432, -0.351051509, -0.0523141921, -0.934893906, -0.735411942, 0.633429527, 0.240701318) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4401. CFrame.new(-1.53455412, 0.605712295, -0.542039633, 0.786121905, 0.427828372, -0.446066588, -0.606968522, 0.398195386, -0.687771559, -0.116626531, 0.811420619, 0.572708428) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4402. CFrame.new(0.903839946, -1.70734286, 0.373858094, 0.863655448, -0.430708885, 0.261895239, 0.187955216, 0.757234871, 0.625514567, -0.46773085, -0.491004646, 0.734943748) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4403. CFrame.new(-0.596739769, -1.62411702, -0.0967329144, 0.725493789, -0.291957259, 0.623233199, -0.081900157, 0.86250174, 0.499382436, -0.683338165, -0.41334182, 0.601828396) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4404. }, 0.2, false)
  4405. end
  4406. CFuncs.Sound.Create("471881954", HitboxR, 1, 1)
  4407. MagnitudeDamage(HitboxR, 7, 10, 15, 50, "Normal", "610359590", 1)
  4408. for i = 0, 1, 0.1 do
  4409. swait()
  4410. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 0.3)
  4411. PlayAnimationFromTable({
  4412. CFrame.new(-0.338160992, -0.0772590488, -0.484170675, 0.307024002, -0.153706044, 0.939207554, -0.403236002, 0.872901201, 0.274671286, -0.86205399, -0.463052958, 0.206021816) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4413. CFrame.new(-0.0502282679, 1.50051379, -0.0864891857, 0.502356887, -0.246090144, -0.828901231, -0.00520065427, 0.957766473, -0.287500501, 0.864644766, 0.148738697, 0.479860842) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4414. CFrame.new(1.81698525, 1.20575511, -0.168038458, 0.0800605565, -0.859217465, 0.505307972, 0.457053572, -0.418860257, -0.784640014, 0.885828495, 0.293771386, 0.359173566) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4415. CFrame.new(-1.66351938, 0.691055655, 0.203685582, 0.309526145, 0.793331623, -0.524231553, -0.937197804, 0.347743452, -0.0271089375, 0.160791725, 0.499699503, 0.851144433) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4416. CFrame.new(0.971616864, -1.6145575, 0.096719563, 0.544056833, -0.203144252, -0.814085484, 0.51142931, 0.849463344, 0.129818588, 0.665161908, -0.486975014, 0.566052973) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4417. CFrame.new(-0.676943898, -1.44413579, 0.206094518, 0.884253025, 0.0570309162, -0.463512957, 0.209485695, 0.838620007, 0.502824426, 0.417387724, -0.541723251, 0.729605079) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4418. }, 0.6, false)
  4419. end
  4420. attack = false
  4421. end
  4422. function CastleCrusherFist()
  4423. attack = true
  4424. STDamage = true
  4425. local S2 = CFuncs.Sound.Create("", Torso, 1, 1)
  4426. for i = 0, 1, 0.1 do
  4427. swait()
  4428. Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
  4429. Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
  4430. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.2)
  4431. PlayAnimationFromTable({
  4432. CFrame.new(-5.99771738E-7, -0.00717129931, 0.169464022, 0.422617912, -2.2671E-7, -0.906308055, -0.309975952, 0.939692557, -0.144544229, 0.851650834, 0.342020661, 0.397130787) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4433. CFrame.new(-0.0102166235, 1.52751005, -0.239579424, 0.456926107, -0.171424359, 0.872835577, -0.167732254, 0.94705075, 0.273807496, -0.87355268, -0.271512181, 0.403976858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4434. CFrame.new(0.944673777, 0.474064022, -0.539126158, 0.229199454, 0.762564063, 0.604949772, 0.809601307, 0.195682317, -0.553402781, -0.540382624, 0.616607308, -0.572522938) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4435. CFrame.new(-1.61232829, 0.309644789, -0.24482432, 0.455398798, 0.536860108, -0.710207343, -0.887026072, 0.205374956, -0.413530886, -0.076149486, 0.818293095, 0.569735885) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4436. CFrame.new(1.08113468, -1.48232126, 0.656104684, 0.81421864, -0.517612338, 0.262917578, 0.175395042, 0.651024699, 0.738514543, -0.553430021, -0.555197835, 0.620862961) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4437. CFrame.new(-0.427128136, -1.50760674, -0.0473105907, 0.804508269, -0.373179317, 0.462065101, -0.173640698, 0.596196175, 0.783836842, -0.567992628, -0.71083647, 0.414845526) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4438. }, 0.2, false)
  4439. end
  4440. MagnitudeDamage(HitboxR, 10, 50, 80, 100, "Normal", "610359515", 1)
  4441. Effects.Wave.Create(BrickColor.new("Pastel blue-green"), RootPart.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.06)
  4442. CFuncs.Sound.Create("471881980", HitboxR, 1, 0.9)
  4443. CFuncs.Sound.Create("471881954", HitboxR, 1, 0.8)
  4444. for i = 0, 1, 0.08 do
  4445. swait()
  4446. Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
  4447. Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
  4448. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 0.3)
  4449. PlayAnimationFromTable({
  4450. CFrame.new(-3.57627869E-7, -0.116980031, -2.22140098, 0.342020035, -6.11579551E-8, 0.939692736, -0.604023039, 0.766044259, 0.219846413, -0.71984607, -0.642787933, 0.262002468) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4451. CFrame.new(-1.13248825E-6, 1.49999046, 8.94069672E-7, 0.422608167, -0.383014679, -0.82140249, -1.36196613E-5, 0.906310022, -0.422613323, 0.906312764, 0.17861104, 0.383008778) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4452. CFrame.new(1.72490048, 1.25688744, -0.021425128, -0.678134382, -0.731868863, 0.0670941696, 0.667953849, -0.575675249, 0.47163111, -0.306547582, 0.364645123, 0.879239857) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4453. CFrame.new(-1.70565486, 0.469353855, 0.162862837, 0.82686162, 0.55728358, 0.0757693052, -0.414878726, 0.513436973, 0.751176, 0.379712611, -0.652546048, 0.655748963) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4454. CFrame.new(0.757160306, -1.48393714, -0.193787217, 0.601814985, 0.305624545, -0.737842917, -2.98023224E-8, 0.923879623, 0.382683486, 0.798635662, -0.230304718, 0.556004763) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4455. CFrame.new(-0.908789515, -1.60188651, -0.0663503706, 0.696367741, 0.548584938, -0.462741733, -0.173660636, 0.7544052, 0.633021533, 0.696362019, -0.360454619, 0.620610356) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4456. }, 0.6, false)
  4457. end
  4458. STDamage = false
  4459. attack = false
  4460. end
  4461. function CastleCrusherFist()
  4462. attack = true
  4463. STDamage = true
  4464. local S2 = CFuncs.Sound.Create("", Torso, 1, 1)
  4465. for i = 0, 1, 0.1 do
  4466. swait()
  4467. Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
  4468. Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
  4469. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.5)
  4470. PlayAnimationFromTable({
  4471. CFrame.new(-5.99771738E-7, -0.00717129931, 0.169464022, 0.422617912, -2.2671E-7, -0.906308055, -0.309975952, 0.939692557, -0.144544229, 0.851650834, 0.342020661, 0.397130787) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4472. CFrame.new(-0.0102166235, 1.52751005, -0.239579424, 0.456926107, -0.171424359, 0.872835577, -0.167732254, 0.94705075, 0.273807496, -0.87355268, -0.271512181, 0.403976858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4473. CFrame.new(0.944673777, 0.474064022, -0.539126158, 0.229199454, 0.762564063, 0.604949772, 0.809601307, 0.195682317, -0.553402781, -0.540382624, 0.616607308, -0.572522938) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4474. CFrame.new(-1.61232829, 0.309644789, -0.24482432, 0.455398798, 0.536860108, -0.710207343, -0.887026072, 0.205374956, -0.413530886, -0.076149486, 0.818293095, 0.569735885) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4475. CFrame.new(1.08113468, -1.48232126, 0.656104684, 0.81421864, -0.517612338, 0.262917578, 0.175395042, 0.651024699, 0.738514543, -0.553430021, -0.555197835, 0.620862961) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4476. CFrame.new(-0.427128136, -1.50760674, -0.0473105907, 0.804508269, -0.373179317, 0.462065101, -0.173640698, 0.596196175, 0.783836842, -0.567992628, -0.71083647, 0.414845526) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4477. }, 0.2, false)
  4478. end
  4479. Effects.Wave.Create(BrickColor.new("Pastel blue-green"), RootPart.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.06)
  4480. Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 140
  4481. CFuncs.Sound.Create("471881980", HitboxR, 1, 0.9)
  4482. CFuncs.Sound.Create("471881954", HitboxR, 1, 0.8)
  4483. for i = 0, 1, 0.08 do
  4484. swait()
  4485. MagnitudeDamage(HitboxR, 5, 50, 80, 100, "Normal", "610359515", 1)
  4486. Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
  4487. Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
  4488. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 1)
  4489. PlayAnimationFromTable({
  4490. CFrame.new(-3.57627869E-7, -0.116980031, -2.22140098, 0.342020035, -6.11579551E-8, 0.939692736, -0.604023039, 0.766044259, 0.219846413, -0.71984607, -0.642787933, 0.262002468) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4491. CFrame.new(-1.13248825E-6, 1.49999046, 8.94069672E-7, 0.422608167, -0.383014679, -0.82140249, -1.36196613E-5, 0.906310022, -0.422613323, 0.906312764, 0.17861104, 0.383008778) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4492. CFrame.new(1.72490048, 1.25688744, -0.021425128, -0.678134382, -0.731868863, 0.0670941696, 0.667953849, -0.575675249, 0.47163111, -0.306547582, 0.364645123, 0.879239857) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4493. CFrame.new(-1.70565486, 0.469353855, 0.162862837, 0.82686162, 0.55728358, 0.0757693052, -0.414878726, 0.513436973, 0.751176, 0.379712611, -0.652546048, 0.655748963) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4494. CFrame.new(0.757160306, -1.48393714, -0.193787217, 0.601814985, 0.305624545, -0.737842917, -2.98023224E-8, 0.923879623, 0.382683486, 0.798635662, -0.230304718, 0.556004763) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4495. CFrame.new(-0.908789515, -1.60188651, -0.0663503706, 0.696367741, 0.548584938, -0.462741733, -0.173660636, 0.7544052, 0.633021533, 0.696362019, -0.360454619, 0.620610356) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4496. }, 0.6, false)
  4497. end
  4498. STDamage = false
  4499. attack = false
  4500. end
  4501.  
  4502.  
  4503. distance2__=0
  4504. AdvancingFortress.FHead.face:remove()
  4505.  
  4506. function Lattack()
  4507. attack = true
  4508. local S = CFuncs.Sound.Create("", Torso, 3, 1)
  4509. S.Looped = true
  4510. if Long then
  4511. while Long and distance2__>-15 do-- max range
  4512. distance2__=distance2__-1
  4513.  
  4514. for i = 0, 1, 0.8 do
  4515. swait()
  4516. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, distance2__), 0.5)
  4517. PlayAnimationFromTable({
  4518. CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4519. CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4520. CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4521. CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4522. CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4523. CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4524. }, 0.8, false)
  4525. end
  4526.  
  4527. end
  4528. for i = 0, 1, 0.8 do
  4529. swait()
  4530. PlayAnimationFromTable({
  4531. CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, -1, 0),
  4532. CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4533. CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4534. CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4535. CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4536. CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4537. }, 0.8, false)
  4538. end
  4539. CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
  4540. MagnitudeDamage(HitboxL, 5, 4, 50, 0, "Normal", "260430117", 1)
  4541. PlayAnimationFromTable({
  4542. CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 1, 0),
  4543. CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4544. CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4545. CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4546. CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4547. CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4548. }, 0.8, false)
  4549. end
  4550. wait(1)
  4551. distance2__=0
  4552. STDamage = false
  4553. attack = false
  4554. end
  4555.  
  4556.  
  4557.  
  4558.  
  4559. function weld5(part0, part1, c0, c1)
  4560. local weeld = Instance.new("Weld", part0)
  4561. weeld.Part0 = part0
  4562. weeld.Part1 = part1
  4563. weeld.C0 = c0
  4564. weeld.C1 = c1
  4565. return weeld
  4566. end
  4567. local Grab = false
  4568. function GRABEMBOIGRABEM()
  4569. attack = true
  4570. gp = nil
  4571. con1 = HitboxR.Touched:connect(function(hit)
  4572. local ht = hit.Parent
  4573. local hum1 = ht:FindFirstChild("Humanoid")
  4574. if Grab == false then
  4575. if hum1 ~= nil and hit.Parent ~= Character then
  4576. hum1.PlatformStand = true
  4577. gp = ht
  4578. Grab = true
  4579. local asd = weld5(RightArm, ht:FindFirstChild("Torso"), CFrame.new(0, -1.5, 0), CFrame.new(0, 0, 0))
  4580. asd.Parent = RightArm
  4581. asd.Name = "asd"
  4582. asd.C0 = asd.C0 * CFrame.Angles(math.rad(-90), 0, 0)
  4583. CFuncs.Sound.Create("200632821", Torso, 1, 1)
  4584. elseif hum1 == nil then
  4585. con1:disconnect()
  4586. wait()
  4587. return
  4588. end
  4589. end
  4590. end)
  4591. for i = 0, 1, 0.2 do
  4592. swait()
  4593. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.3)
  4594. PlayAnimationFromTable({
  4595. CFrame.new(-1.08022243E-4, -0.233785003, -0.0873367637, 0.499999821, -1.78813863E-7, -0.866025507, 0.150383934, 0.984807789, 0.0868239477, 0.852868676, -0.173648283, 0.492403716) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4596. CFrame.new(-1.2665987E-7, 1.49999368, -1.02072954E-6, 0.573575675, 0.0713936985, 0.816035628, -5.01982868E-7, 0.996194899, -0.0871551931, -0.819152594, 0.049989678, 0.571393132) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4597. CFrame.new(1.47017705, 0.884583473, 0.0280318335, 0.886720777, -0.205462068, 0.414139926, 0.236241817, -0.568640172, -0.787933052, 0.397386849, 0.796513736, -0.455686152) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4598. CFrame.new(-1.76647317, 0.409804255, -0.03838256, 0.444113791, 0.836516619, -0.320940912, -0.836516619, 0.258818626, -0.482962757, -0.320940822, 0.482962757, 0.814704895) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4599. CFrame.new(0.838749349, -1.98392951, 0.15807499, 0.830397308, -0.277826965, 0.48296237, 0.167731524, 0.951251447, 0.258818328, -0.53132534, -0.133914024, 0.836516857) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4600. CFrame.new(-0.811016142, -1.63281643, -0.179561377, 0.642214835, 0.00870995224, 0.76647532, -0.0151349902, 0.999884725, 0.00131897628, -0.766375303, -0.0124476701, 0.642272472) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4601. }, 0.3, false)
  4602. end
  4603. for i = 0, 1, 0.1 do
  4604. swait()
  4605. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -6), 0.3)
  4606. PlayAnimationFromTable({
  4607. CFrame.new(0.159273595, -0.292363107, -0.115490548, 0.0844330043, -0.144068986, 0.985959053, -0.357129037, 0.919379771, 0.164923266, -0.930231094, -0.366039604, 0.0261747837) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4608. CFrame.new(4.81307507E-6, 1.49999106, -3.65450978E-6, 0.171444774, -0.100317284, -0.980072975, -0.0616287738, 0.991762042, -0.11229457, 0.983264267, 0.0796530023, 0.163850009) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4609. CFrame.new(1.73932612, 1.06159639, 0.141945362, -0.153680667, -0.913934886, 0.375639945, 0.659919798, -0.377877831, -0.649395287, 0.735450923, 0.148092732, 0.661196351) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4610. CFrame.new(-1.68730593, 0.429691374, -0.418232322, 0.633863091, 0.519853055, -0.57268703, -0.772902489, 0.453472316, -0.443829596, 0.028971523, 0.723958433, 0.689235032) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4611. CFrame.new(0.51381135, -1.74729896, 0.0663300753, 0.422899842, 0.615153313, -0.665388703, -0.0435856879, 0.747240186, 0.66312325, 0.905127704, -0.251433372, 0.342819571) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4612. CFrame.new(-0.991570175, -1.5009346, -0.1830419, 0.415304065, 0.586875141, -0.695054054, -0.166150108, 0.800146103, 0.576333642, 0.894380629, -0.123870395, 0.429813296) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4613. }, 0.3, false)
  4614. end
  4615. if Grab == true then
  4616. for i = 1, 5 do
  4617. for i = 0, 1, 0.35 do
  4618. swait()
  4619. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 13, -6), 0.3)
  4620. PlayAnimationFromTable({
  4621. CFrame.new(-0.0701122433, -0.336599797, -0.467321932, 0.694850504, -0.140219957, -0.70535183, 0.704946458, 0.326802045, 0.629484713, 0.142244101, -0.934633017, 0.325926095) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4622. CFrame.new(-3.05473804E-6, 1.49998987, 8.94069672E-7, 0.707109332, 0.122785509, 0.696362555, 1.49011612E-6, 0.984807491, -0.173649877, -0.707104206, 0.122789055, 0.696367502) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4623. CFrame.new(1.23286271, 0.549701929, -0.640782475, 0.740093768, 0.612683415, 0.277277708, 0.0735714883, 0.336068332, -0.938959956, -0.668469429, 0.715318501, 0.203645304) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4624. CFrame.new(-1.63418663, 0.202915072, -0.0286649466, 0.865367413, 0.490698665, 0.101754986, -0.445756227, 0.846484005, -0.291146517, -0.228999093, 0.206590697, 0.951251805) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4625. CFrame.new(0.702593744, -1.71321297, 0.369734973, 0.965928972, -0.148447216, 0.212003857, 1.10641122E-6, 0.819153726, 0.573574424, -0.258809477, -0.554031372, 0.791244447) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4626. CFrame.new(-0.577289343, -1.34221494, -0.247686923, 0.766049445, -0.219846189, 0.604016602, 1.58697367E-6, 0.939692199, 0.342021465, -0.642781496, -0.262004316, 0.719851196) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4627. }, 0.4, false)
  4628. end
  4629. for i = 0, 1, 0.3 do
  4630. swait()
  4631. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -6), 0.3)
  4632. PlayAnimationFromTable({
  4633. CFrame.new(-0.170705646, -0.774955988, -0.472947001, 0.827218175, 0.130671635, 0.546475112, -0.561879098, 0.194839522, 0.803946257, -0.00142200035, -0.972091854, 0.234596446) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4634. CFrame.new(-1.76951289E-7, 1.49999058, 2.2649765E-6, 0.80180192, -0.161171481, -0.575445414, 0.176131338, 0.983905077, -0.0301590711, 0.571044207, -0.0771723837, 0.817283988) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4635. CFrame.new(1.59014189, 0.537312388, -0.263691217, 0.798337102, -0.524361372, 0.296147287, 0.455999702, 0.205153137, -0.866011977, 0.393347621, 0.826412499, 0.402889967) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4636. CFrame.new(-1.41546631, 0.414666086, 0.337005794, 0.716736436, 0.581529975, 0.384852976, -0.56681174, 0.807305396, -0.164264664, -0.406218559, -0.100404784, 0.908243656) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4637. CFrame.new(0.793360233, -1.59947133, 0.0620805621, 0.876221955, -0.148448378, -0.458477885, 0.368687749, 0.81915307, 0.439383447, 0.310339272, -0.55403173, 0.772486985) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4638. CFrame.new(-0.535338402, -1.81867206, 0.817932665, 0.829598367, 0.11430642, -0.546535134, 0.32139504, 0.702652454, 0.634810925, 0.456587166, -0.702291727, 0.546181798) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4639. }, 0.7, false)
  4640. end
  4641. local hit, pos = rayCast(HitboxR.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 100, Character)
  4642. if hit ~= nil then
  4643. MagnitudeDamage(HitboxR, 5, 10, 30, 0, "Normal", "610359515", 1.3)
  4644. Effects.Block.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 1, 1, 1, 0.7, 0.7, 0.7, 0.09, 1)
  4645. Effects.Wave.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 1, 1, 1, 0.7, 0.7, 0.7, 0.09)
  4646. Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 3, 3, 3, 5, 5, 5, 0.09)
  4647. end
  4648. end
  4649. end
  4650. for i, v in pairs(RightArm:GetChildren()) do
  4651. if v.Name == "asd" and v:IsA("Weld") then
  4652. v:Remove()
  4653. end
  4654. end
  4655. Grab = false
  4656. con1:disconnect()
  4657. attack = false
  4658. end
  4659. local IsWearingArmor = false
  4660. function Armor(Mode)
  4661. attack = true
  4662. if IsWearingArmor == false and Mode == "On" then
  4663. IsWearingArmor = true
  4664. Disappear()
  4665. swait(10)
  4666. ReappearArmorOnly()
  4667. Character.Humanoid.MaxHealth = 500
  4668. Character.Humanoid.Health = 500
  4669. AHandleRWeld.Part0 = Character["Right Arm"]
  4670. AHandleLWeld.Part0 = Character["Left Arm"]
  4671. for i, v in pairs(AdvancingFortress:GetChildren()) do
  4672. if v:IsA("BasePart") then
  4673. v.Transparency = 1
  4674. end
  4675. end
  4676. for i, v in pairs(Character:GetChildren()) do
  4677. if v:IsA("Accessory") then
  4678. v.Handle.Transparency = 1
  4679. end
  4680. end
  4681. elseif IsWearingArmor == true and Mode == "Off" then
  4682. IsWearingArmor = false
  4683. DisappearArmorOnly()
  4684. for i, v in pairs(Character:GetChildren()) do
  4685. if v:IsA("Accessory") then
  4686. v.Handle.Transparency = 0
  4687. end
  4688. end
  4689. swait(10)
  4690. Reappear()
  4691. Character.Humanoid.MaxHealth = 100
  4692. Character.Humanoid.Health = 100
  4693.  
  4694. AHandleRWeld.Part0 = RightArm
  4695. AHandleLWeld.Part0 = LeftArm
  4696.  
  4697. for i, v in pairs(AdvancingFortress:GetChildren()) do
  4698. if v:IsA("BasePart") then
  4699. v.Transparency = 0
  4700. end
  4701. end
  4702. end
  4703. attack = false
  4704. end
  4705. local ShieldMode = false
  4706. local ShieldCharge = false
  4707. function HoloHexShield()
  4708. attack = true
  4709. Shield.Parent = m
  4710. Shield.CanCollide = true
  4711. if ShieldMode == true then
  4712. while ShieldMode == true do
  4713. swait()
  4714. Effects.Elec.Create(Shield.CFrame, 6, 6, 6)
  4715. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
  4716. PlayAnimationFromTable({
  4717. CFrame.new(-1.35600567E-6, -0.00759640103, -0.0868249983, 0.499999046, -1.78813579E-7, -0.866026044, 0.150384009, 0.984807789, 0.0868238211, 0.852869093, -0.173648283, 0.492402941) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4718. CFrame.new(1.49011612E-7, 1.4999963, -2.08616257E-7, 0.499999046, 0.0754797831, 0.862731695, -1.78813579E-7, 0.996196151, -0.0871563852, -0.866026044, 0.0435779616, 0.498097092) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4719. CFrame.new(1.50238657, 0.320674658, 0.252193451, 0.855209947, -0.376432747, -0.356249839, 0.469514668, 0.853786647, 0.224954769, 0.219480619, -0.35964793, 0.906907678) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4720. CFrame.new(-0.944740474, 0.689363539, -0.718644142, 0.836517215, -0.545084715, 0.0558781698, -0.258834839, -0.482974619, -0.836504936, 0.482953727, 0.685287297, -0.545103252) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4721. CFrame.new(0.61525929, -1.85127568, 0.120779425, 0.928754449, -0.162676111, 0.333104134, 0.0394990072, 0.93689239, 0.347407103, -0.368597984, -0.309496939, 0.876555264) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4722. CFrame.new(-0.849455297, -1.60697818, -0.270956695, 0.696359396, -0.136922374, 0.704511464, -0.122786656, 0.944430828, 0.30491665, -0.707112312, -0.298836082, 0.640850842) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4723. }, 0.3, false)
  4724. end
  4725. end
  4726. Shield.CanCollide = false
  4727. CFuncs.Sound.Create("200632211", HitboxR, 1, 0.8)
  4728. CFuncs.Sound.Create("200632875", HitboxR, 1, 0.9)
  4729. Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 160
  4730. Effects.Wave.Create(BrickColor.new("Pastel blue-green"), RootPart.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.06)
  4731. for i = 0, 1, 0.05 do
  4732. swait()
  4733. MagnitudeDamage(Shield, 5, 10, 15, 20, "Normal", "610359515", 1.3)
  4734. Effects.Elec.Create(Shield.CFrame, 6, 6, 6)
  4735. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -3), 1)
  4736. PlayAnimationFromTable({
  4737. CFrame.new(8.64267349E-7, -0.183445007, -0.748600185, 0.499999046, -1.19209105E-7, -0.866026044, 0.496732056, 0.819152176, 0.28678751, 0.709407032, -0.573576331, 0.409575343) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4738. CFrame.new(-7.15255737E-7, 1.50001967, -6.2584877E-7, 0.499999046, 0.36600244, 0.784893453, -1.19209105E-7, 0.90631634, -0.42262283, -0.866026044, 0.211310923, 0.453157306) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4739. CFrame.new(1.76569033, 0.610707581, 0.171269983, 0.658267856, -0.680293143, -0.322312057, 0.725086272, 0.457917482, 0.514355659, -0.202320263, -0.572288036, 0.794703186) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4740. CFrame.new(-1.07552779, 1.01543474, -0.975205183, 0.645357251, -0.653341353, -0.39580214, -0.64124006, -0.181770697, -0.745500326, 0.4151209, 0.734918237, -0.536255598) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4741. CFrame.new(0.630614281, -1.76328135, 0.440194428, 0.866077662, -0.24334389, 0.436684549, -0.0614839792, 0.815044224, 0.57612747, -0.496114343, -0.525820255, 0.69092983) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4742. CFrame.new(-0.857700765, -1.25810766, -0.239681423, 0.499215126, -0.257185757, 0.827429712, -0.238765404, 0.877132356, 0.416689515, -0.832931936, -0.405579239, 0.376470625) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4743. }, 0.5, false)
  4744. end
  4745. Shield.Parent = nil
  4746. attack = false
  4747. end
  4748. Mouse.Button1Down:connect(function()
  4749. if attack == false and attacktype == 1 then
  4750. attacktype = 2
  4751. attackone()
  4752. elseif attack == false and attacktype == 2 then
  4753. attacktype = 1
  4754. attacktwo()
  4755. end
  4756. end)
  4757. game.Lighting.Outlines = false
  4758. function attackone()
  4759. attack = true
  4760. for i = 0, 1, 0.12 do
  4761. swait()
  4762. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
  4763. PlayAnimationFromTable({
  4764. CFrame.new(1.51857734E-4, -0.310488015, -0.087417841, 0.707106054, 5.26835073E-8, -0.707107484, 0.122787014, 0.984807968, 0.122786865, 0.696365058, -0.173646957, 0.696363688) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4765. CFrame.new(0.101928703, 1.50244772, -0.0383823365, 0.76589334, 0.0762532279, 0.638430059, -0.0196644422, 0.995256186, -0.095281601, -0.642666996, 0.0604211651, 0.763759375) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4766. CFrame.new(1.01774633, 0.557527065, -0.776187301, 0.541353703, 0.741649806, 0.396095604, 0.711713314, -0.153383806, -0.685520053, -0.447661191, 0.653015316, -0.610876858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4767. CFrame.new(-1.07208586, 0.264054269, -0.716768324, 0.529938459, -0.260122895, -0.807156265, -0.752277017, 0.295165181, -0.589030504, 0.39146477, 0.919355154, -0.039265126) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4768. CFrame.new(0.81415844, -1.89738977, 0.144144416, 0.866025925, -0.171008825, 0.469845951, -1.40815973E-6, 0.939692497, 0.342020512, -0.499999285, -0.296199232, 0.813797772) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4769. CFrame.new(-0.818738878, -1.59999573, -0.397991776, 0.642786622, 0.0667650178, 0.763130188, 4.3399632E-7, 0.99619472, -0.0871558338, -0.766045213, 0.0560229495, 0.640340626) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4770. }, 0.3, false)
  4771. end
  4772. MagnitudeDamage(HitboxR, 7, 10, 15, math.random(1, 3), "Normal", "260430079", 1)
  4773. CFuncs.Sound.Create("200632136", HitboxR, 1, 1)
  4774. RootPart.Velocity = RootPart.CFrame.lookVector * 40
  4775. for i = 0, 1, 0.11 do
  4776. swait()
  4777. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
  4778. PlayAnimationFromTable({
  4779. CFrame.new(0.31380862, -0.320521832, 0.0252371654, 0.249517962, -0.150383011, 0.956622124, -0.0458769947, 0.984923244, 0.166798219, -0.967282891, -0.0855060965, 0.238856897) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4780. CFrame.new(0.101926193, 1.50244832, -0.0383800864, 0.337979913, 0.0762555003, -0.938059092, -0.0828148723, 0.995255768, 0.051067099, 0.937502801, 0.0604255944, 0.342691481) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4781. CFrame.new(1.96121001, 0.774859428, -0.462411612, 0.340120375, -0.92077136, 0.191045195, 0.466549307, -0.0111669078, -0.884424806, 0.816486418, 0.389942825, 0.42578721) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4782. CFrame.new(-1.36170578, 0.526111126, -0.597925961, 0.81348151, -0.212761745, -0.541276693, -0.539894938, 0.0697831511, -0.838834763, 0.216243982, 0.974609077, -0.0581016839) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4783. CFrame.new(0.970680714, -1.68610644, -0.0975568295, 0.579166114, -0.127570763, -0.805166125, 0.110368893, 0.990856647, -0.0776019096, 0.807703912, -0.0439208932, 0.587950349) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4784. CFrame.new(-0.827146292, -1.8113209, -0.0556658059, 0.816036701, 0.217413262, -0.535551846, -0.0871567726, 0.962250471, 0.257832885, 0.571391284, -0.163724124, 0.804180741) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4785. }, 0.45, false)
  4786. end
  4787. attack = false
  4788. end
  4789. function attacktwo()
  4790. attack = true
  4791. for i = 0, 1, 0.12 do
  4792. swait()
  4793. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
  4794. PlayAnimationFromTable({
  4795. CFrame.new(-0.0382043272, -0.447743475, -0.209081307, 0.653245032, -0.0733856931, 0.753581822, -0.271655023, 0.906307638, 0.323743671, -0.706735075, -0.416198224, 0.572105408) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4796. CFrame.new(-2.74181366E-6, 1.49999321, -3.4570694E-6, 0.707105815, -0.183012873, -0.683013678, -8.7171793E-7, 0.965925694, -0.258819759, 0.707107782, 0.183013588, 0.683011472) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4797. CFrame.new(1.65075588, 0.743636727, -0.356577665, 0.542998552, -0.115416825, 0.831764221, 0.839699984, 0.0834951103, -0.536593378, -0.00751632452, 0.989801884, 0.142253295) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4798. CFrame.new(-1.08620656, -0.00580590963, -0.864283919, 0.656464815, -0.698875248, 0.283949524, 0.478162557, 0.0943745971, -0.873186052, 0.583450615, 0.708990037, 0.396129608) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4799. CFrame.new(0.856426239, -1.40340364, -0.356423855, 0.707105279, -0.122788861, -0.696365654, 9.42498446E-7, 0.98480767, -0.173648372, 0.707108438, 0.122787014, 0.696362913) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4800. CFrame.new(-0.695387185, -1.90375674, -0.304245114, 0.92541647, 0.246137589, -0.288133472, -0.173648298, 0.951251149, 0.254887551, 0.336824656, -0.185843274, 0.923044682) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4801. }, 0.34, false)
  4802. end
  4803. MagnitudeDamage(HitboxL, 7, 10, 15, math.random(1, 3), "Normal", "260430079", 1.1)
  4804. CFuncs.Sound.Create("200632136", HitboxL, 1, 1)
  4805. RootPart.Velocity = RootPart.CFrame.lookVector * 40
  4806. for i = 0, 1, 0.12 do
  4807. swait()
  4808. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
  4809. PlayAnimationFromTable({
  4810. CFrame.new(-0.479634404, -0.393727064, -0.220339894, 0.248309121, 0.219825819, -0.94340837, 0.019257009, 0.972597659, 0.231695861, 0.968489468, -0.0756994039, 0.237271711) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4811. CFrame.new(-4.01586294E-6, 1.4999907, -1.59628689E-6, 0.237956509, -0.0991817266, 0.966198623, 0.22414881, 0.973527908, 0.0447304621, -0.945057809, 0.205928385, 0.253888786) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4812. CFrame.new(1.08192515, 0.657660127, -1.1749661, 0.228772208, 0.493058115, 0.839379132, 0.874719322, 0.27430138, -0.399530977, -0.427234828, 0.825622678, -0.368534833) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4813. CFrame.new(-1.23054802, 1.29996836, -0.754827142, 0.94838953, -0.316170156, 0.0243683457, -0.269034386, -0.84291333, -0.465958893, 0.167862713, 0.43535465, -0.88447094) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4814. CFrame.new(0.839919031, -1.81287205, 0.0102108568, 0.808574855, -0.267538428, 0.524051666, 0.171010748, 0.95905602, 0.22575888, -0.562994003, -0.0929245204, 0.821220458) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4815. CFrame.new(-0.846072078, -1.7213496, -0.247524291, 0.693717241, 0.0689389557, 0.716940701, -0.0478171073, 0.997620881, -0.0496601462, -0.718658566, 1.68083934E-4, 0.695363283) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4816. }, 0.45, false)
  4817. end
  4818. attack = false
  4819. end
  4820. function findNearestTorso(pos)
  4821. local list = game.Workspace:children()
  4822. local torso
  4823. local dist = 1000
  4824. local temp, human, temp2
  4825. for x = 1, #list do
  4826. temp2 = list[x]
  4827. if temp2.className == "Model" and temp2.Name ~= Character.Name then
  4828. temp = temp2:findFirstChild("Torso")
  4829. human = temp2:findFirstChild("Humanoid")
  4830. if temp ~= nil and human ~= nil and human.Health > 0 and dist > (temp.Position - pos).magnitude then
  4831. local dohit = true
  4832. if dohit == true then
  4833. torso = temp
  4834. dist = (temp.Position - pos).magnitude
  4835. end
  4836. end
  4837. end
  4838. end
  4839. return torso, dist
  4840. end
  4841. function TrueAim(aim)
  4842. local target, distance = findNearestTorso(Mouse.Hit.p)
  4843. local tehcf = HitboxR.CFrame * CFrame.fromEulerAnglesXYZ(1.57, 0, 0).lookVector
  4844. if aim ~= nil then
  4845. tehcf = aim
  4846. end
  4847. table.insert(Effects, {
  4848. tehcf,
  4849. "Shoot",
  4850. 30,
  4851. HitboxR.Position,
  4852. 10,
  4853. 15,
  4854. 0,
  4855. 3,
  4856. HitboxR,
  4857. target
  4858. })
  4859. end
  4860. function FireProjectiles()
  4861. attack = true
  4862. Humanoid.WalkSpeed = 20
  4863. CFuncs.Sound.Create("300915902", HitboxR, 1, 0.8)
  4864. for i = 0, 1, 0.1 do
  4865. swait()
  4866. Effects.Elec.Create(HitboxR.CFrame, 2, 2, 2)
  4867. PlayAnimationFromTable({
  4868. CFrame.new(0, -0.100000001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4869. CFrame.new(0, 1.49999201, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4870. CFrame.new(0.874554753, 1.14087927, -1.06730831, -0.166365892, 0.198266983, 0.965925813, 0.797995508, -0.548363924, 0.250000268, 0.579245627, 0.812396049, -0.0669871047) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4871. CFrame.new(-0.257126778, 1.24225974, -0.962940335, 0.692363203, -0.593008757, -0.411064416, -0.708803177, -0.665577948, -0.233675212, -0.135024026, 0.453151852, -0.88114804) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4872. CFrame.new(0.604643881, -1.9909004, 0.0280392915, 0.962250233, -0.0841861367, -0.258818984, 0.0871560201, 0.996194661, 4.23252061E-7, 0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4873. CFrame.new(-0.604644895, -1.99090064, 0.0280393362, 0.962250233, 0.0841861367, 0.258818984, -0.0871560201, 0.996194661, 4.23252061E-7, -0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4874. }, 0.3, false)
  4875. end
  4876. for i = 0, 1, 0.1 do
  4877. swait()
  4878. Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3)
  4879. Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
  4880. Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
  4881. PlayAnimationFromTable({
  4882. CFrame.new(0, -0.100000001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4883. CFrame.new(0, 1.49999201, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4884. CFrame.new(0.661153734, 0.568759024, -0.827975571, -0.166752055, 0.025078943, 0.985679924, 0.98324734, -0.0704026297, 0.168131784, 0.0736110285, 0.99720335, -0.012919019) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4885. CFrame.new(-0.390097797, 0.861622274, -0.554995477, 0.351840883, -0.837056041, -0.418981194, -0.935129642, -0.294365793, -0.197183579, 0.0417199843, 0.461178988, -0.886325777) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4886. CFrame.new(0.604644954, -1.9909004, 0.0280390829, 0.962250233, -0.0841861367, -0.258818984, 0.0871560201, 0.996194661, 4.23252061E-7, 0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4887. CFrame.new(-0.604644775, -1.99090064, 0.0280380547, 0.962250233, 0.0841861367, 0.258818984, -0.0871560201, 0.996194661, 4.23252061E-7, -0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4888. }, 0.2, false)
  4889. end
  4890. for i = 1, 10 do
  4891. for i = 0, 1, 0.3 do
  4892. swait()
  4893. Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3)
  4894. Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
  4895. PlayAnimationFromTable({
  4896. CFrame.new(0, -0.100000001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4897. CFrame.new(0, 1.49999201, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4898. CFrame.new(0.661153734, 0.568759024, -0.827975571, -0.166752055, 0.025078943, 0.985679924, 0.98324734, -0.0704026297, 0.168131784, 0.0736110285, 0.99720335, -0.012919019) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4899. CFrame.new(-0.390097797, 0.861622274, -0.554995477, 0.351840883, -0.837056041, -0.418981194, -0.935129642, -0.294365793, -0.197183579, 0.0417199843, 0.461178988, -0.886325777) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4900. CFrame.new(0.604644954, -1.9909004, 0.0280390829, 0.962250233, -0.0841861367, -0.258818984, 0.0871560201, 0.996194661, 4.23252061E-7, 0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4901. CFrame.new(-0.604644775, -1.99090064, 0.0280380547, 0.962250233, 0.0841861367, 0.258818984, -0.0871560201, 0.996194661, 4.23252061E-7, -0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4902. }, 0.3, false)
  4903. end
  4904. CFuncs.Sound.Create("300916105", HitboxR, 1, 1.2)
  4905. CFuncs.Sound.Create("300916014", HitboxR, 1, 1)
  4906. Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 2, 2, 2, 0.07)
  4907. local MouseLook = CFrame.new((HitboxR.Position + Mouse.Hit.p) / 2, Mouse.Hit.p)
  4908. TrueAim(MouseLook.lookVector)
  4909. for i = 0, 1, 0.3 do
  4910. swait()
  4911. Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3)
  4912. Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
  4913. PlayAnimationFromTable({
  4914. CFrame.new(1.90734863E-6, -0.25291419, 0.238341585, 1, 0, 0, 0, 0.996194661, -0.087155968, 0, 0.087155968, 0.996194661) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4915. CFrame.new(0, 1.49999189, -1.1920929E-6, 1, 0, 0, 0, 0.98480767, 0.173648626, 0, -0.173648626, 0.98480767) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4916. CFrame.new(0.689965963, 0.767623663, -0.856841147, -0.544456005, 0.160545677, 0.823281765, 0.798456132, -0.201499581, 0.567332089, 0.256973624, 0.966241658, -0.0184810348) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4917. CFrame.new(-0.392649293, 0.920519292, -0.977094412, 0.403439909, -0.887421727, -0.222977459, -0.91384387, -0.378501445, -0.147058249, 0.0461054072, 0.263095737, -0.963667512) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4918. CFrame.new(0.598512471, -1.89166105, 0.0173719227, 0.962250233, -0.061308533, -0.265171409, 0.0871564373, 0.992403805, 0.0868248865, 0.257834017, -0.106658652, 0.960284173) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  4919. CFrame.new(-0.598512232, -1.89166129, 0.0173728764, 0.962250233, 0.061308533, 0.265171409, -0.0871564373, 0.992403805, 0.0868248865, -0.257834017, -0.106658652, 0.960284173) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4920. }, 0.3, false)
  4921. end
  4922. end
  4923. Humanoid.WalkSpeed = 20
  4924. attack = false
  4925. end
  4926. SHRA=false
  4927.  
  4928. Check=false
  4929. dimension=workspace
  4930. Mouse.KeyUp:connect(function(k)
  4931. if k=='e' then
  4932. Long=false
  4933. end
  4934. end)
  4935. reload2=false
  4936. hand=true -- collect hands
  4937. Mouse.KeyDown:connect(function(k)
  4938. k = k:lower()
  4939. if k=='r' and dimension==workspace then
  4940. Meg=Instance.new('Part')
  4941. Meg.Parent=Character
  4942. Meg.CFrame=Mouse.Hit
  4943. Meg.Transparency=1
  4944. Meg.CanCollide=false
  4945. Meg.Touched:connect(function(h)
  4946. if h.Parent~=Character or h.Parent~=workspace or h.Parent~=AdvancingFortress then
  4947. if h.Parent:findFirstChild('Torso')~=nil and h.Parent:findFirstChild('Humanoid')~=nil then
  4948. enem=h.Parent
  4949.  
  4950. end
  4951. end
  4952. end)
  4953. wait(.1)
  4954. if enem~=nil then
  4955. eclone(enem.Torso)
  4956.  
  4957. end
  4958. elseif k=='t' then
  4959. if dimension==workspace then
  4960. dimension=workspace.CurrentCamera
  4961. workspace.CurrentCamera.FieldOfView=180
  4962. elseif dimension==workspace.CurrentCamera then
  4963. dimension=workspace
  4964. workspace.CurrentCamera.FieldOfView=70
  4965. end
  4966. Character.Parent=dimension
  4967. elseif k=='y' then
  4968. if YOURCLONE~=nil then
  4969. Sav=YOURCLONE.Torso.CFrame
  4970. Sav2=YOURCLONE.Humanoid.Health
  4971. YOURCLONE.Torso.CFrame=Character.Torso.CFrame
  4972. Character.Torso.CFrame=Sav
  4973. YOURCLONE.Humanoid.Health=Character.Humanoid.Health
  4974. Character.Humanoid.Health=Sav2
  4975. end
  4976. if YOURCLONE== nil then
  4977. yclone()
  4978. end
  4979. end
  4980. if dimension==workspace then
  4981. if k=='f' and IsWearingArmor == false and Invisible == false and reload2==false then
  4982. reload2=true
  4983. M=Instance.new('Part',Character)
  4984. M.Shape='Ball'
  4985. M.Material='Glass'
  4986. M.BrickColor=BrickColor.new('Gold')
  4987. M.Transparency=.5
  4988. M.Position=Character.Torso.Position
  4989. M.Size=Vector3.new(10,10,10)
  4990. M.CanCollide=false
  4991. M.Touched:connect(function(h)
  4992. if h.Parent~=Character or h.Parent~=workspace or h.Parent~=AdvancingFortress or h.Parent~=MEF then
  4993. if h:IsA('Part') and h.Anchored==false then
  4994. h.Velocity=Vector3.new(math.random(-70,70),math.random(40,50),math.random(-70,70))
  4995. end
  4996. end
  4997. end)
  4998. W=Instance.new('Weld',Character)
  4999. W.Part0=M
  5000. W.Part1=Character.Torso
  5001. wait(10)
  5002. M:remove()
  5003. wait(10)
  5004. reload2=false
  5005. end
  5006. if k=='e' and IsWearingArmor == false and Invisible == false then
  5007. Long=true
  5008. Lattack()
  5009. end
  5010. if attack == false and ora == false and k == "z" and IsWearingArmor == false and Invisible == false then
  5011. ora = true
  5012. ORA()
  5013. elseif attack == false and k == "x" and IsWearingArmor == false and Invisible == false then
  5014. GRABEMBOIGRABEM()
  5015. elseif attack == false and k=='g' then
  5016. -- FireProjectiles()--thats lame
  5017. if changeidle==1 then
  5018. changeidle=2
  5019. else changeidle=1
  5020. end
  5021.  
  5022. end
  5023. end
  5024.  
  5025. if attack == false and k == "q" and Invisible == false and IsWearingArmor == false then
  5026. Invisible = true
  5027. Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1)
  5028. Effects.Block.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1, 1)
  5029. Disappear()
  5030. elseif attack == false and k == "q" and Invisible == true and IsWearingArmor == false then
  5031. Invisible = false
  5032. Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.08)
  5033.  
  5034. for i = 1, 2 do
  5035. Effects.Block.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1, 1)
  5036. end
  5037. for i = 1, 20 do
  5038. Effects.Break.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1)
  5039. end
  5040. Reappear()
  5041. G=Instance.new('Sound',AdvancingFortress.FTorso)
  5042. G.Name='FLEF'
  5043. G.SoundId='rbxassetid://1275713993'
  5044. G.Volume=3
  5045. G:Play()
  5046. elseif attack == false and ShieldMode == false and k == "c" and IsWearingArmor == false and Invisible == false and dimension==workspace then
  5047. ShieldMode = true
  5048. HoloHexShield()
  5049. elseif attack == false and k == "v" and IsWearingArmor == false and Invisible == false and dimension==workspace then
  5050. CastleCrusherFist()
  5051.  
  5052. end
  5053. --[[if k == "[" and IsWearingArmor == false and Invisible == false then
  5054. Armor("On")
  5055. end
  5056. if k == "]" and IsWearingArmor == true and Invisible == false then
  5057. Armor("Off")
  5058. end--]]
  5059. end)
  5060.  
  5061. Mouse.KeyUp:connect(function(k)
  5062. k = k:lower()
  5063. if attack == true and ora == true and k == "z" and IsWearingArmor == false then
  5064. ora = false
  5065. elseif attack == true and ShieldMode == true and k == "c" and IsWearingArmor == false then
  5066. ShieldMode = false
  5067. end
  5068. end)
  5069. -- coroutine.resume(coroutine.create(function(Part, Part2)
  5070. -- while Part.Parent ~= nil do
  5071. -- swait(math.random(100, 150))
  5072. -- for i = 0, 1, 0.2 do
  5073. -- wait()
  5074. -- Eye1.Mesh.Scale = Vector3.new(1, 0.7 - 1 * i, 1)
  5075. -- Eye2.Mesh.Scale = Vector3.new(1, 0.7 - 1 * i, 1)
  5076. -- end
  5077. -- for i = 0, 1, 0.2 do
  5078. -- swait()
  5079. -- Eye1.Mesh.Scale = Vector3.new(1, 0.7 + 0.3 * i, 1)
  5080. -- Eye2.Mesh.Scale = Vector3.new(1, 0.7 + 0.3 * i, 1)
  5081. -- end
  5082. -- end
  5083. -- end), Eye1, Eye2)
  5084. tfk=CFuncs.Sound.Create(1325068271, Character.Torso, 1.5, 1)
  5085. tfk.Name='THEME'
  5086. tfk.Looped=true
  5087. changeidle=1
  5088. YOURCLONE=nil
  5089. candecide=true
  5090. Humanoid=Character.Humanoid
  5091. while true do
  5092.  
  5093.  
  5094. for _,v in pairs(AdvancingFortress.FTorso:GetChildren()) do
  5095. end
  5096. swait()
  5097. for i, v in pairs(Character:children()) do
  5098. if v:IsA("Part") and IsWearingArmor == true then
  5099. v.Anchored = false
  5100. end
  5101. end
  5102. for i, v in pairs(AdvancingFortress:GetChildren()) do
  5103. if v:IsA("Part") then
  5104. v.Material = "SmoothPlastic"
  5105. v.CanCollide = false
  5106. elseif v:IsA("Humanoid") then
  5107. v:remove()
  5108. elseif v:IsA("Accessory") then
  5109. v:remove()
  5110. elseif v:IsA("Shirt") then
  5111. v:remove()
  5112. elseif v:IsA("Pants") then
  5113. v:remove()
  5114. elseif v:IsA("Script") or v:IsA("LocalScript") then
  5115. v:remove()
  5116. elseif v:IsA("BodyColors") then
  5117. v:remove()
  5118. end
  5119. end
  5120. AHandleR.Transparency = 1
  5121. AHandleL.Transparency = 1
  5122. RootPart.Transparency = 1
  5123. HitboxR.Transparency = 1
  5124. HitboxL.Transparency = 1
  5125. Head.BrickColor = BrickColor.new("Pastel blue-green")
  5126. Torso.BrickColor = BrickColor.new("Pastel blue-green")
  5127. RightArm.BrickColor = BrickColor.new("Pastel blue-green")
  5128. LeftArm.BrickColor = BrickColor.new("Pastel blue-green")
  5129. RightLeg.BrickColor = BrickColor.new("Pastel blue-green")
  5130. LeftLeg.BrickColor = BrickColor.new("Pastel blue-green")
  5131. RootPart.Anchored = true
  5132. Torsovelocity = (Character.HumanoidRootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  5133. velocity = Character.HumanoidRootPart.Velocity.y
  5134. sine = sine + change
  5135. Shield.Anchored = true
  5136. Shield.CFrame = Shield.CFrame:lerp(RootPart.CFrame * CFrame.new(0, 0, -3.2), 1)
  5137. local hit, pos = rayCast(Character.HumanoidRootPart.Position, CFrame.new(Character.HumanoidRootPart.Position, Character.HumanoidRootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  5138. if Character.HumanoidRootPart.Velocity.y > 1 and hit == nil then
  5139. Anim = "Jump"
  5140. if attack == false then
  5141. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
  5142. PlayAnimationFromTable({
  5143. CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(.5, -1, 0),
  5144. CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, 1, 0),
  5145. CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
  5146. CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1),
  5147. CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5148. CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
  5149. }, 0.3, false)
  5150. end
  5151. elseif Character.HumanoidRootPart.Velocity.y < -1 and hit == nil then
  5152. Anim = "Fall"
  5153. if attack == false then
  5154. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
  5155. PlayAnimationFromTable({
  5156. CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, -1, 1),
  5157. CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 1, 0.5),
  5158. CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
  5159. CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1),
  5160. CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5161. CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
  5162. }, 0.3, false)
  5163. end
  5164. elseif Torsovelocity < 1 and hit ~= nil then
  5165. Anim = "Idle"
  5166. if changeidle==1 then
  5167. if attack == false then
  5168. change = 1
  5169. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
  5170. PlayAnimationFromTable({
  5171. CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, -1, 1),
  5172. CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 1, 0.5),
  5173. CFrame.new(1.5,0,0) * CFrame.new(-1.2, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
  5174. CFrame.new(-1.5,0,0) * CFrame.new(1.5, 0.3, -.5) * CFrame.Angles(3, 0, 1),
  5175. CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5176. CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
  5177. }, 0.3, false)
  5178. end
  5179. elseif changeidle==2 then
  5180. change = 1
  5181. if not attack then
  5182. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
  5183. PlayAnimationFromTable({
  5184. CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5185. CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5186. CFrame.new(1.5,0,0) * CFrame.new(-1.5, 0.4, -.5) * CFrame.Angles(3, 0, -1),
  5187. CFrame.new(-1.5,0,0) * CFrame.new(1.5, 0.4, -.5) * CFrame.Angles(3, 0, 1),
  5188. CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5189. CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
  5190. }, 0.3, false)
  5191. end
  5192. end
  5193. elseif Torsovelocity > 2 and hit ~= nil then
  5194. Anim = "Walk"
  5195. if attack == false then
  5196. RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
  5197. PlayAnimationFromTable({
  5198. CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, -1, 0),
  5199. CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, 0, 0),
  5200. CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
  5201. CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1),
  5202. CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  5203. CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
  5204. }, 0.3, false)
  5205. end
  5206. end
  5207. if 0 < #Effects then
  5208. for e = 1, #Effects do
  5209. if Effects[e] ~= nil then
  5210. local Thing = Effects[e]
  5211. if Thing ~= nil then
  5212. local Part = Thing[1]
  5213. local Mode = Thing[2]
  5214. local Delay = Thing[3]
  5215. local IncX = Thing[4]
  5216. local IncY = Thing[5]
  5217. local IncZ = Thing[6]
  5218. if Thing[2] == "Shoot" then
  5219. local Look = Thing[1]
  5220. local move = 30
  5221. if Thing[8] == 3 then
  5222. move = 10
  5223. end
  5224. local hit, pos = rayCast(Thing[4], Thing[1], move, m)
  5225. if Thing[10] ~= nil then
  5226. da = pos
  5227. cf2 = CFrame.new(Thing[4], Thing[10].Position)
  5228. cfa = CFrame.new(Thing[4], pos)
  5229. tehCF = cfa:lerp(cf2, 0.2)
  5230. Thing[1] = tehCF.lookVector
  5231. end
  5232. local mag = (Thing[4] - pos).magnitude
  5233. Effects.Head.Create(Torso.BrickColor, CFrame.new((Thing[4] + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0), 1, mag * 5, 1, 0.5, 0, 0.5, 0.2)
  5234. if Thing[8] == 2 then
  5235. Effects.Ring.Create(Torso.BrickColor, CFrame.new((Thing[4] + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0), 1, 1, 0.1, 0.5, 0.5, 0.1, 0.1, 1)
  5236. end
  5237. Thing[4] = Thing[4] + Look * move
  5238. Thing[3] = Thing[3] - 1
  5239. if 2 < Thing[5] then
  5240. Thing[5] = Thing[5] - 0.3
  5241. Thing[6] = Thing[6] - 0.3
  5242. end
  5243. if hit ~= nil then
  5244. Thing[3] = 0
  5245. if Thing[8] == 1 or Thing[8] == 3 then
  5246. Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1)
  5247. elseif Thing[8] == 2 then
  5248. Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1)
  5249. if hit.Parent:findFirstChild("Humanoid") ~= nil or hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
  5250. ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Pastel blue-green"), "Reference", Vector3.new())
  5251. ref.Anchored = true
  5252. ref.CFrame = CFrame.new(pos)
  5253. CFuncs.Sound.Create("161006093", ref, 1, 1.2)
  5254. game:GetService("Debris"):AddItem(ref, 0.2)
  5255. Effects.Block.Create(Torso.BrickColor, CFrame.new(ref.Position) * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 1, 1, 10, 10, 10, 0.1, 2)
  5256. Effects.Ring.Create(BrickColor.new("Bright yellow"), CFrame.new(ref.Position) * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 1, 0.1, 4, 4, 0.1, 0.1)
  5257. MagnitudeDamage(ref, 15, Thing[5] / 1.5, Thing[6] / 1.5, 0, "Normal", "", 1)
  5258. end
  5259. end
  5260. ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Pastel blue-green"), "Reference", Vector3.new())
  5261. ref.Anchored = true
  5262. ref.CFrame = CFrame.new(pos)
  5263. Effects.Sphere.Create(Torso.BrickColor, CFrame.new(pos), 5, 5, 5, 1, 1, 1, 0.07)
  5264. game:GetService("Debris"):AddItem(ref, 1)
  5265. end
  5266. if Thing[3] <= 0 then
  5267. table.remove(Effects, e)
  5268. end
  5269. end
  5270. if Thing[2] == "FireWave" then
  5271. if Thing[3] <= Thing[4] then
  5272. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(0, 1, 0)
  5273. Thing[3] = Thing[3] + 1
  5274. Thing[6].Scale = Thing[6].Scale + Vector3.new(Thing[5], 0, Thing[5])
  5275. else
  5276. Part.Parent = nil
  5277. table.remove(Effects, e)
  5278. end
  5279. end
  5280. if Thing[2] ~= "Shoot" and Thing[2] ~= "Wave" and Thing[2] ~= "FireWave" then
  5281. if Thing[1].Transparency <= 1 then
  5282. if Thing[2] == "Block1" then
  5283. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  5284. Mesh = Thing[7]
  5285. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  5286. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5287. elseif Thing[2] == "Block2" then
  5288. Thing[1].CFrame = Thing[1].CFrame
  5289. Mesh = Thing[7]
  5290. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  5291. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5292. elseif Thing[2] == "Fire" then
  5293. Thing[1].CFrame = CFrame.new(Thing[1].Position) + Vector3.new(0, 0.2, 0)
  5294. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  5295. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5296. elseif Thing[2] == "Cylinder" then
  5297. Mesh = Thing[7]
  5298. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  5299. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5300. elseif Thing[2] == "Blood" then
  5301. Mesh = Thing[7]
  5302. Thing[1].CFrame = Thing[1].CFrame * CFrame.new(0, 0.5, 0)
  5303. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  5304. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5305. elseif Thing[2] == "Elec" then
  5306. Thing[1].Size = Thing[1].Size + Vector3.new(Thing[7], Thing[8], Thing[9])
  5307. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5308. elseif Thing[2] == "Disappear" then
  5309. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5310. elseif Thing[2] == "Shatter" then
  5311. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  5312. Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
  5313. Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  5314. Thing[6] = Thing[6] + Thing[5]
  5315. end
  5316. else
  5317. Part.Parent = nil
  5318. table.remove(Effects, e)
  5319. end
  5320. end
  5321. end
  5322. end
  5323. end
  5324. end
  5325. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement