Advertisement
Guest User

CBIABPCYEAIPB2216847139

a guest
Dec 6th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. wait() -- Letting Some Things Load
  2.  
  3. -- Variables
  4. local lighting = game.Lighting
  5. local debounce = false
  6.  
  7. -- Objects
  8. local center = script.Parent
  9.  
  10. -- Values
  11. local Range = script.RadiusRange.Value
  12.  
  13. -- Functions
  14. local function getplayersinvicinity(text)
  15. for _,player in pairs(game:GetService("Players"):GetPlayers()) do
  16. for _,bodypart in pairs(player.Character:GetChildren()) do
  17. if bodypart.Name == "HumanoidRootPart" then
  18. local dist = (center.Position - bodypart.Position).Magnitude
  19. if dist <= Range then
  20. local gui = player.PlayerGui.BLD
  21. local frame = gui.Frame
  22. local textlabel = frame.TextLabel
  23. gui.Enabled = true
  24. game:GetService("TweenService"):Create(frame,TweenInfo.new(0.35),{Transparency = 0.4}):Play()
  25. wait(0.35)
  26. textlabel.Text = text
  27. wait(8)
  28. textlabel.Text = ""
  29. game:GetService("TweenService"):Create(frame,TweenInfo.new(0.35),{Transparency = 1}):Play()
  30. wait(0.35)
  31. gui.Enabled = false
  32. end
  33. end
  34. end
  35. end
  36. end
  37.  
  38. -- Code
  39. lighting.Changed:Connect(function()
  40. if tostring(game.Lighting.TimeOfDay) == "08:00:00" then
  41. if debounce == false then
  42. debounce = true
  43. local text = "Prison Announcement: It's Breakfast Time! Head Down To The Cafeteria For Some Pancakes πŸ₯ž"
  44. getplayersinvicinity(text)
  45. debounce = false
  46. end
  47. elseif tostring(game.Lighting.TimeOfDay) == "12:00:00" then
  48. if debounce == false then
  49. debounce = true
  50. local text = "Prison Announcement: It's Lunch Time! Head Down To The Cafeteria For Some Sandwiches and Apple Juice πŸ₯ͺ πŸ₯ƒ"
  51. getplayersinvicinity(text)
  52. debounce = false
  53. end
  54. elseif tostring(game.Lighting.TimeOfDay) == "17:00:00" then
  55. if debounce == false then
  56. debounce = true
  57. local text = "Prison Announcement: It's Dinner Time! Head Down To The Cafeteria For a Nice Hot Meal Before Bed 🍝"
  58. getplayersinvicinity(text)
  59. debounce = false
  60. end
  61. end
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement