Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local runDummyScript = function(f,scri)
- local oldenv = getfenv(f)
- local newenv = setmetatable({}, {
- __index = function(_, k)
- if k:lower() == 'script' then
- return scri
- else
- return oldenv[k]
- end
- end
- })
- setfenv(f, newenv)
- ypcall(function() f() end)
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "CompiledModel"
- o1 = Instance.new("Model")
- o2 = Instance.new("Part")
- o3 = Instance.new("Motor6D")
- o4 = Instance.new("Script")
- o5 = Instance.new("ScreenGui")
- o6 = Instance.new("Frame")
- o7 = Instance.new("Sound")
- o9 = Instance.new("Part")
- o10 = Instance.new("Motor6D")
- o11 = Instance.new("Motor6D")
- o12 = Instance.new("Motor6D")
- o13 = Instance.new("Motor6D")
- o14 = Instance.new("Motor6D")
- o15 = Instance.new("Part")
- o16 = Instance.new("Part")
- o17 = Instance.new("Part")
- o18 = Instance.new("Part")
- o19 = Instance.new("Part")
- o20 = Instance.new("SpecialMesh")
- o21 = Instance.new("Decal")
- o22 = Instance.new("Decal")
- o23 = Instance.new("Humanoid")
- o24 = Instance.new("BindableEvent")
- o25 = Instance.new("Script")
- o26 = Instance.new("StringValue")
- o27 = Instance.new("Animation")
- o28 = Instance.new("StringValue")
- o29 = Instance.new("Animation")
- o30 = Instance.new("StringValue")
- o31 = Instance.new("Animation")
- o32 = Instance.new("NumberValue")
- o33 = Instance.new("Animation")
- o34 = Instance.new("NumberValue")
- o35 = Instance.new("StringValue")
- o36 = Instance.new("Animation")
- o37 = Instance.new("StringValue")
- o38 = Instance.new("Animation")
- o39 = Instance.new("StringValue")
- o40 = Instance.new("Animation")
- o41 = Instance.new("StringValue")
- o42 = Instance.new("Animation")
- o43 = Instance.new("StringValue")
- o44 = Instance.new("Animation")
- o45 = Instance.new("Script")
- o46 = Instance.new("Animation")
- o47 = Instance.new("Configuration")
- o48 = Instance.new("NumberValue")
- o49 = Instance.new("BoolValue")
- o50 = Instance.new("BoolValue")
- o51 = Instance.new("Vector3Value")
- o52 = Instance.new("BoolValue")
- o53 = Instance.new("BrickColorValue")
- o54 = Instance.new("NumberValue")
- o55 = Instance.new("NumberValue")
- o56 = Instance.new("NumberValue")
- o57 = Instance.new("Configuration")
- o58 = Instance.new("ObjectValue")
- o59 = Instance.new("BindableEvent")
- o60 = Instance.new("BindableFunction")
- o61 = Instance.new("BindableEvent")
- o62 = Instance.new("Model")
- o63 = Instance.new("Part")
- o64 = Instance.new("Script")
- o65 = Instance.new("ScreenGui")
- o66 = Instance.new("Frame")
- o67 = Instance.new("ImageLabel")
- o68 = Instance.new("Sound")
- o69 = Instance.new("Script")
- o70 = Instance.new("Part")
- o71 = Instance.new("ClickDetector")
- o72 = Instance.new("Script")
- o73 = Instance.new("Script")
- o74 = Instance.new("ScreenGui")
- o75 = Instance.new("BoolValue")
- o76 = Instance.new("ImageLabel")
- o77 = Instance.new("Script")
- o78 = Instance.new("NumberValue")
- o79 = Instance.new("Sound")
- o80 = Instance.new("Script")
- o81 = Instance.new("Script")
- o82 = Instance.new("LocalScript")
- o83 = Instance.new("Configuration")
- o84 = Instance.new("ScreenGui")
- o85 = Instance.new("ImageLabel")
- o86 = Instance.new("Script")
- o87 = Instance.new("Sound")
- o88 = Instance.new("LocalScript")
- o89 = Instance.new("ObjectValue")
- o90 = Instance.new("LocalScript")
- o91 = Instance.new("ObjectValue")
- o92 = Instance.new("Sound")
- o93 = Instance.new("Sound")
- o94 = Instance.new("NumberValue")
- o95 = Instance.new("ImageLabel")
- o96 = Instance.new("Script")
- o97 = Instance.new("Sound")
- o98 = Instance.new("Script")
- o99 = Instance.new("Script")
- o1.Name = "Nightmare.exe"
- o1.Parent = mas
- o2.Name = "HumanoidRootPart"
- o2.Parent = o1
- o2.BrickColor = BrickColor.new("Pastel blue-green")
- o2.Transparency = 1
- o2.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
- o2.Rotation = Vector3.new(0, -5.96000004, 0)
- o2.FormFactor = Enum.FormFactor.Symmetric
- o2.Size = Vector3.new(2.33199978, 2.33199978, 1.16599989)
- o2.CFrame = CFrame.new(-41.9444008, 5.49799585, 94.8133926, 0.994581461, 0, -0.103895411, 0, 0.999994755, 0, 0.103895411, 0, 0.994581461)
- o2.BottomSurface = Enum.SurfaceType.Smooth
- o2.TopSurface = Enum.SurfaceType.Smooth
- o2.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o2.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
- o3.Name = "Root Hip"
- o3.Parent = o2
- o3.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o3.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o3.Part0 = o2
- o3.Part1 = o9
- o3.MaxVelocity = 0.10000000149012
- o4.Name = "ScaryScript"
- o4.Parent = o2
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- Sound = script.Parent.Scream
- Popup = script.Parent.Popup
- Ready = true
- function onTouch(hit)
- local h = hit.Parent:FindFirstChild("Humanoid")
- if h ~= nil and Ready == true then
- Ready = false
- local plyr = game.Players:FindFirstChild(h.Parent.Name)
- local c = Popup:clone()
- c.Parent = plyr.PlayerGui
- script.Parent.Scream:play()
- wait(2)
- c:remove()
- wait(1)
- Ready = true
- end
- end
- script.Parent.Touched:connect(onTouch)
- end,o4)
- end))
- o5.Name = "Popup"
- o5.Parent = o2
- o6.Name = "BackGround"
- o6.Parent = o5
- o6.Position = UDim2.new(0,0,-0.10000000149012,0)
- o6.Size = UDim2.new(1.1000000238419,0,1.2000000476837,0)
- o6.Position = UDim2.new(0,0,-0.10000000149012,0)
- o6.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
- o6.BackgroundTransparency = 1
- o7.Name = "Scream"
- o7.Parent = o2
- o7.SoundId = "rbxassetid://464710503"
- o9.Name = "Torso"
- o9.Parent = o1
- o9.BrickColor = BrickColor.new("Pastel blue-green")
- o9.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
- o9.Rotation = Vector3.new(0, -5.96000004, 0)
- o9.FormFactor = Enum.FormFactor.Symmetric
- o9.Size = Vector3.new(2.33199978, 2.33199978, 1.16599989)
- o9.CFrame = CFrame.new(-41.9444008, 5.49799585, 94.8133926, 0.994581461, 0, -0.103895411, 0, 0.999994755, 0, 0.103895411, 0, 0.994581461)
- o9.BottomSurface = Enum.SurfaceType.Smooth
- o9.TopSurface = Enum.SurfaceType.Smooth
- o9.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o9.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
- o10.Name = "Left Hip"
- o10.Parent = o9
- o10.C0 = CFrame.new(-1.16599989, -1.16599989, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- o10.C1 = CFrame.new(-0.582999945, 1.16599989, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- o10.Part0 = o9
- o10.Part1 = o15
- o10.MaxVelocity = 0.10000000149012
- o11.Name = "Right Hip"
- o11.Parent = o9
- o11.C0 = CFrame.new(1.16599989, -1.16599989, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- o11.C1 = CFrame.new(0.582999945, 1.16599989, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- o11.Part0 = o9
- o11.Part1 = o16
- o11.MaxVelocity = 0.10000000149012
- o12.Name = "Left Shoulder"
- o12.Parent = o9
- o12.C0 = CFrame.new(-1.16599989, 0.582999945, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- o12.C1 = CFrame.new(0.582999945, 0.582999945, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- o12.Part0 = o9
- o12.Part1 = o17
- o12.MaxVelocity = 0.10000000149012
- o13.Name = "Right Shoulder"
- o13.Parent = o9
- o13.C0 = CFrame.new(1.16599989, 0.582999945, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- o13.C1 = CFrame.new(-0.582999945, 0.582999945, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- o13.Part0 = o9
- o13.Part1 = o18
- o13.MaxVelocity = 0.10000000149012
- o14.Name = "Neck"
- o14.Parent = o9
- o14.C0 = CFrame.new(0, 1.16599989, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o14.C1 = CFrame.new(0, -0.582999945, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o14.Part0 = o9
- o14.Part1 = o19
- o14.MaxVelocity = 0.10000000149012
- o15.Name = "Left Leg"
- o15.Parent = o1
- o15.BrickColor = BrickColor.new("Pastel blue-green")
- o15.Position = Vector3.new(-42.5242424, 3.16600847, 94.7528229)
- o15.Rotation = Vector3.new(0, -5.96000004, 0)
- o15.FormFactor = Enum.FormFactor.Symmetric
- o15.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
- o15.CFrame = CFrame.new(-42.5242424, 3.16600847, 94.7528229, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
- o15.BottomSurface = Enum.SurfaceType.Smooth
- o15.TopSurface = Enum.SurfaceType.Smooth
- o15.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o15.Position = Vector3.new(-42.5242424, 3.16600847, 94.7528229)
- o16.Name = "Right Leg"
- o16.Parent = o1
- o16.BrickColor = BrickColor.new("Pastel blue-green")
- o16.Position = Vector3.new(-41.3645592, 3.16600847, 94.8739624)
- o16.Rotation = Vector3.new(0, -5.96000004, 0)
- o16.FormFactor = Enum.FormFactor.Symmetric
- o16.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
- o16.CFrame = CFrame.new(-41.3645592, 3.16600847, 94.8739624, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
- o16.BottomSurface = Enum.SurfaceType.Smooth
- o16.TopSurface = Enum.SurfaceType.Smooth
- o16.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o16.Position = Vector3.new(-41.3645592, 3.16600847, 94.8739624)
- o17.Name = "Left Arm"
- o17.Parent = o1
- o17.BrickColor = BrickColor.new("Pastel blue-green")
- o17.Position = Vector3.new(-43.6839218, 5.49799585, 94.6316833)
- o17.Rotation = Vector3.new(0, -5.96000004, 0)
- o17.FormFactor = Enum.FormFactor.Symmetric
- o17.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
- o17.CFrame = CFrame.new(-43.6839218, 5.49799585, 94.6316833, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
- o17.BottomSurface = Enum.SurfaceType.Smooth
- o17.TopSurface = Enum.SurfaceType.Smooth
- o17.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o17.Position = Vector3.new(-43.6839218, 5.49799585, 94.6316833)
- o18.Name = "Right Arm"
- o18.Parent = o1
- o18.BrickColor = BrickColor.new("Pastel blue-green")
- o18.Position = Vector3.new(-40.2048798, 5.49799585, 94.9951019)
- o18.Rotation = Vector3.new(0, -5.96000004, 0)
- o18.FormFactor = Enum.FormFactor.Symmetric
- o18.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
- o18.CFrame = CFrame.new(-40.2048798, 5.49799585, 94.9951019, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
- o18.BottomSurface = Enum.SurfaceType.Smooth
- o18.TopSurface = Enum.SurfaceType.Smooth
- o18.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o18.Position = Vector3.new(-40.2048798, 5.49799585, 94.9951019)
- o19.Name = "Head"
- o19.Parent = o1
- o19.BrickColor = BrickColor.new("Pastel blue-green")
- o19.Position = Vector3.new(-41.9444008, 7.24698639, 94.8133926)
- o19.Rotation = Vector3.new(0, -5.96000004, 0)
- o19.FormFactor = Enum.FormFactor.Symmetric
- o19.Size = Vector3.new(2.33199978, 1.16599989, 1.16599989)
- o19.CFrame = CFrame.new(-41.9444008, 7.24698639, 94.8133926, 0.994581461, 0, -0.103895411, 0, 0.999994755, 0, 0.103895411, 0, 0.994581461)
- o19.BottomSurface = Enum.SurfaceType.Smooth
- o19.TopSurface = Enum.SurfaceType.Smooth
- o19.Color = Color3.new(0.623529, 0.952941, 0.913726)
- o19.Position = Vector3.new(-41.9444008, 7.24698639, 94.8133926)
- o20.Parent = o19
- o20.Scale = Vector3.new(1.25, 1.25, 1.25)
- o21.Parent = o19
- o21.Texture = "http://www.roblox.com/asset/?id=291716137"
- o21.Face = Enum.NormalId.Left
- o22.Parent = o19
- o22.Texture = "http://www.roblox.com/asset/?id=291716137"
- o23.Parent = o1
- o23.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- o23.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- o23.RightLeg = o16
- o23.LeftLeg = o15
- o23.Torso = o2
- o23.Health = 170
- o23.MaxHealth = 170
- o23.WalkSpeed = 20
- o24.Name = "Attacked"
- o24.Parent = o1
- o25.Name = "Animate"
- o25.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- -- This is in charge of the animations for the character. Pretty much stole it from the default character. Removed emote stuff.
- 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 = waitForChild(Figure, "Humanoid")
- 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 }
- },
- dance = {
- { 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 }
- },
- }
- math.randomseed(tick())
- 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
- 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
- -- print("Keyframe : ".. frameName)
- local repeatAnim = currentAnim
- 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)
- 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
- 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 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)
- -- main program
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end,o25)
- end))
- o26.Name = "climb"
- o26.Parent = o25
- o27.Name = "ClimbAnim"
- o27.Parent = o26
- o27.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- o28.Name = "fall"
- o28.Parent = o25
- o29.Name = "FallAnim"
- o29.Parent = o28
- o29.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- o30.Name = "idle"
- o30.Parent = o25
- o31.Name = "Animation1"
- o31.Parent = o30
- o31.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- o32.Name = "Weight"
- o32.Parent = o31
- o32.Value = 9
- o33.Name = "Animation2"
- o33.Parent = o30
- o33.AnimationId = "http://www.roblox.com/asset/?id=180435792"
- o34.Name = "Weight"
- o34.Parent = o33
- o34.Value = 1
- o35.Name = "jump"
- o35.Parent = o25
- o36.Name = "JumpAnim"
- o36.Parent = o35
- o36.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- o37.Name = "run"
- o37.Parent = o25
- o38.Name = "RunAnim"
- o38.Parent = o37
- o38.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- o39.Name = "sit"
- o39.Parent = o25
- o40.Name = "SitAnim"
- o40.Parent = o39
- o40.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- o41.Name = "toolnone"
- o41.Parent = o25
- o42.Name = "ToolNoneAnim"
- o42.Parent = o41
- o42.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- o43.Name = "walk"
- o43.Parent = o25
- o44.Name = "WalkAnim"
- o44.Parent = o43
- o44.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- o45.Name = "ZombieScript"
- o45.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --[[
- Basic Monster by ArceusInator
- Information:
- Configurations.MaximumDetectionDistance (default 200)
- The monster will not detect players past this point. If you set it to a negative number then the monster will be able to chase from any distance.
- Configurations.CanGiveUp (default true)
- If true, the monster will give up if its target goes past the MaximumDetectionDistance. This is a pretty good idea if you have people teleporting around.
- Configurations.CanRespawn (default true)
- If true, the monster will respawn after it dies
- Configurations.AutoDetectSpawnPoint (default true)
- If true, the spawn point will be auto detected based on where the monster is when it starts
- Configurations.SpawnPoint (default 0,0,0)
- If Settings.AutoDetectSpawnPoint is disabled, this will be set to the monster's initial position. This value will be used when the monster auto respawns to tell it where to spawn next.
- Configurations.FriendlyTeam (default Really black)
- The monster will not attack players on this team
- Mind.CurrentTargetHumanoid (Humanoid objects only)
- You can force the monster to follow a certain humanoid by setting this to that humanoid
- Monster.Respawn (Function)
- Arguments are: Vector3 point
- Info: Respawns the monster at the given point, or at the SpawnPoint setting if none if provided
- Monster.Died (Event)
- Info: Fired when the monster dies
- Monster.Respawned (Event)
- Info: Fired when the monster respawns
- --]]
- local Self = script.Parent
- local Settings = Self:FindFirstChild'Configurations' -- Points to the settings.
- local Mind = Self:FindFirstChild'Mind' -- Points to the monster's mind. You can edit parts of this from other scripts in-game to change the monster's behavior. Advanced users only.
- --
- -- Verify that everything is where it should be
- assert(Self:FindFirstChild'Humanoid' ~= nil, 'Monster does not have a humanoid')
- assert(Settings ~= nil, 'Monster does not have a Configurations object')
- assert(Settings:FindFirstChild'MaximumDetectionDistance' ~= nil and Settings.MaximumDetectionDistance:IsA'NumberValue', 'Monster does not have a MaximumDetectionDistance (NumberValue) setting')
- assert(Settings:FindFirstChild'CanGiveUp' ~= nil and Settings.CanGiveUp:IsA'BoolValue', 'Monster does not have a CanGiveUp (BoolValue) setting')
- assert(Settings:FindFirstChild'CanRespawn' ~= nil and Settings.CanRespawn:IsA'BoolValue', 'Monster does not have a CanRespawn (BoolValue) setting')
- assert(Settings:FindFirstChild'SpawnPoint' ~= nil and Settings.SpawnPoint:IsA'Vector3Value', 'Monster does not have a SpawnPoint (Vector3Value) setting')
- assert(Settings:FindFirstChild'AutoDetectSpawnPoint' ~= nil and Settings.AutoDetectSpawnPoint:IsA'BoolValue', 'Monster does not have a AutoDetectSpawnPoint (BoolValue) setting')
- assert(Settings:FindFirstChild'FriendlyTeam' ~= nil and Settings.FriendlyTeam:IsA'BrickColorValue', 'Monster does not have a FriendlyTeam (BrickColorValue) setting')
- assert(Settings:FindFirstChild'AttackDamage' ~= nil and Settings.AttackDamage:IsA'NumberValue', 'Monster does not have a AttackDamage (NumberValue) setting')
- assert(Settings:FindFirstChild'AttackFrequency' ~= nil and Settings.AttackFrequency:IsA'NumberValue', 'Monster does not have a AttackFrequency (NumberValue) setting')
- assert(Settings:FindFirstChild'AttackRange' ~= nil and Settings.AttackRange:IsA'NumberValue', 'Monster does not have a AttackRange (NumberValue) setting')
- assert(Mind ~= nil, 'Monster does not have a Mind object')
- assert(Mind:FindFirstChild'CurrentTargetHumanoid' ~= nil and Mind.CurrentTargetHumanoid:IsA'ObjectValue', 'Monster does not have a CurrentTargetHumanoid (ObjectValue) mind setting')
- assert(Self:FindFirstChild'Respawn' and Self.Respawn:IsA'BindableFunction', 'Monster does not have a Respawn BindableFunction')
- assert(Self:FindFirstChild'Died' and Self.Died:IsA'BindableEvent', 'Monster does not have a Died BindableEvent')
- assert(Self:FindFirstChild'Respawned' and Self.Died:IsA'BindableEvent', 'Monster does not have a Respawned BindableEvent')
- assert(Self:FindFirstChild'Attacked' and Self.Died:IsA'BindableEvent', 'Monster does not have a Attacked BindableEvent')
- assert(script:FindFirstChild'Attack' and script.Attack:IsA'Animation', 'Monster does not have a MonsterScript.Attack Animation')
- --
- --
- local Info = {
- -- These are constant values. Don't change them unless you know what you're doing.
- -- Services
- Players = Game:GetService 'Players',
- PathfindingService = Game:GetService 'PathfindingService',
- -- Advanced settings
- RecomputePathFrequency = 1, -- The monster will recompute its path this many times per second
- RespawnWaitTime = 5, -- How long to wait before the monster respawns
- JumpCheckFrequency = 1, -- How many times per second it will do a jump check
- }
- local Data = {
- -- These are variable values used internally by the script. Advanced users only.
- LastRecomputePath = 0,
- Recomputing = false, -- Reocmputing occurs async, meaning this script will still run while it's happening. This variable will prevent the script from running two recomputes at once.
- PathCoords = {},
- IsDead = false,
- TimeOfDeath = 0,
- CurrentNode = nil,
- CurrentNodeIndex = 1,
- AutoRecompute = true,
- LastJumpCheck = 0,
- LastAttack = 0,
- BaseMonster = Self:Clone(),
- AttackTrack = nil,
- }
- --
- --
- local Monster = {} -- Create the monster class
- function Monster:GetCFrame()
- -- Returns the CFrame of the monster's humanoidrootpart
- local humanoidRootPart = Self:FindFirstChild('HumanoidRootPart')
- if humanoidRootPart ~= nil and humanoidRootPart:IsA('BasePart') then
- return humanoidRootPart.CFrame
- else
- return CFrame.new()
- end
- end
- function Monster:GetMaximumDetectionDistance()
- -- Returns the maximum detection distance
- local setting = Settings.MaximumDetectionDistance.Value
- if setting < 0 then
- return math.huge
- else
- return setting
- end
- end
- function Monster:SearchForTarget()
- -- Finds the closest player and sets the target
- local players = Info.Players:GetPlayers()
- local closestCharacter, closestCharacterDistance
- for i=1, #players do
- local player = players[i]
- if player.Neutral or player.TeamColor ~= Settings.FriendlyTeam.Value then
- local character = player.Character
- if character ~= nil and character:FindFirstChild('Humanoid') ~= nil and character.Humanoid:IsA('Humanoid') then
- local distance = player:DistanceFromCharacter(Monster:GetCFrame().p)
- if distance < Monster:GetMaximumDetectionDistance() then
- if closestCharacter == nil then
- closestCharacter, closestCharacterDistance = character, distance
- else
- if closestCharacterDistance > distance then
- closestCharacter, closestCharacterDistance = character, distance
- end
- end
- end
- end
- end
- end
- if closestCharacter ~= nil then
- Mind.CurrentTargetHumanoid.Value = closestCharacter.Humanoid
- end
- end
- function Monster:TryRecomputePath()
- if Data.AutoRecompute or tick() - Data.LastRecomputePath > 1/Info.RecomputePathFrequency then
- Monster:RecomputePath()
- end
- end
- function Monster:GetTargetCFrame()
- local targetHumanoid = Mind.CurrentTargetHumanoid.Value
- if Monster:TargetIsValid() then
- return targetHumanoid.Torso.CFrame
- else
- return CFrame.new()
- end
- end
- function Monster:IsAlive()
- return Self.Humanoid.Health > 0 and Self.Humanoid.Torso ~= nil
- end
- function Monster:TargetIsValid()
- local targetHumanoid = Mind.CurrentTargetHumanoid.Value
- if targetHumanoid ~= nil and targetHumanoid:IsA 'Humanoid' and targetHumanoid.Torso ~= nil and targetHumanoid.Torso:IsA 'BasePart' then
- return true
- else
- return false
- end
- end
- function Monster:HasClearLineOfSight()
- -- Going to cast a ray to see if I can just see my target
- local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
- local hit, pos = Workspace:FindPartOnRayWithIgnoreList(
- Ray.new(
- myPos,
- targetPos - myPos
- ),
- {
- Self,
- Mind.CurrentTargetHumanoid.Value.Parent
- }
- )
- if hit == nil then
- return true
- else
- return false
- end
- end
- function Monster:RecomputePath()
- if not Data.Recomputing then
- if Monster:IsAlive() and Monster:TargetIsValid() then
- if Monster:HasClearLineOfSight() then
- Data.AutoRecompute = true
- Data.PathCoords = {
- Monster:GetCFrame().p,
- Monster:GetTargetCFrame().p
- }
- Data.LastRecomputePath = tick()
- Data.CurrentNode = nil
- Data.CurrentNodeIndex = 2 -- Starts chasing the target without evaluating its current position
- else
- -- Do pathfinding since you can't walk straight
- Data.Recomputing = true -- Basically a debounce.
- Data.AutoRecompute = false
- local path = Info.PathfindingService:ComputeSmoothPathAsync(
- Monster:GetCFrame().p,
- Monster:GetTargetCFrame().p,
- 500
- )
- Data.PathCoords = path:GetPointCoordinates()
- Data.Recomputing = false
- Data.LastRecomputePath = tick()
- Data.CurrentNode = nil
- Data.CurrentNodeIndex = 1
- end
- end
- end
- end
- function Monster:Update()
- Monster:ReevaluateTarget()
- Monster:SearchForTarget()
- Monster:TryRecomputePath()
- Monster:TravelPath()
- end
- function Monster:TravelPath()
- local closest, closestDistance, closestIndex
- local myPosition = Monster:GetCFrame().p
- local skipCurrentNode = Data.CurrentNode ~= nil and (Data.CurrentNode - myPosition).magnitude < 3
- for i=Data.CurrentNodeIndex, #Data.PathCoords do
- local coord = Data.PathCoords[i]
- if not (skipCurrentNode and coord == Data.CurrentNode) then
- local distance = (coord - myPosition).magnitude
- if closest == nil then
- closest, closestDistance, closestIndex = coord, distance, i
- else
- if distance < closestDistance then
- closest, closestDistance, closestIndex = coord, distance, i
- else
- break
- end
- end
- end
- end
- --
- if closest ~= nil then
- Data.CurrentNode = closest
- Data.CurrentNodeIndex = closestIndex
- local humanoid = Self:FindFirstChild 'Humanoid'
- if humanoid ~= nil and humanoid:IsA'Humanoid' then
- humanoid:MoveTo(closest)
- end
- if Monster:IsAlive() and Monster:TargetIsValid() then
- Monster:TryJumpCheck()
- Monster:TryAttack()
- end
- if closestIndex == #Data.PathCoords then
- -- Reached the end of the path, force a new check
- Data.AutoRecompute = true
- end
- end
- end
- function Monster:TryJumpCheck()
- if tick() - Data.LastJumpCheck > 1/Info.JumpCheckFrequency then
- Monster:JumpCheck()
- end
- end
- function Monster:TryAttack()
- if tick() - Data.LastAttack > 1/Settings.AttackFrequency.Value then
- Monster:Attack()
- end
- end
- function Monster:Attack()
- local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
- if (myPos - targetPos).magnitude <= Settings.AttackRange.Value then
- Mind.CurrentTargetHumanoid.Value:TakeDamage(Settings.AttackDamage.Value)
- Data.LastAttack = tick()
- Data.AttackTrack:Play()
- end
- end
- function Monster:JumpCheck()
- -- Do a raycast to check if we need to jump
- local myCFrame = Monster:GetCFrame()
- local checkVector = (Monster:GetTargetCFrame().p - myCFrame.p).unit*2
- local hit, pos = Workspace:FindPartOnRay(
- Ray.new(
- myCFrame.p + Vector3.new(0, -2.4, 0),
- checkVector
- ),
- Self
- )
- if hit ~= nil and not hit:IsDescendantOf(Mind.CurrentTargetHumanoid.Value.Parent) then
- -- Do a slope check to make sure we're not walking up a ramp
- local hit2, pos2 = Workspace:FindPartOnRay(
- Ray.new(
- myCFrame.p + Vector3.new(0, -2.3, 0),
- checkVector
- ),
- Self
- )
- if hit2 == hit then
- if ((pos2 - pos)*Vector3.new(1,0,1)).magnitude < 0.05 then -- Will pass for any ramp with <2 slope
- Self.Humanoid.Jump = true
- end
- end
- end
- Data.LastJumpCheck = tick()
- end
- function Monster:Connect()
- Mind.CurrentTargetHumanoid.Changed:connect(function(humanoid)
- if humanoid ~= nil then
- assert(humanoid:IsA'Humanoid', 'Monster target must be a humanoid')
- Monster:RecomputePath()
- end
- end)
- Self.Respawn.OnInvoke = function(point)
- Monster:Respawn(point)
- end
- end
- function Monster:Initialize()
- Monster:Connect()
- if Settings.AutoDetectSpawnPoint.Value then
- Settings.SpawnPoint.Value = Monster:GetCFrame().p
- end
- end
- function Monster:Respawn(point)
- local point = point or Settings.SpawnPoint.Value
- for index, obj in next, Data.BaseMonster:Clone():GetChildren() do
- if obj.Name == 'Configurations' or obj.Name == 'Mind' or obj.Name == 'Respawned' or obj.Name == 'Died' or obj.Name == 'MonsterScript' or obj.Name == 'Respawn' then
- obj:Destroy()
- else
- Self[obj.Name]:Destroy()
- obj.Parent = Self
- end
- end
- Monster:InitializeUnique()
- Self.Parent = Workspace
- Self.HumanoidRootPart.CFrame = CFrame.new(point)
- Settings.SpawnPoint.Value = point
- Self.Respawned:Fire()
- end
- function Monster:InitializeUnique()
- Data.AttackTrack = Self.Humanoid:LoadAnimation(script.Attack)
- end
- function Monster:ReevaluateTarget()
- local currentTarget = Mind.CurrentTargetHumanoid.Value
- if currentTarget ~= nil and currentTarget:IsA'Humanoid' then
- local character = currentTarget.Parent
- if character ~= nil then
- local player = Info.Players:GetPlayerFromCharacter(character)
- if player ~= nil then
- if not player.Neutral and player.TeamColor == Settings.FriendlyTeam.Value then
- Mind.CurrentTargetHumanoid.Value = nil
- end
- end
- end
- if currentTarget == Mind.CurrentTargetHumanoid.Value then
- local torso = currentTarget.Torso
- if torso ~= nil and torso:IsA 'BasePart' then
- if Settings.CanGiveUp.Value and (torso.Position - Monster:GetCFrame().p).magnitude > Monster:GetMaximumDetectionDistance() then
- Mind.CurrentTargetHumanoid.Value = nil
- end
- end
- end
- end
- end
- --
- --
- Monster:Initialize()
- Monster:InitializeUnique()
- while true do
- if not Monster:IsAlive() then
- if Data.IsDead == false then
- Data.IsDead = true
- Data.TimeOfDeath = tick()
- Self.Died:Fire()
- end
- if Data.IsDead == true then
- if tick()-Data.TimeOfDeath > Info.RespawnWaitTime then
- Monster:Respawn()
- end
- end
- end
- if Monster:IsAlive() then
- Monster:Update()
- end
- wait()
- end
- end,o45)
- end))
- o46.Name = "Attack"
- o46.Parent = o45
- o46.AnimationId = "rbxassetid://105211514"
- o47.Name = "Configurations"
- o47.Parent = o1
- o48.Name = "MaximumDetectionDistance"
- o48.Parent = o47
- o48.Value = 200
- o49.Name = "CanGiveUp"
- o49.Parent = o47
- o49.Value = true
- o50.Name = "CanRespawn"
- o50.Parent = o47
- o50.Value = true
- o51.Name = "SpawnPoint"
- o51.Parent = o47
- o52.Name = "AutoDetectSpawnPoint"
- o52.Parent = o47
- o52.Value = true
- o53.Name = "FriendlyTeam"
- o53.Parent = o47
- o53.Value = BrickColor.new("Really black")
- o54.Name = "AttackDamage"
- o54.Parent = o47
- o54.Value = 9999999999
- o55.Name = "AttackFrequency"
- o55.Parent = o47
- o55.Value = 2
- o56.Name = "AttackRange"
- o56.Parent = o47
- o56.Value = 3
- o57.Name = "Mind"
- o57.Parent = o1
- o58.Name = "CurrentTargetHumanoid"
- o58.Parent = o57
- o59.Name = "Died"
- o59.Parent = o1
- o60.Name = "Respawn"
- o60.Parent = o1
- o61.Name = "Respawned"
- o61.Parent = o1
- o62.Parent = o1
- o63.Name = "Popup By quicksuper"
- o63.Parent = o1
- o63.BrickColor = BrickColor.new("Bright red")
- o63.Transparency = 1
- o63.Position = Vector3.new(-41.6389313, 6.35199118, 93.7564087)
- o63.Rotation = Vector3.new(0, -5.96000004, 0)
- o63.Anchored = true
- o63.CanCollide = false
- o63.Size = Vector3.new(6, 8.40000057, 1)
- o63.CFrame = CFrame.new(-41.6389313, 6.35199118, 93.7564087, 0.994581699, 0, -0.103895046, 0, 0.999994755, 0, 0.103895046, 0, 0.994581699)
- o63.Color = Color3.new(0.768628, 0.156863, 0.109804)
- o63.Position = Vector3.new(-41.6389313, 6.35199118, 93.7564087)
- o64.Name = "ScaryScript"
- o64.Parent = o63
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- Sound = script.Parent.Scream
- Popup = script.Parent.Popup
- Ready = true
- function onTouch(hit)
- local h = hit.Parent:FindFirstChild("Humanoid")
- if h ~= nil and Ready == true then
- Ready = false
- local plyr = game.Players:FindFirstChild(h.Parent.Name)
- local c = Popup:clone()
- c.Parent = plyr.PlayerGui
- script.Parent.Scream:play()
- wait(2)
- c:remove()
- wait(1)
- Ready = true
- end
- end
- script.Parent.Touched:connect(onTouch)
- end,o64)
- end))
- o65.Name = "Popup"
- o65.Parent = o63
- o66.Name = "BackGround"
- o66.Parent = o65
- o66.Position = UDim2.new(0,0,-0.10000000149012,0)
- o66.Size = UDim2.new(1.1000000238419,0,1.2000000476837,0)
- o66.Position = UDim2.new(0,0,-0.10000000149012,0)
- o66.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
- o66.BackgroundTransparency = 1
- o67.Name = "Image"
- o67.Parent = o66
- o67.Position = UDim2.new(0.0010000000474975,0,0.050000000745058,0)
- o67.Size = UDim2.new(1,0,1,0)
- o67.Position = UDim2.new(0.0010000000474975,0,0.050000000745058,0)
- o67.BackgroundColor3 = Color3.new(0, 0, 0)
- o67.BackgroundTransparency = 1
- o67.Image = "rbxassetid://1885215432"
- o68.Name = "Scream"
- o68.Parent = o63
- o68.Pitch = 2
- o68.SoundId = "http://www.roblox.com/asset/?id=11984351"
- o68.Volume = 1
- o69.Name = "Read dis."
- o69.Parent = o63
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --[[
- How to make a pop-up by quicksuper
- 1. Find my take the templete... well, go to the popup gui.
- 2. Insert the decal on a brick.
- 3. Click the decal and look at "Propertoes".
- 4. Look at the "Image". Copy and paste it in the "Image"
- 5. Enjoy it! :)
- end,o69)
- end))
- o70.Parent = o1
- o70.Transparency = 1
- o70.Position = Vector3.new(-41.9991035, 4.86700535, 95.2486267)
- o70.Rotation = Vector3.new(-180, 5.96000004, -180)
- o70.Anchored = true
- o70.CanCollide = false
- o70.FormFactor = Enum.FormFactor.Custom
- o70.Size = Vector3.new(4.62999916, 5.63000727, 2.13000083)
- o70.CFrame = CFrame.new(-41.9991035, 4.86700535, 95.2486267, -0.994588256, 0, 0.103895791, 0, 1, 0, -0.103895791, 0, -0.994588256)
- o70.Position = Vector3.new(-41.9991035, 4.86700535, 95.2486267)
- o71.Parent = o70
- o71.MaxActivationDistance = 90
- o72.Name = "Script2"
- o72.Parent = o70
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.CFrame = script.Parent.Parent.Torso.CFrame:inverse()
- script.Parent.CFrame = script.Parent.CFrame:inverse()
- wait(0)
- end
- end,o72)
- end))
- o73.Parent = o70
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --SLender scripts (nausea, Static GUI's and the respawn) created by: JoLLDS
- --Do not change!!!!!!!!!!!!!!!!
- script.Parent.ClickDetector.MouseHoverEnter:connect(function(player)
- local s = script.whoseeing:FindFirstChild(player.Name)
- if s == nil then
- local s = Instance.new("ObjectValue")
- s.Name = player.Name
- s.Parent = script.whoseeing
- end
- local s = player.PlayerGui:FindFirstChild("Slenderdeadscene")
- if s == nil then
- local sound = player:FindFirstChild("slenderlook")
- if sound == nil then
- local sound = script.Parent.Parent.Parent.slenderlook:Clone()
- sound.Parent = player
- end
- local sound = player:FindFirstChild("slenderlook")
- local ran = math.random(6,10)
- if ran == 8 then
- sound:Play()
- end
- local s = player.PlayerGui:FindFirstChild("Static")
- if player.PlayerGui:FindFirstChild("Static") == nil then
- local s = script.Static:Clone()
- s.Parent = player.PlayerGui
- end
- if player.PlayerGui.Static.Mousleave.Value == true then
- player.PlayerGui.Static.Mousleave.Value = false
- end
- repeat
- player.PlayerGui.Static.Stage.Value = player.PlayerGui.Static.Stage.Value + 1
- wait(0.5)
- until player.PlayerGui.Static.Stage.Value == 10 or player.PlayerGui.Static.Mousleave.Value == true
- if player.PlayerGui.Static.Stage.Value == 10 then
- local f = script.Slenderdeadscene:Clone()
- f.ImageLabel.Script.cameratoslender.slender.Value = script.Parent.Parent
- f.Parent = player.PlayerGui
- f.ImageLabel.Script.Disabled = false
- local v = script.whoseeing:FindFirstChild(player.Name)
- if v ~= nil then
- v:remove()
- end
- player.PlayerGui.Static:remove()
- local a = player:FindFirstChild("Slender static sound")
- if a ~= nil then
- a.Volume = 0
- end
- local s = player.Character:FindFirstChild("slenderarrivalstatic")
- if s ~= nil then
- s:remove()
- end
- game.Workspace.CurrentCamera.FieldOfView = 70
- else
- if player.PlayerGui.Static.Mousleave.Value == true then
- repeat
- player.PlayerGui.Static.Stage.Value = player.PlayerGui.Static.Stage.Value - 1
- wait(0.5)
- until player.PlayerGui.Static.Stage.Value == 0 or player.PlayerGui.Static.Mousleave.Value == false
- if player.PlayerGui.Static.Mousleave.Value == true then
- player.PlayerGui.Static:remove()
- local a = player:FindFirstChild("Slender static sound")
- if a ~= nil then
- a.Volume = 0
- end
- local s = player.Character:FindFirstChild("slenderarrivalstatic")
- if s ~= nil then
- s:remove()
- end
- game.Workspace.CurrentCamera.FieldOfView = 70
- end
- end
- end
- end
- end)
- script.Parent.ClickDetector.MouseHoverLeave:connect(function(player)
- local s = script.whoseeing:FindFirstChild(player.Name)
- if s ~= nil then
- s:remove()
- end
- if player.PlayerGui:FindFirstChild("Static") ~= nil then
- local c = player.PlayerGui:GetChildren()
- for i, v in pairs(c) do
- if v.Name == "Static" then
- v.Mousleave.Value = true
- end
- end
- end
- end)
- function onPlayerLeaving(oldPlayer)
- local s = script.whoseeing:FindFirstChild(oldPlayer.Name)
- if s ~= nil then
- s:remove()
- end
- end
- game.Players.ChildRemoved:connect(onPlayerLeaving)
- -------------------------------------
- end,o73)
- end))
- o74.Name = "Static"
- o74.Parent = o73
- o75.Name = "Mousleave"
- o75.Parent = o74
- o76.Parent = o74
- o76.Position = UDim2.new(0,0,0,-25)
- o76.Size = UDim2.new(1.249999165535,0,1.249999165535,0)
- o76.Position = UDim2.new(0,0,0,-25)
- o76.Visible = false
- o76.BackgroundColor3 = Color3.new(1, 1, 1)
- o76.BackgroundTransparency = 1
- o77.Parent = o76
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- if script.Parent.Parent.Stage.Value == 0 then
- script.Parent.Image = ""
- end
- if script.Parent.Parent.Stage.Value == 1 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143972101"
- end
- if script.Parent.Parent.Stage.Value == 2 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143972944"
- end
- if script.Parent.Parent.Stage.Value == 3 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143973015"
- end
- if script.Parent.Parent.Stage.Value == 4 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143973101"
- end
- if script.Parent.Parent.Stage.Value == 5 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975045"
- end
- if script.Parent.Parent.Stage.Value == 6 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975153"
- end
- if script.Parent.Parent.Stage.Value == 7 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975287"
- end
- if script.Parent.Parent.Stage.Value == 8 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975446"
- end
- if script.Parent.Parent.Stage.Value == 9 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975528"
- end
- if script.Parent.Parent.Stage.Value == 10 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975639"
- end
- wait() --Your CPU can't be tired, without this, the Roblox will crash
- end
- end,o77)
- end))
- o78.Name = "Stage"
- o78.Parent = o74
- o79.Name = "Slender static sound"
- o79.Parent = o74
- o79.SoundId = "http://www.roblox.com/asset/?id=133267368"
- o79.Volume = 0
- o80.Parent = o79
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local s = script.Parent.Parent.Parent.Parent:FindFirstChild("Slender static sound")
- if s == nil then
- s = script.Parent:Clone()
- s.Parent = script.Parent.Parent.Parent.Parent
- end
- while true do
- s.Volume = script.Parent.Parent.Stage.Value / 10
- if s.Volume > 0.5 then
- s.SoundId = "http://www.roblox.com/asset/?id=133267368"
- else
- s.SoundId = "http://www.roblox.com/asset/?id=132081621"
- end
- s:Play()
- wait(0.5)
- s:Stop()
- end
- end,o80)
- end))
- o81.Name = "Camera static maker"
- o81.Parent = o74
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.Sound.Pitch = math.random((0.1), (0.5))
- script.Parent.ImageLabel.Visible = true
- wait(0.2)
- local s = script.Parent.Parent.Parent.Character:FindFirstChild("slenderarrivalstatic")
- if s == nil then
- local s = script.Parent.slenderarrivalstatic:Clone()
- s.Parent = script.Parent.Parent.Parent.Character
- s.Disabled = false
- end
- wait(math.random(0.04, 0.06))
- if math.random(3,5) == 4 then
- if s ~= nil then
- s:remove()
- end
- game.Workspace.CurrentCamera.FieldOfView = 70
- end
- end
- end,o81)
- end))
- o82.Name = "slenderarrivalstatic"
- o82.Parent = o74
- o82.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView - math.random(10,20)
- wait(0.02)
- game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView + math.random(5,15)
- wait(0.02)
- game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView + math.random(1, 5)
- wait(0.4)
- end
- end,o82)
- end))
- o83.Name = "whoseeing"
- o83.Parent = o73
- o84.Name = "Slenderdeadscene"
- o84.Parent = o73
- o85.Parent = o84
- o85.Position = UDim2.new(0,0,0,-25)
- o85.Size = UDim2.new(0,1750,0,900)
- o85.Position = UDim2.new(0,0,0,-25)
- o85.Visible = false
- o85.BackgroundColor3 = Color3.new(0, 0, 0)
- o85.Image = "rbxassetid://1885215432"
- o86.Parent = o85
- o86.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- script.slenderlook:Play()
- script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 0
- script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkToPart = script.cameratoslender.slender.Value.Torso
- script.died:Play()
- local f = script.cameratoslender
- f.Parent = script.Parent.Parent.Parent.Parent.Character
- f.Disabled = false
- wait(0.5)
- for i = 1, 10 do
- wait(0.1)
- script.Parent.Parent.Stage.Value = script.Parent.Parent.Stage.Value + 1
- end
- script.Parent.Parent.Stage.Value = 0
- script.Parent.Visible = true
- wait(0.2)
- script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
- script.died:Stop()
- play = false
- for i = 1, 24 do
- s = math.random(1,6)
- if s == 1 then
- if play == false then
- script.static:Play()
- play = true
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- end
- if s == 2 then
- if play == true then
- script.static:Stop()
- play = false
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- end
- if s == 3 then
- if play == false then
- script.static:Play()
- play = true
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- end
- if s == 4 then
- if play == false then
- script.static:Play()
- play = true
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- end
- if s == 5 then
- if play == false then
- script.static:Play()
- play = true
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- end
- if s == 6 then
- if play == true then
- script.static:Stop()
- play = false
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- end
- wait(0.1)
- end
- script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
- script.static:Stop()
- local f = script.fixcamera
- f.Parent = script.Parent.Parent.Parent.Parent.Character
- f.Disabled = false
- end,o86)
- end))
- o87.Name = "died"
- o87.Parent = o86
- o87.SoundId = "http://www.roblox.com/asset/?id=131196885"
- o87.Volume = 1
- o88.Name = "cameratoslender"
- o88.Parent = o86
- o88.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local c = game.Workspace.CurrentCamera
- game.Workspace.CurrentCamera.CameraType = "Attach"
- wait()
- wait()
- game.Workspace.CurrentCamera.CameraSubject = script.slender.Value.Cameraa
- wait()
- wait()
- game.Workspace.CurrentCamera.Focus = script.slender.Value.Torso -- the output window say that an error occurred here, please, do not mess here, it's working, no error was detected!
- wait()
- game.Workspace.CurrentCamera.FieldOfView = 55
- repeat wait() until script.slender.Value == nil
- local s = game.Players:FindFirstChild(script.Parent.Name)
- local d = s.PlayerGui.Slenderdeadscene.ImageLabel.Script.fixcamera:clone()
- d.Parent = s.Character
- d.Disabled = false
- end,o88)
- end))
- o89.Name = "slender"
- o89.Parent = o88
- o90.Name = "fixcamera"
- o90.Parent = o86
- o90.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- game.Workspace.CurrentCamera.FieldOfView = 70
- game.Workspace.CurrentCamera.CameraType = "Custom"
- end,o90)
- end))
- o91.Name = "slender"
- o91.Parent = o90
- o92.Name = "slenderlook"
- o92.Parent = o86
- o92.SoundId = "http://www.roblox.com/asset/?id=133267726"
- o92.Volume = 1
- o93.Name = "static"
- o93.Parent = o86
- o93.SoundId = "http://www.roblox.com/asset/?id=133267368"
- o93.Volume = 1
- o93.Looped = true
- o94.Name = "Stage"
- o94.Parent = o84
- o95.Name = "Static"
- o95.Parent = o84
- o95.Position = UDim2.new(0,0,0,-25)
- o95.Size = UDim2.new(1.249999165535,0,1.249999165535,0)
- o95.Position = UDim2.new(0,0,0,-25)
- o95.BackgroundColor3 = Color3.new(1, 1, 1)
- o95.BackgroundTransparency = 1
- o96.Parent = o95
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- if script.Parent.Parent.Stage.Value == 0 then
- script.Parent.Image = ""
- end
- if script.Parent.Parent.Stage.Value == 1 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143972101"
- end
- if script.Parent.Parent.Stage.Value == 2 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143972944"
- end
- if script.Parent.Parent.Stage.Value == 3 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143973015"
- end
- if script.Parent.Parent.Stage.Value == 4 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143973101"
- end
- if script.Parent.Parent.Stage.Value == 5 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975045"
- end
- if script.Parent.Parent.Stage.Value == 6 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975153"
- end
- if script.Parent.Parent.Stage.Value == 7 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975287"
- end
- if script.Parent.Parent.Stage.Value == 8 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975446"
- end
- if script.Parent.Parent.Stage.Value == 9 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975528"
- end
- if script.Parent.Parent.Stage.Value == 10 then
- script.Parent.Image = "http://www.roblox.com/asset/?id=143975639"
- end
- wait() --Your CPU can't be tired, without this, the Roblox will crash
- end
- end,o96)
- end))
- o97.Name = "Slender static sound"
- o97.Parent = o70
- o97.SoundId = "http://www.roblox.com/asset/?id=132081621"
- o97.Volume = 0
- o98.Parent = o97
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local s = script.Parent.Parent.Parent.Parent:FindFirstChild("Slender static sound")
- if s == nil then
- s = script.Parent:Clone()
- s.Parent = script.Parent.Parent.Parent.Parent
- end
- while true do
- s.Volume = script.Parent.Parent.Stage.Value / 10
- if s.Volume > 0.5 then
- s.SoundId = "http://www.roblox.com/asset/?id=133267368"
- else
- s.SoundId = "http://www.roblox.com/asset/?id=132081621"
- end
- s:Play()
- wait(0.5)
- s:Stop()
- end
- end,o98)
- end))
- o99.Name = "Deadly"
- o99.Parent = o70
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:FindFirstChild("Body Colors")
- if human ~= nil then
- local player = game.Players:FindFirstChild(hit.Parent.Name)
- if player == nil then
- human.Health = 0
- else
- local gui = player.PlayerGui:FindFirstChild("Slenderdeadscene")
- if gui == nil then
- local f = script.Parent.Script.Slenderdeadscene:Clone()
- f.ImageLabel.Script.cameratoslender.slender.Value = script.Parent.Parent
- f.Parent = player.PlayerGui
- f.ImageLabel.Script.Disabled = false
- end
- end
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o99)
- end))
- mas.Parent = workspace
- mas:MakeJoints()
- local mas1 = mas:GetChildren()
- for i=1,#mas1 do
- mas1[i].Parent = workspace
- ypcall(function() mas1[i]:MakeJoints() end)
- end
- mas:Destroy()
- for i=1,#cors do
- coroutine.resume(cors[i])
- end
- game:GetService("Lighting").Ambient = Color3.new(0.498039, 0.498039, 0.498039)
- game:GetService("Lighting").Brightness = 5
- game:GetService("Lighting").ColorShift_Bottom = Color3.new(1, 1, 1)
- game:GetService("Lighting").ColorShift_Top = Color3.new(1, 1, 1)
- game:GetService("Lighting").GlobalShadows = true
- game:GetService("Lighting").OutdoorAmbient = Color3.new(0.631373, 0.631373, 0.631373)
- game:GetService("Lighting").Outlines = false
- game:GetService("Lighting").GeographicLatitude = 41.733299255371
- game:GetService("Lighting").TimeOfDay = "16:00:00"
- game:GetService("Lighting").FogColor = Color3.new(0, -7.50588, 0)
- game:GetService("Lighting").FogEnd = 1.0000000037683e+14
Advertisement
Add Comment
Please, Sign In to add comment