We use cookies on this site to enhance your user experience

Server version number GUI

Server version number GUI

Sep 11 2018, 4:31 AM PST

This code sample will place a simple GUI in the StarterGui showing the place version the server is running at.

To use this sample, place it inside a Script in ServerScriptService.

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(1, -10, 1, 0)
textLabel.AnchorPoint = Vector2.new(1, 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.Right
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