Hello, I’m trying to make a small GUI in the bottom left that has the place version and will tell you if the server is up to date. While making this the script is working except it’s not updating when the script is out of date and continues to say the script is up to date. (I apologize for the terrible code, it’s the first time I’ve ever done one without a tutorial.)
local StarterGui = game:GetService("StarterGui")
-- create a screenGui
local versionGui = Instance.new("ScreenGui")
-- create a textLabel
local textLabel = Instance.new("TextLabel")
-- position in the bottom right corner
textLabel.Position = UDim2.new(0, 0, 1, 0)
textLabel.AnchorPoint = Vector2.new(0, 1)
textLabel.Size = UDim2.new(0, 150, 0, 40)
-- configure the text settings
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.TextStrokeTransparency = 0
textLabel.TextXAlignment = Enum.TextXAlignment.Left
textLabel.TextScaled = true
-- display the version number
local placeVersion = game.PlaceVersion
textLabel.Text = string.format("Server version: %s", placeVersion)
textLabel.Parent = versionGui
-- parent to the StarterGui
versionGui.Parent = StarterGui
-- Creating stuff
local VersionCheckerGui = Instance.new("ScreenGui")
local VersionLabel = Instance.new("TextLabel")
-- Setting stuff up
VersionLabel.Position = UDim2.new(0, 0, 1, -40)
VersionLabel.AnchorPoint = Vector2.new(0, 1)
VersionLabel.Size = UDim2.new(0, 150, 0, 40)
VersionLabel.BackgroundTransparency = 1
VersionLabel.TextStrokeTransparency = 0
VersionLabel.TextXAlignment = Enum.TextXAlignment.Left
VersionLabel.TextScaled = true
-- Checking Stuff
while true do
print("Server Version has been checked!")
if placeVersion == game.PlaceVersion then
VersionLabel.TextColor3 = Color3.new(0, 0.666667, 0)
-- Activating the stuff
VersionLabel.Text = string.format("Server is up to date!")
VersionLabel.Parent = VersionCheckerGui
VersionCheckerGui.Parent = StarterGui
print(placeVersion)
wait(20.0)
else if placeVersion ~= game.PlaceVersion then
VersionLabel.TextColor3 = Color3.new(0.666667, 0, 0)
--ACTIVATING stuff again
VersionLabel.Text = string.format("Server is out of date!")
VersionLabel.Parent = VersionCheckerGui
VersionCheckerGui.Parent = StarterGui
print(placeVersion)
end
end
end
Note: The prints are just for me to debug it by using the console log.
What I think the issue is that game.placeversion doesn’t check with the Roblox API for the placeversion but instead the server. How would I go about fixing this?