Is there a way to change the variable depending on which game (or which place) I publish my game? [SOLVED]

I have two versions of my game: Main and Test version.

But when I publish in them I always need to change for teleporter placeID.

Is there any way to do like:

if I publish in "MyGameName Test" then
   placeID = 932420394920
end

if I publish in "MyGameName MAIN" then
   placeID = 77765456456
end

I use one file in Roblox Studio, but my places when I publish called differently like:
MainGame
MainGameTest

Thank you!

game.PlaceId is what you need.

1 Like

Thank you so much! You helped to find a solution! But I used instead of game.Placeid > game.GameId

1 Like

For someone who also will find it:

local function Teleport(player)
	local placeId

	if game.GameId == 66501821443 then --Put your gameId here
		placeId = 94707992709856
	else
		placeId = 18751290989
	end
	SafeTeleport(placeId, {player})
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.