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

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

Asked by 5 years ago
Edited 5 years 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 User#24403 69 — 5y
0
i read isperm as i sperm not is perm and spit my drink out. DinozCreates 1070 — 5y
0
Why do i have to show startUpdate , Its a data store , and i dont want players to use my data store maumaumaumaumaumau 98 — 5y
0
If you dont show where something is defined we cant assume it was done properly. DinozCreates 1070 — 5y
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. User#24403 69 — 5y
0
k maumaumaumaumaumau 98 — 5y
0
@incapaxx actually waitt is nil when he calls it, so no, waitt probably stands for "wait time" TerrodactyI 173 — 5y

Answer this question