Advertisement
munciseek

Untitled

Jan 1st, 2025 (edited)
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 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. local enableDamage = true
  11. local currentLoadedRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
  12. local eyes = game:GetObjects("rbxassetid://108058013422462")[1]
  13.  
  14. local blinkConnection
  15.  
  16. game.Workspace.CurrentRooms.ChildAdded:Connect(function()
  17. local core = game.Workspace:FindFirstChild("Blink")
  18. if core then
  19. core:Destroy()
  20. if blinkConnection then
  21. blinkConnection:Disconnect()
  22. blinkConnection = nil
  23. end
  24. end
  25. enableDamage = true
  26. end)
  27.  
  28. local num = math.floor(#currentLoadedRoom.Nodes:GetChildren() / 2)
  29. eyes.CFrame = (num == 0 and currentLoadedRoom.Base or currentLoadedRoom.Nodes[num]).CFrame + Vector3.new(0, 3, 0)
  30. eyes.Parent = workspace
  31.  
  32. local Close = eyes.Attachment.Close
  33. local Open = eyes.Attachment.Open
  34. local Change = eyes.Change
  35.  
  36. local hum = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  37. local humanoidRootPart = hum.Parent:FindFirstChild("HumanoidRootPart")
  38. local lastPosition = humanoidRootPart.Position
  39. local lastDamageTime = tick()
  40.  
  41. local function onHeartbeat()
  42. if Open.Enabled then
  43. local currentTime = tick()
  44. if currentTime - lastDamageTime >= 1 then
  45. local currentPosition = humanoidRootPart.Position
  46. if (currentPosition - lastPosition).Magnitude > 0.1 then
  47. hum.Health = hum.Health - 10
  48. if hum.Health <= 0 then
  49. game:GetService("ReplicatedStorage").GameStats["Player_" .. game.Players.LocalPlayer.Name].Total.DeathCause.Value = "Blink"
  50. firesignal(game.ReplicatedStorage.RemotesFolder.DeathHint.OnClientEvent, {
  51. "You died to Blink",
  52. "Don't move with his eyes open!",
  53. "Try again"
  54. }, "Blue")
  55. end
  56. end
  57. lastDamageTime = currentTime
  58. lastPosition = currentPosition
  59. end
  60. end
  61. end
  62.  
  63. blinkConnection = game:GetService("RunService").Heartbeat:Connect(onHeartbeat)
  64.  
  65. coroutine.wrap(function()
  66.  
  67. wait(2)
  68. while true do
  69. if not eyes.Parent then break end
  70. Close.Enabled = true
  71. Open.Enabled = false
  72. Change:Play()
  73. wait(7)
  74.  
  75. if not eyes.Parent then break end
  76. Close.Enabled = false
  77. Open.Enabled = true
  78. Change:Play()
  79. wait(7)
  80. end
  81. end)()
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement