Text label being able to get game name

if this is write entire scripts or design entire systems please tell me and this topic will be deleted by me.

  1. What do you want to achieve? a text label where i can put an ID of a game and it will be live as to when ever a game changes a name something like this below.

game name

studio name

changing the game name

studio game name changes on the text label live

so something like that

  1. What is the issue? only a beginners scripter

so how i would want the script to work is.

first: i need to get the ID of the game.

next: the script will then update the text label every 2 mins.

last: if it detecte the game is changing, then it will write the same thing as the game and put it there as the game name into the text label, and that’s how it will work.

Please do not ask people to write entire scripts or design entire systems for you.

The game name is stored in game.Name

So in a LocalScript inside the TextLabel, you could write:

script.Parent.Text = game.Name

If you wanted a message before it, (like welcoming the player) you could do:

local message = 'Welcome, '+game.Players.LocalPlayer.Name+' to '+game.Name+'!'

script.Parent.Text = message

This will automatically update the TextLabel when a player joins.

Isn’t it
'Welcome, '..game.Players.LocalPlayer.Name..' to '..game.Name..'!'

instead of

 'Welcome, '+game.Players.LocalPlayer.Name+' to '+game.Name+'!'

?

Oh yeah I program in javascript and I got mixed up. Thanks.

1 Like

I haven’t tested this a lot before, but I think that doing game.Name doesnt returns the actual name of the game, it used to give me as output something like “Game” but not my game name, I had to use HttpService to get the name of my game instead.

1 Like

Prior to sending this I tested it, but maybe it was the default name.

I try the game.name and what it does is, it changes the game name of your if your in studio is what I got, but idk about in-game that might be different.

You can also do this using MarketplaceService | Documentation - Roblox Creator Hub

For example

game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId,Enum.InfoType.Product)

Not really, the game of my name was different and it only happened when I tested in Roblox but not Studio.

i tried the code and there an underlined red by the .PlaceId when ever there’s numbers and the error is

error:
Game_name.LocalScript:1: Expected ‘)’ (to close ‘(’ at column 53), got ‘.4456880028’

It shouldn’t matter if it doesn’t work in studio, right? He wants it for the players, not his studio.