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

Is there a tutorial on checking if the server is up-to-date?

Asked by 6 years ago

This is still technically a coding question.

I want to know if it's possible to make it so it tells you if the server is up to date or not, like in Murder Mystery 2. I see a ton of games with a small board saying this, and I find it extremely useful. Anyone know where to find a tutorial on how to do this?

0
Not 100% sure but this could possibly help: http://wiki.roblox.com/index.php?title=API:Class/DataModel/PlaceVersion Mayk728 855 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Here is one way: In the studio explorer, write a value of the server version. Make a module script with a function that returns the newest version. Make a script in your game that checks if there is a difference between the numbers.

When you update: You will have to change the version in the module script, and change the version in the studio to be the SAME.

All old games will be shut-down!

Code: ModuleScript:

local version=1 --Put whatever version you put in studio
--MAKE SURE TO NAME THIS "MainModule", No Quotes, No Comma, and proper caps!

return version

Game:

while wait() do
local num=require(PUT MODULE SCRIPT ID HERE)
if num~=game.Workspace.Version.Value then
local plyrs=game.Players:GetChildren()
for i=1,#plyrs,1 do
plyrs[i]:Kick("Game Updated. Please Rejoin.")
end
end
end
0
It kind of works. Not that well, though, and it doesn't work everytime. 0HappyManDudeguy0 15 — 6y
Ad

Answer this question