Knowing if a player joined through the Event page

How are you able to check if the player has joined your game through an Events page in your game:


instead of the regular way:

1 Like

If a player joins through the event page, it should add the event ID to their JoinData.

Below is the relevent information (and code snippet) from the experience events page:

When a player joins an experience through an event entry point, such as by clicking on an event notification or through the join button on the event details page, the event ID is added to the player’s GameJoinContext. You can use this information in your experience to identify players who have come to participate in the event and show them custom prompts or otherwise personalize their experience.

local Players = game:GetService("Players")

local function onPlayerAdded(player)
	local source = player:GetJoinData()
	-- Check if the provided source is valid
	if source then
		-- Read eventId from GameJoinContext
		local eventId = source.GameJoinContext.EventId

		if eventId then
			print(player.Name, "joined from the event:", eventId)
		end
	end
end

Players.PlayerAdded:Connect(onPlayerAdded)

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