You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
This script to send to the function whenever someone joins what place they joined from, and if not, ROBLOX.
What is the issue? Include screenshots / videos if possible!
:FindFirstChild() isnt working at all and everything else i have tried hasnt worked.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried putting in different functions that look for it, i have tried doing [“SourcePlaceID”], and i have tried lots more.
game.Players.PlayerAdded:Connect(function(player)
local joindata = player:GetJoinData().TeleportData
local productinfo = nil
if game.MarketplaceService:GetProductInfo(joindata:FindFirstChild("SourcePlaceID")) then -- this parts the annoying part
productinfo = game.MarketplaceService:GetProductInfo(joindata:FindFirstChild("SourcePlaceId").Name)
else
productinfo = "Roblox"
end
datasend(player, " has joined the Main Menu, from "..productinfo, colors.join)
end)
Dictionaries cannot be used like that only instances!
You should use a for loop if you want to find something but in your case just doing, joindata.SourcePlaceID
The issue is that TeleportData is a Lua table, not an Instance. So :FindFirstChild("SourcePlaceId") will never work.
Instead, access it like this:
local teleportData = player:GetJoinData().TeleportData
if teleportData and teleportData.SourcePlaceId then
local productInfo = game.MarketplaceService:GetProductInfo(teleportData.SourcePlaceId)
datasend(player, " has joined the Main Menu, from "..productInfo.Name, colors.join)
else
datasend(player, " has joined the Main Menu, from Roblox", colors.join)
end