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?

18 comments
:remove is deprecated, use :Destroy. Messages are also deprecated, use Guis, a TextLabel if it should not be interacted with. Also, use local variables, you are using global for your functions.
even booga booga uses them
Because they don't know how to make a game, or they made them LOOK like messages. And they are deprecated.
well i'll do that later , it drops no errors anyway
It doesn't matter if it doesn't, you should not be using deprecated methods, neither should you use global variables.
why i shouldn't be using global variables
Because they are bad practice. They make code messy (as shown), pollute the global namespace and can increase the risk for name collisions.
i didn't put global variables tho
Yes you did. Your functions are global. It's a global variable.
But i wont do any functions that have the same name..
You shouldn't be using globales at all. There's no excuse to use them. I'm just giving you better practices.
when i put a local function i have to write the entire name , when i use globals i just put the beggining and it will auto-write
what?
https://gyazo.com/47a7059e21905947bcdee9cc98a58a72
it's weird that deprecated things work, so it's not the end of the world if you accidentally use :remove() instead of :Destroy(), but just keep them up to date in case for example roblox crates an update that all deprecated things dont work anymore at all
and if you use a global and its not in any script block than it's okay lol
y'all too busy arguing over depreciated code instead of actually answering the question and it's getting kind of ridiculous. Are studio API services enabled? Have you tried running print statements all over to see if it's getting that far? Datastore functions should be wrapped in pcall as well to catch errors...there's a lot of possibilities with this script
yes i did