Hello , i have been creating a script builder , i made two places one for waiting and another to give the info that the servers will update... The problem i have is that when i try to give the request it doesn't work
Code of the request of updates
-- RemoteEvent will be called by a localscript game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr) print("Received request.") local data = game:GetService("DataStoreService") local startUpdate = data:GetDataStore("CENSORED") startUpdate:UpdateAsync("UPDTSRVS",function(old) local newValue = old newValue = newValue+1 return newValue end) end)
Code of the script that will action on update
function MessageToScreen(msg,isperm,waitt) local a = Instance.new("Message") a.Name = "ys27h872hs3gd7agd726ds8agwd972gdsga78wgd27d3" a.Text = msg if isperm == false then wait(waitt) a:remove() end end function UpdateServers(key) print("New server update , New update ID is: "..key) print("Starting..") MessageToScreen("Servers Are Updating , Please wait...",true,math.huge) for i,v in pairs(game:GetService("Players"):GetPlayers()) do game:GetService("TeleportService"):Teleport(838000617,v) end end startUpdate:OnUpdate("UPDTSRVS",UpdateServers)
Why didn't it work?