Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

I have problems with :OnUpdate() , Function called without even changing the key?

Asked by 13 days ago
Edited 13 days ago

Hello , im doing a game , and im doing it to have a update servers feature, But my problem is that when i join the UpdateServers load instantly and i didn't even change the key

local data = game:GetService("DataStoreService")
local startUpdate = data:GetDataStore("censored")
function MessageToScreen(msg,isperm,waitt)
    local a = Instance.new("Message", workspace)
    a.Name = "ys27h872hs3gd7agd726ds8agwd972gdsga78wgd27d3"
    a.Text = msg
    if isperm == false then
        wait(waitt)
        a:remove()
    end
end
function UpdateServers()
    print("Starting....")
    MessageToScreen("Servers Are Updating , Please wait...",true)
    print("Teleporting..")
    for i,v in pairs(game:GetService("Players"):GetPlayers()) do
        game:GetService("TeleportService"):Teleport(2389452311,v)
    end
end
startUpdate:OnUpdate("UPDTSRVS",UpdateServers)
0
First off use local variables second off messages are deprecated, use GUIs, third off, :remove is deprecated, use :Destroy fourth off you never show where you define startUpdate or isperm fifth off you are passing a boolean as an argument to the wait function, sixth off please separate your commas so i, v and not i,v incapaxx 2426 — 13d
0
i read isperm as i sperm not is perm and spit my drink out. DinozCreates 731 — 13d
0
Why do i have to show startUpdate , Its a data store , and i dont want players to use my data store maumaumaumaumaumau 83 — 13d
0
If you dont show where something is defined we cant assume it was done properly. DinozCreates 731 — 13d
View all comments (3 more)
0
It's not your data store it's Roblox's lol. Also what do you mean they'll use your data store. incapaxx 2426 — 13d
0
k maumaumaumaumaumau 83 — 13d
0
@incapaxx actually waitt is nil when he calls it, so no, waitt probably stands for "wait time" TerrodactyI 124 — 13d

Answer this question