Advertisement
munciseek

Untitled

Nov 30th, 2024 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 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 currentLoadedRoom = workspace.CurrentRooms[game:GetService("ReplicatedStorage").GameData.LatestRoom.Value]
  13. local eyes = game:GetObjects("rbxassetid://87636504401588")[1]
  14.  
  15. game.Workspace.CurrentRooms.ChildAdded:Connect(function()
  16. local core = game.Workspace:FindFirstChild("IMPEyes")
  17. if core then core:Destroy() end
  18. enableDamage = true
  19. end)
  20.  
  21. local num = math.floor(#currentLoadedRoom.Nodes:GetChildren() / 2)
  22. eyes.CFrame = (num == 0 and currentLoadedRoom.Base or currentLoadedRoom.Nodes[num]).CFrame + Vector3.new(0, 3, 0)
  23. eyes.Parent = workspace
  24.  
  25. local hum = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  26. while true and enableDamage do
  27. if not game.Workspace:FindFirstChild("IMPEyes") then break end
  28. local _, found = workspace.CurrentCamera:WorldToScreenPoint(eyes.Position)
  29. if found then
  30. hum.Health -= 1
  31. eyes.Attack:Play()
  32. if hum.Health <= 0 then
  33. game:GetService("ReplicatedStorage").GameStats["Player_" .. game.Players.LocalPlayer.Name].Total.DeathCause.Value = "Eyes"
  34. firesignal(game.ReplicatedStorage.RemotesFolder.DeathHint.OnClientEvent, {
  35. "You died to Eyes",
  36. "It's different from normal it",
  37. "It can kill you faster"
  38. }, "Blue")
  39. end
  40. end
  41. task.wait(0.01)
  42. end
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement