Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- do print("FE Compatibility code by Mokiros")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 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")
- Model1 = Instance.new("Model")
- Part2 = Instance.new("Part")
- SpecialMesh3 = Instance.new("SpecialMesh")
- Decal4 = Instance.new("Decal")
- Script5 = Instance.new("Script")
- Script6 = Instance.new("Script")
- Weld7 = Instance.new("Weld")
- Weld8 = Instance.new("Weld")
- Part9 = Instance.new("Part")
- Motor6D10 = Instance.new("Motor6D")
- Motor6D11 = Instance.new("Motor6D")
- Weld12 = Instance.new("Weld")
- Weld13 = Instance.new("Weld")
- Script14 = Instance.new("Script")
- Part15 = Instance.new("Part")
- Script16 = Instance.new("Script")
- Part17 = Instance.new("Part")
- Weld18 = Instance.new("Weld")
- Script19 = Instance.new("Script")
- Part20 = Instance.new("Part")
- Script21 = Instance.new("Script")
- Part22 = Instance.new("Part")
- Script23 = Instance.new("Script")
- Humanoid24 = Instance.new("Humanoid")
- Hat25 = Instance.new("Hat")
- Part26 = Instance.new("Part")
- SpecialMesh27 = Instance.new("SpecialMesh")
- Script28 = Instance.new("Script")
- Part29 = Instance.new("Part")
- Sound30 = Instance.new("Sound")
- Sound31 = Instance.new("Sound")
- Script32 = Instance.new("Script")
- Script33 = Instance.new("Script")
- Hat34 = Instance.new("Hat")
- Part35 = Instance.new("Part")
- SpecialMesh36 = Instance.new("SpecialMesh")
- Part37 = Instance.new("Part")
- SpecialMesh38 = Instance.new("SpecialMesh")
- Script39 = Instance.new("Script")
- Pants40 = Instance.new("Pants")
- Shirt41 = Instance.new("Shirt")
- Script42 = Instance.new("Script")
- Script43 = Instance.new("Script")
- Script44 = Instance.new("Script")
- BillboardGui45 = Instance.new("BillboardGui")
- TextLabel46 = Instance.new("TextLabel")
- Script47 = Instance.new("Script")
- Script48 = Instance.new("Script")
- Sound49 = Instance.new("Sound")
- Model0.Name = "Communist Spawner"
- Model0.Parent = mas
- Model1.Name = "Communist"
- Model1.Parent = Model0
- Model1.PrimaryPart = Part2
- Part2.Name = "Head"
- Part2.Parent = Model1
- Part2.BrickColor = BrickColor.new("Light orange")
- Part2.FormFactor = Enum.FormFactor.Symmetric
- Part2.Size = Vector3.new(2, 1, 1)
- Part2.CFrame = CFrame.new(-8.05184364, 1038.06909, -2.08751607, 1, 0, 3.70398773e-17, 0, 1, 0, 3.70398773e-17, 0, 1)
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part2.Position = Vector3.new(-8.05184364, 1038.06909, -2.08751607)
- Part2.Color = Color3.new(0.917647, 0.721569, 0.572549)
- SpecialMesh3.Parent = Part2
- SpecialMesh3.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh3.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal4.Parent = Part2
- Decal4.Texture = "http://www.roblox.com/asset/?id=221967384"
- Script5.Parent = Part2
- table.insert(cors,sandbox(Script5,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Script6.Name = "PlaySounds"
- Script6.Parent = Part2
- table.insert(cors,sandbox(Script6,function()
- zombieParent = false
- local soundIds = {113306429,111896685,113306429}
- local sounds = {}
- for i=1,#soundIds do
- local s = Instance.new("Sound")
- s.SoundId = "http://www.roblox.com/asset/?id=" .. soundIds[i]
- s.Volume = 1
- s.Parent = script.Parent
- sounds[#sounds + 1] = s
- end
- while zombieParent == false do
- wait(1)
- if script.Parent.Name == "Head" then
- zombieParent = true
- end
- end
- while true do
- wait(math.random(20,35))
- local i = math.random(1, #sounds)
- sounds[i].Pitch = 1
- sounds[i]:Play()
- end
- end))
- Weld7.Name = "HeadWeld"
- Weld7.Parent = Part2
- Weld7.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld7.C1 = CFrame.new(0, 0.349999994, 0, 1, 0, -0, 0, 0.995037258, 0.0995037109, 0, -0.0995037258, 0.995037138)
- Weld7.Part0 = Part2
- Weld7.Part1 = Part26
- Weld8.Name = "HeadWeld"
- Weld8.Parent = Part2
- Weld8.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld8.C1 = CFrame.new(0, -0.100000001, 0, 1, 0, -0, 0, 0.995037258, 0.0995037109, 0, -0.0995037258, 0.995037138)
- Weld8.Part0 = Part2
- Weld8.Part1 = Part35
- Part9.Name = "Torso"
- Part9.Parent = Model1
- Part9.BrickColor = BrickColor.new("Light orange")
- Part9.FormFactor = Enum.FormFactor.Symmetric
- Part9.Size = Vector3.new(2, 2, 1)
- Part9.CFrame = CFrame.new(-8.05184364, 1036.56909, -2.08751607, 1, 0, 1.23466252e-17, 0, 1, 0, 1.23466252e-17, 0, 1)
- Part9.LeftSurface = Enum.SurfaceType.Weld
- Part9.RightSurface = Enum.SurfaceType.Weld
- Part9.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part9.Position = Vector3.new(-8.05184364, 1036.56909, -2.08751607)
- Part9.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Motor6D10.Name = "Right Hip"
- Motor6D10.Parent = Part9
- Motor6D10.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D10.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D10.Part0 = Part9
- Motor6D10.Part1 = Part22
- Motor6D10.MaxVelocity = 0.10000000149012
- Motor6D11.Name = "Left Hip"
- Motor6D11.Parent = Part9
- Motor6D11.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D11.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D11.Part0 = Part9
- Motor6D11.Part1 = Part20
- Motor6D11.MaxVelocity = 0.10000000149012
- Weld12.Parent = Part9
- Weld12.C1 = CFrame.new(0.800000012, 0.5, 0.400000006, 0.766044438, 0, 0.642787576, -0.642787576, 1.19248806e-08, 0.766044438, -7.66516539e-09, -1, 9.13498877e-09)
- Weld12.Part0 = Part9
- Weld12.Part1 = Part15
- Weld13.Parent = Part9
- Weld13.C1 = CFrame.new(-1.20000005, 0.5, 0.400000006, 0.99619472, 0, -0.087155737, 0.087155737, 1.19248806e-08, 0.99619472, 1.03932174e-09, -1, 1.18795027e-08)
- Weld13.Part0 = Part9
- Weld13.Part1 = Part17
- Script14.Parent = Part9
- table.insert(cors,sandbox(Script14,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Part15.Name = "Left Arm"
- Part15.Parent = Model1
- Part15.BrickColor = BrickColor.new("Light orange")
- Part15.Rotation = Vector3.new(90, 0, 40)
- Part15.CanCollide = false
- Part15.FormFactor = Enum.FormFactor.Symmetric
- Part15.Size = Vector3.new(1, 2, 1)
- Part15.CFrame = CFrame.new(-8.34328556, 1036.96912, -2.98476839, 0.766044438, -0.642787576, -7.66516539e-09, 0, 1.19248806e-08, -1, 0.642787576, 0.766044438, 9.13498877e-09)
- Part15.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part15.Position = Vector3.new(-8.34328556, 1036.96912, -2.98476839)
- Part15.Orientation = Vector3.new(90, -40, 0)
- Part15.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Script16.Parent = Part15
- table.insert(cors,sandbox(Script16,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Part17.Name = "Right Arm"
- Part17.Parent = Model1
- Part17.BrickColor = BrickColor.new("Light orange")
- Part17.Rotation = Vector3.new(90, 0, -5)
- Part17.CanCollide = false
- Part17.FormFactor = Enum.FormFactor.Symmetric
- Part17.Size = Vector3.new(1, 2, 1)
- Part17.CFrame = CFrame.new(-6.8999877, 1036.96912, -2.69020033, 0.99619472, 0.087155737, 1.03932174e-09, 0, 1.19248806e-08, -1, -0.087155737, 0.99619472, 1.18795027e-08)
- Part17.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part17.Position = Vector3.new(-6.8999877, 1036.96912, -2.69020033)
- Part17.Orientation = Vector3.new(90, 5, 0)
- Part17.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Weld18.Name = "RightGrip"
- Weld18.Parent = Part17
- Weld18.C0 = CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, 0)
- Weld18.C1 = CFrame.new(0, -0.200000003, 0.200000003, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Weld18.Part0 = Part17
- Weld18.Part1 = Part29
- Script19.Parent = Part17
- table.insert(cors,sandbox(Script19,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Part20.Name = "Left Leg"
- Part20.Parent = Model1
- Part20.BrickColor = BrickColor.new("Light orange")
- Part20.CanCollide = false
- Part20.FormFactor = Enum.FormFactor.Symmetric
- Part20.Size = Vector3.new(1, 2, 1)
- Part20.CFrame = CFrame.new(-8.55184364, 1034.56909, -2.08751607, 1, 0, 1.23466252e-17, 0, 1, 0, 1.23466252e-17, 0, 1)
- Part20.BottomSurface = Enum.SurfaceType.Smooth
- Part20.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part20.Position = Vector3.new(-8.55184364, 1034.56909, -2.08751607)
- Part20.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Script21.Parent = Part20
- table.insert(cors,sandbox(Script21,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Part22.Name = "Right Leg"
- Part22.Parent = Model1
- Part22.BrickColor = BrickColor.new("Light orange")
- Part22.CanCollide = false
- Part22.FormFactor = Enum.FormFactor.Symmetric
- Part22.Size = Vector3.new(1, 2, 1)
- Part22.CFrame = CFrame.new(-7.55184364, 1034.56909, -2.08751607, 1, 0, 1.23466252e-17, 0, 1, 0, 1.23466252e-17, 0, 1)
- Part22.BottomSurface = Enum.SurfaceType.Smooth
- Part22.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part22.Position = Vector3.new(-7.55184364, 1034.56909, -2.08751607)
- Part22.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Script23.Parent = Part22
- table.insert(cors,sandbox(Script23,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Humanoid24.Name = "Zombie"
- Humanoid24.Parent = Model1
- Humanoid24.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid24.RightLeg = Part22
- Humanoid24.LeftLeg = Part20
- Humanoid24.Torso = Part9
- Humanoid24.Health = 135
- Humanoid24.MaxHealth = 135
- Humanoid24.WalkSpeed = 18
- Hat25.Name = "Millitary Beanie"
- Hat25.Parent = Model1
- Hat25.AttachmentForward = Vector3.new(0, -0.0995037109, -0.995037138)
- Hat25.AttachmentPos = Vector3.new(0, 0.349999994, 0)
- Hat25.AttachmentUp = Vector3.new(0, 0.995037258, -0.0995037258)
- Part26.Name = "Handle"
- Part26.Parent = Hat25
- Part26.BrickColor = BrickColor.new("Bright red")
- Part26.Rotation = Vector3.new(5.71000004, 0, 0)
- Part26.CanCollide = false
- Part26.FormFactor = Enum.FormFactor.Symmetric
- Part26.Size = Vector3.new(1, 1, 1)
- Part26.CFrame = CFrame.new(-8.05184364, 1038.22083, -2.12234235, 1, 3.68560538e-18, 3.68560546e-17, 0, 0.995037258, -0.0995037258, 3.70398773e-17, 0.0995037109, 0.995037138)
- Part26.BottomSurface = Enum.SurfaceType.Smooth
- Part26.TopSurface = Enum.SurfaceType.Smooth
- Part26.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Part26.Position = Vector3.new(-8.05184364, 1038.22083, -2.12234235)
- Part26.Orientation = Vector3.new(5.71000004, 0, 0)
- Part26.Color = Color3.new(0.768628, 0.156863, 0.109804)
- SpecialMesh27.Parent = Part26
- SpecialMesh27.MeshId = "http://www.roblox.com/asset/?id=9466401"
- SpecialMesh27.Scale = Vector3.new(1, 1.10000002, 0.850000024)
- SpecialMesh27.TextureId = "http://www.roblox.com/asset/?id=9466384"
- SpecialMesh27.MeshType = Enum.MeshType.FileMesh
- SpecialMesh27.Scale = Vector3.new(1, 1.10000002, 0.850000024)
- Script28.Name = "Control"
- Script28.Parent = Model1
- table.insert(cors,sandbox(Script28,function()
- wait(.1)
- local ammo=30 -- How much ammo the Enemy has
- local w=.14
- local r=false
- local t=script.Parent
- Spawn(function()
- local c=t:Clone()
- wait(1)
- t.Humanoid.Died:wait()
- wait(3)
- c.Parent=workspace
- c:MakeJoints()
- t:Destroy()
- end)
- local cf={CFrame.new(.8,.5,.4)*CFrame.Angles(math.rad(270),math.rad(40),0),CFrame.new(-1.2,0.5,0.4)*CFrame.Angles(math.rad(270),math.rad(-5),0)}
- local c=LoadLibrary'RbxUtility'.Create
- local b1=c'Part'{TopSurface=0;BottomSurface=0;Anchored=true;CanCollide=false;BrickColor=BrickColor.White();Size=Vector3.new(.2,.2,1);c'SpecialMesh'{MeshType=6;Scale=Vector3.new(.2,.2,1)}}
- local b2=b1:Clone()
- b1.Name,b2.Name='1','2'
- local mov=c'Part'{Transparency=1;CanCollide=false;Parent=t;Anchored=true}
- local h=t:WaitForChild'Handle'
- local function reload(boo)
- if(boo and ammo~=30)or ammo==0 then
- r=true
- if w then
- w=.03
- end
- h.Reload:Play()
- wait(3) -- How long the Enemy reloads
- ammo=30
- if w then
- w=.14
- end
- r=false
- elseif boo then
- wait(.1)
- end
- end
- local function near()
- local dis,pl=5000,nil -- Range of the Enemy
- for _,v in ipairs(game.Players:GetPlayers())do
- if v.Character and v.Character:FindFirstChild'Humanoid'and v:DistanceFromCharacter(h.Position)<dis then
- dis,pl=v:DistanceFromCharacter(h.Position),v
- end
- end
- if pl then
- return pl.Character:GetModelCFrame(),dis,CFrame.new(pl.Character.Humanoid.WalkToPoint).lookVector
- else
- return nil
- end
- end
- Spawn(function()
- while true do
- t.Humanoid.Jump=false
- while not w do wait(.1)end
- for i=1,math.random(4,9)do
- wait(w)
- end
- end
- end)
- Spawn(function()
- while wait(math.random(2,7)/10)do
- local n=near()
- if n and math.random(1,3)==2 or not n then
- mov.CFrame=t.Torso.CFrame+t.Torso.CFrame.lookVector*Vector3.new(math.random(-25,25),0,math.random(-25,25))
- else
- mov.CFrame=n+Vector3.new((math.random(1,2)==1 and 1 or -1)*math.random(25,50),0,(math.random(1,2)==1 and 1 or -1)*math.random(25,50))
- end
- wait(.1)
- t.Zombie:MoveTo(mov.Position,mov)
- end
- end)
- while true do
- local n,mag,hum=near()
- if n then
- n=n.p
- if not r then
- w=.14
- local dir=h.Position-n
- local tst,_=workspace:FindPartOnRay(Ray.new(t.Torso.Position,(n-t.Torso.Position).Unit*999),t)
- local aim=n+Vector3.new(math.random(-mag*.015,mag*.015),math.random(-mag*.015,mag*.015),math.random(-mag*.015,mag*.015))*(2+math.random())+hum
- if tst and tst.Parent and game.Players:GetPlayerFromCharacter(tst.Parent)then
- wait(.1)
- h.Fire:Play()
- local par,pos=workspace:FindPartOnRay(Ray.new(h.Position,(aim-h.Position).Unit*999),t)
- if par then
- local h=par.Parent:FindFirstChild'Humanoid'or par.Parent.Parent:FindFirstChild'Humanoid'
- if h and h.Health-10>0 then
- h.Health=h.Health-67.5 -- How much damage the gun inflicts
- elseif h then
- h.Health=0
- h.Parent:BreakJoints()
- end
- end
- ammo=ammo-1
- mag=(h.Position-pos).magnitude
- b1.Parent,b2.Parent=t,t
- b1.CFrame,b2.CFrame=CFrame.new(h.Position:Lerp(pos,.3),pos),CFrame.new(pos:Lerp(h.Position,.175),h.Position) -- Gun Accuracy (ONLY EDIT IF YOU KNOW WHAT TO DO)
- b1.Mesh.Scale,b2.Mesh.Scale=Vector3.new(.2,.2,mag*.75),Vector3.new(.2,.2,mag/4)
- Delay(.03,function()b1.Parent=nil wait(.03)b2.Parent=nil end)
- end
- wait(.035) -- How fast the enemy shoots
- if ammo==0 then
- reload()
- end
- end
- else
- reload(true)
- w=false
- end
- end
- -- Dellkiller123
- end))
- Part29.Name = "Handle"
- Part29.Parent = Model1
- Part29.BrickColor = BrickColor.new("Light orange")
- Part29.Transparency = 1
- Part29.Rotation = Vector3.new(-180, 85, 180)
- Part29.CanCollide = false
- Part29.FormFactor = Enum.FormFactor.Symmetric
- Part29.Size = Vector3.new(2, 1, 1)
- Part29.CFrame = CFrame.new(-7.18638229, 1037.16907, -3.66896391, -0.087155737, -1.03932174e-09, 0.99619472, -1.19248806e-08, 1, 0, -0.99619472, -1.18795027e-08, -0.087155737)
- Part29.RightSurface = Enum.SurfaceType.Hinge
- Part29.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part29.Position = Vector3.new(-7.18638229, 1037.16907, -3.66896391)
- Part29.Orientation = Vector3.new(0, 95, 0)
- Part29.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Sound30.Name = "Reload"
- Sound30.Parent = Part29
- Sound30.SoundId = "http://www.roblox.com/asset/?id=132456279"
- Sound30.Volume = 0.10000000149012
- Sound31.Name = "Fire"
- Sound31.Parent = Part29
- Sound31.SoundId = "http://www.roblox.com/asset/?id=139711658"
- Sound31.Volume = 1
- Script32.Parent = Part29
- table.insert(cors,sandbox(Script32,function()
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- humanoid:TakeDamage(25)
- end
- end
- connection = script.Parent.Touched:connect(blow)
- end))
- Script33.Name = "MoneyKill"
- Script33.Parent = Model1
- table.insert(cors,sandbox(Script33,function()
- --[[Edited by kirbycaden to make it easier to work with, original was made by some free modeler. Thank you for using a script
- that.]]--
- Stat2 = true --Make this either true or false depending if you want something else to go be increased in leaderstats.
- StatName = "KOs" --Name of stats.
- IncreaseValue = 1 --Increase in Money/Cash/Points etc.
- Stat2Name = "Kills" --SecondStat name
- IncreaseValue2 = 1 --SecondStat increase value.
- local Humanoid = script.Parent.Zombie --If your zombies have "Zombie" instead of "Humanoid", make this Zombie.
- function PwntX_X()
- local tag = Humanoid:findFirstChild("creator")
- if tag ~= nil then
- if tag.Value ~= nil then
- local Leaderstats = tag.Value:findFirstChild("leaderstats")
- if Leaderstats ~= nil then
- Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue --Change Money to the stat that is increased.
- if Stat2 == true then
- Leaderstats[Stat2Name].Value = Leaderstats[Stat2Name].Value + IncreaseValue2
- wait(0.1)
- script:remove()
- end
- end
- end
- end
- end
- Humanoid.Died:connect(PwntX_X)
- end))
- Hat34.Name = "Millitary Beanie"
- Hat34.Parent = Model1
- Hat34.AttachmentForward = Vector3.new(0, -0.0995037109, -0.995037138)
- Hat34.AttachmentPos = Vector3.new(0, -0.100000001, 0)
- Hat34.AttachmentUp = Vector3.new(0, 0.995037258, -0.0995037258)
- Part35.Name = "Handle"
- Part35.Parent = Hat34
- Part35.BrickColor = BrickColor.new("Bright red")
- Part35.Rotation = Vector3.new(5.71000004, 0, 0)
- Part35.CanCollide = false
- Part35.FormFactor = Enum.FormFactor.Symmetric
- Part35.Size = Vector3.new(1, 1, 1)
- Part35.CFrame = CFrame.new(-8.05184364, 1038.66858, -2.07756567, 1, 3.68560538e-18, 3.68560546e-17, 0, 0.995037258, -0.0995037258, 3.70398773e-17, 0.0995037109, 0.995037138)
- Part35.BottomSurface = Enum.SurfaceType.Smooth
- Part35.TopSurface = Enum.SurfaceType.Smooth
- Part35.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Part35.Position = Vector3.new(-8.05184364, 1038.66858, -2.07756567)
- Part35.Orientation = Vector3.new(5.71000004, 0, 0)
- Part35.Color = Color3.new(0.768628, 0.156863, 0.109804)
- SpecialMesh36.Parent = Part35
- SpecialMesh36.MeshId = "http://www.roblox.com/asset/?id=76696701"
- SpecialMesh36.Scale = Vector3.new(1.26999998, 1.37, 1.26999998)
- SpecialMesh36.TextureId = "http://www.roblox.com/asset/?id=121377688"
- SpecialMesh36.MeshType = Enum.MeshType.FileMesh
- SpecialMesh36.Scale = Vector3.new(1.26999998, 1.37, 1.26999998)
- Part37.Parent = Model1
- Part37.BrickColor = BrickColor.new("Light orange")
- Part37.Rotation = Vector3.new(0, 5, 0)
- Part37.CanCollide = false
- Part37.FormFactor = Enum.FormFactor.Custom
- Part37.Size = Vector3.new(1, 0.200000003, 2)
- Part37.CFrame = CFrame.new(-7.18634081, 1037.76929, -3.66896701, 0.99619472, -1.03932174e-09, 0.087155737, 0, 1, 1.19248806e-08, -0.087155737, -1.18795027e-08, 0.99619472)
- Part37.TopSurface = Enum.SurfaceType.Smooth
- Part37.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part37.Position = Vector3.new(-7.18634081, 1037.76929, -3.66896701)
- Part37.Orientation = Vector3.new(0, 5, 0)
- Part37.Color = Color3.new(0.917647, 0.721569, 0.572549)
- SpecialMesh38.Parent = Part37
- SpecialMesh38.MeshId = "http://www.roblox.com/asset/?id=3824749"
- SpecialMesh38.Offset = Vector3.new(-0.174999997, -0.600000024, -0.174999997)
- SpecialMesh38.Scale = Vector3.new(1.70000005, 1.29999995, 1.10000002)
- SpecialMesh38.TextureId = "http://www.roblox.com/asset/?id=159740858"
- SpecialMesh38.VertexColor = Vector3.new(0.699999988, 0.699999988, 0.699999988)
- SpecialMesh38.MeshType = Enum.MeshType.FileMesh
- SpecialMesh38.Scale = Vector3.new(1.70000005, 1.29999995, 1.10000002)
- Script39.Name = "RaceGenerator"
- Script39.Parent = Model1
- table.insert(cors,sandbox(Script39,function()
- colors={"Brick yellow", "Light orange", "Nougat", "Bright orange"}
- Color=BrickColor.new(colors[math.random(1,6)])
- for i,v in pairs(script.Parent:GetChildren()) do
- if v.Name=='Head' or v.Name=='Right Leg' or v.Name=='Right Arm' or v.Name=='Left Arm' or v.Name=='Left Leg' or v.Name=='Torso' then
- v.BrickColor=Color
- end
- end
- end))
- Pants40.Name = "Pants"
- Pants40.Parent = Model1
- Pants40.PantsTemplate = "http://www.roblox.com/asset/?id=221961768"
- Shirt41.Name = "Shirt"
- Shirt41.Parent = Model1
- Shirt41.ShirtTemplate = "http://www.roblox.com/asset/?id=221961698"
- Script42.Name = "Robot"
- Script42.Parent = Model1
- table.insert(cors,sandbox(Script42,function()
- miked=script.Parent
- itlh=miked.Torso:findFirstChild("Left Hip")
- itlh.Part0=miked.Torso
- itlh.Part1=miked:findFirstChild("Left Leg")
- itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- itrh=miked.Torso:findFirstChild("Right Hip")
- itrh.Part0=miked.Torso
- itrh.Part1=miked:findFirstChild("Right Leg")
- itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- itls=miked.Torso:findFirstChild("Left Shoulder")
- itls.Part1=miked.Torso
- itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- itls.Part0=miked:findFirstChild("Left Arm")
- itrs=miked.Torso:findFirstChild("Right Shoulder")
- itrs.Part1=miked.Torso
- itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- itrs.Part0=miked:findFirstChild("Right Arm")
- miked.Head:makeJoints()
- ------------------
- ------------------
- function waitForChild(parent, childName)
- while true do
- local child = parent:findFirstChild(childName)
- if child then
- return child
- end
- parent.ChildAdded:wait()
- end
- end
- local Figure = script.Parent
- 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"
- local toolAnim = "None"
- local toolAnimTime = 0
- local isSeated = false
- function onRunning(speed)
- if isSeated then return end
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- isSeated = false
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onDancing()
- pose = "Dancing"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- isSeated = true
- pose = "Seated"
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -3.14
- LeftShoulder.DesiredAngle = -3.14
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1
- LeftShoulder.DesiredAngle = -1
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- function moveFloat()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 1.57
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = -1.57
- end
- function moveBoogy()
- while pose=="Boogy" do
- wait(.5)
- RightShoulder.MaxVelocity = 1
- LeftShoulder.MaxVelocity = 1
- RightShoulder.DesiredAngle = -3.14
- LeftShoulder.DesiredAngle = 0
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 0
- wait(.5)
- RightShoulder.MaxVelocity = 1
- LeftShoulder.MaxVelocity = 1
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = -3.14
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 1.57
- end
- end
- function moveZombie()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 1.57
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- function movePunch()
- script.Parent.Torso.Anchored=true
- RightShoulder.MaxVelocity = 60
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -1.57
- LeftShoulder.DesiredAngle = 0
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- wait(1)
- script.Parent.Torso.Anchored=false
- pose="Standing"
- end
- function moveKick()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = 0
- RightHip.MaxVelocity = 40
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 0
- wait(1)
- pose="Standing"
- end
- function moveFly()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = 0
- RightHip.MaxVelocity = 40
- RightHip.DesiredAngle = 1.57
- LeftHip.DesiredAngle = 0
- wait(1)
- pose="Standing"
- end
- function moveClimb()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle = -3.14
- LeftShoulder.DesiredAngle = 3.14
- 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()
- kidTable = Figure:children()
- if (kidTable ~= nil) then
- numKids = #kidTable
- for i=1,numKids do
- if (kidTable[i].className == "Tool") then return kidTable[i] end
- end
- end
- return nil
- end
- function getToolAnim(tool)
- c = tool:children()
- for i=1,#c do
- if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
- return c[i]
- 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 == "Zombie") then
- moveZombie()
- return
- end
- if (pose == "Boogy") then
- moveBoogy()
- return
- end
- if (pose == "Float") then
- moveFloat()
- return
- end
- if (pose == "Punch") then
- movePunch()
- return
- end
- if (pose == "Kick") then
- moveKick()
- return
- end
- if (pose == "Fly") then
- moveFly()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Climbing") then
- moveClimb()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- amplitude = 0.1
- frequency = 1
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- if (pose == "Running") then
- amplitude = 1
- frequency = 9
- elseif (pose == "Dancing") then
- amplitude = 2
- frequency = 16
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- if pose~="Dancing" then
- RightShoulder.DesiredAngle = -desiredAngle
- LeftShoulder.DesiredAngle = desiredAngle
- RightHip.DesiredAngle = -desiredAngle
- LeftHip.DesiredAngle = -desiredAngle
- else
- RightShoulder.DesiredAngle = desiredAngle
- LeftShoulder.DesiredAngle = desiredAngle
- RightHip.DesiredAngle = -desiredAngle
- LeftHip.DesiredAngle = -desiredAngle
- end
- local tool = getTool()
- if tool ~= nil then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject ~= nil then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- -----------------------------------------------------------------------------------------------------------------------
- function unequip()
- local items=script.Parent:children()
- for i=1, #items do
- if items[i].className=="Tool" then items[i]:remove() end
- end
- end
- function onChatted(msg, recipient)
- msg = string.lower(msg)
- if string.match(msg, string.lower(script.Parent.Name))~=nil or string.match(msg, "everyone") then
- if string.match(msg, "equip") then
- if game.Workspace:findFirstChild("Hub") then
- if string.match(msg, "rocket") then unequip()
- game.Workspace.Hub.Rocket:clone().Parent=script.Parent
- elseif string.match(msg, "slingshot") then unequip()
- game.Workspace.Hub.Slingshot:clone().Parent=script.Parent
- elseif string.match(msg, "sword") then unequip()
- game.Workspace.Hub.Sword:clone().Parent=script.Parent
- elseif string.match(msg, "pbg") then unequip()
- game.Workspace.Hub.PBG:clone().Parent=script.Parent
- elseif string.match(msg, "superball") then unequip()
- game.Workspace.Hub.Superball:clone().Parent=script.Parent
- elseif string.match(msg, "trowel") then unequip()
- game.Workspace.Hub.Trowel:clone().Parent=script.Parent
- elseif string.match(msg, "bomb") then unequip()
- game.Workspace.Hub.Bomb:clone().Parent=script.Parent
- end
- end
- end
- if string.match(msg, "unequip") then unequip() end
- if string.match(msg, "run") then onRunning(1) end
- if string.match(msg, "climb") then onClimbing() end
- if string.match(msg, "jump") then onJumping() end
- if string.match(msg, "zombie") then pose="Zombie" end
- if string.match(msg, "disco") then pose="Boogy" end
- if string.match(msg, "float") then pose="Float" end
- if string.match(msg, "punch") then pose="Punch" end
- if string.match(msg, "kick") then pose="Kick" end
- if string.match(msg, "fly") then pose="Fly" end
- if string.match(msg, "heal") then script.Parent.Humanoid.Health=script.Parent.Humanoid.MaxHealth end
- if string.match(msg, "defend") then defence() end
- if string.match(msg, "stop") then pose="Standing"; proxkill=false; following=false; stopmoving() end
- if string.match(msg, "go home") then following=false; gohome() end
- if string.match(msg, "follow") then
- if string.match(msg, "all") then
- followany()
- else
- local egg=game.Players:children()
- for i=1, #egg do
- if string.match(msg, string.lower(egg[i].Name)) then
- follow(egg[i].Name)
- return
- end
- end
- end
- end
- if string.match(msg, "kill") then
- if string.match(msg, "all") then
- attackany()
- else
- local egg=game.Players:children()
- for i=1, #egg do
- if string.match(msg, string.lower(egg[i].Name)) then
- attack(egg[i].Name)
- return
- end
- end
- end
- end
- end
- end
- if game.Players.NumPlayers>1 then
- x=game.Players:children()
- for i=1, #x do
- if script.Parent:findFirstChild("Commander")~=nil then
- if script.Parent.Commander:children()~=nil or script.Parent.Commander:children()>0 then
- local ch=script.Parent.Commander:children()
- for i=1, #ch do
- if string.lower(ch[i].Name)==string.lower(x[i].Name) then
- x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
- end
- end
- elseif string.lower(script.Parent.Commander.Value)==string.lower(x[i].Name) then
- x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
- end
- else
- x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
- end
- end
- end
- function onPlayerEntered(Player)
- while Player.Name==nil do
- wait(2)
- end
- if script.Parent:findFirstChild("Commander")~=nil then
- if script.Parent.Commander:children()~=nil or script.Parent.Commander:children()>0 then
- local ch=script.Parent.Commander:children()
- for i=1, #ch do
- if string.lower(ch[i].Name)==string.lower(Player.Name) then
- Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
- end
- end
- elseif string.lower(script.Parent.Commander.Value)==string.lower(Player.Name) then
- Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
- end
- else
- Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
- end
- end
- game.Players.ChildAdded:connect(onPlayerEntered)
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------------------------------------
- dist=20
- function followany()
- following=true
- while following==true do
- local ch=game.Players:children()
- for i=1, #ch do
- local l=game.Workspace:findFirstChild(ch[i].Name)
- if l~=nil then
- local s=l.Torso
- local p=l.Torso.Position
- local q=script.Parent.Torso.Position
- local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
- if smallest==nil then
- smallest=d
- target=s
- elseif d<smallest then
- smallest=d
- target=s
- end
- end
- end
- if smallest==nil then stopmoving() return end
- if smallest>6*dist then return end
- script.Parent.Humanoid:MoveTo(target.Position, target)
- wait(0.5)
- for i=1, 6 do
- if target.Parent.Humanoid.Health<1 then stopmoving() else wait(0.5) end
- end
- end
- end
- function gohome()
- script.Parent.Humanoid:MoveTo(Vector3.new(0,0,0), game.Workspace.Bases.Base)
- end
- function stopmoving()
- script.Parent.Humanoid:MoveTo(script.Parent.Torso.Position, script.Parent.Torso)
- end
- function follow(name)
- following=true
- local p=game.Workspace:findFirstChild(name)
- if p==nil then return end
- while following==true do
- script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
- wait(0.5)
- for i=1, 3 do
- if p.Humanoid.Health<1 then following=false; stopmoving() return end
- wait(0.5)
- end
- end
- end
- function attack(name)
- if script.Parent:findFirstChild("Sword")~=nil then
- following=true
- local p=game.Workspace:findFirstChild(name)
- if p==nil then return end
- while following==true do
- script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
- wait(0.5)
- for i=1, 3 do
- if p.Humanoid.Health<1 then following=false; stopmoving() return end
- local l=p.Torso.Position
- local q=script.Parent.Torso.Position
- local d=math.sqrt( ((l.x-q.x)^2)+((l.y-q.y)^2)+((l.z-q.z)^2) )
- if d<10 then
- script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso); slash()
- if (q.y-l.y)>3 and (q.y-l.y)<7 then
- script.Parent.Humanoid:MoveTo(p.Torso.Position+Vector3.new(math.random(-4,4),0,math.random(-4,4)), p.Torso);
- end
- end
- wait(1)
- end
- end
- end
- end
- function attackany()
- if script.Parent:findFirstChild("Sword")~=nil then
- following=true
- while following==true do
- local ch=game.Players:children()
- for i=1, #ch do
- local l=game.Workspace:findFirstChild(ch[i].Name)
- if l~=nil then
- local s=l.Torso
- local p=l.Torso.Position
- local q=script.Parent.Torso.Position
- local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
- if smallest==nil then
- smallest=d
- target=s
- elseif d<smallest then
- smallest=d
- target=s
- end
- end
- end
- if smallest==nil then stopmoving() return end
- if smallest>6*dist then return end
- script.Parent.Humanoid:MoveTo(target.Position, target)
- if smallest<10 then
- slash()
- end
- if target.Parent==nil then stopmoving() return end
- wait(0.5)
- for i=1, 3 do
- if target.Parent.Humanoid.Health<1 then
- stopmoving()
- else
- local p=target.Position
- local q=script.Parent.Torso.Position
- local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
- if d<10 then
- script.Parent.Humanoid:MoveTo(target.Position, target); slash()
- if (q.y-p.y)>3 and (q.y-p.y)<7 then
- script.Parent.Humanoid:MoveTo(p.Torso.Position+Vector3.new(math.random(-4,4),0,math.random(-4,4)), p.Torso);
- end
- end
- wait(1)
- end
- end
- end
- end
- end
- function patrol()
- if points==nil then
- points=0
- if game.Workspace:findFirstChild("pp1")~=nil then
- pp1=game.Workspace:findFirstChild("pp1")
- local points=points+1
- if game.Workspace:findFirstChild("pp2")~=nil then
- pp2=game.Workspace:findFirstChild("pp2")
- local points=points+1
- if game.Workspace:findFirstChild("pp3")~=nil then
- pp3=game.Workspace:findFirstChild("pp3")
- local points=points+1
- if game.Workspace:findFirstChild("pp4")~=nil then
- pp4=game.Workspace:findFirstChild("pp4")
- local points=points+1
- if game.Workspace:findFirstChild("pp5")~=nil then
- pp5=game.Workspace:findFirstChild("pp5")
- local points=points+1
- if game.Workspace:findFirstChild("pp6")~=nil then
- pp6=game.Workspace:findFirstChild("pp6")
- local points=points+1
- if game.Workspace:findFirstChild("pp7")~=nil then
- pp7=game.Workspace:findFirstChild("pp7")
- local points=points+1
- if game.Workspace:findFirstChild("pp8")~=nil then
- pp8=game.Workspace:findFirstChild("pp8")
- local points=points+1
- if game.Workspace:findFirstChild("pp9")~=nil then
- pp9=game.Workspace:findFirstChild("pp9")
- local points=points+1
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- if points<1 then return end
- patrolling=true
- local time=2
- if points==1 then return end
- if points>1 then
- while patrolling==true do
- script.Parent.Humanoid:MoveTo(pp1.Position, pp1)
- wait(time)
- script.Parent.Humanoid:MoveTo(pp2.Position, pp2)
- wait(time)
- if points>2 then
- script.Parent.Humanoid:MoveTo(pp3.Position, pp3)
- wait(time)
- if points>3 then
- script.Parent.Humanoid:MoveTo(pp4.Position, pp4)
- wait(time)
- if points>4 then
- script.Parent.Humanoid:MoveTo(pp5.Position, pp5)
- wait(time)
- if points>5 then
- script.Parent.Humanoid:MoveTo(pp6.Position, pp6)
- wait(time)
- if points>6 then
- script.Parent.Humanoid:MoveTo(pp7.Position, pp7)
- wait(time)
- if points>7 then
- script.Parent.Humanoid:MoveTo(pp8.Position, pp8)
- wait(time)
- if points>8 then
- script.Parent.Humanoid:MoveTo(pp9.Position, pp9)
- wait(time)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- function goto(pos,part)
- while true do
- end
- end
- function slash()
- for i=1, 3 do
- wait(.3)
- RightShoulder.MaxVelocity = 2
- LeftShoulder.MaxVelocity = 1
- RightShoulder.DesiredAngle = -2.14
- LeftShoulder.DesiredAngle = 0
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- wait(.2)
- RightShoulder.MaxVelocity = 2
- LeftShoulder.MaxVelocity = 1
- RightShoulder.DesiredAngle = 0
- LeftShoulder.DesiredAngle = 0
- RightHip.DesiredAngle = 0
- LeftHip.DesiredAngle = 0
- end
- end
- function defence()
- proxkill=true
- while proxkill==true do
- local ch=game.Players:children()
- for i=1, #ch do
- local p=game.Workspace:findFirstChild(ch[i].Name)
- if p~=nil then
- local p=p.Torso.Position
- local q=script.Parent.Torso.Position
- local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
- if d<dist and d>8 then
- local ex=Instance.new("Explosion")
- ex.Position=p
- ex.Parent=game.Workspace
- end
- end
- end
- wait(1)
- 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)
- --[[
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- 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)
- --]]
- local nextTime = 0
- local runService = game:service("RunService");
- while Figure.Parent~=nil do
- time = runService.Stepped:wait()
- if time > nextTime then
- move(time)
- nextTime = time + 0.1
- end
- end
- end))
- Script43.Name = "spawnHandler"
- Script43.Parent = Model1
- table.insert(cors,sandbox(Script43,function()
- local NPC = script.Parent
- local cln=NPC:Clone()
- local Config = NPC.Configuration
- local Head, Torso, LArm, RArm, LLeg, RLeg = NPC.Head, NPC.Torso, NPC['Left Arm'], NPC['Right Arm'], NPC['Left Leg'], NPC['Right Leg'];
- local Humanoid;
- print('Starting bot setup')
- -- Preset config
- Config.HumanoidReady.Value = false;
- -- Make sure parts are anchored
- function anchor(bool)
- for _,child in pairs(script.Parent:GetChildren()) do
- if child:IsA('Part') and child.Name~='MoveHere' then
- child.Anchored=bool
- end
- end
- end
- anchor(true)
- function Join(MainPart, LegacyPart, Parent, C0, C1)
- local Joint = Instance.new("Motor");
- Joint.Part0 = MainPart
- Joint.Part1 = LegacyPart
- Joint.C0 = C0
- Joint.C1 = C1
- Joint.Parent = Parent -- !Important: Without parenting last, the C1 and C0 will take affect and prematurely move the parts.
- return Joint;
- end
- for _,child in pairs(script.Parent:children()) do
- if child:IsA('Part') then
- Join(Torso,child,Torso,CFrame.new(),child.CFrame:toObjectSpace(Torso.CFrame))
- end
- end
- -- -- Build NPC
- -- --Join(script.Parent['Right Arm'],script.Parent.Handle, script.Parent['Right Arm'] ,CFrame.new(),script.Parent.Handle.CFrame:toObjectSpace(script.Parent['Right Arm'].CFrame));
- -- print('Welded Gun')
- -- Join(Torso,script.Parent.Hat1, Torso,CFrame.new(),script.Parent.Hat1.CFrame:toObjectSpace(Torso.CFrame));
- -- Join(Torso,script.Parent.Hat2, Torso,CFrame.new(),script.Parent.Hat2.CFrame:toObjectSpace(Torso.CFrame));
- -- Join(Torso, Head, Torso, CFrame.new(), Head.CFrame:toObjectSpace(Torso.CFrame));
- -- Join(Torso, script.Parent['Left Arm'], Torso, CFrame.new(), script.Parent['Left Arm'].CFrame:toObjectSpace(Torso.CFrame));
- -- Join(Torso, script.Parent['Right Arm'], Torso, CFrame.new(), script.Parent['Right Arm'].CFrame:toObjectSpace(Torso.CFrame));
- -- Join(Torso, LLeg, Torso, CFrame.new(0.5,-1,0), CFrame.new(0,1,0));
- -- Join(Torso, RLeg, Torso, CFrame.new(-0.5,-1,0), CFrame.new(0,1,0));
- Humanoid = Instance.new("Humanoid");
- Humanoid.Name = "Zombie";
- Humanoid.Parent = NPC;
- Config.HumanoidReady.Value = true;
- wait()
- anchor(false)
- Humanoid.Died:connect(function()
- wait(3)
- local np=cln
- cln.Parent=workspace
- NPC:Remove()
- end)
- end))
- Script44.Name = "RealisticGraphicsDay/Night"
- Script44.Parent = Model1
- BillboardGui45.Parent = Model1
- BillboardGui45.Size = UDim2.new(0, 200, 0, 50)
- BillboardGui45.ExtentsOffset = Vector3.new(0, 0.5, 0)
- TextLabel46.Parent = BillboardGui45
- TextLabel46.Transparency = 1
- TextLabel46.Size = UDim2.new(0, 200, 0, 50)
- TextLabel46.Text = "TIME FOR COMMUNISM"
- TextLabel46.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel46.BackgroundTransparency = 1
- TextLabel46.BorderSizePixel = 0
- TextLabel46.Font = Enum.Font.Fantasy
- TextLabel46.FontSize = Enum.FontSize.Size24
- TextLabel46.TextColor3 = Color3.new(0.470588, 0.0470588, 0.0470588)
- TextLabel46.TextStrokeColor3 = Color3.new(0.454902, 0.12549, 0)
- TextLabel46.TextWrapped = true
- Script47.Parent = Model1
- table.insert(cors,sandbox(Script47,function()
- txt=script.Parent.BillboardGui.TextLabel
- while true do
- txt.Text="T34 caN beAt the TigER"
- wait(1)
- txt.Text="ITS LENNIN TIME"
- wait(1)
- txt.Text="REEEEE"
- wait(1)
- txt.Text="CHEEKI BREEKI TIME"
- wait(1)
- txt.Text="BLYAT"
- wait(1)
- txt.Text="CAPITLSIT PIG DOG"
- wait(1)
- txt.Text="SOVIET UNION STRONK"
- wait(1)
- txt.Text="CAPITLISM IS BAD"
- wait(1)
- txt.Text="CYKA BYLAT"
- wait(1)
- txt.Text="HAIL COMRADE STALIN"
- wait(1)
- txt.Text="COMMUNISM WORKS"
- wait(1)
- end
- end))
- Script48.Name = "Respawn"
- Script48.Parent = Model0
- table.insert(cors,sandbox(Script48,function()
- name="Zombie"
- robo=script.Parent.Communist:clone()
- while true do
- wait(3)
- robot=robo:clone()
- robot.Parent=script.Parent.Parent
- robot:makeJoints()
- end
- end))
- Sound49.Name = "RussianMusic"
- Sound49.Parent = Model0
- Sound49.SoundId = "rbxassetid://755194793"
- Sound49.Playing = true
- Sound49.Looped = true
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement