Yo guys, so I’m currently working on a big project and I want to teleport the player to a new place after clicking a button in the main menu, but I want the player to bring some data with him, but it does not work. The teleporting works fine btw.
Here is a local script in the place where there is the main menu :
local data = {}
data[“Race”] = player.Race.Value
data[“Spins”] = player.Spins.Value
data[“FirstTimePlayer”] = player.FirstTimePlayer.Value
data[“SpinsCounter”] = player.SpinsCounter.Value
main.EnterWorldButton.MouseButton1Click:Connect(function()
game:GetService(“TeleportService”):Teleport(12031829590, player, data)
end)
And here is the local script in the new place, where the main game is :
local player = game.Players.LocalPlayer
local data = game:GetService("TeleportService"):GetLocalPlayerTeleportData()
if data then
player.Race.Value = data["Race"]
player.Spins.Value = data["Spins"]
player.SpinsCounter.Value = data["SpinsCounter"]
player.FirstTimePlayer.Value = data["FirstTimePlayer"]
else
warn("NoData")
end
For some reasons data comes back nil.