player:GetJoinData() not working?

So im making a multiplace game

teleporter script in lobby:

local function TeleportPlayers()
	local placeId = 13408545241
	local server = TeleportService:ReserveServer(placeId)
	local options = Instance.new("TeleportOptions")
	options:SetTeleportData({Difficulty = script.Parent.Difficulty.Value})
	options.ReservedServerAccessCode = server
	SafeTeleport(placeId, playersWaiting, options)
	print("Finished teleport")
end

Teleporter Model:
image

the actual game’s join data script:

local Players = game:GetService("Players")
local PhysicsService = game:GetService("PhysicsService")

Players.PlayerAdded:Connect(function(player)

	if game["Run Service"]:IsStudio() then
		workspace.Info.Diff.Value = "Amateur"
	else
		local joinDat = player:GetJoinData()
		if joinDat then
			local difficulty = joinDat.Difficulty
			print(joinDat.Difficulty)

			--Line 45
workspace.Info.Diff.Value = joinDat.Difficulty

			if joinDat.Difficulty ~= ("Amateur" or "Expert" or "Master") then
				workspace.Info.Diff.Value = "Amateur"
			end
		else
			workspace.Info.Diff.Value = "Amateur"
		end
	end
end)

ingame print:
image

lobby teleporter difficulty value

And when the player got into the game place, the game did not load the difficulty value from the teleport data. What’s wrong??? I already tried finding solutions but still isnt working

From looking at Player | Documentation - Roblox Creator Hub :

You should try doing

local joinDat = player:GetJoinData().TeleportData

and see if it lets you acces the Difficulty thing now

2 Likes

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