Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer warn'villager minecraft script.'
- player = owner
- char = player.Character
- Model0 = char
- Part1 = char.Head
- DropWeapon = Instance.new("BoolValue",char)
- DropWeapon.Name = "DropWeapon"
- DropWeapon.Value = true
- Force_Hat = Instance.new("IntValue",char)
- Force_Hat.Name = "Force_Hat"
- Force_Hat.Value = 0
- Force_Pants = Instance.new("IntValue",char)
- Force_Pants.Name = "Force_Pants"
- Force_Pants.Value = 0
- Force_Shirt = Instance.new("IntValue",char)
- Force_Shirt.Name = "Force_Shirt"
- Force_Shirt.Value = 0
- Force_Weapon = Instance.new("IntValue",char)
- Force_Weapon.Name = "Force_Weapon"
- Force_Weapon.Value = 0
- IgnoreCombatFF = Instance.new("BoolValue",char)
- IgnoreCombatFF.Name = "IgnoreCombatFF"
- IgnoreCombatFF.Value = true
- IsAPlayer = Instance.new("CFrameValue",char)
- IsAPlayer.Name = "IsAPlayer"
- IsOnTeam = Instance.new("BoolValue",char)
- IsOnTeam.Name = "IsOnTeam"
- IsOnTeam.Value = false
- ShowTag = Instance.new("BoolValue",IsOnTeam)
- ShowTag.Name = "ShowTag"
- ShowTag.Value = false
- Team = Instance.new("BrickColorValue",IsOnTeam)
- Team.Name = "Team"
- Team.Value = BrickColor.new("Really black")
- PathTo = Instance.new("Vector3Value",char)
- PathTo.Name = "PathTo"
- PathTo.Value = Vector3.new(0,0,0)
- PrintMap = Instance.new("BoolValue",char)
- PrintMap.Name = "PrintMap"
- PrintMap.Value = false
- Respawn = Instance.new("BoolValue",char)
- Respawn.Name = "Respawn"
- Respawn.Value = false
- Wander = Instance.new("BoolValue",char)
- Wander.Name = "Wander"
- Wander.Value = false
- SpecialMesh2 = Instance.new("SpecialMesh")
- Part3 = Instance.new("Part")
- Decal4 = Instance.new("Decal")
- Decal5 = Instance.new("Decal")
- Decal6 = Instance.new("Decal")
- Decal7 = Instance.new("Decal")
- Decal8 = Instance.new("Decal")
- Decal9 = Instance.new("Decal")
- Snap10 = Instance.new("Snap")
- Weld11 = Instance.new("Weld")
- CFrameValue12 = Instance.new("CFrameValue")
- Part13 = Instance.new("Part")
- Decal14 = Instance.new("Decal")
- Decal15 = Instance.new("Decal")
- Decal16 = Instance.new("Decal")
- Decal17 = Instance.new("Decal")
- Decal18 = Instance.new("Decal")
- Decal19 = Instance.new("Decal")
- Weld20 = Instance.new("Weld")
- CFrameValue21 = Instance.new("CFrameValue")
- Part22 = char.Torso
- Decal23 = Instance.new("Decal")
- Motor24 = Instance.new("Motor")
- Motor25 = Instance.new("Motor")
- Motor26 = Instance.new("Motor")
- Motor27 = Instance.new("Motor")
- Motor28 = Instance.new("Motor")
- Part29 = Instance.new("Part")
- Decal30 = Instance.new("Decal")
- Decal31 = Instance.new("Decal")
- Decal32 = Instance.new("Decal")
- Decal33 = Instance.new("Decal")
- Decal34 = Instance.new("Decal")
- ManualWeld35 = Instance.new("ManualWeld")
- Weld36 = Instance.new("Weld")
- CFrameValue37 = Instance.new("CFrameValue")
- Part38 = Instance.new("Part")
- Decal39 = Instance.new("Decal")
- Decal40 = Instance.new("Decal")
- Decal41 = Instance.new("Decal")
- Decal42 = Instance.new("Decal")
- Weld43 = Instance.new("Weld")
- CFrameValue44 = Instance.new("CFrameValue")
- Part45 = Instance.new("Part")
- Decal46 = Instance.new("Decal")
- Decal47 = Instance.new("Decal")
- Decal48 = Instance.new("Decal")
- Decal49 = Instance.new("Decal")
- Decal50 = Instance.new("Decal")
- ManualWeld51 = Instance.new("ManualWeld")
- Weld52 = Instance.new("Weld")
- CFrameValue53 = Instance.new("CFrameValue")
- Part54 = Instance.new("Part")
- Decal55 = Instance.new("Decal")
- Decal56 = Instance.new("Decal")
- Decal57 = Instance.new("Decal")
- Decal58 = Instance.new("Decal")
- Decal59 = Instance.new("Decal")
- Snap60 = Instance.new("Snap")
- Weld61 = Instance.new("Weld")
- CFrameValue62 = Instance.new("CFrameValue")
- Part63 = Instance.new("Part")
- Decal64 = Instance.new("Decal")
- Decal65 = Instance.new("Decal")
- Decal66 = Instance.new("Decal")
- Decal67 = Instance.new("Decal")
- Weld68 = Instance.new("Weld")
- CFrameValue69 = Instance.new("CFrameValue")
- Part70 = char["Left Arm"]
- Part71 = char["Right Arm"]
- Part72 = char["Left Leg"]
- Part73 = Instance.new("Part")
- Decal74 = Instance.new("Decal")
- Decal75 = Instance.new("Decal")
- Decal76 = Instance.new("Decal")
- Decal77 = Instance.new("Decal")
- Decal78 = Instance.new("Decal")
- Snap79 = Instance.new("Snap")
- Weld80 = Instance.new("Weld")
- CFrameValue81 = Instance.new("CFrameValue")
- Part82 = char["Right Leg"]
- Part83 = Instance.new("Part")
- Decal84 = Instance.new("Decal")
- Decal85 = Instance.new("Decal")
- Decal86 = Instance.new("Decal")
- Decal87 = Instance.new("Decal")
- Decal88 = Instance.new("Decal")
- Snap89 = Instance.new("Snap")
- Weld90 = Instance.new("Weld")
- CFrameValue91 = Instance.new("CFrameValue")
- Humanoid92 = char.Humanoid
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(121.909309, 4.5, 208.680298, 0.999999881, -1.17239551e-13, -1.77635684e-15, 2.76438676e-08, 1, -5.96044032e-08, -1.63117981e-08, 1.1920902e-07, 0.999999881)
- Part1.Position = Vector3.new(121.909309, 4.5, 208.680298)
- Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part1.Transparency = 1
- Part1.Size = Vector3.new(2, 1, 1)
- Part1.BrickColor = BrickColor.new("Bright yellow")
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Bright yellow")
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh2.Parent = Part1
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- Part3.Name = "head"
- Part3.Parent = Part1
- Part3.CFrame = CFrame.new(121.863251, 4.71428871, 208.672256, 1.63118017e-08, 2.76438747e-08, 0.999999881, -5.96046448e-08, 1, -1.24344979e-13, -0.999999881, -1.75151654e-15, 1.77635684e-15)
- Part3.Orientation = Vector3.new(0, 90, 0)
- Part3.Position = Vector3.new(121.863251, 4.71428871, 208.672256)
- Part3.Rotation = Vector3.new(89.1800003, 89.9700012, -59.4599991)
- Part3.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part3.Size = Vector3.new(1.25713921, 1.57142401, 1.25713909)
- Part3.BrickColor = BrickColor.new("Light orange")
- Part3.brickColor = BrickColor.new("Light orange")
- Part3.FormFactor = Enum.FormFactor.Custom
- Part3.formFactor = Enum.FormFactor.Custom
- Decal4.Parent = Part3
- Decal4.Texture = "http://www.roblox.com/asset/?id=111288035"
- Decal4.Face = Enum.NormalId.Right
- Decal5.Parent = Part3
- Decal5.Texture = "http://www.roblox.com/asset/?id=111289140"
- Decal5.Face = Enum.NormalId.Back
- Decal6.Parent = Part3
- Decal6.Texture = "http://www.roblox.com/asset/?id=111289140"
- Decal7.Parent = Part3
- Decal7.Texture = "http://www.roblox.com/asset/?id=111289140"
- Decal7.Face = Enum.NormalId.Left
- Decal8.Parent = Part3
- Decal8.Texture = "http://www.roblox.com/asset/?id=111289156"
- Decal8.Face = Enum.NormalId.Top
- Decal9.Parent = Part3
- Decal9.Texture = "http://www.roblox.com/asset/?id=111292912"
- Decal9.Face = Enum.NormalId.Bottom
- Snap10.Parent = Part3
- Snap10.C0 = CFrame.new(0, -0.785712004, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- Snap10.C1 = CFrame.new(0, 0.942797899, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- Snap10.Part0 = Part3
- Snap10.Part1 = Part38
- Snap10.part1 = Part38
- Weld11.Name = "qCFrameWeldThingy"
- Weld11.Parent = Part3
- Weld11.C1 = CFrame.new(-0.00804138184, -0.214288712, 0.0460586548, 1.63118017e-08, -1.19209034e-07, -1, 2.76439938e-08, 1, -1.19209048e-07, 1, -2.76439938e-08, 1.63118052e-08)
- Weld11.Part0 = Part1
- Weld11.Part1 = Part3
- Weld11.part1 = Part3
- CFrameValue12.Name = "qRelativeCFrameWeldValue"
- CFrameValue12.Parent = Part3
- CFrameValue12.Value = CFrame.new(-0.00804138184, -0.214288712, 0.0460586548, 1.63118017e-08, -1.19209034e-07, -1, 2.76439938e-08, 1, -1.19209048e-07, 1, -2.76439938e-08, 1.63118052e-08)
- Part13.Name = "head"
- Part13.Parent = Part1
- Part13.CFrame = CFrame.new(121.863251, 4.08579206, 207.886551, 1.63116631e-08, 2.7643873e-08, 0.999991298, -5.9604119e-08, 1, -1.2709358e-13, -0.999991298, -1.42108547e-14, 3.55271368e-15)
- Part13.Orientation = Vector3.new(0, 90, 0)
- Part13.Position = Vector3.new(121.863251, 4.08579206, 207.886551)
- Part13.Rotation = Vector3.new(88.4000015, 89.7600021, -59.4599991)
- Part13.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part13.Size = Vector3.new(0.314284772, 0.628569543, 0.314284772)
- Part13.BrickColor = BrickColor.new("Nougat")
- Part13.brickColor = BrickColor.new("Nougat")
- Part13.FormFactor = Enum.FormFactor.Custom
- Part13.formFactor = Enum.FormFactor.Custom
- Decal14.Parent = Part13
- Decal14.Texture = "http://www.roblox.com/asset/?id=111291001"
- Decal14.Face = Enum.NormalId.Right
- Decal15.Parent = Part13
- Decal15.Texture = "http://www.roblox.com/asset/?id=111291021"
- Decal15.Face = Enum.NormalId.Back
- Decal16.Parent = Part13
- Decal16.Texture = "http://www.roblox.com/asset/?id=111291021"
- Decal17.Parent = Part13
- Decal17.Texture = "http://www.roblox.com/asset/?id=111291001"
- Decal17.Face = Enum.NormalId.Top
- Decal18.Parent = Part13
- Decal18.Texture = "http://www.roblox.com/asset/?id=111291021"
- Decal18.Face = Enum.NormalId.Bottom
- Decal19.Parent = Part13
- Decal19.Texture = "http://www.roblox.com/asset/?id=111291001"
- Decal19.Face = Enum.NormalId.Left
- Weld20.Name = "qCFrameWeldThingy"
- Weld20.Parent = Part13
- Weld20.C1 = CFrame.new(-0.793746948, 0.414207935, 0.0460586548, 1.63116631e-08, -1.19208011e-07, -0.999991417, 2.76439938e-08, 1, -1.19209048e-07, 0.999991417, -2.76437557e-08, 1.63116667e-08)
- Weld20.Part0 = Part1
- Weld20.Part1 = Part13
- Weld20.part1 = Part13
- CFrameValue21.Name = "qRelativeCFrameWeldValue"
- CFrameValue21.Parent = Part13
- CFrameValue21.Value = CFrame.new(-0.793746948, 0.414207935, 0.0460586548, 1.63116631e-08, -1.19208011e-07, -0.999991417, 2.76439938e-08, 1, -1.19209048e-07, 0.999991417, -2.76437557e-08, 1.63116667e-08)
- Part22.Name = "Torso"
- Part22.Parent = Model0
- Part22.CFrame = CFrame.new(121.909317, 3.00000191, 208.680313, 1, -2.7644111e-08, 1.63118035e-08, 2.76441128e-08, 1, -8.94061998e-08, -1.63118017e-08, 8.94061998e-08, 1)
- Part22.Position = Vector3.new(121.909317, 3.00000191, 208.680313)
- Part22.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part22.Transparency = 1
- Part22.Size = Vector3.new(2, 2, 1)
- Part22.BrickColor = BrickColor.new("Bright blue")
- Part22.LeftParamA = 0
- Part22.LeftParamB = 0
- Part22.LeftSurface = Enum.SurfaceType.Weld
- Part22.RightParamA = 0
- Part22.RightParamB = 0
- Part22.RightSurface = Enum.SurfaceType.Weld
- Part22.brickColor = BrickColor.new("Bright blue")
- Part22.FormFactor = Enum.FormFactor.Symmetric
- Part22.formFactor = Enum.FormFactor.Symmetric
- Decal23.Name = "roblox"
- Decal23.Parent = Part22
- Motor24.Name = "Right Shoulder"
- Motor24.Parent = Part22
- Motor24.MaxVelocity = 0.15000000596046
- Motor24.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor24.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor24.Part0 = Part22
- Motor24.Part1 = Part71
- Motor24.part1 = Part71
- Motor25.Name = "Left Shoulder"
- Motor25.Parent = Part22
- Motor25.MaxVelocity = 0.15000000596046
- Motor25.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor25.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor25.Part0 = Part22
- Motor25.Part1 = Part70
- Motor25.part1 = Part70
- Motor26.Name = "Right Hip"
- Motor26.Parent = Part22
- Motor26.MaxVelocity = 0.10000000149012
- Motor26.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor26.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor26.Part0 = Part22
- Motor26.Part1 = Part82
- Motor26.part1 = Part82
- Motor27.Name = "Left Hip"
- Motor27.Parent = Part22
- Motor27.MaxVelocity = 0.10000000149012
- Motor27.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor27.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor27.Part0 = Part22
- Motor27.Part1 = Part72
- Motor27.part1 = Part72
- Motor28.Name = "Neck"
- Motor28.Parent = Part22
- Motor28.MaxVelocity = 0.10000000149012
- Motor28.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor28.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor28.Part0 = Part22
- Motor28.Part1 = Part1
- Motor28.part1 = Part1
- Part29.Name = "torso"
- Part29.Parent = Part22
- Part29.CFrame = CFrame.new(122.806099, 3.30007219, 208.357971, -7.88208609e-08, -2.04724557e-08, 1, 0.707108676, 0.707104862, 7.02110867e-08, -0.707104921, 0.707108736, -4.12583674e-08)
- Part29.Orientation = Vector3.new(0, 90, 45)
- Part29.Position = Vector3.new(122.806099, 3.30007219, 208.357971)
- Part29.Rotation = Vector3.new(45, 90, 0)
- Part29.Color = Color3.new(0.486275, 0.360784, 0.27451)
- Part29.Size = Vector3.new(0.628569543, 1.25713921, 0.628569543)
- Part29.BrickColor = BrickColor.new("Brown")
- Part29.brickColor = BrickColor.new("Brown")
- Part29.FormFactor = Enum.FormFactor.Custom
- Part29.formFactor = Enum.FormFactor.Custom
- Decal30.Parent = Part29
- Decal30.Texture = "http://www.roblox.com/asset/?id=111291326"
- Decal30.Face = Enum.NormalId.Top
- Decal31.Parent = Part29
- Decal31.Texture = "http://www.roblox.com/asset/?id=111291534"
- Decal31.Face = Enum.NormalId.Bottom
- Decal32.Parent = Part29
- Decal32.Texture = "http://www.roblox.com/asset/?id=111291643"
- Decal32.Face = Enum.NormalId.Right
- Decal33.Parent = Part29
- Decal33.Texture = "http://www.roblox.com/asset/?id=111291741"
- Decal33.Face = Enum.NormalId.Back
- Decal34.Parent = Part29
- Decal34.Texture = "http://www.roblox.com/asset/?id=111291643"
- Decal34.Face = Enum.NormalId.Left
- ManualWeld35.Name = "torso-to-head Strong Joint"
- ManualWeld35.Parent = Part29
- ManualWeld35.C0 = CFrame.new(0.314284772, -0.628569603, -0.314284772, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- ManualWeld35.C1 = CFrame.new(0.98098594, -1.63644803, 0.628564417, -0.707104802, -0.707108617, -4.12583603e-08, -0.707108617, 0.707104921, -7.02107315e-08, 4.77393129e-08, -1.24593891e-08, -0.999999881)
- ManualWeld35.Part0 = Part29
- ManualWeld35.Part1 = Part3
- ManualWeld35.part1 = Part3
- Weld36.Name = "qCFrameWeldThingy"
- Weld36.Parent = Part29
- Weld36.C1 = CFrame.new(-0.440109253, 0.0157470703, -0.896781921, -4.77393201e-08, 0.707108617, -0.707104981, -1.24593882e-08, 0.707104921, 0.707108676, 1, 4.25669775e-08, -2.49465693e-08)
- Weld36.Part0 = Part22
- Weld36.Part1 = Part29
- Weld36.part1 = Part29
- CFrameValue37.Name = "qRelativeCFrameWeldValue"
- CFrameValue37.Parent = Part29
- CFrameValue37.Value = CFrame.new(-0.440109253, 0.0157470703, -0.896781921, -4.77393201e-08, 0.707108617, -0.707104981, -1.24593882e-08, 0.707104921, 0.707108676, 1, 4.25669775e-08, -2.49465693e-08)
- Part38.Name = "torso"
- Part38.Parent = Part22
- Part38.CFrame = CFrame.new(121.863243, 2.98578, 208.672241, -1.77635684e-15, -3.57047725e-13, 0.999991298, -1.15818466e-12, 1, 2.7643873e-08, -0.999991357, 8.94061998e-08, -1.63116614e-08)
- Part38.Orientation = Vector3.new(0, 90, 0)
- Part38.Position = Vector3.new(121.863243, 2.98578, 208.672241)
- Part38.Rotation = Vector3.new(-120.540001, 89.7600021, 90.2900009)
- Part38.Color = Color3.new(0.486275, 0.360784, 0.27451)
- Part38.Size = Vector3.new(0.942854345, 1.88570893, 1.25713909)
- Part38.BrickColor = BrickColor.new("Brown")
- Part38.brickColor = BrickColor.new("Brown")
- Part38.FormFactor = Enum.FormFactor.Custom
- Part38.formFactor = Enum.FormFactor.Custom
- Decal39.Parent = Part38
- Decal39.Texture = "http://www.roblox.com/asset/?id=111289291"
- Decal39.Face = Enum.NormalId.Right
- Decal40.Parent = Part38
- Decal40.Texture = "http://www.roblox.com/asset/?id=111289318"
- Decal40.Face = Enum.NormalId.Left
- Decal41.Parent = Part38
- Decal41.Texture = "http://www.roblox.com/asset/?id=111290766"
- Decal41.Face = Enum.NormalId.Back
- Decal42.Parent = Part38
- Decal42.Texture = "http://www.roblox.com/asset/?id=111290905"
- Weld43.Name = "qCFrameWeldThingy"
- Weld43.Parent = Part38
- Weld43.C1 = CFrame.new(-0.00807189941, 0.0142219067, 0.0460739136, 1.63116596e-08, -8.94065835e-08, -0.999991357, 2.7643754e-08, 1, -1.75151686e-15, 0.999991298, 0, -1.77634922e-15)
- Weld43.Part0 = Part22
- Weld43.Part1 = Part38
- Weld43.part1 = Part38
- CFrameValue44.Name = "qRelativeCFrameWeldValue"
- CFrameValue44.Parent = Part38
- CFrameValue44.Value = CFrame.new(-0.00807189941, 0.0142219067, 0.0460739136, 1.63116596e-08, -8.94065835e-08, -0.999991357, 2.7643754e-08, 1, -1.75151686e-15, 0.999991298, 0, -1.77634922e-15)
- Part45.Name = "torso"
- Part45.Parent = Part22
- Part45.CFrame = CFrame.new(120.920395, 3.30007219, 208.357971, -4.77392312e-08, -1.2459302e-08, 1, 0.707108617, 0.707104921, 4.25668532e-08, -0.707104921, 0.707108617, -2.49465639e-08)
- Part45.Orientation = Vector3.new(0, 90, 45)
- Part45.Position = Vector3.new(120.920395, 3.30007219, 208.357971)
- Part45.Rotation = Vector3.new(45, 90, 0)
- Part45.Color = Color3.new(0.486275, 0.360784, 0.27451)
- Part45.Size = Vector3.new(0.628569543, 1.25713921, 0.628569543)
- Part45.BrickColor = BrickColor.new("Brown")
- Part45.brickColor = BrickColor.new("Brown")
- Part45.FormFactor = Enum.FormFactor.Custom
- Part45.formFactor = Enum.FormFactor.Custom
- Decal46.Parent = Part45
- Decal46.Texture = "http://www.roblox.com/asset/?id=111291326"
- Decal46.Face = Enum.NormalId.Top
- Decal47.Parent = Part45
- Decal47.Texture = "http://www.roblox.com/asset/?id=111291534"
- Decal47.Face = Enum.NormalId.Bottom
- Decal48.Parent = Part45
- Decal48.Texture = "http://www.roblox.com/asset/?id=111291643"
- Decal48.Face = Enum.NormalId.Right
- Decal49.Parent = Part45
- Decal49.Texture = "http://www.roblox.com/asset/?id=111291741"
- Decal50.Parent = Part45
- Decal50.Texture = "http://www.roblox.com/asset/?id=111291643"
- Decal50.Face = Enum.NormalId.Left
- ManualWeld51.Name = "torso-to-head Strong Joint"
- ManualWeld51.Parent = Part45
- ManualWeld51.C0 = CFrame.new(-0.314284772, -0.628569603, 0.314284772, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- ManualWeld51.C1 = CFrame.new(0.536520302, -2.08091497, -0.628567398, 0.707104802, -0.707108617, 4.12583603e-08, 0.707108617, 0.707104921, 7.02107315e-08, -4.77393129e-08, -1.24593891e-08, 0.999999881)
- ManualWeld51.Part0 = Part45
- ManualWeld51.Part1 = Part3
- ManualWeld51.part1 = Part3
- Weld52.Name = "qCFrameWeldThingy"
- Weld52.Parent = Part45
- Weld52.C1 = CFrame.new(-0.440109253, 0.0157470703, 0.988922119, -1.66576832e-08, 0.707108557, -0.707104981, -4.44623094e-09, 0.707104981, 0.707108557, 1, 1.49227404e-08, -8.63476401e-09)
- Weld52.Part0 = Part22
- Weld52.Part1 = Part45
- Weld52.part1 = Part45
- CFrameValue53.Name = "qRelativeCFrameWeldValue"
- CFrameValue53.Parent = Part45
- CFrameValue53.Value = CFrame.new(-0.440109253, 0.0157470703, 0.988922119, -1.66576832e-08, 0.707108557, -0.707104981, -4.44623094e-09, 0.707104981, 0.707108557, 1, 1.49227404e-08, -8.63476401e-09)
- Part54.Name = "torso"
- Part54.Parent = Part22
- Part54.CFrame = CFrame.new(121.863251, 2.43583798, 208.680084, -0.999991119, 2.76438747e-08, -1.34903999e-08, 1.26691572e-13, 1, -8.94077345e-08, 2.98020595e-08, 2.9801555e-08, -0.999991119)
- Part54.Orientation = Vector3.new(0, -180, 0)
- Part54.Position = Vector3.new(121.863251, 2.43583798, 208.680084)
- Part54.Rotation = Vector3.new(180, 0, -180)
- Part54.Color = Color3.new(0.486275, 0.360784, 0.27451)
- Part54.Transparency = 1
- Part54.Size = Vector3.new(1.41428137, 3.12713337, 1.09999657)
- Part54.BrickColor = BrickColor.new("Brown")
- Part54.brickColor = BrickColor.new("Brown")
- Part54.FormFactor = Enum.FormFactor.Custom
- Part54.formFactor = Enum.FormFactor.Custom
- Decal55.Parent = Part54
- Decal55.Texture = "http://www.roblox.com/asset/?id=111294593"
- Decal55.Face = Enum.NormalId.Top
- Decal56.Parent = Part54
- Decal56.Texture = "http://www.roblox.com/asset/?id=111294408"
- Decal56.Face = Enum.NormalId.Back
- Decal57.Parent = Part54
- Decal57.Texture = "http://www.roblox.com/asset/?id=111294436"
- Decal58.Parent = Part54
- Decal58.Texture = "http://www.roblox.com/asset/?id=111294458"
- Decal58.Face = Enum.NormalId.Left
- Decal59.Parent = Part54
- Decal59.Texture = "http://www.roblox.com/asset/?id=111294490"
- Decal59.Face = Enum.NormalId.Right
- Snap60.Parent = Part54
- Snap60.C0 = CFrame.new(0, 1.56356668, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Snap60.C1 = CFrame.new(-0.0460586548, -0.500595808, -0.000213623047, 0.999991059, -2.9802063e-08, 0, 0, 0, 1, -2.9802063e-08, -0.999991059, 0)
- Snap60.Part0 = Part54
- Snap60.Part1 = Part1
- Snap60.part1 = Part1
- Weld61.Name = "qCFrameWeldThingy"
- Weld61.Parent = Part54
- Weld61.C1 = CFrame.new(-0.0460662842, 0.564163923, -0.000228881836, -0.999991119, 2.76439955e-08, 1.34904017e-08, 5.52879875e-08, 1, -5.96046448e-08, 2.82125256e-09, -1.78813139e-07, -0.999991119)
- Weld61.Part0 = Part22
- Weld61.Part1 = Part54
- Weld61.part1 = Part54
- CFrameValue62.Name = "qRelativeCFrameWeldValue"
- CFrameValue62.Parent = Part54
- CFrameValue62.Value = CFrame.new(-0.0460662842, 0.564163923, -0.000228881836, -0.999991119, 2.76439955e-08, 1.34904017e-08, 5.52879875e-08, 1, -5.96046448e-08, 2.82125256e-09, -1.78813139e-07, -0.999991119)
- Part63.Name = "torso"
- Part63.Parent = Part22
- Part63.CFrame = CFrame.new(121.863251, 3.0778501, 208.135757, -1.66572462e-08, -4.44579396e-09, 1, 0.707108557, 0.707104981, 1.49221293e-08, -0.707105041, 0.707108617, -8.63476224e-09)
- Part63.Orientation = Vector3.new(0, 90, 45)
- Part63.Position = Vector3.new(121.863251, 3.0778501, 208.135757)
- Part63.Rotation = Vector3.new(45, 90, 0)
- Part63.Color = Color3.new(0.486275, 0.360784, 0.27451)
- Part63.Size = Vector3.new(0.628569543, 0.628569543, 1.25713909)
- Part63.BrickColor = BrickColor.new("Brown")
- Part63.brickColor = BrickColor.new("Brown")
- Part63.FormFactor = Enum.FormFactor.Custom
- Part63.formFactor = Enum.FormFactor.Custom
- Decal64.Parent = Part63
- Decal64.Texture = "http://www.roblox.com/asset/?id=111290271"
- Decal64.Face = Enum.NormalId.Right
- Decal65.Parent = Part63
- Decal65.Texture = "http://www.roblox.com/asset/?id=111290491"
- Decal65.Face = Enum.NormalId.Bottom
- Decal66.Parent = Part63
- Decal66.Texture = "http://www.roblox.com/asset/?id=111290491"
- Decal66.Face = Enum.NormalId.Top
- Decal67.Parent = Part63
- Decal67.Texture = "http://www.roblox.com/asset/?id=111290271"
- Decal67.Face = Enum.NormalId.Left
- Weld68.Name = "qCFrameWeldThingy"
- Weld68.Parent = Part63
- Weld68.C1 = CFrame.new(-0.440109253, 0.33001709, 0.0460662842, 1.44242982e-08, 0.707108498, -0.7071051, 3.56727914e-09, 0.707105041, 0.707108557, 1, -1.27219835e-08, 7.67704122e-09)
- Weld68.Part0 = Part22
- Weld68.Part1 = Part63
- Weld68.part1 = Part63
- CFrameValue69.Name = "qRelativeCFrameWeldValue"
- CFrameValue69.Parent = Part63
- CFrameValue69.Value = CFrame.new(-0.440109253, 0.33001709, 0.0460662842, 1.44242982e-08, 0.707108498, -0.7071051, 3.56727914e-09, 0.707105041, 0.707108557, 1, -1.27219835e-08, 7.67704122e-09)
- Part70.Name = "Left Arm"
- Part70.Parent = Model0
- Part70.CFrame = CFrame.new(120.409317, 3.00000191, 208.680313, 1, -2.7644111e-08, 1.63118035e-08, 2.76441128e-08, 1, -8.94061998e-08, -1.63118017e-08, 8.94061998e-08, 1)
- Part70.Position = Vector3.new(120.409317, 3.00000191, 208.680313)
- Part70.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part70.Transparency = 1
- Part70.Size = Vector3.new(1, 2, 1)
- Part70.BrickColor = BrickColor.new("Bright yellow")
- Part70.brickColor = BrickColor.new("Bright yellow")
- Part70.FormFactor = Enum.FormFactor.Symmetric
- Part70.formFactor = Enum.FormFactor.Symmetric
- Part71.Name = "Right Arm"
- Part71.Parent = Model0
- Part71.CFrame = CFrame.new(123.409317, 3.00000191, 208.680313, 1, -2.7644111e-08, 1.63118035e-08, 2.76441128e-08, 1, -8.94061998e-08, -1.63118017e-08, 8.94061998e-08, 1)
- Part71.Position = Vector3.new(123.409317, 3.00000191, 208.680313)
- Part71.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part71.Transparency = 1
- Part71.Size = Vector3.new(1, 2, 1)
- Part71.BrickColor = BrickColor.new("Bright yellow")
- Part71.brickColor = BrickColor.new("Bright yellow")
- Part71.FormFactor = Enum.FormFactor.Symmetric
- Part71.formFactor = Enum.FormFactor.Symmetric
- Part72.Name = "Left Leg"
- Part72.Parent = Model0
- Part72.CFrame = CFrame.new(121.409309, 1.00000477, 208.680298, 0.999982595, -2.76441128e-08, 1.6311521e-08, 8.29316207e-08, 1, -5.96034866e-08, -4.89345595e-08, 2.68217832e-07, 0.999982655)
- Part72.Position = Vector3.new(121.409309, 1.00000477, 208.680298)
- Part72.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part72.Transparency = 1
- Part72.Size = Vector3.new(1, 2, 1)
- Part72.BottomSurface = Enum.SurfaceType.Smooth
- Part72.BrickColor = BrickColor.new("Br. yellowish green")
- Part72.TopSurface = Enum.SurfaceType.Inlet
- Part72.brickColor = BrickColor.new("Br. yellowish green")
- Part72.FormFactor = Enum.FormFactor.Symmetric
- Part72.formFactor = Enum.FormFactor.Symmetric
- Part73.Name = "lleg"
- Part73.Parent = Part72
- Part73.CFrame = CFrame.new(121.54895, 1.02150536, 208.672241, -1.77635684e-15, -3.57047725e-13, 0.999991298, -1.15818466e-12, 1, 2.7643873e-08, -0.999991357, 8.94061998e-08, -1.63116614e-08)
- Part73.Orientation = Vector3.new(0, 90, 0)
- Part73.Position = Vector3.new(121.54895, 1.02150536, 208.672241)
- Part73.Rotation = Vector3.new(-120.540001, 89.7600021, 90.2900009)
- Part73.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part73.Size = Vector3.new(0.628569543, 2.04285121, 0.628569543)
- Part73.BrickColor = BrickColor.new("Dark stone grey")
- Part73.brickColor = BrickColor.new("Dark stone grey")
- Part73.FormFactor = Enum.FormFactor.Custom
- Part73.formFactor = Enum.FormFactor.Custom
- Decal74.Parent = Part73
- Decal74.Texture = "http://www.roblox.com/asset/?id=111291534"
- Decal74.Face = Enum.NormalId.Top
- Decal75.Parent = Part73
- Decal75.Texture = "http://www.roblox.com/asset/?id=111292682"
- Decal75.Face = Enum.NormalId.Right
- Decal76.Parent = Part73
- Decal76.Texture = "http://www.roblox.com/asset/?id=111292704"
- Decal76.Face = Enum.NormalId.Back
- Decal77.Parent = Part73
- Decal77.Texture = "http://www.roblox.com/asset/?id=111292718"
- Decal78.Parent = Part73
- Decal78.Texture = "http://www.roblox.com/asset/?id=111292729"
- Decal78.Face = Enum.NormalId.Left
- Snap79.Parent = Part73
- Snap79.C0 = CFrame.new(0, 1.0214256, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Snap79.C1 = CFrame.new(0, -0.94284898, -0.314291984, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Snap79.Part0 = Part73
- Snap79.Part1 = Part38
- Snap79.part1 = Part38
- Weld80.Name = "qCFrameWeldThingy"
- Weld80.Parent = Part73
- Weld80.C1 = CFrame.new(-0.00805664063, -0.0215005875, -0.139640808, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
- Weld80.Part0 = Part72
- Weld80.Part1 = Part73
- Weld80.part1 = Part73
- CFrameValue81.Name = "qRelativeCFrameWeldValue"
- CFrameValue81.Parent = Part73
- CFrameValue81.Value = CFrame.new(-0.00805664063, -0.0215005875, -0.139640808, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
- Part82.Name = "Right Leg"
- Part82.Parent = Model0
- Part82.CFrame = CFrame.new(122.409317, 1.00000477, 208.680298, 0.999982595, -2.76441128e-08, 1.6311521e-08, 8.29316207e-08, 1, -5.96034866e-08, -4.89345595e-08, 2.68217832e-07, 0.999982655)
- Part82.Position = Vector3.new(122.409317, 1.00000477, 208.680298)
- Part82.Color = Color3.new(0.643137, 0.741176, 0.278431)
- Part82.Transparency = 1
- Part82.Size = Vector3.new(1, 2, 1)
- Part82.BottomSurface = Enum.SurfaceType.Smooth
- Part82.BrickColor = BrickColor.new("Br. yellowish green")
- Part82.TopSurface = Enum.SurfaceType.Inlet
- Part82.brickColor = BrickColor.new("Br. yellowish green")
- Part82.FormFactor = Enum.FormFactor.Symmetric
- Part82.formFactor = Enum.FormFactor.Symmetric
- Part83.Name = "rleg"
- Part83.Parent = Part82
- Part83.CFrame = CFrame.new(122.177536, 1.02150536, 208.672241, -1.77635684e-15, -3.57047725e-13, 0.999991298, -1.15818466e-12, 1, 2.7643873e-08, -0.999991357, 8.94061998e-08, -1.63116614e-08)
- Part83.Orientation = Vector3.new(0, 90, 0)
- Part83.Position = Vector3.new(122.177536, 1.02150536, 208.672241)
- Part83.Rotation = Vector3.new(-120.540001, 89.7600021, 90.2900009)
- Part83.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part83.Size = Vector3.new(0.628569543, 2.04285121, 0.628569543)
- Part83.BrickColor = BrickColor.new("Dark stone grey")
- Part83.brickColor = BrickColor.new("Dark stone grey")
- Part83.FormFactor = Enum.FormFactor.Custom
- Part83.formFactor = Enum.FormFactor.Custom
- Decal84.Parent = Part83
- Decal84.Texture = "http://www.roblox.com/asset/?id=111291534"
- Decal84.Face = Enum.NormalId.Top
- Decal85.Parent = Part83
- Decal85.Texture = "http://www.roblox.com/asset/?id=111292682"
- Decal85.Face = Enum.NormalId.Right
- Decal86.Parent = Part83
- Decal86.Texture = "http://www.roblox.com/asset/?id=111292704"
- Decal86.Face = Enum.NormalId.Back
- Decal87.Parent = Part83
- Decal87.Texture = "http://www.roblox.com/asset/?id=111292718"
- Decal88.Parent = Part83
- Decal88.Texture = "http://www.roblox.com/asset/?id=111292729"
- Decal88.Face = Enum.NormalId.Left
- Snap89.Parent = Part83
- Snap89.C0 = CFrame.new(0, 1.0214256, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Snap89.C1 = CFrame.new(0, -0.94284898, 0.314291984, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Snap89.Part0 = Part83
- Snap89.Part1 = Part38
- Snap89.part1 = Part38
- Weld90.Name = "qCFrameWeldThingy"
- Weld90.Parent = Part83
- Weld90.C1 = CFrame.new(-0.00805664063, -0.0215005875, 0.231781006, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
- Weld90.Part0 = Part82
- Weld90.Part1 = Part83
- Weld90.part1 = Part83
- CFrameValue91.Name = "qRelativeCFrameWeldValue"
- CFrameValue91.Parent = Part83
- CFrameValue91.Value = CFrame.new(-0.00805664063, -0.0215005875, 0.231781006, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
- Humanoid92.Parent = Model0
- Humanoid92.LeftLeg = Part72
- Humanoid92.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid92.RightLeg = Part82
- Humanoid92.Torso = Part22
- remoteevent = Instance.new("RemoteEvent",char)
- remoteevent.Name = "SteveFunction"
- remoteevent.OnServerEvent:Connect(function(plr,a,b)
- necka = plr.Character.Torso.Neck
- necka.C0 = a
- necka.C1 = b
- end)
- NLS([[
- local sneaking = 0
- local ticks = 0
- local RS = game:GetService("RunService").RenderStepped
- local player = owner
- local bodyRot = CFrame.new(0, 0, 0)
- local mouse = player:GetMouse()
- mouse.KeyDown:Connect(function(key)
- if key == "q" then
- sneaking = 1
- end
- end)
- mouse.KeyUp:Connect(function(key)
- if key == "q" then
- sneaking = 0
- end
- end)
- char = player.Character
- local head = char:WaitForChild("Head")
- local remoteevent = char:WaitForChild("SteveFunction")
- remoteevent.Name = "SteveEvent"
- local torso = char:WaitForChild("Torso")
- local humanoid = char:WaitForChild("Humanoid")
- humanoid.AutoRotate = false
- neck = torso:WaitForChild("Neck")
- local humRootPart = char:WaitForChild("HumanoidRootPart")
- camera = workspace.CurrentCamera
- local camPart = Instance.new("Part", char)
- camPart.Size = Vector3.new(0, 0, 0)
- camPart.CFrame = camera.CFrame
- camPart.CanCollide = false
- camPart.Anchored = true
- camPart.Transparency = 1
- local lastCamRot = camPart.Orientation
- function AngleDifference(Angle1, Angle2)
- local Difference = {X = 0, Y = 0, Z = 0}
- Difference.X = Angle2.X - Angle1.X
- if (Difference.X > 180) then
- Difference.X = Difference.X - 360
- elseif (Difference.X < -180) then
- Difference.X = Difference.X + 360
- end
- Difference.Y = Angle2.Y - Angle1.Y
- if (Difference.Y > 180) then
- Difference.Y = Difference.Y - 360
- elseif (Difference.Y < -180) then
- Difference.Y = Difference.Y + 360
- end
- Difference.Z = Angle2.Z - Angle1.Z
- if (Difference.Z > 180) then
- Difference.Z = Difference.Z - 360
- elseif (Difference.Z < -180) then
- Difference.Z = Difference.Z + 360
- end
- return Vector3.new(Difference.X, Difference.Y, Difference.Z)
- end
- game:GetService("RunService").RenderStepped:Connect(function()
- if char:FindFirstChild("MobileCrouching") then
- sneaking = 1
- else
- sneaking = 0
- end
- local remoteevent = char:WaitForChild("SteveEvent")
- camPart.CFrame = camera.CFrame
- local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
- local rotX = math.deg(math.atan2(humanoid.MoveDirection.Z, humanoid.MoveDirection.X)) + 90
- if humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then
- --print(rotX)
- bodyRot = bodyRot:lerp(CFrame.Angles(0, -math.rad(rotX), 0), 0.125)
- humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * bodyRot
- end
- local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
- local YOffset = neck.C0.Y
- local CFNew, CFAng = CFrame.new, CFrame.Angles
- local asin = math.asin
- local CameraDirection = owner.Character.HumanoidRootPart.CFrame:toObjectSpace(camera.CFrame).lookVector
- neck.C0 = CFNew(0, YOffset, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(0, 0, -asin(CameraDirection.x)) * CFAng(-asin(CameraDirection.y), 0, 0)
- if owner.Character:WaitForChild("SteveEvent") then
- owner.Character.SteveEvent:FireServer (neck.C0,neck.C1)
- end
- end)
- ]], char)
- 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
- -- ANIMATION
- -- declarations
- local Figure = char
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- coroutine.resume(coroutine.create(function()
- while true do
- for i,v in pairs(char.Animate:GetChildren()) do
- for i,animation in pairs(v:GetChildren()) do
- animation.AnimationId = "rbxassetid://0"
- dooo = char.Humanoid:LoadAnimation(animation)
- dooo:Stop()
- end
- end
- wait(0.0001)
- end
- end))
- -- animations --
- 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 = char.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 = char
- 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 = char
- 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 = char
- --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 char:FindFirstChild("IsLocalEnemy") == nil and char: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 (char.IsOnTeam.Value == true and IsInCombat == false and char.IsOnTeam.Team.Value == Tag.Value.TeamColor) or char.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" ..char.Name) ~= nil then
- Tag.Value.Character:FindFirstChild("Loc" ..char.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Tag.Value.Character)
- Found.Name = "Loc" ..char.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif char:FindFirstChild("IsLocalEnemy") == nil and char: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 (char.IsOnTeam.Value == true and IsInCombat == false and char.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or char.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" ..char.Name) ~= nil then
- game.Players[Tag.Value].Character:FindFirstChild("Loc" ..char.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
- Found.Name = "Loc" ..char.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif char:FindFirstChild("IsLocalEnemy") == nil and char: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 (char.IsOnTeam.Value == true and IsInCombat == false and Workspace[Tag.Value].IsOnTeam.Value == true and char.IsOnTeam.Team.Value == Workspace[Tag.Value].IsOnTeam.Team.Value) or char.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" ..char.Name) ~= nil then
- game.Workspace[Tag.Value]:FindFirstChild("Loc" ..char.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
- Found.Name = "Loc" ..char.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif (char:FindFirstChild("IsLocalEnemy") ~= nil or char: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" ..char.Name
- game:GetService("Debris"):AddItem(Found, 3)
- elseif (char:FindFirstChild("IsLocalEnemy") ~= nil or char: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" ..char.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 char.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 char: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 = char
- else
- Base = char.BASE
- Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
- end
- function Jump()
- --char.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
- char.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 = char
- 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, char)
- if TRHit ~= nil then
- Hit = true
- end
- if Tag.Parent ~= nil then
- Tag:Remove()
- end
- if Hit == false and Attempts > 0 and char.Wander.Value == true then
- Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1)
- elseif char.Wander.Value == true then
- local TargetRay = Ray.new(char.Torso.CFrame.p, (CFrame.new(Target).p - char.Torso.CFrame.p).Unit * ((Target - char.Torso.Position).Magnitude - 3))
- local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, char)
- local TrueTarget = char.Torso.Position
- if THit ~= nil then
- for HazardCheck = 1, math.floor((char.Torso.CFrame.p - TPos).Magnitude) do
- local TR2 = Ray.new(char.Torso.CFrame.p + (TPos - char.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - char.Torso.CFrame.p).Unit * 3)
- local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, char)
- if TH2 ~= nil and TH2.Name ~= "Lava" then
- TrueTarget = TP2
- else
- break
- end
- end
- else
- for HazardCheck = 1, math.floor((char.Torso.CFrame.p - Target).Magnitude) do
- local TR2 = Ray.new(char.Torso.CFrame.p + (Target - char.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - char.Torso.CFrame.p).Unit * 3)
- local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, char)
- if TH2 ~= nil and TH2.Name ~= "Lava" then
- TrueTarget = TP2
- else
- break
- end
- end
- end
- --char.Humanoid:MoveTo(TrueTarget, Current)
- end
- end
- function ZHit(Part)
- if char:FindFirstChild("IsAZombie") ~= nil and char.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)
- char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + 1
- char.Humanoid:TakeDamage(-1)
- end
- end
- char["Right Arm"].Touched:connect(ZHit)
- char["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 char.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(char.Torso.Position.X, 0, char.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(char.Torso.Position.X, 0, char.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(char.PathTo.Value.X, 0, char.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(char.PathTo.Value.X, 0, char.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(char.Torso.Position.X, 0, char.Torso.Position.Z)).Unit
- while (Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do
- --char.Humanoid:MoveTo(pTo, Base)
- Timer = Timer - 1
- if Timer == 10 then
- --char.Humanoid.Jump = true
- end
- wait(0.1)
- end
- if Timer == 0 then
- if (Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z) - pTo).Magnitude <= 5 then
- char.Torso.CFrame = char.Torso.CFrame + (pTo - Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z)).Unit * (pTo - Vector3.new(char.Torso.Position.X, 0, char.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 > char.Torso.Position.Y + 2 and X[I].Position.Y - X[I].Size.Y / 2 < char.Torso.Position.Y + 2) or X[I].Position.Y + X[I].Size.Y / 2 < char.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 char.Humanoid.Health > 0 and char:FindFirstChild("IsAZombie") == nil do
- local Distance = 100
- local Target = nil
- IsInCombat = false
- local Players = Workspace:GetChildren()
- for Check = 1, #Players do
- if Players[Check] ~= char and ((Players[Check]:FindFirstChild("Humanoid") ~= nil and (Players[Check]:FindFirstChild("IsAZombie") ~= nil or Players[Check]:FindFirstChild("IsLocalEnemy") ~= nil or char:FindFirstChild("IsLocalEnemy") ~= nil or (char.IsOnTeam.Value == true and Players[Check]:FindFirstChild("IsOnTeam") ~= nil and Players[Check].IsOnTeam.Value == true and char.IsOnTeam.Team.Value ~= Players[Check].IsOnTeam.Team.Value) or (game.Players:GetPlayerFromCharacter(Players[Check]) ~= nil and char.IsOnTeam.Value == true and game.Players:GetPlayerFromCharacter(Players[Check]).Neutral == false and game.Players:GetPlayerFromCharacter(Players[Check]).TeamColor ~= char.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 - char.Torso.Position).Magnitude <= 100 then
- local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - char.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
- 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 == char.IsOnTeam.Team.Value then
- TeamTag = Parts[X]
- end
- end
- end
- if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil or Parts[X] ~= nil or (Players[Check].Torso.Position - (char.Torso.Position + char.Torso.CFrame.lookVector * 50)).Magnitude <= 52 then
- if char.IsOnTeam.Value == false then
- if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil then
- Players[Check]:FindFirstChild("Loc" ..char.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Players[Check])
- Found.Name = "Loc" ..char.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 = char.IsOnTeam.Team.Value
- game:GetService("Debris"):AddItem(Found, 3)
- if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil then
- Players[Check]:FindFirstChild("Loc" ..char.Name):Remove()
- end
- local Found = Instance.new("CFrameValue", Players[Check])
- Found.Name = "Loc" ..char.Name
- game:GetService("Debris"):AddItem(Found, 3)
- end
- end
- if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil and (Players[Check].Torso.Position - char.Torso.Position).Magnitude <= Distance then
- Target = Players[Check].Torso
- Distance = (Target.Position - char.Torso.Position).Magnitude
- end
- end
- end
- end
- if Target == nil then
- local HasTool = false
- local ToolCheck = char: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 - char.Torso.Position).Magnitude <= Distance then
- local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - char.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
- Distance = (Players[Check].Handle.Position - char.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 = char
- 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 - char.Torso.Position).Magnitude <= Distance then
- local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].CFrame.p - char.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
- if Hit ~= nil and Hit == Players[Check] then
- Target = Players[Check]
- Distance = (Target.Position - char.Torso.Position).Magnitude
- end
- end
- end
- if Target ~= nil then
- --char.Humanoid:MoveTo(Target.Position, Target)
- if (Target.Position - char.Torso.Position).Magnitude <= 10 then
- Target.OpenCrate.Value = true
- end
- else
- local HasHat = false
- local HatCheck = char: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 - char.Torso.Position).Magnitude <= Distance then
- local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - char.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
- if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
- Distance = (Players[Check].Handle.Position - char.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 = char
- HasHat = true
- else
- Prep(Target.Handle.Position, Base)
- end
- else
- if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
- if char.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(char.PathTo.Value)
- char.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and char.Wander.Value == true then
- Prep(char.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] ~= char 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 - char.Torso.Position).Magnitude <= Distance then
- local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - char.Torso.CFrame.p).Unit * 100)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
- 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 - char.Torso.Position).Magnitude
- end
- end
- end
- if Target ~= nil then
- local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 10
- Prep(Position, Base)
- else
- if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
- if char.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(char.PathTo.Value)
- char.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and char.Wander.Value == true then
- Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- end
- else
- if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
- if char.PathTo.Value ~= Vector3.new(0, 0, 0) then
- GenerateMap(char.PathTo.Value)
- char.PathTo.Value = Vector3.new(0, 0, 0)
- elseif math.random(1, 10) == 1 and char.Wander.Value == true then
- Prep(char.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 = char: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 - char.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 + (char.Torso.Position - Target.Position).Unit * 40, Base)
- if (Target.Position - char.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 + (char.Torso.Position - Target.Position).Unit * 30, Base)
- if (Target.Position - char.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 + (char.Torso.Position - Target.Position).Unit * 20, Base)
- if (Target.Position - char.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 + (char.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 + (char.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 + (char.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 + (char.Torso.Position - Target.Position).Unit * (char.Torso.Position - Target.Position).Magnitude + Target.Velocity
- --char.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 + (char.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 + (char.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 + (char.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 + (char.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) - char.Torso.Position).Magnitude / 8, math.random(-2, 2))
- wait()
- Weapon.Active.Value = true
- end
- elseif Weapon.Type.Value == "HealDrink" then
- local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 120
- Prep(Position, Base)
- if char.Humanoid.Health < char.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 + (char.Torso.Position - Target.Position).Unit * 100
- Prep(Position, Base)
- else
- local Position = Target.Position + (char.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 + (char.Torso.Position - Target.Position).Unit * 80, Base)
- wait(0.5)
- end
- end
- elseif Weapon.Type.Value == "Backstab" then
- if Distance >= 10 then
- if (char.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then
- Prep(Target.Position, Target)
- else
- if (char.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then
- Prep(Target.Position, Base)
- local backstab_time = 20
- while backstab_time > 1 and (char.Torso.Position - Target.Position).Magnitude >= 4 do
- wait(0.1)
- backstab_time = backstab_time - 1
- end
- if (char.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 + (char.Torso.Position - Target.Position).Unit * 100, Base)
- elseif Distance <= 80 and Distance >= 40 then
- Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * ((char.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 + (char.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 = char:GetChildren()
- for Check = 1, #ToolCheck do
- if ToolCheck[Check].ClassName == "Tool" then
- Weapon = ToolCheck[Check]
- end
- end
- if Weapon ~= nil and char.DropWeapon.Value == true then
- Weapon.Parent = Workspace
- elseif Weapon ~= nil then
- Weapon:Remove()
- end
- if char:FindFirstChild("IsAZombie") ~= nil then
- char.Name = "New Zombie"
- char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100)))
- wait()
- char.Humanoid.Health = char.Humanoid.MaxHealth
- char.Humanoid.WalkSpeed = char.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 char:FindFirstChild("Humanoid") ~= nil and char.Humanoid.Health > 0 do
- char.Humanoid.MaxHealth = math.max(0, char.Humanoid.MaxHealth - 1)
- char.Humanoid.Health = math.min(char.Humanoid.Health, char.Humanoid.MaxHealth)
- wait(1)
- end
- end)
- while char.Humanoid.Health > 0 and char: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 - char.Torso.Position).Magnitude <= 100 then
- local ZRay = Ray.new(char.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - char.Torso.CFrame.p).Unit * 100)
- local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, char)
- 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 - char.Torso.Position).Magnitude <= Distance then
- Target = Players[Check].Torso
- Distance = (Target.Position - char.Torso.Position).Magnitude
- end
- end
- end
- end
- if Target == nil then
- if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
- if math.random(1, 10) == 1 and char.Wander.Value == true then
- Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
- end
- else
- Jump()
- end
- elseif char.Wander.Value == true then
- --char.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 = char: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
- 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 char.IsOnTeam.Value == true then
- SColor = char.IsOnTeam.Team.Value
- PColor = SColor
- if char.IsOnTeam.ShowTag.Value == true then
- char.Name = char.Name .." [" ..char.IsOnTeam.Team.Value.Name .."]"
- end
- end
- char.Head.BrickColor = char["Body Colors"].HeadColor
- char["Left Arm"].BrickColor = char["Body Colors"].LeftArmColor
- char["Left Leg"].BrickColor = char["Body Colors"].LeftLegColor
- char["Right Arm"].BrickColor = char["Body Colors"].RightArmColor
- char["Right Leg"].BrickColor = char["Body Colors"].RightLegColor
- char.Torso.BrickColor = char["Body Colors"].TorsoColor
- if char["Force_Weapon"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(char["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 = char
- char.DropWeapon.Value = false
- end
- end
- end
- if char["Force_Hat"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(char["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 = char
- end
- end
- end
- if char["Force_Shirt"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(char["Force_Shirt"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Shirt" then
- c[i].Parent = char
- end
- end
- end
- if char["Force_Pants"].Value ~= 0 then
- local x = game:GetService("InsertService"):LoadAsset(char["Force_Pants"].Value)
- local c = x:GetChildren()
- for i = 1, #c do
- if c[i].ClassName == "Pants" then
- c[i].Parent = char
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement