Advertisement
Hizemack

Untitled

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