Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

A better method for Global Messages than running off the clock?

Asked by 6 years ago

Hi there!

I have a message system that announces specific events to the whole server, just like any typical say, jail game, minigames or school game. "Class is starting now! (Teleport) that type of thing.

The way I do this is running off the clock's time.

here is an example chunk of it:

if game.Lighting.TimeOfDay == "07:00:00" then
        player.PlayerGui.Teleport.breakfastbeginning.Visible = true
        wait(20)
        player.PlayerGui.Teleport.breakfastbeginning.Visible = false
    end

The easiest way of explaining what this problem is - if an event pops up at 7:10:00 but they come in the server at 7:12:00, they will not see this message.

This is not too big of a deal, but more serious issues have happened because of this. Various events a player can do while playing can completely break their ability to see these popup messages. For an example, if their game freezes for a time, if they tab out (weird right), or if they teleport using a teleporter at a specific time of an event is supposed to pop up, they NEVER get the notification. And sometimes, their notifications just stop coming up completely! Big problem!

I'm not even sure a different way to tackle this. It needs to be more.. server based, I believe? Less player based? Those terms confuse me but I hope you understand what I mean.

Thank you so much for your help and advice.

1 answer

Log in to vote
0
Answered by 6 years ago

This would help a little bit .. If time doesn't change then the newJoiner's script will execute

if game.Lighting.TimeOfDay == "07:00:00" then
        player.PlayerGui.Teleport.breakfastbeginning.Visible = true
    game.Lighting.TimeOfDay = "07:00;01"
        wait(20)
        player.PlayerGui.Teleport.breakfastbeginning.Visible = false
    end
Ad

Answer this question