Advertisement
munciseek

Untitled

Jan 2nd, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. coroutine.wrap(function()
  2. game:GetService("ReplicatedStorage").GameData.LatestRoom.Changed:Connect(function(v)
  3. local room = game:GetService("Workspace").CurrentRooms[v]
  4. local nodes = room.PathfindNodes:Clone()
  5. nodes.Parent = room
  6. nodes.Name = 'Nodes'
  7. end)
  8. end)()
  9.  
  10. wait(0.5)
  11. local enableDamage = true
  12. local eyes = game:GetObjects("rbxassetid://125171553498127")[1]
  13. local hum = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  14. local humanoidRootPart = hum.Parent:FindFirstChild("HumanoidRootPart")
  15. local Crouch = game.Players.LocalPlayer.PlayerGui.MainUI.MainFrame.Healthbar.Effects.Crouching
  16. local lastPosition = humanoidRootPart.Position
  17. local TweenService = game:GetService("TweenService")
  18. local lighting = game.Lighting
  19.  
  20. -- 创建初始雾效动画
  21. local fogTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  22. local fogTween = TweenService:Create(lighting, fogTweenInfo, {FogEnd = 30, FogStart = 0})
  23. fogTween:Play()
  24.  
  25. local currentLoadedRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
  26. local num = math.floor(#currentLoadedRoom.Nodes:GetChildren() / 2)
  27. eyes.CFrame = (num == 0 and currentLoadedRoom.Base or currentLoadedRoom.Nodes[num]).CFrame + Vector3.new(0, 10, 0)
  28. eyes.Parent = workspace
  29.  
  30. local function cleanCurrentRoom()
  31. local currentRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
  32. local LightFixtures = currentRoom.Assets:FindFirstChild("Light_Fixtures")
  33. local chandeliers = currentRoom.Assets:GetChildren()
  34.  
  35. if LightFixtures then
  36. LightFixtures:Destroy()
  37. end
  38.  
  39. for _, object in ipairs(chandeliers) do
  40. if object.Name == "Chandelier" then
  41. object:Destroy()
  42. end
  43. end
  44. end
  45.  
  46. cleanCurrentRoom()
  47.  
  48. game:GetService("ReplicatedStorage").GameData.LatestRoom.Changed:Connect(function()
  49. if eyes.Parent then
  50. eyes:Destroy()
  51. end
  52. enableDamage = false
  53.  
  54. local fogChangeTween = TweenService:Create(lighting, fogTweenInfo, {FogEnd = 250, FogStart = 150})
  55. fogChangeTween:Play()
  56. end)
  57.  
  58. while true and enableDamage do
  59. if not game.Workspace:FindFirstChild("Silence") then break end
  60. local currentPosition = humanoidRootPart.Position
  61. local isMoving = (currentPosition - lastPosition).Magnitude > 0.1
  62.  
  63. if not Crouch.Visible and isMoving then
  64. hum.Health -= 5
  65. if hum.Health <= 0 then
  66. game:GetService("ReplicatedStorage").GameStats["Player_" .. game.Players.LocalPlayer.Name].Total.DeathCause.Value = "Silence"
  67. firesignal(game.ReplicatedStorage.RemotesFolder.DeathHint.OnClientEvent, {
  68. "You died to Silence",
  69. "You should keep quiet",
  70. "It needs quiet"
  71. }, "Blue")
  72. end
  73. end
  74.  
  75. lastPosition = currentPosition
  76. task.wait(1)
  77. end
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement