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