Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)--this was so much work i did not change the animations from the last stand sorry...
- warn "Slenercat5's"
- warn "Dirty Deeds Done Dirt Cheep"
- warn "Q to call stand"
- warn "E to do far range attack"
- warn "R to make Enemy clone"
- warn "T to jump to other dimension"
- warn "Y to Make Clone"
- warn "F to use love train"
- warn "moveset based on project jojo's d4c"
- warn "Model by JojofMer"
- warn"sorry currently 1 color"
- warn "Avatar clothing and hair by Masterofroblox1206"
- plr = game.Players.LocalPlayer
- mse = plr:GetMouse()
- sound = Instance.new("Sound", game.Workspace)
- sound.SoundId = "https://www.roblox.com/asset/?id=274698941"
- sound.Volume = 10
- canworld = true
- BeeSpeed = 50
- chr=plr.Character
- tors=torso
- --[[
- for _,v in pairs(plr.Character:GetChildren())do
- if v:IsA('Shirt') or v:IsA('Pants') or v:IsA('Accessory') then
- v:remove()
- end
- end
- local sh = Instance.new("Shirt",chr)
- sh.ShirtTemplate = "http://www.roblox.com/asset/?id=394790364"
- p=Instance.new('Pants',chr)
- p.PantsTemplate='http://www.roblox.com/asset/?id=394795102'--]]
- chr['Left Arm'].BrickColor=BrickColor.new('Pastel brown')
- chr['Right Arm'].BrickColor=BrickColor.new('Pastel brown')
- chr['Torso'].BrickColor=BrickColor.new('Pastel brown')
- chr.Head.BrickColor=BrickColor.new('Pastel brown')
- local Players=game:service'Players'
- local Player=Players.LocalPlayer
- local Mouse=Player:GetMouse''
- Character=Player.Character
- local RenderStepped=game:service'RunService'.RenderStepped
- local MeshId='http://www.roblox.com/asset?id=779592805'
- local TextureId='http://www.roblox.com/asset/?id=775493027'
- local QHold=false
- local EHold=false
- cut = Instance.new("Sound", chr)
- cut.SoundId = "https://www.roblox.com/asset/?id=0"
- cut.Volume = 1.5
- thri = Instance.new("Sound", chr)
- thri.SoundId = "https://www.roblox.com/asset/?id=186311262"
- thri.Volume = 2.5
- Sound2=Instance.new('Sound')
- Sound2.SoundId='rbxassetid://616594063'
- Sound2.Parent=Player.Character.Head
- Effects = {}
- local Player = game.Players.localPlayer
- local Character = Player.Character
- Character.Archivable = true
- AdvancingFortress = Character:Clone()
- --[[
- Hair=Instance.new('Part',Character)
- Hair.Size=Vector3.new(1,1,1)
- M=Instance.new('FileMesh',Hair)
- M.Scale=Vector3.new(.028,.028,.028)
- M.MeshId='rbxassetid://1450916371'
- M.TextureId='rbxassetid://1450916523'
- WARF=Instance.new('Weld',Hair)
- WARF.Part0=Hair
- WARF.Part1=Character.Head
- WARF.C0=CFrame.new(0,-.2,0)--]]
- --//D4cCostume
- function eclone(targetPart)
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Decal3 = Instance.new("Decal")
- Part4 = Instance.new("Part")
- Decal5 = Instance.new("Decal")
- Motor6 = Instance.new("Motor")
- Motor7 = Instance.new("Motor")
- Motor8 = Instance.new("Motor")
- Motor9 = Instance.new("Motor")
- Motor10 = Instance.new("Motor")
- Part11 = Instance.new("Part")
- Part12 = Instance.new("Part")
- Part13 = Instance.new("Part")
- Part14 = Instance.new("Part")
- Humanoid15 = Instance.new("Humanoid")
- Humanoid15.WalkToPart=targetPart
- BodyColors16 = Instance.new("BodyColors")
- Script17 = Instance.new("Script")
- Model0.Name = "Clone"
- Model0.Parent = mas
- Model0.PrimaryPart = Part1
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.BrickColor = BrickColor.new("Bright yellow")
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(2, 1, 1)
- Part1.CFrame = CFrame.new(6.34995413, 4.50001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part1.Position = Vector3.new(6.34995413, 4.50001717, 23.1599998)
- Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal3.Name = "face"
- Decal3.Parent = Part1
- Decal3.Texture = "rbxasset://textures/face.png"
- Part4.Name = "Torso"
- Part4.Parent = Model0
- Part4.BrickColor = BrickColor.new("Bright blue")
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.Size = Vector3.new(2, 2, 1)
- Part4.CFrame = CFrame.new(6.34995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.LeftSurface = Enum.SurfaceType.Weld
- Part4.RightSurface = Enum.SurfaceType.Weld
- Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part4.Position = Vector3.new(6.34995413, 3.00001717, 23.1599998)
- Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Decal5.Name = "roblox"
- Decal5.Parent = Part4
- Motor6.Name = "Right Shoulder"
- Motor6.Parent = Part4
- Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6.Part0 = Part4
- Motor6.Part1 = Part12
- Motor6.MaxVelocity = 0.15000000596046
- Motor7.Name = "Left Shoulder"
- Motor7.Parent = Part4
- Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor7.Part0 = Part4
- Motor7.Part1 = Part11
- Motor7.MaxVelocity = 0.15000000596046
- Motor8.Name = "Right Hip"
- Motor8.Parent = Part4
- Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor8.Part0 = Part4
- Motor8.Part1 = Part14
- Motor8.MaxVelocity = 0.10000000149012
- Motor9.Name = "Left Hip"
- Motor9.Parent = Part4
- Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor9.Part0 = Part4
- Motor9.Part1 = Part13
- Motor9.MaxVelocity = 0.10000000149012
- Motor10.Name = "Neck"
- Motor10.Parent = Part4
- Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor10.Part0 = Part4
- Motor10.Part1 = Part1
- Motor10.MaxVelocity = 0.10000000149012
- Part11.Name = "Left Arm"
- Part11.Parent = Model0
- Part11.BrickColor = BrickColor.new("Bright yellow")
- Part11.CanCollide = false
- Part11.FormFactor = Enum.FormFactor.Symmetric
- Part11.Size = Vector3.new(1, 2, 1)
- Part11.CFrame = CFrame.new(4.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part11.Position = Vector3.new(4.84995413, 3.00001717, 23.1599998)
- Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part12.Name = "Right Arm"
- Part12.Parent = Model0
- Part12.BrickColor = BrickColor.new("Bright yellow")
- Part12.CanCollide = false
- Part12.FormFactor = Enum.FormFactor.Symmetric
- Part12.Size = Vector3.new(1, 2, 1)
- Part12.CFrame = CFrame.new(7.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part12.Position = Vector3.new(7.84995413, 3.00001717, 23.1599998)
- Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part13.Name = "Left Leg"
- Part13.Parent = Model0
- Part13.BrickColor = BrickColor.new("Br. yellowish green")
- Part13.CanCollide = false
- Part13.FormFactor = Enum.FormFactor.Symmetric
- Part13.Size = Vector3.new(1, 2, 1)
- Part13.CFrame = CFrame.new(5.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.TopSurface = Enum.SurfaceType.Inlet
- Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part13.Position = Vector3.new(5.84995413, 1.00001717, 23.1599998)
- Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part14.Name = "Right Leg"
- Part14.Parent = Model0
- Part14.BrickColor = BrickColor.new("Br. yellowish green")
- Part14.CanCollide = false
- Part14.FormFactor = Enum.FormFactor.Symmetric
- Part14.Size = Vector3.new(1, 2, 1)
- Part14.CFrame = CFrame.new(6.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part14.BottomSurface = Enum.SurfaceType.Smooth
- Part14.TopSurface = Enum.SurfaceType.Inlet
- Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part14.Position = Vector3.new(6.84995413, 1.00001717, 23.1599998)
- Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Humanoid15.Parent = Model0
- Humanoid15.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid15.RightLeg = Part14
- Humanoid15.LeftLeg = Part13
- Humanoid15.Torso = Part4
- Humanoid15.WalkToPoint=Vector3.new(0,20,0)
- BodyColors16.Parent = Model0
- BodyColors16.HeadColor = BrickColor.new("Bright yellow")
- BodyColors16.LeftArmColor = BrickColor.new("Bright yellow")
- BodyColors16.LeftLegColor = BrickColor.new("Br. yellowish green")
- BodyColors16.RightArmColor = BrickColor.new("Bright yellow")
- BodyColors16.RightLegColor = BrickColor.new("Br. yellowish green")
- BodyColors16.TorsoColor = BrickColor.new("Bright blue")
- Script17.Name = "Full Animation"
- Script17.Parent = Model0
- table.insert(cors,sandbox(Script17,function()
- --[[Made by Jammer622 @[http://www.roblox.com/Advanced-Player-AI-item?id=59391730],
- This is the ORIGINAL model, if you see others, they are stolen.
- Scripts mixed from vanilla Animate, Health, and Sound,
- with much custom content by myself, making them great AIs.
- No help from Miked's scripts, I made my own joint script.
- If you find any glitches, bugs, or just want to suggest an idea, please message me.
- My team works hard on these AIs, please don't make attempts to steal them.
- Your feedback is extremely appreciated!
- _---=CREDITS=---_
- The Roblox Team Without them, none of this would be possible.
- Vanilla Sound
- Vanilla Health
- Vanilla Animate
- Jammer622 That's me, main programmer and weapon publisher.
- Main Developer
- Health GUI Script
- Animation Work
- Relationship Work
- Wandering
- Pathing (Map Generation)
- Weapon Usage
- Weapon (Re)Publishing
- Sonypony458
- McDonalds Drink
- Customization
- Teamwork AI
- Model Variables
- Setting Wiki [Below]
- Macdeath I owe it to him for keeping me on track during this.
- Feature Inspiration
- Problem Solving
- Suggestions
- lah30303 Amazing pathing work goes to this fine sir.
- Pathing (Pathing Generation/System)
- _---=SETTINGS=---_
- Inside this model's file, you'll find several values that can be changed.
- DropWeapon -This sets whether or not the bot will drop any equipped weapon upon dying.
- Force_Pants -This must be set through Spawners.
- Force_Shirt -This must be set through Spawners.
- Force_Weapon -This must be set through Spawners.
- Force_Hat -This must be set through Spawners.
- IgnoreCombatFF -This sets whether or not the bot will allow friendly fire during combat.
- IsAPlayer -This is a tag to specify this bot's existance to other AIs.
- IsOnTeam -This sets whether or not the bot is on a team.
- ShowTag -This sets whether or not the bot's team color name shows up beside its own.
- Team -This sets the bot's team color.
- PathTo -This is an experimental pathfinding engine. Use at your own risk!
- PrintMap -This prints maps generated when using PathTo. Use at your own risk!
- Respawn -This sets whether the bot will respawn or not upon death.
- Custom_Name -This must be set through Spawners.
- Wander -This sets whether the bot is stationary or if it moves, but not if it uses weapons or not.
- ]]
- print("Player Bot Loading")
- Delay(0, function() --Vanilla Sound
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.archivable = false
- sound.Parent = script.Parent.Head
- return sound
- end
- local sDied = newSound("rbxasset://sounds/uuhhh.wav")
- local sFallingDown = newSound("rbxasset://sounds/splat.wav")
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
- local sGettingUp = newSound("rbxasset://sounds/hit.wav")
- local sJumping = newSound("rbxasset://sounds/button.wav")
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
- sRunning.Looped = true
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- function onDied()
- sDied:Play()
- end
- function onState(state, sound)
- if state then
- sound:Play()
- else
- sound:Pause()
- end
- end
- function onRunning(speed)
- if speed>0 then
- sRunning:Play()
- else
- sRunning:Pause()
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- end)
- Delay(0, function() --Vanilla Health
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Humanoid = waitForChild(Figure, "Humanoid")
- local regening = false
- function regenHealth()
- if regening then return end
- regening = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local s = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
- health = health + newHealthDelta
- Humanoid.Health = math.min(health,Humanoid.MaxHealth)
- end
- end
- if Humanoid.Health > Humanoid.MaxHealth then
- Humanoid.Health = Humanoid.MaxHealth
- end
- regening = false
- end
- Humanoid.HealthChanged:connect(regenHealth)
- end)
- Delay(0, function() --Vanilla Animate, Multiple Additions
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Clone = Figure:Clone()
- local Torso = waitForChild(Figure, "Torso")
- local Joints = Torso:GetChildren()
- for All = 1, #Joints do
- if Joints.className == "Motor" or Joints.className == "Motor6D" then
- Joints[All]:Remove()
- end
- end
- local RightShoulder = Instance.new("Motor")
- local LeftShoulder = Instance.new("Motor")
- local RightHip = Instance.new("Motor")
- local LeftHip = Instance.new("Motor")
- local Neck = Instance.new("Motor")
- local Humanoid = waitForChild(Figure, "Humanoid")
- ZStat = 1
- ZStat2 = 0
- local pose = "Standing"
- RightShoulder.Part0 = Torso
- RightShoulder.Part1 = Figure["Right Arm"]
- RightShoulder.MaxVelocity = 0.15
- RightShoulder.Name = "Right Shoulder"
- RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightShoulder.Parent = Torso
- LeftShoulder.Part0 = Torso
- LeftShoulder.Part1 = Figure["Left Arm"]
- LeftShoulder.MaxVelocity = 0.15
- LeftShoulder.Name = "Left Shoulder"
- LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftShoulder.Parent = Torso
- RightHip.Part0 = Torso
- RightHip.Part1 = Figure["Right Leg"]
- RightHip.MaxVelocity = 0.1
- RightHip.Name = "Right Hip"
- RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightHip.Parent = Torso
- LeftHip.Part0 = Torso
- LeftHip.Part1 = Figure["Left Leg"]
- LeftHip.MaxVelocity = 0.1
- LeftHip.Name = "Left Hip"
- LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftHip.Parent = Torso
- Neck.Part0 = Torso
- Neck.Part1 = Figure["Head"]
- Neck.MaxVelocity = 0.1
- Neck.Name = "Neck"
- Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- Neck.Parent = Torso
- local toolAnim = "None"
- local toolAnimTime = 0
- SpawnModel = Instance.new("Model")
- function onRunning(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function CheckTag(Tag)
- 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
- if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then
- 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
- local Tag2 = Instance.new("CFrameValue", Tag.Value.Character)
- Tag2.Name = "IsLocalEnemy"
- print(Tag.Value.Character.Name .." Has Become An Outlaw")
- end
- end
- if Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Tag.Value.Character)
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- 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
- if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then
- 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
- local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
- Tag2.Name = "IsLocalEnemy"
- print(Tag.Value .." Has Become An Outlaw")
- end
- end
- if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
- if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then
- 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
- local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Tag2.Name = "IsLocalEnemy"
- print(Tag.Value .." Has Become An Outlaw")
- end
- end
- if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- 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
- local Found = Instance.new("CFrameValue", Tag.Value.Character)
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
- local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- end
- end
- function CheckSpawns(Object)
- local Parts = Object:GetChildren()
- for Check = 1, #Parts do
- if Parts[Check].className == "SpawnLocation" then
- local I = Instance.new("Vector3Value", SpawnModel)
- I.Value = Parts[Check].Position
- end
- CheckSpawns(Parts[Check])
- end
- end
- function onDied()
- pose = "Dead"
- Delay(5, function()
- if script.Parent.Respawn.Value == true then
- CheckSpawns(Workspace)
- local Spawn = SpawnModel:GetChildren()
- Clone.Parent = game.Workspace
- if #Spawn > 0 then
- Spawn = Spawn[math.random(1, #Spawn)].Value
- Clone:MoveTo(Spawn)
- else
- Clone:MoveTo(Vector3.new(0, 50, 0))
- end
- end
- Figure:Remove()
- return
- end)
- end
- function onJumping()
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (3.14/ZStat)
- LeftShoulder.DesiredAngle = (-3.14/ZStat)
- RightHip.DesiredAngle = (0)
- LeftHip.DesiredAngle = (0)
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (3.14/ZStat)
- LeftShoulder.DesiredAngle = (-3.14/ZStat)
- RightHip.DesiredAngle = (0)
- LeftHip.DesiredAngle = (0)
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder.DesiredAngle = (3.14 /2)
- LeftShoulder.DesiredAngle = (-3.14 /2)
- RightHip.DesiredAngle = (3.14 /2)
- LeftHip.DesiredAngle = (-3.14 /2)
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- RightShoulder.DesiredAngle = (1.57)
- return
- end
- if (toolAnim == "Slash") then
- RightShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (0)
- return
- end
- if (toolAnim == "Lunge") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightHip.MaxVelocity = 0.5
- LeftHip.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (1.57)
- LeftShoulder.DesiredAngle = (1.0)
- RightHip.DesiredAngle = (1.57)
- LeftHip.DesiredAngle = (1.0)
- return
- end
- end
- function move(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2
- LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2
- RightHip.DesiredAngle = (-desiredAngle)
- LeftHip.DesiredAngle = (-desiredAngle)
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.ChildAdded:connect(CheckTag)
- OriginalTime = 0.1
- Time = OriginalTime
- while Figure.Parent~=nil do
- Time = Time + 0.1
- wait(OriginalTime)
- move(Time)
- end
- end)
- Delay(0, function() --lah30303's Pathing Script
- function CalcMoves(map, px, py, tx, ty)
- if map[ty][tx] ~= 0 then
- return nil
- end
- local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {}
- openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1}
- local nodenumber = 0
- while listk > 0 do
- nodenumber = nodenumber + 1
- if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then
- wait()
- if DebugPathing == true then
- print("Node", nodenumber)
- end
- end
- closedk = closedk + 1
- table.insert(closedlist, closedk, openlist[1])
- curbase = closedlist[closedk]
- if closedlist[closedk].x == tx and closedlist[closedk].y == ty then
- return closedlist
- end
- openlist[1] = openlist[listk]
- table.remove(openlist, listk)
- listk = listk - 1
- local v = 1
- while true do
- local u = v
- if 2 * u + 1 <= listk then
- if openlist[u].f >= openlist[2 * u].f then
- v = 2 * u
- end
- if openlist[v].f >= openlist[2 * u + 1].f then
- v = 2 * u + 1
- end
- elseif 2 * u <= listk then
- if openlist[u].f >= openlist[2 * u].f then
- v = 2 * u
- end
- end
- if u ~= v then
- local temp = openlist[u]
- openlist[u] = openlist[v]
- openlist[v] = temp
- else
- break
- end
- end
- 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
- if closedk > 0 then
- for k = 1, closedk do
- for i, v in pairs(tocheck) do
- if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then
- tocheck[i] = nil
- end
- end
- end
- end
- for i, v in pairs(tocheck) do
- local a = curbase.x + v[1]
- local b = curbase.y + v[2]
- if a > xsize or a < 1 or b > ysize or b < 1 then
- tocheck[i] = nil
- end
- end
- for i, v in pairs(tocheck) do
- local a, b = curbase.x + v[1], curbase.y + v[2]
- if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then
- tocheck[i] = nil
- end
- end
- tempG = curbase.g + 1
- tempDiagG = curbase.g + 1.4
- for k = 1, listk do
- for i, v in pairs(tocheck) do
- if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then
- tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty)
- table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk})
- local m = k
- while m ~= 1 do
- if openlist[m].f <= openlist[math.floor(m/2)].f then
- temp = openlist[math.floor(m/2)]
- openlist[math.floor(m/2)] = openlist[m]
- openlist[m] = temp
- m = math.floor(m/2)
- else
- break
- end
- tocheck[i] = nil
- end
- end
- end
- end
- for i, v in pairs(tocheck) do
- listk = listk + 1
- tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty)
- table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk})
- m = listk
- while m ~= 1 do
- if openlist[m].f <= openlist[math.floor(m/2)].f then
- temp = openlist[math.floor(m/2)]
- openlist[math.floor(m/2)] = openlist[m]
- openlist[m] = temp
- m = math.floor(m/2)
- else
- break
- end
- end
- end
- end
- return nil
- end
- function CalcPath(closedlist)
- if closedlist == nil or table.getn(closedlist) == 1 then
- return nil
- end
- local path = {}
- local pathIndex = {}
- local last = table.getn(closedlist)
- table.insert(pathIndex,1,last)
- local i = 1
- while pathIndex[i] > 1 do
- i = i + 1
- table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par)
- end
- for n = table.getn(pathIndex) - 1, 1, -1 do
- table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y})
- end
- closedlist = nil
- return path
- end
- end)
- Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator
- local Base
- if script.Parent:FindFirstChild("BASE") == nil then
- Base = Instance.new("Part")
- Base.Transparency = 1
- Base.TopSurface = "Smooth"
- Base.BottomSurface = "Smooth"
- Base.CanCollide = false
- Base.Anchored = true
- Base.Locked = true
- Base.BrickColor = BrickColor.new(0, 0, 0)
- Base.Name = "BASE"
- Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
- Base.Parent = script.Parent
- else
- Base = script.Parent.BASE
- Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
- end
- function Jump()
- script.Parent.Humanoid.Jump = true
- end
- function Check(Hit)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then
- if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
- Jump()
- end
- end
- end
- script.Parent.Torso.Touched:connect(Check)
- function Prep(Target, Current, Attempts)
- if Attempts == nil then
- Attempts = 1000
- end
- local Hit = false
- local Tag = Base:Clone()
- Tag.Position = Target
- Tag.Parent = script.Parent
- local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40)
- local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, script.Parent)
- if TRHit ~= nil then
- Hit = true
- end
- if Tag.Parent ~= nil then
- Tag:Remove()
- end
- if Hit == false and Attempts > 0 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1)
- elseif script.Parent.Wander.Value == true then
- 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))
- local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, script.Parent)
- local TrueTarget = script.Parent.Torso.Position
- if THit ~= nil then
- for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - TPos).Magnitude) do
- 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)
- local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
- if TH2 ~= nil and TH2.Name ~= "Lava" then
- TrueTarget = TP2
- else
- break
- end
- end
- else
- for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - Target).Magnitude) do
- 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)
- local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
- if TH2 ~= nil and TH2.Name ~= "Lava" then
- TrueTarget = TP2
- else
- break
- end
- end
- end
- script.Parent.Humanoid:MoveTo(TrueTarget, Current)
- end
- end
- function ZHit(Part)
- 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
- Part.Parent.Humanoid:TakeDamage(2)
- script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + 1
- script.Parent.Humanoid:TakeDamage(-1)
- end
- end
- script.Parent["Right Arm"].Touched:connect(ZHit)
- script.Parent["Left Arm"].Touched:connect(ZHit)
- CurrentMap = {}
- MapMask = {}
- MapVar = {0, 0, 0, 0, 0}
- BlockScanned = 0
- ScanSkip = 5
- DebugPathing = true
- function GenerateMap(PathPos)
- CurrentMap = {}
- MapMask = {}
- MapVar = {0, 0, 0, 0, 0}
- BlockScanned = 0
- MapVariables = ScanParts(Workspace, 1)
- for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do
- CurrentMap[MapX] = {}
- for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do
- CurrentMap[MapX][MapY] = 0
- end
- end
- for MaskX = 1, #CurrentMap do
- MapMask[MaskX] = {}
- for MaskY = 1, #CurrentMap[MaskX] do
- MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5}
- end
- end
- ScanParts(Workspace, 2, MapVariables)
- wait(1)
- if script.Parent.PrintMap.Value == true then
- print("Printing Map...")
- for ClearPrint = 1, 250 do
- wait()
- print()
- end
- for PrintX = 1, #CurrentMap do
- local PrintZ = ""
- for PrintY = 1, #CurrentMap[PrintX] do
- PrintZ = PrintZ ..CurrentMap[PrintX][PrintY]
- end
- print(PrintZ)
- wait(0.1)
- end
- end
- local MapCoords = {0, 0, 0, 0}
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- 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
- MapCoords = {MPX, MPY, 0, 0}
- 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
- end
- end
- end
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- 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
- MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)}
- 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
- end
- end
- end
- for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do
- local Timer = 20
- local pX = v["x"]
- local pY = v["y"]
- local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2])
- pTo = pTo + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit
- while (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do
- script.Parent.Humanoid:MoveTo(pTo, Base)
- Timer = Timer - 1
- if Timer == 10 then
- script.Parent.Humanoid.Jump = true
- end
- wait(0.1)
- end
- if Timer == 0 then
- if (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude <= 5 then
- 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
- else
- break
- end
- end
- end
- end
- function ScanParts(CurrentModel, CurrentStage, Variables)
- local X = CurrentModel:GetChildren()
- for I = 1, #X do
- if #X[I]:GetChildren() > 0 then
- ScanParts(X[I], 1, Variables)
- end
- 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
- BlockScanned = BlockScanned + 1
- if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then
- wait()
- if DebugPathing == true then
- print("Block", BlockScanned)
- end
- end
- if CurrentStage == 1 then
- MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1])
- MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2])
- MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3])
- MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4])
- 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
- local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2}
- local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2}
- local BlockCoords = {0, 0, 0, 0}
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then
- BlockCoords = {MPX, MPY, 0, 0}
- Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude
- end
- end
- end
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then
- BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY}
- Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude
- end
- end
- end
- for XGrid = BlockCoords[2], BlockCoords[4] do
- for YGrid = BlockCoords[1], BlockCoords[3] do
- CurrentMap[XGrid][YGrid] = 1
- end
- end
- end
- end
- end
- if CurrentStage == 1 then
- MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2}
- return MapVar
- end
- end
- IsInCombat = false
- while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") == nil do
- local Distance = 100
- local Target = nil
- IsInCombat = false
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- 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
- local TeamTag = nil
- local Parts = Players[Check]:GetChildren()
- for X = 1, #Parts do
- if Parts[X].Name == "TeamLoc" then
- if Parts[X].Value == script.Parent.IsOnTeam.Team.Value then
- TeamTag = Parts[X]
- end
- end
- end
- 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
- if script.Parent.IsOnTeam.Value == false then
- if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Players[Check])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- else
- if Parts[X] ~= nil then
- Parts[X]:Remove()
- end
- local Found = Instance.new("BrickColorValue", Players[Check])
- Found.Name = "TeamLoc"
- Found.Value = script.Parent.IsOnTeam.Team.Value
- game:GetService("Debris"):AddItem(Found, 3)
- if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Players[Check])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- end
- end
- if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
- Target = Players[Check].Torso
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- end
- if Target == nil then
- local HasTool = false
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- HasTool = true
- end
- end
- if HasTool == false then
- Distance = 100
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
- Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
- Target = Players[Check]
- end
- end
- end
- if Target ~= nil and Target.ClassName == "Tool" then
- if Distance <= 5 and HasTool == false then
- Target.Parent = script.Parent
- HasTool = true
- else
- Prep(Target.Handle.Position, Base)
- end
- else
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- if Hit ~= nil and Hit == Players[Check] then
- Target = Players[Check]
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- if Target ~= nil then
- script.Parent.Humanoid:MoveTo(Target.Position, Target)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
- Target.OpenCrate.Value = true
- end
- else
- local HasHat = false
- local HatCheck = script.Parent:GetChildren()
- for Check = 1, #HatCheck do
- if ToolCheck[Check].ClassName == "Hat" then
- HasHat = true
- end
- end
- if HasHat == false then
- Distance = 100
- for Check = 1, #Players do
- if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
- Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
- Target = Players[Check]
- end
- end
- end
- if Target ~= nil and Target.ClassName == "Hat" then
- if Distance <= 5 and HasHat == false then
- Target.Parent = script.Parent
- HasHat = true
- else
- Prep(Target.Handle.Position, Base)
- end
- else
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(script.Parent.PathTo.Value)
- script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- end
- end
- end
- else
- if Target == nil then
- local Distance = 80
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- 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
- Target = Players[Check].Torso
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- if Target ~= nil then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 10
- Prep(Position, Base)
- else
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(script.Parent.PathTo.Value)
- script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- else
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(script.Parent.PathTo.Value)
- script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- end
- else
- local Weapon = nil
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
- if Weapon.Type.Value == "Melee" then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "Melee/Ranged" then
- if Distance <= 10 then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- else
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Base)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 50 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Melee/RangedMed" then
- if Distance <= 10 then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- else
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 40 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Melee/RangedClose" then
- if Distance <= 10 then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- else
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Base)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 30 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Ranged" then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- elseif Weapon.Type.Value == "RangedMed" then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 60, Base)
- if Distance <= 70 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "RangedClose" then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
- if Distance <= 40 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * (script.Parent.Torso.Position - Target.Position).Magnitude + Target.Velocity
- script.Parent.Humanoid:MoveTo(Position, Base)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- elseif Weapon.Type.Value == "RangedTactical" then
- if Distance <= 30 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 50
- Prep(Position, Base)
- elseif Distance >= 50 then
- Prep(Target.Position, Target)
- end
- if Distance <= 50 and Distance >= 30 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso)
- end
- if Distance <= 60 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "Shuriken" then
- if Distance <= 15 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20
- Prep(Position, Base)
- elseif Distance >= 30 then
- Prep(Target.Position, Target)
- end
- if Distance <= 30 and Distance >= 15 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso)
- end
- if Distance <= 50 then
- 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))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "HealDrink" then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
- Prep(Position, Base)
- if script.Parent.Humanoid.Health < script.Parent.Humanoid.MaxHealth then
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "GrenadeDirect" then
- if Distance >= 80 and Distance <= 100 then
- Prep(Target.Position, Target)
- wait(0.5)
- Weapon.Active.Value = true
- wait(0.5)
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
- Prep(Position, Base)
- else
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
- Prep(Position, Base)
- end
- elseif Weapon.Type.Value == "Bomb" then
- if Distance > 10 then
- Prep(Target.Position, Target)
- elseif Distance <= 10 then
- Weapon.Active.Value = true
- wait(2)
- while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
- wait(0.5)
- end
- end
- elseif Weapon.Type.Value == "Backstab" then
- if Distance >= 10 then
- if (script.Parent.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then
- Prep(Target.Position, Target)
- else
- if (script.Parent.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then
- Prep(Target.Position, Base)
- local backstab_time = 20
- while backstab_time > 1 and (script.Parent.Torso.Position - Target.Position).Magnitude >= 4 do
- wait(0.1)
- backstab_time = backstab_time - 1
- end
- if (script.Parent.Torso.Position - Target.Position).Magnitude < 4 then
- Weapon.Active.Value = true
- end
- else
- Prep(Target.Position - Target.CFrame.lookVector * 15, Base)
- end
- end
- else
- Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
- if Distance <= 5 then
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Crossbow" then
- if Distance > 80 then
- Prep(Target.Position, Target)
- elseif Distance < 40 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100, Base)
- elseif Distance <= 80 and Distance >= 40 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * ((script.Parent.Torso.Position - Target.Position).Magnitude - 5), Base)
- wait(0.2)
- Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- IsInCombat = true
- elseif Distance <= 100 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
- Prep(Position, Base)
- end
- end
- if IsInCombat == true then
- wait(0.2)
- else
- wait(0.6)
- end
- end
- local Weapon = nil
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and script.Parent.DropWeapon.Value == true then
- Weapon.Parent = Workspace
- elseif Weapon ~= nil then
- Weapon:Remove()
- end
- if script.Parent:FindFirstChild("IsAZombie") ~= nil then
- script.Parent.Name = "New Zombie"
- script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100)))
- wait()
- script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
- script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100
- ZStat = 2
- ZStat2 = 1.57
- Delay(1, function()
- while script.Parent:FindFirstChild("Humanoid") ~= nil and script.Parent.Humanoid.Health > 0 do
- script.Parent.Humanoid.MaxHealth = math.max(0, script.Parent.Humanoid.MaxHealth - 1)
- script.Parent.Humanoid.Health = math.min(script.Parent.Humanoid.Health, script.Parent.Humanoid.MaxHealth)
- wait(1)
- end
- end)
- while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") ~= nil do
- local Distance = 100
- local Target = nil
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- 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
- local ZRay = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, script.Parent)
- 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
- if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then
- if Players[Check]:FindFirstChild("ZFound") ~= nil then
- Players[Check].ZFound:Remove()
- end
- local ZTag = Instance.new("CFrameValue", Players[Check])
- ZTag.Name = "ZFound"
- game:GetService("Debris"):AddItem(ZTag, 5)
- end
- if (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
- Target = Players[Check].Torso
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- end
- if Target == nil then
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- elseif script.Parent.Wander.Value == true then
- script.Parent.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
- end
- wait(0.8)
- end
- end
- end)
- Delay(0, function() --Random Tool Usage Script
- while true do
- wait(math.random(40, 70 + math.random(30, 120)) / 10)
- local Weapon = nil
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
- if Weapon.Type.Value == "HealDrink" then
- Weapon.Active.Value = true
- end
- end
- end
- end)
- Delay(1, function() --Player Customization Script
- if script.Parent["Custom_Name"].Value == "" then
- script.Parent.Name = "Player" ..math.random(1, 999)
- else
- script.Parent.Name = script.Parent["Custom_Name"].Value
- end
- BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226}
- SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200}
- PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030}
- BColor = BrickColor.new(BColors[math.random(1, #BColors)])
- SColor = BrickColor.new(SColors[math.random(1, #SColors)])
- PColor = BrickColor.new(PColors[math.random(1, #PColors)])
- if script.Parent.IsOnTeam.Value == true then
- SColor = script.Parent.IsOnTeam.Team.Value
- PColor = SColor
- if script.Parent.IsOnTeam.ShowTag.Value == true then
- script.Parent.Name = script.Parent.Name .." [" ..script.Parent.IsOnTeam.Team.Value.Name .."]"
- end
- end
- if script.Parent["Body Colors"].ForceColors.Value ~= true then
- script.Parent["Body Colors"].HeadColor = BColor
- script.Parent["Body Colors"].LeftArmColor = BColor
- script.Parent["Body Colors"].LeftLegColor = PColor
- script.Parent["Body Colors"].RightArmColor = BColor
- script.Parent["Body Colors"].RightLegColor = PColor
- script.Parent["Body Colors"].TorsoColor = SColor
- end
- script.Parent.Head.BrickColor = script.Parent["Body Colors"].HeadColor
- script.Parent["Left Arm"].BrickColor = script.Parent["Body Colors"].LeftArmColor
- script.Parent["Left Leg"].BrickColor = script.Parent["Body Colors"].LeftLegColor
- script.Parent["Right Arm"].BrickColor = script.Parent["Body Colors"].RightArmColor
- script.Parent["Right Leg"].BrickColor = script.Parent["Body Colors"].RightLegColor
- script.Parent.Torso.BrickColor = script.Parent["Body Colors"].TorsoColor
- if script.Parent["Force_Weapon"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Weapon"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- 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
- c[i].Parent = script.Parent
- script.Parent.DropWeapon.Value = false
- end
- end
- end
- if script.Parent["Force_Hat"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Hat"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then
- c[i].Parent = script.Parent
- end
- end
- end
- if script.Parent["Force_Shirt"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Shirt"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Shirt" then
- c[i].Parent = script.Parent
- end
- end
- end
- if script.Parent["Force_Pants"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Pants"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Pants" then
- c[i].Parent = script.Parent
- end
- end
- end
- end)
- wait()
- print("Player Bot Loaded")
- end))
- Model0.Name=targetPart.Parent.Name
- Model0.Torso.Touched:connect(function(h)
- if h.Parent.Name==Model0.Name then
- h.Parent:BreakJoints()
- Model0:remove()
- end
- end)
- Model0.Torso.Position=Character.Torso.Position
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Character
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- end
- function yclone()
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Model0.Name =Player.Name .."'s clone"
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Decal3 = Instance.new("Decal")
- Part4 = Instance.new("Part")
- Decal5 = Instance.new("Decal")
- Motor6 = Instance.new("Motor")
- Motor7 = Instance.new("Motor")
- Motor8 = Instance.new("Motor")
- Motor9 = Instance.new("Motor")
- Motor10 = Instance.new("Motor")
- Part11 = Instance.new("Part")
- Part12 = Instance.new("Part")
- Part13 = Instance.new("Part")
- Part14 = Instance.new("Part")
- Humanoid15 = Instance.new("Humanoid")
- BodyColors16 = Instance.new("BodyColors")
- Script17 = Instance.new("Script")
- Model0.Name = "Clone"
- Model0.Parent = mas
- Model0.PrimaryPart = Part1
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.BrickColor = BrickColor.new("Bright yellow")
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(2, 1, 1)
- Part1.CFrame = CFrame.new(6.34995413, 4.50001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part1.Position = Vector3.new(6.34995413, 4.50001717, 23.1599998)
- Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal3.Name = "face"
- Decal3.Parent = Part1
- Decal3.Texture = "rbxasset://textures/face.png"
- Part4.Name = "Torso"
- Part4.Parent = Model0
- Part4.BrickColor = BrickColor.new("Bright blue")
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.Size = Vector3.new(2, 2, 1)
- Part4.CFrame = CFrame.new(6.34995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.LeftSurface = Enum.SurfaceType.Weld
- Part4.RightSurface = Enum.SurfaceType.Weld
- Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part4.Position = Vector3.new(6.34995413, 3.00001717, 23.1599998)
- Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Decal5.Name = "roblox"
- Decal5.Parent = Part4
- Motor6.Name = "Right Shoulder"
- Motor6.Parent = Part4
- Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6.Part0 = Part4
- Motor6.Part1 = Part12
- Motor6.MaxVelocity = 0.15000000596046
- Motor7.Name = "Left Shoulder"
- Motor7.Parent = Part4
- Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor7.Part0 = Part4
- Motor7.Part1 = Part11
- Motor7.MaxVelocity = 0.15000000596046
- Motor8.Name = "Right Hip"
- Motor8.Parent = Part4
- Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor8.Part0 = Part4
- Motor8.Part1 = Part14
- Motor8.MaxVelocity = 0.10000000149012
- Motor9.Name = "Left Hip"
- Motor9.Parent = Part4
- Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor9.Part0 = Part4
- Motor9.Part1 = Part13
- Motor9.MaxVelocity = 0.10000000149012
- Motor10.Name = "Neck"
- Motor10.Parent = Part4
- Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor10.Part0 = Part4
- Motor10.Part1 = Part1
- Motor10.MaxVelocity = 0.10000000149012
- Part11.Name = "Left Arm"
- Part11.Parent = Model0
- Part11.BrickColor = BrickColor.new("Bright yellow")
- Part11.CanCollide = false
- Part11.FormFactor = Enum.FormFactor.Symmetric
- Part11.Size = Vector3.new(1, 2, 1)
- Part11.CFrame = CFrame.new(4.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part11.Position = Vector3.new(4.84995413, 3.00001717, 23.1599998)
- Part11.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part12.Name = "Right Arm"
- Part12.Parent = Model0
- Part12.BrickColor = BrickColor.new("Bright yellow")
- Part12.CanCollide = false
- Part12.FormFactor = Enum.FormFactor.Symmetric
- Part12.Size = Vector3.new(1, 2, 1)
- Part12.CFrame = CFrame.new(7.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part12.Position = Vector3.new(7.84995413, 3.00001717, 23.1599998)
- Part12.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part13.Name = "Left Leg"
- Part13.Parent = Model0
- Part13.BrickColor = BrickColor.new("Br. yellowish green")
- Part13.CanCollide = false
- Part13.FormFactor = Enum.FormFactor.Symmetric
- Part13.Size = Vector3.new(1, 2, 1)
- Part13.CFrame = CFrame.new(5.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.TopSurface = Enum.SurfaceType.Inlet
- Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part13.Position = Vector3.new(5.84995413, 1.00001717, 23.1599998)
- Part13.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part14.Name = "Right Leg"
- Part14.Parent = Model0
- Part14.BrickColor = BrickColor.new("Br. yellowish green")
- Part14.CanCollide = false
- Part14.FormFactor = Enum.FormFactor.Symmetric
- Part14.Size = Vector3.new(1, 2, 1)
- Part14.CFrame = CFrame.new(6.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part14.BottomSurface = Enum.SurfaceType.Smooth
- Part14.TopSurface = Enum.SurfaceType.Inlet
- Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part14.Position = Vector3.new(6.84995413, 1.00001717, 23.1599998)
- Part14.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Humanoid15.Parent = Model0
- Humanoid15.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid15.RightLeg = Part14
- Humanoid15.LeftLeg = Part13
- Humanoid15.Torso = Part4
- BodyColors16.Parent = Model0
- BodyColors16.HeadColor = BrickColor.new("Bright yellow")
- BodyColors16.LeftArmColor = BrickColor.new("Bright yellow")
- BodyColors16.LeftLegColor = BrickColor.new("Br. yellowish green")
- BodyColors16.RightArmColor = BrickColor.new("Bright yellow")
- BodyColors16.RightLegColor = BrickColor.new("Br. yellowish green")
- BodyColors16.TorsoColor = BrickColor.new("Bright blue")
- Script17.Name = "Full Animation"
- Script17.Parent = Model0
- table.insert(cors,sandbox(Script17,function()
- --[[Made by Jammer622 @[http://www.roblox.com/Advanced-Player-AI-item?id=59391730],
- This is the ORIGINAL model, if you see others, they are stolen.
- Scripts mixed from vanilla Animate, Health, and Sound,
- with much custom content by myself, making them great AIs.
- No help from Miked's scripts, I made my own joint script.
- If you find any glitches, bugs, or just want to suggest an idea, please message me.
- My team works hard on these AIs, please don't make attempts to steal them.
- Your feedback is extremely appreciated!
- _---=CREDITS=---_
- The Roblox Team Without them, none of this would be possible.
- Vanilla Sound
- Vanilla Health
- Vanilla Animate
- Jammer622 That's me, main programmer and weapon publisher.
- Main Developer
- Health GUI Script
- Animation Work
- Relationship Work
- Wandering
- Pathing (Map Generation)
- Weapon Usage
- Weapon (Re)Publishing
- Sonypony458
- McDonalds Drink
- Customization
- Teamwork AI
- Model Variables
- Setting Wiki [Below]
- Macdeath I owe it to him for keeping me on track during this.
- Feature Inspiration
- Problem Solving
- Suggestions
- lah30303 Amazing pathing work goes to this fine sir.
- Pathing (Pathing Generation/System)
- _---=SETTINGS=---_
- Inside this model's file, you'll find several values that can be changed.
- DropWeapon -This sets whether or not the bot will drop any equipped weapon upon dying.
- Force_Pants -This must be set through Spawners.
- Force_Shirt -This must be set through Spawners.
- Force_Weapon -This must be set through Spawners.
- Force_Hat -This must be set through Spawners.
- IgnoreCombatFF -This sets whether or not the bot will allow friendly fire during combat.
- IsAPlayer -This is a tag to specify this bot's existance to other AIs.
- IsOnTeam -This sets whether or not the bot is on a team.
- ShowTag -This sets whether or not the bot's team color name shows up beside its own.
- Team -This sets the bot's team color.
- PathTo -This is an experimental pathfinding engine. Use at your own risk!
- PrintMap -This prints maps generated when using PathTo. Use at your own risk!
- Respawn -This sets whether the bot will respawn or not upon death.
- Custom_Name -This must be set through Spawners.
- Wander -This sets whether the bot is stationary or if it moves, but not if it uses weapons or not.
- ]]
- print("Player Bot Loading")
- Delay(0, function() --Vanilla Sound
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.archivable = false
- sound.Parent = script.Parent.Head
- return sound
- end
- local sDied = newSound("rbxasset://sounds/uuhhh.wav")
- local sFallingDown = newSound("rbxasset://sounds/splat.wav")
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
- local sGettingUp = newSound("rbxasset://sounds/hit.wav")
- local sJumping = newSound("rbxasset://sounds/button.wav")
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
- sRunning.Looped = true
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- function onDied()
- sDied:Play()
- end
- function onState(state, sound)
- if state then
- sound:Play()
- else
- sound:Pause()
- end
- end
- function onRunning(speed)
- if speed>0 then
- sRunning:Play()
- else
- sRunning:Pause()
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- end)
- Delay(0, function() --Vanilla Health
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Humanoid = waitForChild(Figure, "Humanoid")
- local regening = false
- function regenHealth()
- if regening then return end
- regening = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local s = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
- health = health + newHealthDelta
- Humanoid.Health = math.min(health,Humanoid.MaxHealth)
- end
- end
- if Humanoid.Health > Humanoid.MaxHealth then
- Humanoid.Health = Humanoid.MaxHealth
- end
- regening = false
- end
- Humanoid.HealthChanged:connect(regenHealth)
- end)
- Delay(0, function() --Vanilla Animate, Multiple Additions
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Clone = Figure:Clone()
- local Torso = waitForChild(Figure, "Torso")
- local Joints = Torso:GetChildren()
- for All = 1, #Joints do
- if Joints.className == "Motor" or Joints.className == "Motor6D" then
- Joints[All]:Remove()
- end
- end
- local RightShoulder = Instance.new("Motor")
- local LeftShoulder = Instance.new("Motor")
- local RightHip = Instance.new("Motor")
- local LeftHip = Instance.new("Motor")
- local Neck = Instance.new("Motor")
- local Humanoid = waitForChild(Figure, "Humanoid")
- ZStat = 1
- ZStat2 = 0
- local pose = "Standing"
- RightShoulder.Part0 = Torso
- RightShoulder.Part1 = Figure["Right Arm"]
- RightShoulder.MaxVelocity = 0.15
- RightShoulder.Name = "Right Shoulder"
- RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightShoulder.Parent = Torso
- LeftShoulder.Part0 = Torso
- LeftShoulder.Part1 = Figure["Left Arm"]
- LeftShoulder.MaxVelocity = 0.15
- LeftShoulder.Name = "Left Shoulder"
- LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftShoulder.Parent = Torso
- RightHip.Part0 = Torso
- RightHip.Part1 = Figure["Right Leg"]
- RightHip.MaxVelocity = 0.1
- RightHip.Name = "Right Hip"
- RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RightHip.Parent = Torso
- LeftHip.Part0 = Torso
- LeftHip.Part1 = Figure["Left Leg"]
- LeftHip.MaxVelocity = 0.1
- LeftHip.Name = "Left Hip"
- LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- LeftHip.Parent = Torso
- Neck.Part0 = Torso
- Neck.Part1 = Figure["Head"]
- Neck.MaxVelocity = 0.1
- Neck.Name = "Neck"
- Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- Neck.Parent = Torso
- local toolAnim = "None"
- local toolAnimTime = 0
- SpawnModel = Instance.new("Model")
- function onRunning(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function CheckTag(Tag)
- 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
- if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then
- 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
- local Tag2 = Instance.new("CFrameValue", Tag.Value.Character)
- Tag2.Name = "IsLocalEnemy"
- print(Tag.Value.Character.Name .." Has Become An Outlaw")
- end
- end
- if Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Tag.Value.Character)
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- 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
- if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then
- 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
- local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
- Tag2.Name = "IsLocalEnemy"
- print(Tag.Value .." Has Become An Outlaw")
- end
- end
- if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
- if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then
- 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
- local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Tag2.Name = "IsLocalEnemy"
- print(Tag.Value .." Has Become An Outlaw")
- end
- end
- if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- 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
- local Found = Instance.new("CFrameValue", Tag.Value.Character)
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
- local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- end
- end
- function CheckSpawns(Object)
- local Parts = Object:GetChildren()
- for Check = 1, #Parts do
- if Parts[Check].className == "SpawnLocation" then
- local I = Instance.new("Vector3Value", SpawnModel)
- I.Value = Parts[Check].Position
- end
- CheckSpawns(Parts[Check])
- end
- end
- function onDied()
- pose = "Dead"
- Delay(5, function()
- if script.Parent.Respawn.Value == true then
- CheckSpawns(Workspace)
- local Spawn = SpawnModel:GetChildren()
- Clone.Parent = game.Workspace
- if #Spawn > 0 then
- Spawn = Spawn[math.random(1, #Spawn)].Value
- Clone:MoveTo(Spawn)
- else
- Clone:MoveTo(Vector3.new(0, 50, 0))
- end
- end
- Figure:Remove()
- return
- end)
- end
- function onJumping()
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (3.14/ZStat)
- LeftShoulder.DesiredAngle = (-3.14/ZStat)
- RightHip.DesiredAngle = (0)
- LeftHip.DesiredAngle = (0)
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (3.14/ZStat)
- LeftShoulder.DesiredAngle = (-3.14/ZStat)
- RightHip.DesiredAngle = (0)
- LeftHip.DesiredAngle = (0)
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder.DesiredAngle = (3.14 /2)
- LeftShoulder.DesiredAngle = (-3.14 /2)
- RightHip.DesiredAngle = (3.14 /2)
- LeftHip.DesiredAngle = (-3.14 /2)
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- RightShoulder.DesiredAngle = (1.57)
- return
- end
- if (toolAnim == "Slash") then
- RightShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (0)
- return
- end
- if (toolAnim == "Lunge") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightHip.MaxVelocity = 0.5
- LeftHip.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = (1.57)
- LeftShoulder.DesiredAngle = (1.0)
- RightHip.DesiredAngle = (1.57)
- LeftHip.DesiredAngle = (1.0)
- return
- end
- end
- function move(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2
- LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2
- RightHip.DesiredAngle = (-desiredAngle)
- LeftHip.DesiredAngle = (-desiredAngle)
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.ChildAdded:connect(CheckTag)
- OriginalTime = 0.1
- Time = OriginalTime
- while Figure.Parent~=nil do
- Time = Time + 0.1
- wait(OriginalTime)
- move(Time)
- end
- end)
- Delay(0, function() --lah30303's Pathing Script
- function CalcMoves(map, px, py, tx, ty)
- if map[ty][tx] ~= 0 then
- return nil
- end
- local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {}
- openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1}
- local nodenumber = 0
- while listk > 0 do
- nodenumber = nodenumber + 1
- if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then
- wait()
- if DebugPathing == true then
- print("Node", nodenumber)
- end
- end
- closedk = closedk + 1
- table.insert(closedlist, closedk, openlist[1])
- curbase = closedlist[closedk]
- if closedlist[closedk].x == tx and closedlist[closedk].y == ty then
- return closedlist
- end
- openlist[1] = openlist[listk]
- table.remove(openlist, listk)
- listk = listk - 1
- local v = 1
- while true do
- local u = v
- if 2 * u + 1 <= listk then
- if openlist[u].f >= openlist[2 * u].f then
- v = 2 * u
- end
- if openlist[v].f >= openlist[2 * u + 1].f then
- v = 2 * u + 1
- end
- elseif 2 * u <= listk then
- if openlist[u].f >= openlist[2 * u].f then
- v = 2 * u
- end
- end
- if u ~= v then
- local temp = openlist[u]
- openlist[u] = openlist[v]
- openlist[v] = temp
- else
- break
- end
- end
- 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
- if closedk > 0 then
- for k = 1, closedk do
- for i, v in pairs(tocheck) do
- if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then
- tocheck[i] = nil
- end
- end
- end
- end
- for i, v in pairs(tocheck) do
- local a = curbase.x + v[1]
- local b = curbase.y + v[2]
- if a > xsize or a < 1 or b > ysize or b < 1 then
- tocheck[i] = nil
- end
- end
- for i, v in pairs(tocheck) do
- local a, b = curbase.x + v[1], curbase.y + v[2]
- if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then
- tocheck[i] = nil
- end
- end
- tempG = curbase.g + 1
- tempDiagG = curbase.g + 1.4
- for k = 1, listk do
- for i, v in pairs(tocheck) do
- if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then
- tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty)
- table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk})
- local m = k
- while m ~= 1 do
- if openlist[m].f <= openlist[math.floor(m/2)].f then
- temp = openlist[math.floor(m/2)]
- openlist[math.floor(m/2)] = openlist[m]
- openlist[m] = temp
- m = math.floor(m/2)
- else
- break
- end
- tocheck[i] = nil
- end
- end
- end
- end
- for i, v in pairs(tocheck) do
- listk = listk + 1
- tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty)
- table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk})
- m = listk
- while m ~= 1 do
- if openlist[m].f <= openlist[math.floor(m/2)].f then
- temp = openlist[math.floor(m/2)]
- openlist[math.floor(m/2)] = openlist[m]
- openlist[m] = temp
- m = math.floor(m/2)
- else
- break
- end
- end
- end
- end
- return nil
- end
- function CalcPath(closedlist)
- if closedlist == nil or table.getn(closedlist) == 1 then
- return nil
- end
- local path = {}
- local pathIndex = {}
- local last = table.getn(closedlist)
- table.insert(pathIndex,1,last)
- local i = 1
- while pathIndex[i] > 1 do
- i = i + 1
- table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par)
- end
- for n = table.getn(pathIndex) - 1, 1, -1 do
- table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y})
- end
- closedlist = nil
- return path
- end
- end)
- Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator
- local Base
- if script.Parent:FindFirstChild("BASE") == nil then
- Base = Instance.new("Part")
- Base.Transparency = 1
- Base.TopSurface = "Smooth"
- Base.BottomSurface = "Smooth"
- Base.CanCollide = false
- Base.Anchored = true
- Base.Locked = true
- Base.BrickColor = BrickColor.new(0, 0, 0)
- Base.Name = "BASE"
- Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
- Base.Parent = script.Parent
- else
- Base = script.Parent.BASE
- Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
- end
- function Jump()
- script.Parent.Humanoid.Jump = true
- end
- function Check(Hit)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then
- if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
- Jump()
- end
- end
- end
- script.Parent.Torso.Touched:connect(Check)
- function Prep(Target, Current, Attempts)
- if Attempts == nil then
- Attempts = 1000
- end
- local Hit = false
- local Tag = Base:Clone()
- Tag.Position = Target
- Tag.Parent = script.Parent
- local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40)
- local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, script.Parent)
- if TRHit ~= nil then
- Hit = true
- end
- if Tag.Parent ~= nil then
- Tag:Remove()
- end
- if Hit == false and Attempts > 0 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1)
- elseif script.Parent.Wander.Value == true then
- 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))
- local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, script.Parent)
- local TrueTarget = script.Parent.Torso.Position
- if THit ~= nil then
- for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - TPos).Magnitude) do
- 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)
- local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
- if TH2 ~= nil and TH2.Name ~= "Lava" then
- TrueTarget = TP2
- else
- break
- end
- end
- else
- for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - Target).Magnitude) do
- 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)
- local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent)
- if TH2 ~= nil and TH2.Name ~= "Lava" then
- TrueTarget = TP2
- else
- break
- end
- end
- end
- script.Parent.Humanoid:MoveTo(TrueTarget, Current)
- end
- end
- function ZHit(Part)
- 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
- Part.Parent.Humanoid:TakeDamage(2)
- script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + 1
- script.Parent.Humanoid:TakeDamage(-1)
- end
- end
- script.Parent["Right Arm"].Touched:connect(ZHit)
- script.Parent["Left Arm"].Touched:connect(ZHit)
- CurrentMap = {}
- MapMask = {}
- MapVar = {0, 0, 0, 0, 0}
- BlockScanned = 0
- ScanSkip = 5
- DebugPathing = true
- function GenerateMap(PathPos)
- CurrentMap = {}
- MapMask = {}
- MapVar = {0, 0, 0, 0, 0}
- BlockScanned = 0
- MapVariables = ScanParts(Workspace, 1)
- for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do
- CurrentMap[MapX] = {}
- for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do
- CurrentMap[MapX][MapY] = 0
- end
- end
- for MaskX = 1, #CurrentMap do
- MapMask[MaskX] = {}
- for MaskY = 1, #CurrentMap[MaskX] do
- MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5}
- end
- end
- ScanParts(Workspace, 2, MapVariables)
- wait(1)
- if script.Parent.PrintMap.Value == true then
- print("Printing Map...")
- for ClearPrint = 1, 250 do
- wait()
- print()
- end
- for PrintX = 1, #CurrentMap do
- local PrintZ = ""
- for PrintY = 1, #CurrentMap[PrintX] do
- PrintZ = PrintZ ..CurrentMap[PrintX][PrintY]
- end
- print(PrintZ)
- wait(0.1)
- end
- end
- local MapCoords = {0, 0, 0, 0}
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- 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
- MapCoords = {MPX, MPY, 0, 0}
- 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
- end
- end
- end
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- 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
- MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)}
- 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
- end
- end
- end
- for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do
- local Timer = 20
- local pX = v["x"]
- local pY = v["y"]
- local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2])
- pTo = pTo + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit
- while (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do
- script.Parent.Humanoid:MoveTo(pTo, Base)
- Timer = Timer - 1
- if Timer == 10 then
- script.Parent.Humanoid.Jump = true
- end
- wait(0.1)
- end
- if Timer == 0 then
- if (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude <= 5 then
- 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
- else
- break
- end
- end
- end
- end
- function ScanParts(CurrentModel, CurrentStage, Variables)
- local X = CurrentModel:GetChildren()
- for I = 1, #X do
- if #X[I]:GetChildren() > 0 then
- ScanParts(X[I], 1, Variables)
- end
- 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
- BlockScanned = BlockScanned + 1
- if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then
- wait()
- if DebugPathing == true then
- print("Block", BlockScanned)
- end
- end
- if CurrentStage == 1 then
- MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1])
- MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2])
- MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3])
- MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4])
- 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
- local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2}
- local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2}
- local BlockCoords = {0, 0, 0, 0}
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then
- BlockCoords = {MPX, MPY, 0, 0}
- Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude
- end
- end
- end
- local Distance = math.huge
- for MPX = 1, #CurrentMap do
- for MPY = 1, #CurrentMap[MPX] do
- if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then
- BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY}
- Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude
- end
- end
- end
- for XGrid = BlockCoords[2], BlockCoords[4] do
- for YGrid = BlockCoords[1], BlockCoords[3] do
- CurrentMap[XGrid][YGrid] = 1
- end
- end
- end
- end
- end
- if CurrentStage == 1 then
- MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2}
- return MapVar
- end
- end
- IsInCombat = false
- while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") == nil do
- local Distance = 100
- local Target = nil
- IsInCombat = false
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- 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
- local TeamTag = nil
- local Parts = Players[Check]:GetChildren()
- for X = 1, #Parts do
- if Parts[X].Name == "TeamLoc" then
- if Parts[X].Value == script.Parent.IsOnTeam.Team.Value then
- TeamTag = Parts[X]
- end
- end
- end
- 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
- if script.Parent.IsOnTeam.Value == false then
- if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Players[Check])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- else
- if Parts[X] ~= nil then
- Parts[X]:Remove()
- end
- local Found = Instance.new("BrickColorValue", Players[Check])
- Found.Name = "TeamLoc"
- Found.Value = script.Parent.IsOnTeam.Team.Value
- game:GetService("Debris"):AddItem(Found, 3)
- if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then
- Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Players[Check])
- Found.Name = "Loc" ..script.Parent.Name
- game:GetService("Debris"):AddItem(Found, 3)
- end
- end
- if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
- Target = Players[Check].Torso
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- end
- if Target == nil then
- local HasTool = false
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- HasTool = true
- end
- end
- if HasTool == false then
- Distance = 100
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
- Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
- Target = Players[Check]
- end
- end
- end
- if Target ~= nil and Target.ClassName == "Tool" then
- if Distance <= 5 and HasTool == false then
- Target.Parent = script.Parent
- HasTool = true
- else
- Prep(Target.Handle.Position, Base)
- end
- else
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- if Hit ~= nil and Hit == Players[Check] then
- Target = Players[Check]
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- if Target ~= nil then
- script.Parent.Humanoid:MoveTo(Target.Position, Target)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
- Target.OpenCrate.Value = true
- end
- else
- local HasHat = false
- local HatCheck = script.Parent:GetChildren()
- for Check = 1, #HatCheck do
- if ToolCheck[Check].ClassName == "Hat" then
- HasHat = true
- end
- end
- if HasHat == false then
- Distance = 100
- for Check = 1, #Players do
- if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
- Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude
- Target = Players[Check]
- end
- end
- end
- if Target ~= nil and Target.ClassName == "Hat" then
- if Distance <= 5 and HasHat == false then
- Target.Parent = script.Parent
- HasHat = true
- else
- Prep(Target.Handle.Position, Base)
- end
- else
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(script.Parent.PathTo.Value)
- script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- end
- end
- end
- else
- if Target == nil then
- local Distance = 80
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- 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
- local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent)
- 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
- Target = Players[Check].Torso
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- if Target ~= nil then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 10
- Prep(Position, Base)
- else
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(script.Parent.PathTo.Value)
- script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- else
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(script.Parent.PathTo.Value)
- script.Parent.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- end
- else
- local Weapon = nil
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
- if Weapon.Type.Value == "Melee" then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "Melee/Ranged" then
- if Distance <= 10 then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- else
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Base)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 50 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Melee/RangedMed" then
- if Distance <= 10 then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- else
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 40 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Melee/RangedClose" then
- if Distance <= 10 then
- Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- else
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Base)
- if (Target.Position - script.Parent.Torso.Position).Magnitude <= 30 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Ranged" then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- elseif Weapon.Type.Value == "RangedMed" then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 60, Base)
- if Distance <= 70 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "RangedClose" then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base)
- if Distance <= 40 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * (script.Parent.Torso.Position - Target.Position).Magnitude + Target.Velocity
- script.Parent.Humanoid:MoveTo(Position, Base)
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- elseif Weapon.Type.Value == "RangedTactical" then
- if Distance <= 30 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 50
- Prep(Position, Base)
- elseif Distance >= 50 then
- Prep(Target.Position, Target)
- end
- if Distance <= 50 and Distance >= 30 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso)
- end
- if Distance <= 60 then
- Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "Shuriken" then
- if Distance <= 15 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20
- Prep(Position, Base)
- elseif Distance >= 30 then
- Prep(Target.Position, Target)
- end
- if Distance <= 30 and Distance >= 15 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso)
- end
- if Distance <= 50 then
- 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))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "HealDrink" then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
- Prep(Position, Base)
- if script.Parent.Humanoid.Health < script.Parent.Humanoid.MaxHealth then
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "GrenadeDirect" then
- if Distance >= 80 and Distance <= 100 then
- Prep(Target.Position, Target)
- wait(0.5)
- Weapon.Active.Value = true
- wait(0.5)
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
- Prep(Position, Base)
- else
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100
- Prep(Position, Base)
- end
- elseif Weapon.Type.Value == "Bomb" then
- if Distance > 10 then
- Prep(Target.Position, Target)
- elseif Distance <= 10 then
- Weapon.Active.Value = true
- wait(2)
- while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base)
- wait(0.5)
- end
- end
- elseif Weapon.Type.Value == "Backstab" then
- if Distance >= 10 then
- if (script.Parent.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then
- Prep(Target.Position, Target)
- else
- if (script.Parent.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then
- Prep(Target.Position, Base)
- local backstab_time = 20
- while backstab_time > 1 and (script.Parent.Torso.Position - Target.Position).Magnitude >= 4 do
- wait(0.1)
- backstab_time = backstab_time - 1
- end
- if (script.Parent.Torso.Position - Target.Position).Magnitude < 4 then
- Weapon.Active.Value = true
- end
- else
- Prep(Target.Position - Target.CFrame.lookVector * 15, Base)
- end
- end
- else
- Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
- if Distance <= 5 then
- Weapon.Active.Value = true
- end
- end
- elseif Weapon.Type.Value == "Crossbow" then
- if Distance > 80 then
- Prep(Target.Position, Target)
- elseif Distance < 40 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100, Base)
- elseif Distance <= 80 and Distance >= 40 then
- Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * ((script.Parent.Torso.Position - Target.Position).Magnitude - 5), Base)
- wait(0.2)
- Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
- Weapon.Active.Value = true
- end
- end
- IsInCombat = true
- elseif Distance <= 100 then
- local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120
- Prep(Position, Base)
- end
- end
- if IsInCombat == true then
- wait(0.2)
- else
- wait(0.6)
- end
- end
- local Weapon = nil
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and script.Parent.DropWeapon.Value == true then
- Weapon.Parent = Workspace
- elseif Weapon ~= nil then
- Weapon:Remove()
- end
- if script.Parent:FindFirstChild("IsAZombie") ~= nil then
- script.Parent.Name = "New Zombie"
- script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100)))
- wait()
- script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
- script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100
- ZStat = 2
- ZStat2 = 1.57
- Delay(1, function()
- while script.Parent:FindFirstChild("Humanoid") ~= nil and script.Parent.Humanoid.Health > 0 do
- script.Parent.Humanoid.MaxHealth = math.max(0, script.Parent.Humanoid.MaxHealth - 1)
- script.Parent.Humanoid.Health = math.min(script.Parent.Humanoid.Health, script.Parent.Humanoid.MaxHealth)
- wait(1)
- end
- end)
- while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") ~= nil do
- local Distance = 100
- local Target = nil
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- 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
- local ZRay = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100)
- local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, script.Parent)
- 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
- if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then
- if Players[Check]:FindFirstChild("ZFound") ~= nil then
- Players[Check].ZFound:Remove()
- end
- local ZTag = Instance.new("CFrameValue", Players[Check])
- ZTag.Name = "ZFound"
- game:GetService("Debris"):AddItem(ZTag, 5)
- end
- if (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then
- Target = Players[Check].Torso
- Distance = (Target.Position - script.Parent.Torso.Position).Magnitude
- end
- end
- end
- end
- if Target == nil then
- if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then
- if math.random(1, 10) == 1 and script.Parent.Wander.Value == true then
- Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- elseif script.Parent.Wander.Value == true then
- script.Parent.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
- end
- wait(0.8)
- end
- end
- end)
- Delay(0, function() --Random Tool Usage Script
- while true do
- wait(math.random(40, 70 + math.random(30, 120)) / 10)
- local Weapon = nil
- local ToolCheck = script.Parent:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
- if Weapon.Type.Value == "HealDrink" then
- Weapon.Active.Value = true
- end
- end
- end
- end)
- Delay(1, function() --Player Customization Script
- if script.Parent["Custom_Name"].Value == "" then
- script.Parent.Name = "Player" ..math.random(1, 999)
- else
- script.Parent.Name = script.Parent["Custom_Name"].Value
- end
- BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226}
- SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200}
- PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030}
- BColor = BrickColor.new(BColors[math.random(1, #BColors)])
- SColor = BrickColor.new(SColors[math.random(1, #SColors)])
- PColor = BrickColor.new(PColors[math.random(1, #PColors)])
- if script.Parent.IsOnTeam.Value == true then
- SColor = script.Parent.IsOnTeam.Team.Value
- PColor = SColor
- if script.Parent.IsOnTeam.ShowTag.Value == true then
- script.Parent.Name = script.Parent.Name .." [" ..script.Parent.IsOnTeam.Team.Value.Name .."]"
- end
- end
- if script.Parent["Body Colors"].ForceColors.Value ~= true then
- script.Parent["Body Colors"].HeadColor = BColor
- script.Parent["Body Colors"].LeftArmColor = BColor
- script.Parent["Body Colors"].LeftLegColor = PColor
- script.Parent["Body Colors"].RightArmColor = BColor
- script.Parent["Body Colors"].RightLegColor = PColor
- script.Parent["Body Colors"].TorsoColor = SColor
- end
- script.Parent.Head.BrickColor = script.Parent["Body Colors"].HeadColor
- script.Parent["Left Arm"].BrickColor = script.Parent["Body Colors"].LeftArmColor
- script.Parent["Left Leg"].BrickColor = script.Parent["Body Colors"].LeftLegColor
- script.Parent["Right Arm"].BrickColor = script.Parent["Body Colors"].RightArmColor
- script.Parent["Right Leg"].BrickColor = script.Parent["Body Colors"].RightLegColor
- script.Parent.Torso.BrickColor = script.Parent["Body Colors"].TorsoColor
- if script.Parent["Force_Weapon"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Weapon"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- 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
- c[i].Parent = script.Parent
- script.Parent.DropWeapon.Value = false
- end
- end
- end
- if script.Parent["Force_Hat"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Hat"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then
- c[i].Parent = script.Parent
- end
- end
- end
- if script.Parent["Force_Shirt"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Shirt"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Shirt" then
- c[i].Parent = script.Parent
- end
- end
- end
- if script.Parent["Force_Pants"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Pants"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Pants" then
- c[i].Parent = script.Parent
- end
- end
- end
- end)
- wait()
- print("Player Bot Loaded")
- end))
- Model0.Humanoid.Died:connect(function()
- Model0:remove()
- YOURCLONE=nil
- end)
- Model0.Torso.Position=Vector3.new(Character.Torso.Position.X,Character.Torso.Position.Y+3,Character.Torso.Position.Z)
- Model0.Name=Character.Name.."'s clone"
- Model0.Humanoid.WalkToPart=torso
- YOURCLONE=Model0
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- end
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- MEF=Model0
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Part3 = Instance.new("Part")
- SpecialMesh4 = Instance.new("SpecialMesh")
- Part5 = Instance.new("Part")
- SpecialMesh6 = Instance.new("SpecialMesh")
- Part7 = Instance.new("Part")
- SpecialMesh8 = Instance.new("SpecialMesh")
- Part9 = Instance.new("Part")
- SpecialMesh10 = Instance.new("SpecialMesh")
- Part11 = Instance.new("Part")
- SpecialMesh12 = Instance.new("SpecialMesh")
- Model0.Parent = mas
- Part1.Name = "Right Arm"
- Part1.Parent = Model0
- Part1.Material = Enum.Material.Glass
- Part1.BrickColor = BrickColor.new("Pastel blue-green")
- Part1.Rotation = Vector3.new(-180, 0, -90)
- Part1.Size = Vector3.new(4, 1, 2)
- Part1.CFrame = CFrame.new(-12.3300028, 0.500003994, -1.11000025, 0, 1, 0, 1, 0, 0, 0, 0, -1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.623529, 0.952941, 0.913726)
- Part1.Position = Vector3.new(-12.3300028, 0.500003994, -1.11000025)
- Part1.Orientation = Vector3.new(0, 180, 90)
- Part1.Color = Color3.new(0.623529, 0.952941, 0.913726)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "rbxassetid://1563415862"
- SpecialMesh2.Offset = Vector3.new(0, 4, 0)
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- Part3.Name = "Right Leg"
- Part3.Parent = Model0
- Part3.Material = Enum.Material.Glass
- Part3.BrickColor = BrickColor.new("Pastel blue-green")
- Part3.Rotation = Vector3.new(-180, 0, -90)
- Part3.Size = Vector3.new(4, 1, 2)
- Part3.CFrame = CFrame.new(-14.3400002, 0.500003994, -0.0500001721, 0, 1, 0, 1, 0, 0, 0, 0, -1)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.Color = Color3.new(0.623529, 0.952941, 0.913726)
- Part3.Position = Vector3.new(-14.3400002, 0.500003994, -0.0500001721)
- Part3.Orientation = Vector3.new(0, 180, 90)
- Part3.Color = Color3.new(0.623529, 0.952941, 0.913726)
- SpecialMesh4.Parent = Part3
- SpecialMesh4.MeshId = "rbxassetid://1563410216"
- SpecialMesh4.Offset = Vector3.new(0, 4, 0)
- SpecialMesh4.MeshType = Enum.MeshType.FileMesh
- Part5.Name = "Left Leg"
- Part5.Parent = Model0
- Part5.Material = Enum.Material.Glass
- Part5.BrickColor = BrickColor.new("Pastel blue-green")
- Part5.Rotation = Vector3.new(-180, 0, -90)
- Part5.Size = Vector3.new(4, 1, 2)
- Part5.CFrame = CFrame.new(-14.3299971, 0.500003994, 1.17999947, 0, 1, 0, 1, 0, 0, 0, 0, -1)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.Color = Color3.new(0.623529, 0.952941, 0.913726)
- Part5.Position = Vector3.new(-14.3299971, 0.500003994, 1.17999947)
- Part5.Orientation = Vector3.new(0, 180, 90)
- Part5.Color = Color3.new(0.623529, 0.952941, 0.913726)
- SpecialMesh6.Parent = Part5
- SpecialMesh6.MeshId = "rbxassetid://1563408982"
- SpecialMesh6.Offset = Vector3.new(0, 4, 0)
- SpecialMesh6.MeshType = Enum.MeshType.FileMesh
- Part7.Name = "Left Arm"
- Part7.Parent = Model0
- Part7.Material = Enum.Material.Glass
- Part7.BrickColor = BrickColor.new("Pastel blue-green")
- Part7.Rotation = Vector3.new(0, 0, -90)
- Part7.Size = Vector3.new(4, 1, 2)
- Part7.CFrame = CFrame.new(-12.2099981, 0.490003794, 2.1400013, 0, 1, 0, -1, 0, 0, 0, 0, 1)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.623529, 0.952941, 0.913726)
- Part7.Position = Vector3.new(-12.2099981, 0.490003794, 2.1400013)
- Part7.Orientation = Vector3.new(0, 0, -90)
- Part7.Color = Color3.new(0.623529, 0.952941, 0.913726)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "rbxassetid://1563407350"
- SpecialMesh8.Offset = Vector3.new(0, 4, 0)
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- Part9.Name = "Torso"
- Part9.Parent = Model0
- Part9.Material = Enum.Material.Glass
- Part9.BrickColor = BrickColor.new("Pastel blue-green")
- Part9.Rotation = Vector3.new(-180, 0, -90)
- Part9.Size = Vector3.new(4, 1, 2)
- Part9.CFrame = CFrame.new(-12.6299973, 0.500003994, 0.519999921, 0, 1, 0, 1, 0, 0, 0, 0, -1)
- Part9.BottomSurface = Enum.SurfaceType.Smooth
- Part9.TopSurface = Enum.SurfaceType.Smooth
- Part9.Color = Color3.new(0.623529, 0.952941, 0.913726)
- Part9.Position = Vector3.new(-12.6299973, 0.500003994, 0.519999921)
- Part9.Orientation = Vector3.new(0, 180, 90)
- Part9.Color = Color3.new(0.623529, 0.952941, 0.913726)
- SpecialMesh10.Parent = Part9
- SpecialMesh10.MeshId = "rbxassetid://1563386325"
- SpecialMesh10.MeshType = Enum.MeshType.FileMesh
- Part11.Name = "Head"
- Part11.Parent = Model0
- Part11.Material = Enum.Material.Glass
- Part11.BrickColor = BrickColor.new("Pastel blue-green")
- Part11.Rotation = Vector3.new(-180, 0, -90)
- Part11.Size = Vector3.new(4, 1, 2)
- Part11.CFrame = CFrame.new(-10.1799965, 0.500003994, 0.519999921, 0, 1, 0, 1, 0, 0, 0, 0, -1)
- Part11.BottomSurface = Enum.SurfaceType.Smooth
- Part11.TopSurface = Enum.SurfaceType.Smooth
- Part11.Color = Color3.new(0.623529, 0.952941, 0.913726)
- Part11.Position = Vector3.new(-10.1799965, 0.500003994, 0.519999921)
- Part11.Orientation = Vector3.new(0, 180, 90)
- Part11.Color = Color3.new(0.623529, 0.952941, 0.913726)
- SpecialMesh12.Parent = Part11
- SpecialMesh12.MeshId = "rbxassetid://1563390192"
- SpecialMesh12.MeshType = Enum.MeshType.FileMesh
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = AdvancingFortress
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- --end of costume
- AdvancingFortress.Parent = Character
- torso = AdvancingFortress.Torso
- hum = AdvancingFortress.Humanoid
- AdvancingFortress.Name = "Advancing Fortress"
- pl = AdvancingFortress
- for i, v in pairs(AdvancingFortress:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = 1
- end
- end
- local Humanoid = AdvancingFortress.Humanoid
- local Mouse = Player:GetMouse()
- local LeftArm = AdvancingFortress["Left Arm"]
- local RightArm = AdvancingFortress["Right Arm"]
- local LeftLeg = AdvancingFortress["Left Leg"]
- local RightLeg = AdvancingFortress["Right Leg"]
- local Head = AdvancingFortress.Head
- local Torso = AdvancingFortress.Torso
- local Camera = game.Workspace.CurrentCamera
- local RootPart = AdvancingFortress.HumanoidRootPart
- local RootJoint = RootPart.RootJoint
- local attack = false
- local Anim = "Idle"
- local attacktype = 1
- local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
- local velocity = RootPart.Velocity.y
- local sine = 0
- local change = 1
- local Create = LoadLibrary("RbxUtility").Create
- local TimeStop = false
- local m = Create("Model")({
- Parent = AdvancingFortress,
- Name = "WeaponModel"
- })
- --for _,v in pairs(KQ) do
- --v.Transparency=1
- --end
- KQ={
- }
- AdvancingFortress.Head.Name = "FHead"
- AdvancingFortress.Torso.Name = "FTorso"
- shirt = Instance.new("Shirt", Character)
- shirt.Name = "Shirt"
- pants = Instance.new("Pants", Character)
- pants.Name = "Pants"
- Character.Shirt.ShirtTemplate = "rbxassetid://609199174"
- Character.Pants.PantsTemplate = "rbxassetid://1079566963"
- for i, v in pairs(Character:GetChildren()) do
- if v.ClassName == "Accessory" then
- v:Remove()
- end
- end
- Hat3 = Instance.new("Model")
- Hat3.Parent = Character
- Hat3.Name = "Hat3"
- rh = Instance.new("Part")
- rh.Parent = Hat3
- rh.BrickColor = BrickColor.new("Cool yellow")
- rh.Locked = true
- rh.CanCollide = false
- mesh = Instance.new("SpecialMesh")
- rh.formFactor = "Symmetric"
- mesh.MeshType = "FileMesh"
- mesh.MeshId = "rbxassetid://495152230"
- mesh.Parent = rh
- local weld = Instance.new("Weld")
- weld.Parent = rh
- weld.Part0 = rh
- weld.Part1 =Character.Head
- weld.C0 = CFrame.new(0, 0.4, 0)*CFrame.Angles(0, 0, 0)
- mesh.Scale = Vector3.new(1,1,1)
- Hat3.Part.Transparency = 0
- for _,v in pairs(AdvancingFortress:GetChildren()) do
- if v:IsA('Part') then
- v.BrickColor=BrickColor.new('Pastel blue-green')
- end
- end
- for _,v in pairs(MEF:GetChildren()) do
- table.insert(KQ,v)
- v.CanCollide=false
- if v.Name=='Head' or v.Name=='Torso' then
- g=AdvancingFortress['F'..v.Name]
- else
- g=AdvancingFortress[v.Name]
- end
- v.Parent=AdvancingFortress
- v.Transparency=1
- weld=Instance.new('Weld',v)
- if v.Name=='Head' then
- weld.C0=CFrame.new(0,-1,0)*CFrame.Angles(0,-1.5,0)
- elseif v.Name=='Torso' then
- weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
- elseif v.Name=='Left Arm' then
- weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,1.5,0)
- elseif v.Name=='Left Leg' then
- weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
- elseif v.Name=='Right Arm' then
- weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
- elseif v.Name=='Right Leg' then
- weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0)
- end
- weld.Part0=v
- weld.Part1=g
- end-- apply costume
- AdvancingFortress.FTorso.BrickColor=BrickColor.new('Pastel blue-green')
- AdvancingFortress.HumanoidRootPart.Name = "FHumanoidRootPart"
- Humanoid.Animator.Parent = nil
- AdvancingFortress.Animate.Parent = nil
- base = Instance.new("ScreenGui",plr.PlayerGui)
- bbg = Instance.new("BillboardGui",plr.Character.Head)
- bbg.Size = UDim2.new(0,200,0,50)
- bbg.StudsOffset = Vector3.new(0,3,0)
- bbgTl = Instance.new("TextLabel",bbg)
- bbgTl.BackgroundTransparency = 1
- bbgTl.Size = UDim2.new(10,0,1,0)
- bbgTl.Position = UDim2.new(-4.5,0,0,0)
- bbgTl.Font = "Code"
- bbgTl.Text = " "
- bbgTl.TextSize = 25
- bbgTl.TextStrokeColor3 = Color3.new(1,1,1)
- bbgTl.TextColor3 = Color3.new(0,0,0)
- bbgTl.TextStrokeTransparency = 0
- bbgTl.TextWrapped = true
- function Chat(msg)
- if msg=='NANI' then
- CFuncs.Sound.Create(948494432, Torso, 1, 1)
- end
- ff=game.Chat:FilterStringAsync(msg,Player,Player)
- bbgTl.Text = ff
- wait(1)
- if bbgTl.Text == ff then
- bbgTl.Text = " "
- end
- end
- lknives=false
- -- Fired when client sends a request to write on the sign
- -- Called when button is clicked
- plr.Chatted:connect(function(msg)-- local messageObject = getTextObject(msg, Player.UserId)
- Chat(msg)
- end)
- local function newMotor(part0, part1, c0, c1)
- local w = Create("Weld")({
- Parent = part0,
- Part0 = part0,
- Part1 = part1,
- C0 = c0,
- C1 = c1
- })
- return w
- end
- function clerp(a, b, t)
- return a:lerp(b, t)
- end
- RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
- NeckCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
- local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
- local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
- local RH = newMotor(Torso, RightLeg, CFrame.new(0.5, -2, 0), CFrame.new(0, 0, 0))
- local LH = newMotor(Torso, LeftLeg, CFrame.new(-0.5, -2, 0), CFrame.new(0, 0, 0))
- RootJoint.C1 = CFrame.new(0, 0, 0)
- RootJoint.C0 = CFrame.new(0, 0, 0)
- Torso.Neck.C1 = CFrame.new(0, 0, 0)
- Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
- local rarmc1 = RW.C1
- local larmc1 = LW.C1
- local rlegc1 = RH.C1
- local llegc1 = LH.C1
- local resetc1 = false
- function PlayAnimationFromTable(table, speed, bool)
- RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
- Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
- RW.C0 = clerp(RW.C0, table[3], speed)
- LW.C0 = clerp(LW.C0, table[4], speed)
- RH.C0 = clerp(RH.C0, table[5], speed)
- LH.C0 = clerp(LH.C0, table[6], speed)
- if bool == true and resetc1 == false then
- resetc1 = true
- RootJoint.C1 = RootJoint.C1
- Torso.Neck.C1 = Torso.Neck.C1
- RW.C1 = rarmc1
- LW.C1 = larmc1
- RH.C1 = rlegc1
- LH.C1 = llegc1
- end
- end
- ArtificialHB = Create("BindableEvent", script)({Parent = script, Name = "Heartbeat"})
- script:WaitForChild("Heartbeat")
- frame = 0.03333333333333333
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.Heartbeat:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.Heartbeat:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- function RemoveOutlines(part)
- part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
- end
- CFuncs = {
- Part = {
- Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
- local Part = Create("Part")({
- Parent = Parent,
- Reflectance = Reflectance,
- Transparency = Transparency,
- CanCollide = false,
- Locked = true,
- BrickColor = BrickColor.new(tostring(BColor)),
- Name = Name,
- Size = Size,
- Material = Material
- })
- RemoveOutlines(Part)
- return Part
- end
- },
- Mesh = {
- Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
- local Msh = Create(Mesh)({
- Parent = Part,
- Offset = OffSet,
- Scale = Scale
- })
- if Mesh == "SpecialMesh" then
- Msh.MeshType = MeshType
- Msh.MeshId = MeshId
- end
- return Msh
- end
- },
- Weld = {
- Create = function(Parent, Part0, Part1, C0, C1)
- local Weld = Create("Weld")({
- Parent = Parent,
- Part0 = Part0,
- Part1 = Part1,
- C0 = C0,
- C1 = C1
- })
- return Weld
- end
- },
- Sound = {
- Create = function(id, par, vol, pit)
- local Sound = Create("Sound")({
- Volume = vol,
- Pitch = pit or 1,
- SoundId = "rbxassetid://" .. id,
- Parent = par or workspace
- })
- Sound:play()
- game:GetService("Debris"):AddItem(Sound, 130)
- return Sound
- end
- },
- Decal = {
- Create = function(Color, Texture, Transparency, Name, Parent)
- local Decal = Create("Decal")({
- Color3 = Color,
- Texture = "rbxassetid://" .. Texture,
- Transparency = Transparency,
- Name = Name,
- Parent = Parent
- })
- return Decal
- end
- },
- BillboardGui = {
- Create = function(Parent, Image, Position, Size)
- local BillPar = CFuncs.Part.Create(Parent, "SmoothPlastic", 0, 1, BrickColor.new("Black"), "BillboardGuiPart", Vector3.new(1, 1, 1))
- BillPar.CFrame = CFrame.new(Position)
- local Bill = Create("BillboardGui")({
- Parent = BillPar,
- Adornee = BillPar,
- Size = UDim2.new(1, 0, 1, 0),
- SizeOffset = Vector2.new(Size, Size)
- })
- local d = Create("ImageLabel", Bill)({
- Parent = Bill,
- BackgroundTransparency = 1,
- Size = UDim2.new(1, 0, 1, 0),
- Image = "rbxassetid://" .. Image
- })
- return BillPar
- end
- },
- ParticleEmitter = {
- Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
- local Particle = Create("ParticleEmitter")({
- Parent = Parent,
- Color = ColorSequence.new(Color1, Color2),
- LightEmission = LightEmission,
- Size = Size,
- Texture = Texture,
- Transparency = Transparency,
- ZOffset = ZOffset,
- Acceleration = Accel,
- Drag = Drag,
- LockedToPart = LockedToPart,
- VelocityInheritance = VelocityInheritance,
- EmissionDirection = EmissionDirection,
- Enabled = Enabled,
- Lifetime = LifeTime,
- Rate = Rate,
- Rotation = Rotation,
- RotSpeed = RotSpeed,
- Speed = Speed,
- VelocitySpread = VelocitySpread
- })
- return Particle
- end
- },
- CreateTemplate = {}
- }
- function rayCast(Position, Direction, Range, Ignore)
- return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
- end
- function FindNearestTorso(pos)
- local list = game.Workspace:children()
- local torso
- local dist = 1000
- local temp, human, temp2
- for x = 1, #list do
- temp2 = list[x]
- if temp2.className == "Model" and temp2.Name ~= Character.Name then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if temp ~= nil and human ~= nil and human.Health > 0 and dist > (temp.Position - pos).magnitude then
- local dohit = true
- if dohit == true then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso, dist
- end
- function Damage(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
- if hit.Parent == nil then
- return
- end
- local h = hit.Parent:FindFirstChild("Humanoid")
- for _, v in pairs(hit.Parent:children()) do
- c=hit.Parent:findFirstChild('HumanoidRootPart')
- if v:IsA("Humanoid") then
- h = v
- if c~=nil then
- end
- end
- end
- if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
- if hit.Parent:findFirstChild("DebounceHit") ~= nil and hit.Parent.DebounceHit.Value == true then
- return
- end
- local c = Create("ObjectValue")({
- Name = "creator",
- Value = game:service("Players").LocalPlayer,
- Parent = h
- })
- game:GetService("Debris"):AddItem(c, 0.5)
- CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
- local Damage = math.random(minim, maxim)
- local blocked = false
- local block = hit.Parent:findFirstChild("Block")
- if block ~= nil and block.className == "IntValue" and block.Value > 0 then
- blocked = true
- block.Value = block.Value - 1
- print(block.Value)
- end
- if TimeStop == false then
- h.Health = h.Health - Damage
- 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)
- elseif TimeStop == true then
- repeat
- wait()
- until TimeStop == false
- h.Health = h.Health - Damage / 2
- 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)
- end
- if Type == "Knockdown" then
- local hum = hit.Parent.Humanoid
- hum.PlatformStand = true
- coroutine.resume(coroutine.create(function(HHumanoid)
- swait(1)
- HHumanoid.PlatformStand = false
- end), hum)
- local angle = hit.Position - (Property.Position + Vector3.new(0, 0, 0)).unit
- local bodvol = Create("BodyVelocity")({
- velocity = angle * knockback,
- P = 5000,
- maxForce = Vector3.new(8000, 8000, 8000),
- Parent = hit
- })
- local rl = Create("BodyAngularVelocity")({
- P = 3000,
- maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
- angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
- Parent = hit
- })
- game:GetService("Debris"):AddItem(bodvol, 0.5)
- game:GetService("Debris"):AddItem(rl, 0.5)
- elseif Type == "Normal" then
- local vp = Create("BodyVelocity")({
- P = 500,
- maxForce = Vector3.new(math.huge, 0, math.huge),
- velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05
- })
- if knockback > 0 then
- vp.Parent = hit.Parent.Torso
- end
- game:GetService("Debris"):AddItem(vp, 0.5)
- elseif Type == "Up" then
- local bodyVelocity = Create("BodyVelocity")({
- velocity = Vector3.new(0, 20, 0),
- P = 5000,
- maxForce = Vector3.new(8000, 8000, 8000),
- Parent = hit
- })
- game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
- elseif Type == "DarkUp" then
- coroutine.resume(coroutine.create(function()
- for i = 0, 1, 0.1 do
- swait()
- Effects.Block.Create(BrickColor.new("Black"), hit.Parent.Torso.CFrame, 5, 5, 5, 1, 1, 1, 0.08, 1)
- end
- end))
- local bodyVelocity = Create("BodyVelocity")({
- velocity = Vector3.new(0, 20, 0),
- P = 5000,
- maxForce = Vector3.new(8000, 8000, 8000),
- Parent = hit
- })
- game:GetService("Debris"):AddItem(bodyVelocity, 1)
- elseif Type == "Snare" then
- local bp = Create("BodyPosition")({
- P = 2000,
- D = 100,
- maxForce = Vector3.new(math.huge, math.huge, math.huge),
- position = hit.Parent.Torso.Position,
- Parent = hit.Parent.Torso
- })
- game:GetService("Debris"):AddItem(bp, 1)
- elseif Type == "Freeze" then
- local BodPos = Create("BodyPosition")({
- P = 50000,
- D = 1000,
- maxForce = Vector3.new(math.huge, math.huge, math.huge),
- position = hit.Parent.Torso.Position,
- Parent = hit.Parent.Torso
- })
- local BodGy = Create("BodyGyro")({
- maxTorque = Vector3.new(400000, 400000, 400000) * math.huge,
- P = 20000,
- Parent = hit.Parent.Torso,
- cframe = hit.Parent.Torso.CFrame
- })
- hit.Parent.Torso.Anchored = true
- coroutine.resume(coroutine.create(function(Part)
- swait(1.5)
- Part.Anchored = false
- end), hit.Parent.Torso)
- game:GetService("Debris"):AddItem(BodPos, 3)
- game:GetService("Debris"):AddItem(BodGy, 3)
- end
- local debounce = Create("BoolValue")({
- Name = "DebounceHit",
- Parent = hit.Parent,
- Value = true
- })
- game:GetService("Debris"):AddItem(debounce, Delay)
- c = Create("ObjectValue")({
- Name = "creator",
- Value = Player,
- Parent = h
- })
- game:GetService("Debris"):AddItem(c, 0.5)
- end
- end
- function ShowDamage(Pos, Text, Time, Color)
- local Rate = 0.03333333333333333
- local Pos = Pos or Vector3.new(0, 0, 0)
- local Text = Text or ""
- local Time = Time or 2
- local Color = Color or Color3.new(1, 0, 1)
- local EffectPart = CFuncs.Part.Create(workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0))
- EffectPart.Anchored = true
- local BillboardGui = Create("BillboardGui")({
- Size = UDim2.new(3, 0, 3, 0),
- Adornee = EffectPart,
- Parent = EffectPart
- })
- local TextLabel = Create("TextLabel")({
- BackgroundTransparency = 1,
- Size = UDim2.new(1, 0, 1, 0),
- Text = Text,
- Font = "SciFi",
- TextColor3 = Color,
- TextScaled = true,
- Parent = BillboardGui
- })
- game.Debris:AddItem(EffectPart, Time)
- EffectPart.Parent = game:GetService("Workspace")
- delay(0, function()
- local Frames = Time / Rate
- for Frame = 1, Frames do
- wait(Rate)
- local Percent = Frame / Frames
- EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
- TextLabel.TextTransparency = Percent
- end
- if EffectPart and EffectPart.Parent then
- EffectPart:Destroy()
- end
- end)
- end
- local STDamage = false
- function MagnitudeDamage(Part, Magnitude, MinimumDamage, MaximumDamage, KnockBack, Type, HitSound, HitPitch)
- for _, c in pairs(workspace:children()) do
- local hum = c:findFirstChild("Humanoid")
- if hum ~= nil then
- local head = c:findFirstChild("Torso")
- if head ~= nil then
- local targ = head.Position - Part.Position
- local mag = targ.magnitude
- if Magnitude >= mag and c.Name ~= Player.Name then
- Damage(head, head, MinimumDamage, MaximumDamage, KnockBack, Type, RootPart, 0.1, HitSound, HitPitch)
- if STDamage == true then
- for i = 1, 3 do
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 1, 1, 1, 4, 4, 4, 0.07, 1)
- end
- for i = 1, 10 do
- CamShake(1, 70000)
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 1, 1, 1)
- end
- elseif STDamage == false then
- CamShake(1, 90000)
- 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)
- for i = 1, 2 do
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 0.4, 0.4, 0.4)
- end
- end
- end
- end
- end
- end
- end
- --[[
- HHandle = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HHandle", Vector3.new(1.09999979, 0.299999923, 1.0999999))
- 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))
- Eye1 = CFuncs.Part.Create(m, Enum.Material.Neon, 0, 1, "White", "Eye1", Vector3.new(0.400000006, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Eye1, Enum.MeshType.Sphere, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Eye2 = CFuncs.Part.Create(m, Enum.Material.Neon, 0, 1, "White", "Eye2", Vector3.new(0.400000006, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Eye2, Enum.MeshType.Sphere, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- THandle = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Medium stone grey", "THandle", Vector3.new(1, 0.799999893, 1))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.80000019, 0.300000012, 1.80000007))
- 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))
- CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 1.10000002, 0.300000012))
- 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))
- CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- --]]
- AHandleR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "AHandleR", Vector3.new(0.799999952, 0.800000012, 1.22000003))
- 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))
- --[[
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.899999976, 1.01999998))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.20000005, 0.800000012, 1.20000005))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999988, 1.01999998))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.699999988, 1.01999998))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999928, 0.520000041))
- 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))
- --]]
- HitboxR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HitboxR", Vector3.new(0.799999952, 0.800000012, 1.22000003))
- 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))
- AHandleL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "AHandleL", Vector3.new(0.800000072, 0.800000012, 1.22000003))
- 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))
- HitboxL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HitboxL", Vector3.new(0.800000072, 0.800000012, 1.22000003))
- 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))
- --[[
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999928, 0.520000041))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.20000005, 0.800000012, 1.20000005))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.899999976, 1.01999998))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999988, 1.01999998))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.699999988, 1.01999998))
- 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))
- LHandleR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "LHandleR", Vector3.new(1.02999997, 1.00999999, 1.19000006))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000012, 0.800000012, 0.200000003))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 1.00999999, 1.19000006))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 0.699999928, 1.19000006))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.400000006, 1.20000005, 0.200000003))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000131, 1.20000005, 0.800000012))
- 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))
- CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- LHandleL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "LHandleL", Vector3.new(1.02999997, 1.00999999, 1.19000006))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 1.00999999, 1.19000006))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.400000006, 1.20000005, 0.300000012))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 0.699999928, 1.19000006))
- 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))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000131, 1.20000005, 0.800000012))
- 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))
- CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000012, 0.800000012, 0.300000012))
- 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))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003))
- 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))
- CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
- --]]
- Shield = CFuncs.Part.Create(m, "Neon", 0, 0.5, "Pastle brown", "Part", Vector3.new(9.1, 8.5, 0.2))
- CFuncs.Mesh.Create("SpecialMesh", Shield, "FileMesh", "rbxassetid://708292865", Vector3.new(0, 0, 0), Vector3.new(0.04, 0.04, 0.04))
- Shield.Parent = nil
- EffectModel = Create("Model")({Parent = Character, Name = "Effects"})
- Effects = {
- Block = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- if Type == 1 or Type == nil then
- table.insert(Effects, {
- prt,
- "Block1",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- elseif Type == 2 then
- table.insert(Effects, {
- prt,
- "Block2",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- end
- end
- },
- Cylinder = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = CFuncs.Part .. Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.2, 0.2, 0.2))
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 2)
- Effects[#Effects + 1] = {
- prt,
- "Cylinder",
- delay,
- x3,
- y3,
- z3
- }
- end
- },
- Head = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Head", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Cylinder",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- end
- },
- Sphere = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Cylinder",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- end
- },
- Sphere2 = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Cylinder",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- end
- },
- Elec = {
- Create = function(cff, x, y, z)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, BrickColor.new("Pastel blue-green"), "Part", Vector3.new(1, 1, 1))
- prt.Anchored = true
- prt.CFrame = cff * CFrame.new(math.random(-x, x), math.random(-y, y), math.random(-z, z))
- prt.CFrame = CFrame.new(prt.Position)
- game:GetService("Debris"):AddItem(prt, 2)
- local xval = math.random() / 2
- local yval = math.random() / 2
- local zval = math.random() / 2
- local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(xval, yval, zval))
- table.insert(Effects, {
- prt,
- "Elec",
- 0.1,
- x,
- y,
- z,
- xval,
- yval,
- zval
- })
- end
- },
- Ring = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Cylinder",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- end
- },
- Wave = {
- Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Cylinder",
- delay,
- x3,
- y3,
- z3,
- msh
- })
- end
- },
- Break = {
- Create = function(brickcolor, cframe, x1, y1, z1)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
- prt.Anchored = true
- prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
- local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- local num = math.random(10, 50) / 1000
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Shatter",
- num,
- prt.CFrame,
- math.random() - math.random(),
- 0,
- math.random(50, 100) / 100
- })
- end
- },
- Fire = {
- Create = function(brickcolor, cframe, x1, y1, z1, delay)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "Fire",
- delay,
- 1,
- 1,
- 1,
- msh
- })
- end
- },
- FireWave = {
- Create = function(brickcolor, cframe, x1, y1, z1)
- local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 1, brickcolor, "Effect", Vector3.new())
- prt.Anchored = true
- prt.CFrame = cframe
- msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
- local d = Create("Decal")({
- Parent = prt,
- Texture = "rbxassetid://26356434",
- Face = "Top"
- })
- local d = Create("Decal")({
- Parent = prt,
- Texture = "rbxassetid://26356434",
- Face = "Bottom"
- })
- game:GetService("Debris"):AddItem(prt, 10)
- table.insert(Effects, {
- prt,
- "FireWave",
- 1,
- 30,
- math.random(400, 600) / 100,
- msh
- })
- end
- },
- Lightning = {
- Create = function(p0, p1, tym, ofs, col, th, tra, last)
- local magz = (p0 - p1).magnitude
- local curpos = p0
- local trz = {
- -ofs,
- ofs
- }
- for i = 1, tym do
- local li = CFuncs.Part.Create(EffectModel, "Neon", 0, tra or 0.4, col, "Ref", Vector3.new(th, th, magz / tym))
- local ofz = Vector3.new(trz[math.random(1, 2)], trz[math.random(1, 2)], trz[math.random(1, 2)])
- local trolpos = CFrame.new(curpos, p1) * CFrame.new(0, 0, magz / tym).p + ofz
- li.Material = "Neon"
- if tym == i then
- local magz2 = (curpos - p1).magnitude
- li.Size = Vector3.new(th, th, magz2)
- li.CFrame = CFrame.new(curpos, p1) * CFrame.new(0, 0, -magz2 / 2)
- table.insert(Effects, {
- li,
- "Disappear",
- last
- })
- else
- li.CFrame = CFrame.new(curpos, trolpos) * CFrame.new(0, 0, magz / tym / 2)
- curpos = li.CFrame * CFrame.new(0, 0, magz / tym / 2).p
- game.Debris:AddItem(li, 10)
- table.insert(Effects, {
- li,
- "Disappear",
- last
- })
- end
- end
- end
- },
- EffectTemplate = {}
- }
- local Invisible = true
- function Reappear()
- for _, i in pairs(AdvancingFortress:children()) do
- if i:IsA("BasePart") then
- coroutine.resume(coroutine.create(function(Part)
- for i = 0, 1, 0.3 do
- swait()
- Part.Transparency = -i
- end
- Part.Transparency = 0
- end), i)
- end
- end
- for _, i in pairs(m:children()) do
- if i:IsA("BasePart") then
- coroutine.resume(coroutine.create(function(Part)
- for i = 0, 1, 0.3 do
- swait()
- Part.Transparency = i
- end
- Part.Transparency = 0
- end), i)
- end
- end
- end
- function ReappearArmorOnly()
- for _, i in pairs(m:children()) do
- if i:IsA("BasePart") then
- coroutine.resume(coroutine.create(function(Part)
- for i = 0, 1, 0.3 do
- swait()
- Part.Transparency = i
- end
- Part.Transparency = 0
- for _,v in pairs(KQ) do
- St=v.Weld.Part1.Name
- if St=='FHead' then
- St='Head'
- end
- v.Weld.Part1=Character[St]
- end
- end), i)
- end
- end
- end
- function Disappear()
- for _, i in pairs(AdvancingFortress:children()) do
- if i:IsA("BasePart") then
- coroutine.resume(coroutine.create(function(Part)
- for i = 0, 1, 0.3 do
- swait()
- Part.Transparency = i
- end
- Part.Transparency = 1
- end), i)
- end
- end
- for _, i in pairs(m:children()) do
- if i:IsA("BasePart") then
- coroutine.resume(coroutine.create(function(Part)
- for i = 0, 1, 0.3 do
- swait()
- Part.Transparency = i
- end
- Part.Transparency = 1
- end), i)
- end
- end
- end
- function DisappearArmorOnly()
- for _, i in pairs(m:children()) do
- if i:IsA("BasePart") then
- coroutine.resume(coroutine.create(function(Part)
- for i = 0, 1, 0.3 do
- swait()
- Part.Transparency = i
- end
- Part.Transparency = 1
- for _,v in pairs(KQ) do
- St=v.Weld.Part1.Name
- if St=='Head' then
- St='FHead'
- end
- v.Weld.Part1=AdvancingFortress[St]
- end
- end), i)
- end
- end
- end
- function CamShake(time, freq)
- coroutine.resume(coroutine.create(function()
- local cam = game:GetService("Workspace").CurrentCamera
- local time = 10
- local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
- if math.random(1, 2) == 1 then
- seed = Vector3.new(-seed.x, seed.y, 0)
- end
- if math.random(1, 2) == 1 then
- seed = Vector3.new(seed.x, -seed.y, 0)
- end
- 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)
- for i = 1, time do
- 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)
- wait()
- end
- end))
- end
- local ora = false
- function ORA()
- attack = true
- local S = CFuncs.Sound.Create("", Torso, 3, 1)
- S.Looped = true
- if ora == true then
- while ora == true do
- CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
- MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1)
- for i = 0, 1, 0.8 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- CFuncs.Sound.Create("200632136", HitboxR, 0.3, math.random(1, 1.2))
- MagnitudeDamage(HitboxR, 5, 4, 10, 0, "Normal", "260430117", 1)
- for i = 0, 1, 0.8 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
- MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1)
- for i = 0, 1, 0.8 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- CFuncs.Sound.Create("200632136", HitboxR, 0.3, math.random(1, 1.2))
- MagnitudeDamage(HitboxR, 5, 4, 10, 0, "Normal", "260430117", 1)
- for i = 0, 1, 0.8 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
- MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1)
- end
- end
- S:Stop()
- local S2 = CFuncs.Sound.Create("", Torso, 1.5, 1)
- for i = 0, 1, 0.13 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -3), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.2, false)
- end
- CFuncs.Sound.Create("471881954", HitboxR, 1, 1)
- MagnitudeDamage(HitboxR, 7, 10, 15, 50, "Normal", "610359590", 1)
- for i = 0, 1, 0.1 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.6, false)
- end
- attack = false
- end
- function CastleCrusherFist()
- attack = true
- STDamage = true
- local S2 = CFuncs.Sound.Create("", Torso, 1, 1)
- for i = 0, 1, 0.1 do
- swait()
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.2)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.2, false)
- end
- MagnitudeDamage(HitboxR, 10, 50, 80, 100, "Normal", "610359515", 1)
- 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)
- CFuncs.Sound.Create("471881980", HitboxR, 1, 0.9)
- CFuncs.Sound.Create("471881954", HitboxR, 1, 0.8)
- for i = 0, 1, 0.08 do
- swait()
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.6, false)
- end
- STDamage = false
- attack = false
- end
- function CastleCrusherFist()
- attack = true
- STDamage = true
- local S2 = CFuncs.Sound.Create("", Torso, 1, 1)
- for i = 0, 1, 0.1 do
- swait()
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.2, false)
- end
- 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)
- Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 140
- CFuncs.Sound.Create("471881980", HitboxR, 1, 0.9)
- CFuncs.Sound.Create("471881954", HitboxR, 1, 0.8)
- for i = 0, 1, 0.08 do
- swait()
- MagnitudeDamage(HitboxR, 5, 50, 80, 100, "Normal", "610359515", 1)
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1)
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5)
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 1)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.6, false)
- end
- STDamage = false
- attack = false
- end
- distance2__=0
- AdvancingFortress.FHead.face:remove()
- function Lattack()
- attack = true
- local S = CFuncs.Sound.Create("", Torso, 3, 1)
- S.Looped = true
- if Long then
- while Long and distance2__>-15 do-- max range
- distance2__=distance2__-1
- for i = 0, 1, 0.8 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, distance2__), 0.5)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- end
- for i = 0, 1, 0.8 do
- swait()
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2))
- MagnitudeDamage(HitboxL, 5, 4, 50, 0, "Normal", "260430117", 1)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.8, false)
- end
- wait(1)
- distance2__=0
- STDamage = false
- attack = false
- end
- function weld5(part0, part1, c0, c1)
- local weeld = Instance.new("Weld", part0)
- weeld.Part0 = part0
- weeld.Part1 = part1
- weeld.C0 = c0
- weeld.C1 = c1
- return weeld
- end
- local Grab = false
- function GRABEMBOIGRABEM()
- attack = true
- gp = nil
- con1 = HitboxR.Touched:connect(function(hit)
- local ht = hit.Parent
- local hum1 = ht:FindFirstChild("Humanoid")
- if Grab == false then
- if hum1 ~= nil and hit.Parent ~= Character then
- hum1.PlatformStand = true
- gp = ht
- Grab = true
- local asd = weld5(RightArm, ht:FindFirstChild("Torso"), CFrame.new(0, -1.5, 0), CFrame.new(0, 0, 0))
- asd.Parent = RightArm
- asd.Name = "asd"
- asd.C0 = asd.C0 * CFrame.Angles(math.rad(-90), 0, 0)
- CFuncs.Sound.Create("200632821", Torso, 1, 1)
- elseif hum1 == nil then
- con1:disconnect()
- wait()
- return
- end
- end
- end)
- for i = 0, 1, 0.2 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- for i = 0, 1, 0.1 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -6), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- if Grab == true then
- for i = 1, 5 do
- for i = 0, 1, 0.35 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 13, -6), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.4, false)
- end
- for i = 0, 1, 0.3 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -6), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.7, false)
- end
- local hit, pos = rayCast(HitboxR.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 100, Character)
- if hit ~= nil then
- MagnitudeDamage(HitboxR, 5, 10, 30, 0, "Normal", "610359515", 1.3)
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 1, 1, 1, 0.7, 0.7, 0.7, 0.09, 1)
- Effects.Wave.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 1, 1, 1, 0.7, 0.7, 0.7, 0.09)
- Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 3, 3, 3, 5, 5, 5, 0.09)
- end
- end
- end
- for i, v in pairs(RightArm:GetChildren()) do
- if v.Name == "asd" and v:IsA("Weld") then
- v:Remove()
- end
- end
- Grab = false
- con1:disconnect()
- attack = false
- end
- local IsWearingArmor = false
- function Armor(Mode)
- attack = true
- if IsWearingArmor == false and Mode == "On" then
- IsWearingArmor = true
- Disappear()
- swait(10)
- ReappearArmorOnly()
- Character.Humanoid.MaxHealth = 500
- Character.Humanoid.Health = 500
- AHandleRWeld.Part0 = Character["Right Arm"]
- AHandleLWeld.Part0 = Character["Left Arm"]
- for i, v in pairs(AdvancingFortress:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = 1
- end
- end
- for i, v in pairs(Character:GetChildren()) do
- if v:IsA("Accessory") then
- v.Handle.Transparency = 1
- end
- end
- elseif IsWearingArmor == true and Mode == "Off" then
- IsWearingArmor = false
- DisappearArmorOnly()
- for i, v in pairs(Character:GetChildren()) do
- if v:IsA("Accessory") then
- v.Handle.Transparency = 0
- end
- end
- swait(10)
- Reappear()
- Character.Humanoid.MaxHealth = 100
- Character.Humanoid.Health = 100
- AHandleRWeld.Part0 = RightArm
- AHandleLWeld.Part0 = LeftArm
- for i, v in pairs(AdvancingFortress:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = 0
- end
- end
- end
- attack = false
- end
- local ShieldMode = false
- local ShieldCharge = false
- function HoloHexShield()
- attack = true
- Shield.Parent = m
- Shield.CanCollide = true
- if ShieldMode == true then
- while ShieldMode == true do
- swait()
- Effects.Elec.Create(Shield.CFrame, 6, 6, 6)
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- end
- Shield.CanCollide = false
- CFuncs.Sound.Create("200632211", HitboxR, 1, 0.8)
- CFuncs.Sound.Create("200632875", HitboxR, 1, 0.9)
- Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 160
- 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)
- for i = 0, 1, 0.05 do
- swait()
- MagnitudeDamage(Shield, 5, 10, 15, 20, "Normal", "610359515", 1.3)
- Effects.Elec.Create(Shield.CFrame, 6, 6, 6)
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -3), 1)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.5, false)
- end
- Shield.Parent = nil
- attack = false
- end
- Mouse.Button1Down:connect(function()
- if attack == false and attacktype == 1 then
- attacktype = 2
- attackone()
- elseif attack == false and attacktype == 2 then
- attacktype = 1
- attacktwo()
- end
- end)
- game.Lighting.Outlines = false
- function attackone()
- attack = true
- for i = 0, 1, 0.12 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- MagnitudeDamage(HitboxR, 7, 10, 15, math.random(1, 3), "Normal", "260430079", 1)
- CFuncs.Sound.Create("200632136", HitboxR, 1, 1)
- RootPart.Velocity = RootPart.CFrame.lookVector * 40
- for i = 0, 1, 0.11 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.45, false)
- end
- attack = false
- end
- function attacktwo()
- attack = true
- for i = 0, 1, 0.12 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.34, false)
- end
- MagnitudeDamage(HitboxL, 7, 10, 15, math.random(1, 3), "Normal", "260430079", 1.1)
- CFuncs.Sound.Create("200632136", HitboxL, 1, 1)
- RootPart.Velocity = RootPart.CFrame.lookVector * 40
- for i = 0, 1, 0.12 do
- swait()
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.45, false)
- end
- attack = false
- end
- function findNearestTorso(pos)
- local list = game.Workspace:children()
- local torso
- local dist = 1000
- local temp, human, temp2
- for x = 1, #list do
- temp2 = list[x]
- if temp2.className == "Model" and temp2.Name ~= Character.Name then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if temp ~= nil and human ~= nil and human.Health > 0 and dist > (temp.Position - pos).magnitude then
- local dohit = true
- if dohit == true then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso, dist
- end
- function TrueAim(aim)
- local target, distance = findNearestTorso(Mouse.Hit.p)
- local tehcf = HitboxR.CFrame * CFrame.fromEulerAnglesXYZ(1.57, 0, 0).lookVector
- if aim ~= nil then
- tehcf = aim
- end
- table.insert(Effects, {
- tehcf,
- "Shoot",
- 30,
- HitboxR.Position,
- 10,
- 15,
- 0,
- 3,
- HitboxR,
- target
- })
- end
- function FireProjectiles()
- attack = true
- Humanoid.WalkSpeed = 20
- CFuncs.Sound.Create("300915902", HitboxR, 1, 0.8)
- for i = 0, 1, 0.1 do
- swait()
- Effects.Elec.Create(HitboxR.CFrame, 2, 2, 2)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- for i = 0, 1, 0.1 do
- swait()
- Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3)
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
- Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.2, false)
- end
- for i = 1, 10 do
- for i = 0, 1, 0.3 do
- swait()
- Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3)
- Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- CFuncs.Sound.Create("300916105", HitboxR, 1, 1.2)
- CFuncs.Sound.Create("300916014", HitboxR, 1, 1)
- Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 2, 2, 2, 0.07)
- local MouseLook = CFrame.new((HitboxR.Position + Mouse.Hit.p) / 2, Mouse.Hit.p)
- TrueAim(MouseLook.lookVector)
- for i = 0, 1, 0.3 do
- swait()
- Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3)
- Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1)
- PlayAnimationFromTable({
- 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),
- 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),
- 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),
- 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),
- 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),
- 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)
- }, 0.3, false)
- end
- end
- Humanoid.WalkSpeed = 20
- attack = false
- end
- SHRA=false
- Check=false
- dimension=workspace
- Mouse.KeyUp:connect(function(k)
- if k=='e' then
- Long=false
- end
- end)
- reload2=false
- hand=true -- collect hands
- Mouse.KeyDown:connect(function(k)
- k = k:lower()
- if k=='r' and dimension==workspace then
- Meg=Instance.new('Part')
- Meg.Parent=Character
- Meg.CFrame=Mouse.Hit
- Meg.Transparency=1
- Meg.CanCollide=false
- Meg.Touched:connect(function(h)
- if h.Parent~=Character or h.Parent~=workspace or h.Parent~=AdvancingFortress then
- if h.Parent:findFirstChild('Torso')~=nil and h.Parent:findFirstChild('Humanoid')~=nil then
- enem=h.Parent
- end
- end
- end)
- wait(.1)
- if enem~=nil then
- eclone(enem.Torso)
- end
- elseif k=='t' then
- if dimension==workspace then
- dimension=workspace.CurrentCamera
- workspace.CurrentCamera.FieldOfView=180
- elseif dimension==workspace.CurrentCamera then
- dimension=workspace
- workspace.CurrentCamera.FieldOfView=70
- end
- Character.Parent=dimension
- elseif k=='y' then
- if YOURCLONE~=nil then
- Sav=YOURCLONE.Torso.CFrame
- Sav2=YOURCLONE.Humanoid.Health
- YOURCLONE.Torso.CFrame=Character.Torso.CFrame
- Character.Torso.CFrame=Sav
- YOURCLONE.Humanoid.Health=Character.Humanoid.Health
- Character.Humanoid.Health=Sav2
- end
- if YOURCLONE== nil then
- yclone()
- end
- end
- if dimension==workspace then
- if k=='f' and IsWearingArmor == false and Invisible == false and reload2==false then
- reload2=true
- M=Instance.new('Part',Character)
- M.Shape='Ball'
- M.Material='Glass'
- M.BrickColor=BrickColor.new('Gold')
- M.Transparency=.5
- M.Position=Character.Torso.Position
- M.Size=Vector3.new(10,10,10)
- M.CanCollide=false
- M.Touched:connect(function(h)
- if h.Parent~=Character or h.Parent~=workspace or h.Parent~=AdvancingFortress or h.Parent~=MEF then
- if h:IsA('Part') and h.Anchored==false then
- h.Velocity=Vector3.new(math.random(-70,70),math.random(40,50),math.random(-70,70))
- end
- end
- end)
- W=Instance.new('Weld',Character)
- W.Part0=M
- W.Part1=Character.Torso
- wait(10)
- M:remove()
- wait(10)
- reload2=false
- end
- if k=='e' and IsWearingArmor == false and Invisible == false then
- Long=true
- Lattack()
- end
- if attack == false and ora == false and k == "z" and IsWearingArmor == false and Invisible == false then
- ora = true
- ORA()
- elseif attack == false and k == "x" and IsWearingArmor == false and Invisible == false then
- GRABEMBOIGRABEM()
- elseif attack == false and k=='g' then
- -- FireProjectiles()--thats lame
- if changeidle==1 then
- changeidle=2
- else changeidle=1
- end
- end
- end
- if attack == false and k == "q" and Invisible == false and IsWearingArmor == false then
- Invisible = true
- Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1)
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1, 1)
- Disappear()
- elseif attack == false and k == "q" and Invisible == true and IsWearingArmor == false then
- Invisible = false
- Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.08)
- for i = 1, 2 do
- Effects.Block.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1, 1)
- end
- for i = 1, 20 do
- Effects.Break.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1)
- end
- Reappear()
- G=Instance.new('Sound',AdvancingFortress.FTorso)
- G.Name='FLEF'
- G.SoundId='rbxassetid://1275713993'
- G.Volume=3
- G:Play()
- elseif attack == false and ShieldMode == false and k == "c" and IsWearingArmor == false and Invisible == false and dimension==workspace then
- ShieldMode = true
- HoloHexShield()
- elseif attack == false and k == "v" and IsWearingArmor == false and Invisible == false and dimension==workspace then
- CastleCrusherFist()
- end
- --[[if k == "[" and IsWearingArmor == false and Invisible == false then
- Armor("On")
- end
- if k == "]" and IsWearingArmor == true and Invisible == false then
- Armor("Off")
- end--]]
- end)
- Mouse.KeyUp:connect(function(k)
- k = k:lower()
- if attack == true and ora == true and k == "z" and IsWearingArmor == false then
- ora = false
- elseif attack == true and ShieldMode == true and k == "c" and IsWearingArmor == false then
- ShieldMode = false
- end
- end)
- -- coroutine.resume(coroutine.create(function(Part, Part2)
- -- while Part.Parent ~= nil do
- -- swait(math.random(100, 150))
- -- for i = 0, 1, 0.2 do
- -- wait()
- -- Eye1.Mesh.Scale = Vector3.new(1, 0.7 - 1 * i, 1)
- -- Eye2.Mesh.Scale = Vector3.new(1, 0.7 - 1 * i, 1)
- -- end
- -- for i = 0, 1, 0.2 do
- -- swait()
- -- Eye1.Mesh.Scale = Vector3.new(1, 0.7 + 0.3 * i, 1)
- -- Eye2.Mesh.Scale = Vector3.new(1, 0.7 + 0.3 * i, 1)
- -- end
- -- end
- -- end), Eye1, Eye2)
- tfk=CFuncs.Sound.Create(1325068271, Character.Torso, 1.5, 1)
- tfk.Name='THEME'
- tfk.Looped=true
- changeidle=1
- YOURCLONE=nil
- candecide=true
- Humanoid=Character.Humanoid
- while true do
- for _,v in pairs(AdvancingFortress.FTorso:GetChildren()) do
- end
- swait()
- for i, v in pairs(Character:children()) do
- if v:IsA("Part") and IsWearingArmor == true then
- v.Anchored = false
- end
- end
- for i, v in pairs(AdvancingFortress:GetChildren()) do
- if v:IsA("Part") then
- v.Material = "SmoothPlastic"
- v.CanCollide = false
- elseif v:IsA("Humanoid") then
- v:remove()
- elseif v:IsA("Accessory") then
- v:remove()
- elseif v:IsA("Shirt") then
- v:remove()
- elseif v:IsA("Pants") then
- v:remove()
- elseif v:IsA("Script") or v:IsA("LocalScript") then
- v:remove()
- elseif v:IsA("BodyColors") then
- v:remove()
- end
- end
- AHandleR.Transparency = 1
- AHandleL.Transparency = 1
- RootPart.Transparency = 1
- HitboxR.Transparency = 1
- HitboxL.Transparency = 1
- Head.BrickColor = BrickColor.new("Pastel blue-green")
- Torso.BrickColor = BrickColor.new("Pastel blue-green")
- RightArm.BrickColor = BrickColor.new("Pastel blue-green")
- LeftArm.BrickColor = BrickColor.new("Pastel blue-green")
- RightLeg.BrickColor = BrickColor.new("Pastel blue-green")
- LeftLeg.BrickColor = BrickColor.new("Pastel blue-green")
- RootPart.Anchored = true
- Torsovelocity = (Character.HumanoidRootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
- velocity = Character.HumanoidRootPart.Velocity.y
- sine = sine + change
- Shield.Anchored = true
- Shield.CFrame = Shield.CFrame:lerp(RootPart.CFrame * CFrame.new(0, 0, -3.2), 1)
- local hit, pos = rayCast(Character.HumanoidRootPart.Position, CFrame.new(Character.HumanoidRootPart.Position, Character.HumanoidRootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
- if Character.HumanoidRootPart.Velocity.y > 1 and hit == nil then
- Anim = "Jump"
- if attack == false then
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
- PlayAnimationFromTable({
- CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(.5, -1, 0),
- CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, 1, 0),
- CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
- CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1),
- CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
- }, 0.3, false)
- end
- elseif Character.HumanoidRootPart.Velocity.y < -1 and hit == nil then
- Anim = "Fall"
- if attack == false then
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
- PlayAnimationFromTable({
- CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, -1, 1),
- CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 1, 0.5),
- CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
- CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1),
- CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
- }, 0.3, false)
- end
- elseif Torsovelocity < 1 and hit ~= nil then
- Anim = "Idle"
- if changeidle==1 then
- if attack == false then
- change = 1
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
- PlayAnimationFromTable({
- CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, -1, 1),
- CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 1, 0.5),
- CFrame.new(1.5,0,0) * CFrame.new(-1.2, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
- CFrame.new(-1.5,0,0) * CFrame.new(1.5, 0.3, -.5) * CFrame.Angles(3, 0, 1),
- CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
- }, 0.3, false)
- end
- elseif changeidle==2 then
- change = 1
- if not attack then
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
- PlayAnimationFromTable({
- CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(1.5,0,0) * CFrame.new(-1.5, 0.4, -.5) * CFrame.Angles(3, 0, -1),
- CFrame.new(-1.5,0,0) * CFrame.new(1.5, 0.4, -.5) * CFrame.Angles(3, 0, 1),
- CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
- }, 0.3, false)
- end
- end
- elseif Torsovelocity > 2 and hit ~= nil then
- Anim = "Walk"
- if attack == false then
- RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5)
- PlayAnimationFromTable({
- CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, -1, 0),
- CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, 0, 0),
- CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5),
- CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1),
- CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0)
- }, 0.3, false)
- end
- end
- if 0 < #Effects then
- for e = 1, #Effects do
- if Effects[e] ~= nil then
- local Thing = Effects[e]
- if Thing ~= nil then
- local Part = Thing[1]
- local Mode = Thing[2]
- local Delay = Thing[3]
- local IncX = Thing[4]
- local IncY = Thing[5]
- local IncZ = Thing[6]
- if Thing[2] == "Shoot" then
- local Look = Thing[1]
- local move = 30
- if Thing[8] == 3 then
- move = 10
- end
- local hit, pos = rayCast(Thing[4], Thing[1], move, m)
- if Thing[10] ~= nil then
- da = pos
- cf2 = CFrame.new(Thing[4], Thing[10].Position)
- cfa = CFrame.new(Thing[4], pos)
- tehCF = cfa:lerp(cf2, 0.2)
- Thing[1] = tehCF.lookVector
- end
- local mag = (Thing[4] - pos).magnitude
- 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)
- if Thing[8] == 2 then
- 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)
- end
- Thing[4] = Thing[4] + Look * move
- Thing[3] = Thing[3] - 1
- if 2 < Thing[5] then
- Thing[5] = Thing[5] - 0.3
- Thing[6] = Thing[6] - 0.3
- end
- if hit ~= nil then
- Thing[3] = 0
- if Thing[8] == 1 or Thing[8] == 3 then
- Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1)
- elseif Thing[8] == 2 then
- Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1)
- if hit.Parent:findFirstChild("Humanoid") ~= nil or hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
- ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Pastel blue-green"), "Reference", Vector3.new())
- ref.Anchored = true
- ref.CFrame = CFrame.new(pos)
- CFuncs.Sound.Create("161006093", ref, 1, 1.2)
- game:GetService("Debris"):AddItem(ref, 0.2)
- 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)
- 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)
- MagnitudeDamage(ref, 15, Thing[5] / 1.5, Thing[6] / 1.5, 0, "Normal", "", 1)
- end
- end
- ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Pastel blue-green"), "Reference", Vector3.new())
- ref.Anchored = true
- ref.CFrame = CFrame.new(pos)
- Effects.Sphere.Create(Torso.BrickColor, CFrame.new(pos), 5, 5, 5, 1, 1, 1, 0.07)
- game:GetService("Debris"):AddItem(ref, 1)
- end
- if Thing[3] <= 0 then
- table.remove(Effects, e)
- end
- end
- if Thing[2] == "FireWave" then
- if Thing[3] <= Thing[4] then
- Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(0, 1, 0)
- Thing[3] = Thing[3] + 1
- Thing[6].Scale = Thing[6].Scale + Vector3.new(Thing[5], 0, Thing[5])
- else
- Part.Parent = nil
- table.remove(Effects, e)
- end
- end
- if Thing[2] ~= "Shoot" and Thing[2] ~= "Wave" and Thing[2] ~= "FireWave" then
- if Thing[1].Transparency <= 1 then
- if Thing[2] == "Block1" then
- Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
- Mesh = Thing[7]
- Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Block2" then
- Thing[1].CFrame = Thing[1].CFrame
- Mesh = Thing[7]
- Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Fire" then
- Thing[1].CFrame = CFrame.new(Thing[1].Position) + Vector3.new(0, 0.2, 0)
- Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Cylinder" then
- Mesh = Thing[7]
- Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Blood" then
- Mesh = Thing[7]
- Thing[1].CFrame = Thing[1].CFrame * CFrame.new(0, 0.5, 0)
- Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Elec" then
- Thing[1].Size = Thing[1].Size + Vector3.new(Thing[7], Thing[8], Thing[9])
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Disappear" then
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- elseif Thing[2] == "Shatter" then
- Thing[1].Transparency = Thing[1].Transparency + Thing[3]
- Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
- Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
- Thing[6] = Thing[6] + Thing[5]
- end
- else
- Part.Parent = nil
- table.remove(Effects, e)
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement