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)

7 comments

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

0

i read isperm as i sperm not is perm and spit my drink out.

0

Why do i have to show startUpdate , Its a data store , and i dont want players to use my data store

0

If you dont show where something is defined we cant assume it was done properly.

0

It's not your data store it's Roblox's lol. Also what do you mean they'll use your data store.

0

k

0

@incapaxx actually waitt is nil when he calls it, so no, waitt probably stands for "wait time"