Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- coroutine.wrap(function()
- game:GetService("ReplicatedStorage").GameData.LatestRoom.Changed:Connect(function(v)
- local room = game:GetService("Workspace").CurrentRooms[v]
- local nodes = room.PathfindNodes:Clone()
- nodes.Parent = room
- nodes.Name = 'Nodes'
- end)
- end)()
- wait(0.5)
- local enableDamage = true
- local eyes = game:GetObjects("rbxassetid://125171553498127")[1]
- local hum = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
- local humanoidRootPart = hum.Parent:FindFirstChild("HumanoidRootPart")
- local Crouch = game.Players.LocalPlayer.PlayerGui.MainUI.MainFrame.Healthbar.Effects.Crouching
- local lastPosition = humanoidRootPart.Position
- local TweenService = game:GetService("TweenService")
- local lighting = game.Lighting
- -- 创建初始雾效动画
- local fogTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local fogTween = TweenService:Create(lighting, fogTweenInfo, {FogEnd = 30, FogStart = 0})
- fogTween:Play()
- local currentLoadedRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
- local num = math.floor(#currentLoadedRoom.Nodes:GetChildren() / 2)
- eyes.CFrame = (num == 0 and currentLoadedRoom.Base or currentLoadedRoom.Nodes[num]).CFrame + Vector3.new(0, 10, 0)
- eyes.Parent = workspace
- local function cleanCurrentRoom()
- local currentRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
- local LightFixtures = currentRoom.Assets:FindFirstChild("Light_Fixtures")
- local chandeliers = currentRoom.Assets:GetChildren()
- if LightFixtures then
- LightFixtures:Destroy()
- end
- for _, object in ipairs(chandeliers) do
- if object.Name == "Chandelier" then
- object:Destroy()
- end
- end
- end
- cleanCurrentRoom()
- game:GetService("ReplicatedStorage").GameData.LatestRoom.Changed:Connect(function()
- if eyes.Parent then
- eyes:Destroy()
- end
- enableDamage = false
- local fogChangeTween = TweenService:Create(lighting, fogTweenInfo, {FogEnd = 250, FogStart = 150})
- fogChangeTween:Play()
- end)
- while true and enableDamage do
- if not game.Workspace:FindFirstChild("Silence") then break end
- local currentPosition = humanoidRootPart.Position
- local isMoving = (currentPosition - lastPosition).Magnitude > 0.1
- if not Crouch.Visible and isMoving then
- hum.Health -= 5
- if hum.Health <= 0 then
- game:GetService("ReplicatedStorage").GameStats["Player_" .. game.Players.LocalPlayer.Name].Total.DeathCause.Value = "Silence"
- firesignal(game.ReplicatedStorage.RemotesFolder.DeathHint.OnClientEvent, {
- "You died to Silence",
- "You should keep quiet",
- "It needs quiet"
- }, "Blue")
- end
- end
- lastPosition = currentPosition
- task.wait(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement