Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Decal2 = Instance.new("Decal")
- SpecialMesh3 = Instance.new("SpecialMesh")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Sound6 = Instance.new("Sound")
- Part7 = Instance.new("Part")
- Motor6D8 = Instance.new("Motor6D")
- Part9 = Instance.new("Part")
- SpecialMesh10 = Instance.new("SpecialMesh")
- Part11 = Instance.new("Part")
- SpecialMesh12 = Instance.new("SpecialMesh")
- Part13 = Instance.new("Part")
- SpecialMesh14 = Instance.new("SpecialMesh")
- Part15 = Instance.new("Part")
- SpecialMesh16 = Instance.new("SpecialMesh")
- Humanoid17 = Instance.new("Humanoid")
- Model18 = Instance.new("Model")
- Part19 = Instance.new("Part")
- Decal20 = Instance.new("Decal")
- Motor6D21 = Instance.new("Motor6D")
- Motor6D22 = Instance.new("Motor6D")
- Motor6D23 = Instance.new("Motor6D")
- Motor6D24 = Instance.new("Motor6D")
- Motor6D25 = Instance.new("Motor6D")
- SpecialMesh26 = Instance.new("SpecialMesh")
- Script27 = Instance.new("Script")
- BodyColors28 = Instance.new("BodyColors")
- Script29 = Instance.new("Script")
- ScreenGui30 = Instance.new("ScreenGui")
- Script31 = Instance.new("Script")
- Sound32 = Instance.new("Sound")
- Frame33 = Instance.new("Frame")
- Script34 = Instance.new("Script")
- Script35 = Instance.new("Script")
- Script36 = Instance.new("Script")
- StringValue37 = Instance.new("StringValue")
- Animation38 = Instance.new("Animation")
- StringValue39 = Instance.new("StringValue")
- Animation40 = Instance.new("Animation")
- StringValue41 = Instance.new("StringValue")
- Animation42 = Instance.new("Animation")
- NumberValue43 = Instance.new("NumberValue")
- Animation44 = Instance.new("Animation")
- NumberValue45 = Instance.new("NumberValue")
- StringValue46 = Instance.new("StringValue")
- Animation47 = Instance.new("Animation")
- StringValue48 = Instance.new("StringValue")
- Animation49 = Instance.new("Animation")
- StringValue50 = Instance.new("StringValue")
- Animation51 = Instance.new("Animation")
- StringValue52 = Instance.new("StringValue")
- Animation53 = Instance.new("Animation")
- StringValue54 = Instance.new("StringValue")
- Animation55 = Instance.new("Animation")
- Script56 = Instance.new("Script")
- Animation57 = Instance.new("Animation")
- Camera58 = Instance.new("Camera")
- Model0.Name = "GhostAbomination"
- Model0.Parent = mas
- Model0.PrimaryPart = Part1
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(61.767746, -159.101074, -74.5056076, 0.0413627587, 0.999141395, -0.00233228342, -0.98481977, 0.0411634967, 0.168628141, 0.168579355, -0.0046780468, 0.985676885)
- Part1.Orientation = Vector3.new(-9.71000004, -0.140000001, -87.6100006)
- Part1.Position = Vector3.new(61.767746, -159.101074, -74.5056076)
- Part1.Rotation = Vector3.new(-9.71000004, -0.129999995, -87.6299973)
- Part1.Color = Color3.new(1, 0.8, 0.6)
- Part1.Size = Vector3.new(2, 1, 1)
- Part1.BrickColor = BrickColor.new("Pastel brown")
- Part1.CustomPhysicalProperties = 0.699999988, 0, 0, 1, 1
- Part1.Elasticity = 0
- Part1.Friction = 0
- Part1.Locked = true
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Pastel brown")
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.formFactor = Enum.FormFactor.Symmetric
- Decal2.Name = "face"
- Decal2.Parent = Part1
- SpecialMesh3.Parent = Part1
- SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=126601774"
- SpecialMesh3.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=189929079"
- SpecialMesh3.MeshType = Enum.MeshType.FileMesh
- Sound4.Name = "2"
- Sound4.Parent = Part1
- Sound4.SoundId = "rbxassetid://209120562"
- Sound4.Volume = 1
- Sound5.Name = "1"
- Sound5.Parent = Part1
- Sound5.SoundId = "rbxassetid://209120562"
- Sound5.Volume = 1
- Sound6.Name = "slv_die"
- Sound6.Parent = Part1
- Sound6.SoundId = "rbxassetid://209120593"
- Sound6.Volume = 1
- Part7.Name = "HumanoidRootPart"
- Part7.Parent = Model0
- Part7.CFrame = CFrame.new(62.3288956, -159.123993, -71.9343872, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part7.Position = Vector3.new(62.3288956, -159.123993, -71.9343872)
- Part7.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part7.Transparency = 1
- Part7.Size = Vector3.new(2, 2, 1)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.BrickColor = BrickColor.new("Bright blue")
- Part7.CustomPhysicalProperties = 0.699999988, 0, 0, 1, 1
- Part7.Elasticity = 0
- Part7.Friction = 0
- Part7.LeftParamA = 0
- Part7.LeftParamB = 0
- Part7.Locked = true
- Part7.RightParamA = 0
- Part7.RightParamB = 0
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.brickColor = BrickColor.new("Bright blue")
- Part7.FormFactor = Enum.FormFactor.Symmetric
- Part7.formFactor = Enum.FormFactor.Symmetric
- Motor6D8.Name = "RootJoint"
- Motor6D8.Parent = Part7
- Motor6D8.MaxVelocity = 0.10000000149012
- Motor6D8.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D8.C1 = CFrame.new(0, -9.31322575e-10, -0.332509816, -1, -0, 0, 0, -0.999699414, -0.0245158393, 0, -0.0245158393, 0.999699414)
- Motor6D8.Part0 = Part7
- Motor6D8.Part1 = Part19
- Motor6D8.part1 = Part19
- Part9.Name = "Right Leg"
- Part9.Parent = Model0
- Part9.CFrame = CFrame.new(62.8288956, -160.761353, -71.8360062, 1, -2.77511552e-16, 4.95461293e-18, 2.7747235e-16, 0.999977767, 0.00666642748, -6.80451304e-18, -0.00666642748, 0.999977767)
- Part9.Orientation = Vector3.new(-0.379999995, 0, 0)
- Part9.Position = Vector3.new(62.8288956, -160.761353, -71.8360062)
- Part9.Rotation = Vector3.new(-0.379999995, 0, 0)
- Part9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part9.Size = Vector3.new(1, 2, 1)
- Part9.BottomSurface = Enum.SurfaceType.Smooth
- Part9.BrickColor = BrickColor.new("Really black")
- Part9.CanCollide = false
- Part9.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
- Part9.Elasticity = 0
- Part9.Friction = 2
- Part9.Locked = true
- Part9.brickColor = BrickColor.new("Really black")
- Part9.FormFactor = Enum.FormFactor.Symmetric
- Part9.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh10.Parent = Part9
- SpecialMesh10.MeshId = "http://www.roblox.com/asset/?id=152167904"
- SpecialMesh10.Scale = Vector3.new(0.400000006, 0.300000012, 0.600000024)
- SpecialMesh10.TextureId = "http://www.roblox.com/asset/?id=189963280"
- SpecialMesh10.MeshType = Enum.MeshType.FileMesh
- Part11.Name = "Left Leg"
- Part11.Parent = Model0
- Part11.CFrame = CFrame.new(61.8288956, -160.801682, -73.5468674, 1, 3.09405701e-09, -1.09643787e-10, -3.09542281e-09, 0.998503089, -0.0546938851, -5.97463676e-11, 0.0546938851, 0.998503089)
- Part11.Orientation = Vector3.new(3.1400001, 0, 0)
- Part11.Position = Vector3.new(61.8288956, -160.801682, -73.5468674)
- Part11.Rotation = Vector3.new(3.1400001, 0, 0)
- Part11.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part11.Size = Vector3.new(1, 2, 1)
- Part11.BottomSurface = Enum.SurfaceType.Smooth
- Part11.BrickColor = BrickColor.new("Really black")
- Part11.CanCollide = false
- Part11.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
- Part11.Elasticity = 0
- Part11.Friction = 2
- Part11.Locked = true
- Part11.brickColor = BrickColor.new("Really black")
- Part11.FormFactor = Enum.FormFactor.Symmetric
- Part11.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh12.Parent = Part11
- SpecialMesh12.MeshId = "http://www.roblox.com/asset/?id=152167845"
- SpecialMesh12.Scale = Vector3.new(0.400000006, 0.300000012, 0.600000024)
- SpecialMesh12.TextureId = "http://www.roblox.com/asset/?id=189963280"
- SpecialMesh12.MeshType = Enum.MeshType.FileMesh
- Part13.Name = "Right Arm"
- Part13.Parent = Model0
- Part13.CFrame = CFrame.new(62.566452, -159.759781, -72.2535553, 1, 1.90852524e-16, 3.91499941e-15, 3.59224005e-15, -0.444252521, -0.895901442, 1.56826308e-15, 0.895901442, -0.444252521)
- Part13.Orientation = Vector3.new(63.6199989, 180, 180)
- Part13.Position = Vector3.new(62.566452, -159.759781, -72.2535553)
- Part13.Rotation = Vector3.new(116.379997, 0, 0)
- Part13.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part13.Size = Vector3.new(1, 2, 1)
- Part13.BrickColor = BrickColor.new("Really black")
- Part13.CanCollide = false
- Part13.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
- Part13.Elasticity = 0
- Part13.Friction = 2
- Part13.Locked = true
- Part13.brickColor = BrickColor.new("Really black")
- Part13.FormFactor = Enum.FormFactor.Symmetric
- Part13.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh14.Parent = Part13
- SpecialMesh14.MeshId = "http://www.roblox.com/asset/?id=152066055"
- SpecialMesh14.Scale = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- SpecialMesh14.TextureId = "http://www.roblox.com/asset/?id=189963280"
- SpecialMesh14.MeshType = Enum.MeshType.FileMesh
- Part15.Name = "Left Arm"
- Part15.Parent = Model0
- Part15.CFrame = CFrame.new(61.0088577, -159.243515, -72.8943329, 0.229391053, 0.410681158, 0.882451594, 0.973329604, -0.0939662457, -0.209283918, -0.00302830525, 0.906924069, -0.421283066)
- Part15.Orientation = Vector3.new(12.0799999, 115.519997, 95.5100021)
- Part15.Position = Vector3.new(61.0088577, -159.243515, -72.8943329)
- Part15.Rotation = Vector3.new(153.580002, 61.9399986, -60.8100014)
- Part15.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part15.Size = Vector3.new(1, 2, 1)
- Part15.BrickColor = BrickColor.new("Really black")
- Part15.CanCollide = false
- Part15.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
- Part15.Elasticity = 0
- Part15.Friction = 2
- Part15.Locked = true
- Part15.brickColor = BrickColor.new("Really black")
- Part15.FormFactor = Enum.FormFactor.Symmetric
- Part15.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh16.Parent = Part15
- SpecialMesh16.MeshId = "http://www.roblox.com/asset/?id=152167765"
- SpecialMesh16.Scale = Vector3.new(0.200000003, 1, 0.200000003)
- SpecialMesh16.TextureId = "http://www.roblox.com/asset/?id=189963280"
- SpecialMesh16.MeshType = Enum.MeshType.FileMesh
- Humanoid17.Parent = Model0
- Humanoid17.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- Humanoid17.Health = 500
- Humanoid17.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- Humanoid17.LeftLeg = Part11
- Humanoid17.MaxHealth = 500
- Humanoid17.NameOcclusion = Enum.NameOcclusion.EnemyOcclusion
- Humanoid17.RightLeg = Part9
- Humanoid17.Torso = Part7
- Humanoid17.WalkSpeed = 10
- Humanoid17.maxHealth = 500
- Model18.Name = "Status"
- Model18.Parent = Humanoid17
- Part19.Name = "Torso"
- Part19.Parent = Model0
- Part19.CFrame = CFrame.new(62.3288956, -158.79158, -71.9425354, 1, -0, 0, 0, -0.0245158393, 0.999699414, 0, -0.999699414, -0.0245158393)
- Part19.Orientation = Vector3.new(-88.5999985, 180, 180)
- Part19.Position = Vector3.new(62.3288956, -158.79158, -71.9425354)
- Part19.Rotation = Vector3.new(-91.4000015, 0, 0)
- Part19.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part19.Size = Vector3.new(2, 2, 1)
- Part19.BrickColor = BrickColor.new("Really black")
- Part19.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
- Part19.Elasticity = 0
- Part19.Friction = 2
- Part19.LeftParamA = 0
- Part19.LeftParamB = 0
- Part19.LeftSurface = Enum.SurfaceType.Weld
- Part19.Locked = true
- Part19.RightParamA = 0
- Part19.RightParamB = 0
- Part19.RightSurface = Enum.SurfaceType.Weld
- Part19.brickColor = BrickColor.new("Really black")
- Part19.FormFactor = Enum.FormFactor.Symmetric
- Part19.formFactor = Enum.FormFactor.Symmetric
- Decal20.Name = "roblox"
- Decal20.Parent = Part19
- Decal20.Texture = "http://www.roblox.com/asset/?id=47730520"
- Motor6D21.Name = "Neck"
- Motor6D21.Parent = Part19
- Motor6D21.MaxVelocity = 0.10000000149012
- Motor6D21.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D21.C1 = CFrame.new(0.00611115014, 0.565083683, 1.58772755, -0.0413627587, -0.9886567, -0.14438501, -0.999141395, 0.0412658118, 0.00366748311, 0.00233228342, 0.144412771, -0.989514709)
- Motor6D21.Part0 = Part19
- Motor6D21.Part1 = Part1
- Motor6D21.part1 = Part1
- Motor6D22.Name = "Left Hip"
- Motor6D22.Parent = Part19
- Motor6D22.MaxVelocity = 0.10000000149012
- Motor6D22.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D22.C1 = CFrame.new(-0.499999881, 2.17400312, 2.48885155, -3.09302783e-09, 1.35615297e-10, -1, 0.996862113, -0.079156585, -3.09405701e-09, -0.079156585, -0.996862113, 1.09643787e-10)
- Motor6D22.Part0 = Part19
- Motor6D22.Part1 = Part11
- Motor6D22.part1 = Part11
- Motor6D23.Name = "Right Hip"
- Motor6D23.Parent = Part19
- Motor6D23.MaxVelocity = 0.10000000149012
- Motor6D23.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D23.C1 = CFrame.new(0.5, 1.98828626, 0.906443715, -2.77555783e-16, 0, 1, -0.999840677, -0.0178508721, -2.77511552e-16, 0.0178508721, -0.999840677, 4.95461293e-18)
- Motor6D23.Part0 = Part19
- Motor6D23.Part1 = Part9
- Motor6D23.part1 = Part9
- Motor6D24.Name = "Left Shoulder"
- Motor6D24.Parent = Part19
- Motor6D24.MaxVelocity = 0.10000000149012
- Motor6D24.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D24.C1 = CFrame.new(0.49999994, 0.499999762, 1.11758702e-07, 0.973111331, -0.0208345987, -0.229391053, -0.116172016, -0.904347897, -0.410681158, -0.198892906, 0.426287234, -0.882451594)
- Motor6D24.Part0 = Part19
- Motor6D24.Part1 = Part15
- Motor6D24.part1 = Part15
- Motor6D25.Name = "Right Shoulder"
- Motor6D25.Parent = Part19
- Motor6D25.MaxVelocity = 0.10000000149012
- Motor6D25.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D25.C1 = CFrame.new(0.762441993, -0.593848407, -0.772536874, -3.55271326e-15, -1.65585857e-15, 1, 0.466082782, -0.884741008, 1.90852524e-16, 0.884741008, 0.466082782, 3.91499941e-15)
- Motor6D25.Part0 = Part19
- Motor6D25.Part1 = Part13
- Motor6D25.part1 = Part13
- SpecialMesh26.Parent = Part19
- SpecialMesh26.MeshId = "http://www.roblox.com/asset/?id=53422030 "
- SpecialMesh26.Scale = Vector3.new(2.5, 2.5, 2.5)
- SpecialMesh26.TextureId = "http://www.roblox.com/asset/?id=189963280"
- SpecialMesh26.MeshType = Enum.MeshType.FileMesh
- Script27.Name = "GhostAbominationTargetScript"
- Script27.Parent = Model0
- table.insert(cors,sandbox(Script27,function()
- local GhostAbominationMainScript = script;
- local GhostAbomination = GhostAbominationMainScript.Parent;
- local Head = GhostAbomination:FindFirstChild("Head");
- local HumanoidRootPart = GhostAbomination:FindFirstChild("HumanoidRootPart");
- local LeftArm = GhostAbomination:FindFirstChild("Left Arm");
- local LeftLeg = GhostAbomination:FindFirstChild("Left Leg");
- local RightArm = GhostAbomination:FindFirstChild("Right Arm");
- local RightLeg = GhostAbomination:FindFirstChild("Right Leg");
- local Torso = GhostAbomination:FindFirstChild("Torso");
- local GhostAbominationHumanoid = GhostAbomination:FindFirstChild("Humanoid");
- local RechargeTime = 0;
- for GhostAbominationHealthCheck = 1,5 do
- GhostAbominationHumanoid.Health = GhostAbominationHumanoid.MaxHealth
- Wait(0)
- end
- local SpawnForceField = Instance.new("ForceField")
- SpawnForceField.Name = "SpawnForceField"
- SpawnForceField.Parent = GhostAbomination
- function FindTargetToTerrorise(TargetPosition)
- local PlayerList = Game.Workspace:children();
- local TargetTorso = nil;
- local VisibleDistance = 99999e99999;
- local TempTargetModel = nil;
- local TargetHumanoid = nil;
- local TargetModel = nil;
- for Check = 1, #PlayerList do
- TargetModel = PlayerList[Check]
- if (TargetModel.className == "Model") and (TargetModel ~= GhostAbomination) and (TargetModel.Name ~= GhostAbomination.Name) and (TargetModel.Name ~= "Stranger") and (TargetModel.Name ~= "Twitcher") and (TargetModel.Name ~= "HandCrab") and (TargetModel.Name ~= "David Leatherhoff") then
- TempTargetModel = TargetModel:FindFirstChild("Torso")
- TargetHumanoid = TargetModel:FindFirstChild("Humanoid")
- if (TempTargetModel ~= nil) and (TargetHumanoid ~= nil) and (TargetHumanoid.Health > 0) then
- if (TempTargetModel.Position - TargetPosition).magnitude < VisibleDistance then
- TargetTorso = TempTargetModel
- VisibleDistance = (TempTargetModel.Position - TargetPosition).magnitude
- end
- end
- end
- end
- return TargetTorso
- end
- Wait(5)
- for GhostAbominationHealthCheck = 1,5 do
- GhostAbominationHumanoid.Health = GhostAbominationHumanoid.MaxHealth
- Wait(0)
- end
- HumanoidRootPart.Anchored = false
- SpawnForceField:Destroy()
- while true do
- Wait(0)
- if GhostAbominationHumanoid.Health == 0 or GhostAbominationHumanoid.Health < 0 then
- GhostAbominationHumanoid.WalkSpeed = 0
- Head:FindFirstChild("slv_die"):Play()
- GhostAbomination["GhostAbominationAnimationScript"].Disabled = true
- GhostAbomination["GhostAbominationMeleeAttackScript"].Disabled = true
- GhostAbomination["GhostAbominationTargetScript"].Disabled = true
- Wait(5)
- GhostAbomination:Destroy()
- end
- local GhostAbominationChosenTarget = FindTargetToTerrorise(Torso.Position);
- if GhostAbominationHumanoid.Sit==true then
- GhostAbominationHumanoid.Jump=true
- end
- if GhostAbominationHumanoid.PlatformStand==true then
- GhostAbominationHumanoid.Jump=true
- end
- if GhostAbominationChosenTarget ~= nil then
- --[[GhostAbominationHumanoid:MoveTo(GhostAbominationChosenTarget.Position, GhostAbominationChosenTarget)]]--
- GhostAbominationRadiusXAxis = math.random(-2,2)
- GhostAbominationRadiusYAxis = math.random(-2,2)
- GhostAbominationRadiusZAxis = math.random(-2,2)
- GhostAbominationHumanoid:MoveTo(GhostAbominationChosenTarget.Position+Vector3.new(GhostAbominationRadiusXAxis,GhostAbominationRadiusYAxis,GhostAbominationRadiusZAxis), GhostAbominationChosenTarget)
- end
- end
- end))
- BodyColors28.Parent = Model0
- BodyColors28.HeadColor = BrickColor.new("Pastel brown")
- BodyColors28.HeadColor3 = Color3.new(1, 0.8, 0.6)
- BodyColors28.LeftArmColor = BrickColor.new("Really black")
- BodyColors28.LeftArmColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
- BodyColors28.LeftLegColor = BrickColor.new("Really black")
- BodyColors28.LeftLegColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
- BodyColors28.RightArmColor = BrickColor.new("Really black")
- BodyColors28.RightArmColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
- BodyColors28.RightLegColor = BrickColor.new("Really black")
- BodyColors28.RightLegColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
- BodyColors28.TorsoColor = BrickColor.new("Really black")
- BodyColors28.TorsoColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Script29.Name = "GhostAbominationMeleeAttackScript"
- Script29.Parent = Model0
- table.insert(cors,sandbox(Script29,function()
- local GhostAbominationMainScript = script;
- local GhostAbomination = GhostAbominationMainScript.Parent;
- local Head = GhostAbomination:FindFirstChild("Head");
- local HumanoidRootPart = GhostAbomination:FindFirstChild("HumanoidRootPart");
- local LeftArm = GhostAbomination:FindFirstChild("Left Arm");
- local LeftLeg = GhostAbomination:FindFirstChild("Left Leg");
- local RightArm = GhostAbomination:FindFirstChild("Right Arm");
- local RightLeg = GhostAbomination:FindFirstChild("Right Leg");
- local Torso = GhostAbomination:FindFirstChild("Torso");
- local RechargeTime = 0;
- function FindTargetToTerrorise(TargetPosition)
- local PlayerList = Game.Workspace:children();
- local TargetTorso = nil;
- local AttackDistance = 4;
- local TempTargetModel = nil;
- local TargetHumanoid = nil;
- local TargetModel = nil;
- for Check = 1, #PlayerList do
- TargetModel = PlayerList[Check]
- if (TargetModel.className == "Model") and (TargetModel ~= GhostAbomination) and (TargetModel.Name ~= GhostAbomination.Name) and (TargetModel.Name ~= "Stranger") and (TargetModel.Name ~= "Twitcher") and (TargetModel.Name ~= "HandCrab") and (TargetModel.Name ~= "David Leatherhoff") then
- TempTargetModel = TargetModel:findFirstChild("Torso")
- TargetHumanoid = TargetModel:findFirstChild("Humanoid")
- if (TempTargetModel ~= nil) and (TargetHumanoid ~= nil) and (TargetHumanoid.Health > 0) then
- if (TempTargetModel.Position - TargetPosition).magnitude < AttackDistance then
- TargetTorso = TempTargetModel
- AttackDistance = (TempTargetModel.Position - TargetPosition).magnitude
- end
- end
- end
- end
- return TargetTorso
- end
- while true do
- Wait(0)
- if RechargeTime > 0 then
- RechargeTime = RechargeTime - 1
- end
- local GhostAbominationChosenTarget = FindTargetToTerrorise(Torso.Position);
- if GhostAbominationChosenTarget ~= nil then
- local GhostAbominationDamage = 5
- local GhostAbominationHumanoid = GhostAbomination:FindFirstChild("Humanoid")
- local GhostAbominationCloseAttackAnimation = GhostAbominationHumanoid:LoadAnimation(GhostAbomination.SmackAnim);
- GhostAbominationCloseAttackAnimation:Play()
- GhostAbominationHumanoid.WalkSpeed = 0
- GhostAbominationChosenTarget.Parent.Humanoid:TakeDamage(GhostAbominationDamage)
- if not Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name) then
- GhostAbominationChosenTarget.Parent.Humanoid:TakeDamage(GhostAbominationDamage)
- end
- if Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name) then
- if not Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name).PlayerGui:FindFirstChild("PoisenedGui") then
- local PoisenedGui = script:FindFirstChild("PoisenedGui"):Clone()
- PoisenedGui.Parent = Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name).PlayerGui
- PoisenedGui.PoisenScript.Disabled = false
- else
- GhostAbominationChosenTarget.Parent.Humanoid:TakeDamage(GhostAbominationDamage)
- end
- end
- Wait(0.75)
- GhostAbominationHumanoid.WalkSpeed = 10
- Wait(2)
- end
- end
- end))
- ScreenGui30.Name = "PoisenedGui"
- ScreenGui30.Parent = Script29
- Script31.Name = "PoisenScript"
- Script31.Parent = ScreenGui30
- table.insert(cors,sandbox(Script31,function()
- --[[By: Brutez.]]--
- local CurrentCamera = Game.Workspace.CurrentCamera;
- local PoisendGui = script.Parent;
- local LocalPlayer = PoisendGui.Parent.Parent.Character;
- local LocalPlayerHumanoid = LocalPlayer:FindFirstChild("Humanoid");
- repeat Wait(0) until LocalPlayerHumanoid ~= nil
- PoisendGui:FindFirstChild("ear_ringing"):Play()
- for PlayerHurt = 1,6 do
- LocalPlayerHumanoid:TakeDamage(5)
- Wait(2)
- end
- for Fade = 1,5 do
- PoisendGui:FindFirstChild("RedFrame").BackgroundTransparency = PoisendGui:FindFirstChild("RedFrame").BackgroundTransparency+0.1
- Wait(0)
- end
- PoisendGui:Destroy()
- --[[By: Brutez.]]--
- end))
- Script31.Disabled = true
- Sound32.Name = "ear_ringing"
- Sound32.Parent = ScreenGui30
- Sound32.SoundId = "rbxassetid://189925130"
- Sound32.Volume = 10
- Frame33.Name = "RedFrame"
- Frame33.Parent = ScreenGui30
- Frame33.Size = UDim2.new(2, 0, 2, 0)
- Frame33.BackgroundColor = BrickColor.new("Really red")
- Frame33.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
- Frame33.BackgroundTransparency = 0.5
- Frame33.BorderColor = BrickColor.new("Really red")
- Frame33.BorderColor3 = Color3.new(1, 0, 0.0156863)
- Script34.Name = "GhostHeadSoundScript"
- Script34.Parent = Model0
- table.insert(cors,sandbox(Script34,function()
- --[[ By: Brutez ]]--
- local Ghost = script.Parent;
- local GhostHead = Ghost:FindFirstChild("Head");
- local SelectedSoundID = {209120567, 209120562};
- local SelectedSounds = {};
- for SelectedSound=1,#SelectedSoundID do
- local GhostHeadSound = Instance.new("Sound")
- GhostHeadSound.SoundId = "rbxassetid://" .. SelectedSoundID[SelectedSound]
- GhostHeadSound.Volume = 1
- GhostHeadSound.Parent = GhostHead
- SelectedSounds[#SelectedSounds + 1] = GhostHeadSound
- --[[Sound Appearence]]--
- if GhostHeadSound.SoundId == "rbxassetid://209120567" then--
- GhostHeadSound.Name = "slv_alert10"
- end
- if GhostHeadSound.SoundId == "rbxassetid://209120562" then--
- GhostHeadSound.Name = "slv_alert20"
- end
- --[[Sound Appearence]]--
- end
- while true do
- Wait(0)
- GhostRandomSound=math.random(1,1000)
- if GhostRandomSound==10 or GhostRandomSound==20 or GhostRandomSound==30 then
- local SelectedSound = math.random(1, #SelectedSounds)
- local SelectedSoundClone=SelectedSounds[SelectedSound]:Clone()
- SelectedSoundClone.Parent = GhostHead
- SelectedSoundClone.Pitch = 1 + (math.random() * 0.05)
- SelectedSoundClone:Play()
- SelectedSoundClone:Destroy()
- end
- end
- --[[ By: Brutez ]]--
- end))
- Script35.Name = "GhostHurtSoundScript"
- Script35.Parent = Model0
- table.insert(cors,sandbox(Script35,function()
- local TwitcherHurtScript = script;
- local Twitcher = TwitcherHurtScript.Parent;
- local TwitcherHumanoid = Twitcher:FindFirstChild("Humanoid");
- local TwitcherHead = Twitcher:FindFirstChild("Head");
- local HurtEnable = true;
- function HurtSound(HumanoidData)
- if HurtEnable==false then return end
- if TwitcherHumanoid.Health<0 or TwitcherHumanoid.Health==0 then return end
- HurtEnable = false;
- local TwitcherHurtSoundList = {"zo_pain1", "zo_pain2"};
- local SelectedHurtSound = TwitcherHead[math.random(1, #TwitcherHurtSoundList)];
- SelectedHurtSound:Play()
- Wait(0.5)
- HurtEnable = true;
- end
- TwitcherHumanoid.HealthChanged:connect(HurtSound)
- end))
- Script36.Name = "AnimateSauce"
- Script36.Parent = Model0
- table.insert(cors,sandbox(Script36,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid;
- for _,Child in pairs(Figure:GetChildren())do
- if Child and Child.ClassName=="Humanoid"then
- Humanoid=Child;
- end;
- end;
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimInstance = nil
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- --{ id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance1 = {
- { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- local dances = {"dance1", "dance2", "dance3"}
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- --print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- --print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- --print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- currentAnimInstance = nil
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- local repeatAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
- repeatAnim = "idle"
- end
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- --print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- switch animation
- if (anim ~= currentAnimInstance) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- currentAnimInstance = anim
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local toolAnimInstance = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- --print("Keyframe : ".. frameName)
- playToolAnimation(toolAnimName, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- --print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- if (toolAnimInstance ~= anim) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- toolAnimInstance = anim
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- toolAnimInstance = nil
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
- setAnimationSpeed(speed / 14.5)
- end
- pose = "Running"
- else
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- playAnimation("sit", 0.5, Humanoid)
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- --print("Wha " .. pose)
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- local desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool and tool:FindFirstChild("Handle") then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimInstance = nil
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid);
- pose = "Standing";
- while Wait(0)do
- move(0);
- end;
- end))
- StringValue37.Name = "climb"
- StringValue37.Parent = Script36
- Animation38.Name = "ClimbAnim"
- Animation38.Parent = StringValue37
- Animation38.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- StringValue39.Name = "fall"
- StringValue39.Parent = Script36
- Animation40.Name = "FallAnim"
- Animation40.Parent = StringValue39
- Animation40.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- StringValue41.Name = "idle"
- StringValue41.Parent = Script36
- Animation42.Name = "Animation1"
- Animation42.Parent = StringValue41
- Animation42.AnimationId = "rbxassetid://1341345663"
- NumberValue43.Name = "Weight"
- NumberValue43.Parent = Animation42
- NumberValue43.Value = 9
- Animation44.Name = "Animation2"
- Animation44.Parent = StringValue41
- Animation44.AnimationId = "rbxassetid://1341345663"
- NumberValue45.Name = "Weight"
- NumberValue45.Parent = Animation44
- NumberValue45.Value = 1
- StringValue46.Name = "jump"
- StringValue46.Parent = Script36
- Animation47.Name = "JumpAnim"
- Animation47.Parent = StringValue46
- Animation47.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue48.Name = "run"
- StringValue48.Parent = Script36
- Animation49.Name = "RunAnim"
- Animation49.Parent = StringValue48
- Animation49.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- StringValue50.Name = "sit"
- StringValue50.Parent = Script36
- Animation51.Name = "SitAnim"
- Animation51.Parent = StringValue50
- Animation51.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- StringValue52.Name = "toolnone"
- StringValue52.Parent = Script36
- Animation53.Name = "ToolNoneAnim"
- Animation53.Parent = StringValue52
- Animation53.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- StringValue54.Name = "walk"
- StringValue54.Parent = Script36
- Animation55.Name = "WalkAnim"
- Animation55.Parent = StringValue54
- Animation55.AnimationId = "rbxassetid://1341351335"
- Script56.Name = "Health"
- Script56.Parent = Model0
- table.insert(cors,sandbox(Script56,function()
- --Responsible for regening a player's humanoid's health
- -- declarations
- local Figure = script.Parent
- local Head = Figure:WaitForChild("Head")
- local Humanoid;
- for _,Child in pairs(Figure:GetChildren())do
- if Child and Child.ClassName=="Humanoid"then
- Humanoid=Child;
- end;
- end;
- local regening = false
- -- regeneration
- function regenHealth()
- if regening then return end
- regening = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local s = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
- health = health + newHealthDelta
- Humanoid.Health = math.min(health,Humanoid.MaxHealth)
- end
- end
- if Humanoid.Health > Humanoid.MaxHealth then
- Humanoid.Health = Humanoid.MaxHealth
- end
- regening = false
- end
- Humanoid.HealthChanged:connect(regenHealth)
- end))
- Animation57.Name = "SmackAnim"
- Animation57.Parent = Model0
- Animation57.AnimationId = "rbxassetid://1341364247"
- Camera58.Name = "ThumbnailCamera"
- Camera58.Parent = Model0
- Camera58.CFrame = CFrame.new(21.1681595, 1.88080251, -60.4921494, -0.999440372, -0.00384576037, -0.0332317129, -0, 0.993370414, -0.114958383, 0.0334535018, -0.114894047, -0.992814302)
- Camera58.CoordinateFrame = CFrame.new(21.1681595, 1.88080251, -60.4921494, -0.999440372, -0.00384576037, -0.0332317129, -0, 0.993370414, -0.114958383, 0.0334535018, -0.114894047, -0.992814302)
- Camera58.FieldOfView = 49
- Camera58.Focus = CFrame.new(21.234623, 2.11071944, -58.5065193, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Camera58.focus = CFrame.new(21.234623, 2.11071944, -58.5065193, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement