Still have questions? Join our Discord server and get real time help.
0

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

Edited 2 months 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
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

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 2881 — 2mo
0
i read isperm as i sperm not is perm and spit my drink out. DinozCreates 746 — 2mo
0
Why do i have to show startUpdate , Its a data store , and i dont want players to use my data store maumaumaumaumaumau 98 — 2mo
0
If you dont show where something is defined we cant assume it was done properly. DinozCreates 746 — 2mo