Quick actions

cmd+k|ctrl+k

Navigation

Languages

Fixed struggle:)

Snippet info

Language

Lua

Visibility

public

Author

santosbryle14

Created

2026-07-09T12:08:23.455799Z

Updated

2026-07-09T12:08:44.144504Z

-- Services
local Workspace = game:GetService("Workspace")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")

-- Camera Shaker Setup
local CameraShaker = require(ReplicatedStorage:WaitForChild("CameraShaker"))
local camera = Workspace.CurrentCamera
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCf)
    camera.CFrame = camera.CFrame * shakeCf
end)
camShake:Start()

-- Entity Spawner Setup
local spawner = loadstring(game:HttpGet("https://raw.githubusercontent.com/RegularVynixu/Utilities/main/Doors/Entity%20Spawner/V2/Source.lua"))()

local entity = spawner.Create({
    Entity = {
        Name = "Struggle",
        Asset = "https://github.com/ThatOneGuyRuben/Stuff/raw/main/FG/DisturbMDL.rbxm",
        HeightOffset = 1
    },
    Lights = {
        Flicker = {
            Enabled = false,
            Duration = 1
        },
        Shatter = false,
        Repair = false
    },
    Earthquake = {
        Enabled = false
    },
    CameraShake = {
        Enabled = false,
        Range = 170,
        Values = {1.5, 20, 0.1, 1}
    },
    Movement = {
        Speed = 100,
        Delay = 5,
        Reversed = false
    },
    Rebounding = {
        Enabled = false,
        Type = "Ambush",
        Min = 1,
        Max = 1,
        Delay = 1
    },
    Damage = {
        Enabled = true,
        Range = 40,
        Amount = 1
    },
    Crucifixion = {
        Enabled = true,
        Range = 40,
        Resist = false,
        Break = true
    },
    Death = {
        Type = "Guiding",
        Hints = {"You Died to who you call..", "Dread!", "First his watch appears, Then he appears too!", "Look out next time!"},
        Cause = ""
    }
})

-- Callbacks
entity:SetCallback("OnSpawned", function()
    print("Entity has spawned")

    -- Safely look for and destroy the default scream to avoid nil instance breaks
    local struggleModel = Workspace:WaitForChild("Struggle", 5)
    if struggleModel then
        local defaultScream = struggleModel:WaitForChild("scream", 3)
        if defaultScream then defaultScream:Destroy() end
    end

    -- Play Appear Sound (1546975842)
    local slam = Instance.new("Sound")
    slam.Parent = Workspace
    slam.PlaybackSpeed = 0.6 -- Modern replacement for deprecated .Pitch
    slam.SoundId = "rbxassetid://1546975842"
    slam:Play()
    Debris:AddItem(slam, 10)

    -- Red Room Light Tween
    local redTweenInfo = TweenInfo.new(3)
    local redInfo = {Color = Color3.fromRGB(255, 0, 0)}
    local currentRooms = Workspace:FindFirstChild("CurrentRooms")
    
    if currentRooms then
        for _, v in pairs(currentRooms:GetDescendants()) do
            if v:IsA("Light") then
                TweenService:Create(v, redTweenInfo, redInfo):Play()
                if v.Parent and v.Parent.Name == "LightFixture" then
                    TweenService:Create(v.Parent, redTweenInfo, redInfo):Play()
                end
            end
        end
    end
end)

entity:SetCallback("OnStartMoving", function()
    print("Entity has started moving")
end)

entity:SetCallback("OnEnterRoom", function(room, firstTime)
    if firstTime == true then
        print("Entity has entered room: ".. room.Name.. " for the first time")
    else
        print("Entity has entered room: ".. room.Name.. " again")
    end
end)

entity:SetCallback("OnLookAt", function(lineOfSight)
    if lineOfSight == true then
        print("Player is looking at entity")
    else
        print("Player view is obstructed by something")
    end
end)

entity:SetCallback("OnRebounding", function(startOfRebound)
    if startOfRebound == true then
        print("Entity has started rebounding")
    else
        print("Entity has finished rebounding")
    end
end)

entity:SetCallback("OnDespawning", function()
    print("Entity is despawning")
end)

entity:SetCallback("OnDespawned", function()
    print("Entity has despawned")

    -- Despawn Sound Effects
    local slam = Instance.new("Sound")
    slam.Parent = Workspace
    slam.Volume = 4
    slam.PlaybackSpeed = 0.6
    slam.SoundId = "rbxassetid://1837829565"
    slam:Play()
    Debris:AddItem(slam, 5)

    camShake:ShakeOnce(15, 25, 0, 2, 1, 6)

    -- Display Custom Achievement
    local achievementGiver = loadstring(game:HttpGet("https://raw.githubusercontent.com/RegularVynixu/Utilities/main/Doors/Custom%20Achievements/Source.lua"))()
    achievementGiver({
        Title = "Unexpected Disaster",
        Desc = "Hide or you will suffer.",
        Reason = "Encounter Struggle.",
        Image = "rbxassetid://107235108660243"
    })
end)

entity:SetCallback("OnDamagePlayer", function(newHealth)
    
    local function playSound(id, volume)
        local sound = Instance.new("Sound")
        sound.SoundId = "rbxassetid://" .. tostring(id)
        sound.Volume = volume or 1
        sound.PlayOnRemove = true
        sound.Parent = Workspace
        sound:Destroy() -- Instantly fires via PlayOnRemove and cleans up memory
    end

    local function jumpscare(imageId1, imageId2, soundId1, soundId2, flashColor, teaseData, shakeEnabled)
        local MinTeaseSize, MaxTeaseSize = 150, 750
        local image1 = "rbxassetid://" .. tostring(imageId1)
        local image2 = "rbxassetid://" .. tostring(imageId2)

        local JumpscareGui = Instance.new("ScreenGui")
        local Background = Instance.new("Frame")
        local Face = Instance.new("ImageLabel")

        JumpscareGui.Name = "JumpscareGui"
        JumpscareGui.IgnoreGuiInset = true
        JumpscareGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

        Background.Name = "Background"
        Background.BackgroundColor3 = Color3.new(0, 0, 0)
        Background.BorderSizePixel = 0
        Background.Size = UDim2.new(1, 0, 1, 0)
        Background.ZIndex = 999

        Face.Name = "Face"
        Face.AnchorPoint = Vector2.new(0.5, 0.5)
        Face.BackgroundTransparency = 1
        Face.Position = UDim2.new(0.5, 0, 0.5, 0)
        Face.ResampleMode = Enum.ResamplerMode.Pixelated
        Face.Size = UDim2.new(0, MinTeaseSize, 0, MinTeaseSize)
        Face.Image = image1

        Face.Parent = Background
        Background.Parent = JumpscareGui
        
        -- Fallback to PlayerGui if CoreGui isn't accessible in execution level
        local targetGui = CoreGui or Players.LocalPlayer:WaitForChild("PlayerGui")
        JumpscareGui.Parent = targetGui

        -- Tease Phase
        if teaseData and teaseData.Enabled then
            if soundId1 then
                playSound(soundId1, teaseData.Sound1Volume or 1)
            end

            local rdmTease = math.random(teaseData.Min, teaseData.Max)
            for _ = 1, rdmTease do
                task.wait(math.random(100, 200) / 100)
                local growFactor = (MaxTeaseSize - MinTeaseSize) / rdmTease
                Face.Size = UDim2.new(0, Face.AbsoluteSize.X + growFactor, 0, Face.AbsoluteSize.Y + growFactor)
            end
            task.wait(math.random(100, 200) / 100)
        end

        -- Red Flash Loop
        if flashColor then
            task.spawn(function()
                while JumpscareGui.Parent do
                    Background.BackgroundColor3 = flashColor
                    task.wait(math.random(25, 100) / 1000)
                    Background.BackgroundColor3 = Color3.new(0, 0, 0)
                    task.wait(math.random(25, 100) / 1000)
                end
            end)
        end

        -- Screen Shake Loop
        if shakeEnabled then
            task.spawn(function()
                local origin = Face.Position
                while JumpscareGui.Parent do
                    Face.Position = origin + UDim2.new(0, math.random(-10, 10), 0, math.random(-10, 10))
                    Face.Rotation = math.random(-5, 5)
                    task.wait()
                end
            end)
        end

        -- Final Impact Audio Execution
        if soundId2 then
            playSound(soundId2, 1)
        end

        Face.Image = image2
        Face.Size = UDim2.new(0, 750, 0, 750)

        TweenService:Create(Face, TweenInfo.new(0.75), {
            Size = UDim2.new(0, 2000, 0, 2000),
            ImageTransparency = 0.5
        }):Play()

        task.wait(0.75)
        JumpscareGui:Destroy()
    end

    -- Run the jumpscare layout utilizing your specified --sfx input identifier (9113731836)
    jumpscare(
        135322783205122, 
        135322783205122, 
        10483790459, 
        9113731836, -- Applied user requested sound effect ID here
        Color3.fromRGB(255, 0, 0), 
        {
            Enabled = true,
            Min = 2,
            Max = 5,
            Sound1Volume = 1
        },
        true 
    )

    if replicatesignal then
        replicatesignal(Players.LocalPlayer.Kill)
    else
        Players.LocalPlayer.Character:BreakJoints()
    end

end)

entity:Run()
INFO