Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait() -- Letting Some Things Load
- -- Variables
- local lighting = game.Lighting
- local debounce = false
- -- Objects
- local center = script.Parent
- -- Values
- local Range = script.RadiusRange.Value
- -- Functions
- local function getplayersinvicinity(text)
- for _,player in pairs(game:GetService("Players"):GetPlayers()) do
- for _,bodypart in pairs(player.Character:GetChildren()) do
- if bodypart.Name == "HumanoidRootPart" then
- local dist = (center.Position - bodypart.Position).Magnitude
- if dist <= Range then
- local gui = player.PlayerGui.BLD
- local frame = gui.Frame
- local textlabel = frame.TextLabel
- gui.Enabled = true
- game:GetService("TweenService"):Create(frame,TweenInfo.new(0.35),{Transparency = 0.4}):Play()
- wait(0.35)
- textlabel.Text = text
- wait(8)
- textlabel.Text = ""
- game:GetService("TweenService"):Create(frame,TweenInfo.new(0.35),{Transparency = 1}):Play()
- wait(0.35)
- gui.Enabled = false
- end
- end
- end
- end
- end
- -- Code
- lighting.Changed:Connect(function()
- if tostring(game.Lighting.TimeOfDay) == "08:00:00" then
- if debounce == false then
- debounce = true
- local text = "Prison Announcement: It's Breakfast Time! Head Down To The Cafeteria For Some Pancakes π₯"
- getplayersinvicinity(text)
- debounce = false
- end
- elseif tostring(game.Lighting.TimeOfDay) == "12:00:00" then
- if debounce == false then
- debounce = true
- local text = "Prison Announcement: It's Lunch Time! Head Down To The Cafeteria For Some Sandwiches and Apple Juice π₯ͺ π₯"
- getplayersinvicinity(text)
- debounce = false
- end
- elseif tostring(game.Lighting.TimeOfDay) == "17:00:00" then
- if debounce == false then
- debounce = true
- local text = "Prison Announcement: It's Dinner Time! Head Down To The Cafeteria For a Nice Hot Meal Before Bed π"
- getplayersinvicinity(text)
- debounce = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement