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

How can I make a RemoteEvent Live Event happen across all servers?

Asked by 4 years ago
Edited 4 years ago

I have a game that has Live events, but I have been trying to get the events to happen on every server, for context, I use RemoteEvents and ScreenGuis to make the Events happen, below is the code I use for the ScreenGui and the parts in the event

function onClick()
    game.ReplicatedStorage.Eventpartname:FireServer()
end

script.Parent.MouseButton1Click:Connect (onClick)
game.ReplicatedStorage.Eventpart.OnServerEvent:Connect(function(player)
    script.Parent.Transparency = 0
    game.Workspace.Blasting:Play()
    script.Parent.Attachment.ParticleEmitter:Emit(5000)
end)

If I can make the Event happen across all servers, what script could I use, and how?

1 answer

Log in to vote
0
Answered by 4 years ago

You could use os.date and use UTC instead of Local Time and check if that time is equal to the specified time.

local eventTimeH = "12"
local eventTimeM = "00"

while wait() do
    if os.date("!*t").hour == eventTimeH then
        if os.date("!*t").min == eventTimeM then
            break
        end
    end
end

print("Event Is Happening!")

You can also add onto that using MessagingService to add extra pizzazz if you wanted, as this will send a message to all servers using PublishAsync() and the servers will receive the messages using SubscribeAsync().

Hope this helped! Feel free to select this as an answer if this helped you!


MessagingService

OS

Ad

Answer this question