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)()
- local enableDamage = true
- local currentLoadedRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
- local eyes = game:GetObjects("rbxassetid://108058013422462")[1]
- local blinkConnection
- game.Workspace.CurrentRooms.ChildAdded:Connect(function()
- local core = game.Workspace:FindFirstChild("Blink")
- if core then
- core:Destroy()
- if blinkConnection then
- blinkConnection:Disconnect()
- blinkConnection = nil
- end
- end
- enableDamage = true
- end)
- local num = math.floor(#currentLoadedRoom.Nodes:GetChildren() / 2)
- eyes.CFrame = (num == 0 and currentLoadedRoom.Base or currentLoadedRoom.Nodes[num]).CFrame + Vector3.new(0, 3, 0)
- eyes.Parent = workspace
- local Close = eyes.Attachment.Close
- local Open = eyes.Attachment.Open
- local Change = eyes.Change
- local hum = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
- local humanoidRootPart = hum.Parent:FindFirstChild("HumanoidRootPart")
- local lastPosition = humanoidRootPart.Position
- local lastDamageTime = tick()
- local function onHeartbeat()
- if Open.Enabled then
- local currentTime = tick()
- if currentTime - lastDamageTime >= 1 then
- local currentPosition = humanoidRootPart.Position
- if (currentPosition - lastPosition).Magnitude > 0.1 then
- hum.Health = hum.Health - 10
- if hum.Health <= 0 then
- game:GetService("ReplicatedStorage").GameStats["Player_" .. game.Players.LocalPlayer.Name].Total.DeathCause.Value = "Blink"
- firesignal(game.ReplicatedStorage.RemotesFolder.DeathHint.OnClientEvent, {
- "You died to Blink",
- "Don't move with his eyes open!",
- "Try again"
- }, "Blue")
- end
- end
- lastDamageTime = currentTime
- lastPosition = currentPosition
- end
- end
- end
- blinkConnection = game:GetService("RunService").Heartbeat:Connect(onHeartbeat)
- coroutine.wrap(function()
- wait(2)
- while true do
- if not eyes.Parent then break end
- Close.Enabled = true
- Open.Enabled = false
- Change:Play()
- wait(7)
- if not eyes.Parent then break end
- Close.Enabled = false
- Open.Enabled = true
- Change:Play()
- wait(7)
- end
- end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement