Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RunService = game:GetService("RunService")
- local Workspace = game:GetService("Workspace")
- -- 加载外部工具
- HookHelper = loadstring(game:HttpGet("https://raw.githubusercontent.com/ChronoAcceleration/Comet-Development/refs/heads/main/Doors/Utility/DoorsScriptUtility.lua"))()
- SyncHelper = loadstring(game:HttpGet("https://github.com/ChronoAcceleration/Comet-Development/raw/refs/heads/main/Doors/Utility/SyncHelper.lua"))()
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local roomHook = HookHelper.RoomHook:New()
- -- 全局变量
- local isRunning = false
- local isRoomLocked = false
- local speedsterChance = 5
- -- 初始化音效和灯光
- local sound = Instance.new("Sound", Workspace)
- sound.SoundId = "rbxassetid://101724323124983"
- sound.Looped = true
- sound.Volume = 0.01
- sound:Play()
- game.Lighting.FogEnd = 50
- game.Lighting.FogStart = 10
- game.Lighting.OutdoorAmbient = Color3.fromRGB(60, 60, 60)
- -- 显示初始文本
- local function executeText()
- local messages = {
- "Misfortune has snuck up on to you, and you have been dragged down to hell.",
- "As you make your way through the reception room, you wonder if you are alone.",
- "You soon realize you are not.",
- "There are hungry beings in this hellscape. Hide, defend, and run until door 100.",
- "Goodluck."
- }
- for _, text in messages do
- require(player.PlayerGui.MainUI.Initiator.Main_Game).caption(text, true)
- task.wait(4)
- end
- end
- -- 创建难度选择界面
- local screenGui = Instance.new("ScreenGui", player.PlayerGui)
- local frame = Instance.new("Frame", screenGui)
- frame.Size = UDim2.new(0.5, 0, 0.5, 0)
- frame.Position = UDim2.new(0.25, 0, 0.25, 0)
- local function createButton(text, position, callback)
- local button = Instance.new("TextButton", frame)
- button.Size = UDim2.new(0.3, 0, 0.2, 0)
- button.Position = position
- button.Text = text
- button.MouseButton1Click:Connect(callback)
- return button
- end
- createButton("Intermediate", UDim2.new(0.1, 0, 0.1, 0), function()
- speedsterChance = 10
- screenGui:Destroy()
- executeText()
- end)
- createButton("Medium", UDim2.new(0.1, 0, 0.4, 0), function()
- speedsterChance = 5
- isRunning = true
- screenGui:Destroy()
- executeText()
- end)
- createButton("Hard", UDim2.new(0.1, 0, 0.7, 0), function()
- speedsterChance = 3
- isRunning = true
- screenGui:Destroy()
- executeText()
- end)
- -- 处理房间变化
- roomHook:On("ServerRoomChanged", function(roomModel)
- if roomModel.Name == "10" then
- isRunning = false
- -- 成就提示
- local achievementGiver = loadstring(game:HttpGet("https://raw.githubusercontent.com/RegularVynixu/Utilities/main/Doors/Custom%20Achievements/Source.lua"))()
- achievementGiver({
- Title = "Cant Keep My Eyes Off You",
- Desc = "And stay out!",
- Reason = "Survive the Gatekeeper.",
- Image = "rbxassetid://13769107799"
- })
- end
- -- 生成随机事件
- local randomNumber = SyncHelper:generateFullRandom(1, speedsterChance, tonumber(roomModel.Name))
- if randomNumber == 1 and not (roomModel.Name == "1" or roomModel.Name == "2" or roomModel.Name == "3" or roomModel.Name == "4" or roomModel.Name == "5") then
- spawnEntity(roomModel, "Speedster", "rbxassetid://9125351901", "http://www.roblox.com/asset/?id=12001502218", 5, 45)
- end
- end)
- -- 生成实体
- local function spawnEntity(roomModel, entityName, soundId, imageId, tweenDuration, damageRange)
- local part = Instance.new("Part", Workspace)
- part.Anchored = true
- part.Transparency = 1
- local sound = Instance.new("Sound", part)
- sound.SoundId = soundId
- sound.Looped = true
- sound.Volume = 10
- sound:Play()
- local billboardGui = Instance.new("BillboardGui", part)
- local imageLabel = Instance.new("ImageLabel", billboardGui)
- imageLabel.Image = imageId
- imageLabel.Size = UDim2.new(1, 0, 1, 0)
- local oldestRoom = Workspace.CurrentRooms:GetChildren()[1]
- part:PivotTo(oldestRoom.Door:GetPivot())
- local tween = game:GetService("TweenService"):Create(part, TweenInfo.new(tweenDuration), {Position = roomModel.Door:GetPivot().Position})
- tween:Play()
- RunService.Heartbeat:Connect(function()
- if character and character:FindFirstChild("Humanoid") then
- local distance = (part.Position - character.HumanoidRootPart.Position).Magnitude
- if distance <= damageRange and not character:GetAttribute("Hiding") then
- character.Humanoid:TakeDamage(character.Humanoid.Health)
- end
- end
- end)
- tween.Completed:Connect(function()
- part:Destroy()
- end)
- end
- -- 锁定房间事件
- roomHook:On("LockedRoom", function()
- isRoomLocked = true
- end)
- -- 持续伤害逻辑
- while true do
- task.wait(1)
- if isRoomLocked == false and isRunning == true then
- player.Character.Humanoid:TakeDamage(3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement