Hello! I am currently trying to pass TeleportData through a RemoteEvent, but it is not working:
Client side:
local maps = script.Parent
for i, v in pairs(maps:GetDescendants()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
local map = v.Parent.Name
game:GetService("ReplicatedStorage"):WaitForChild("GamemodeTP"):WaitForChild("FreeDrive"):FireServer(map)
end)
end
end
Server Side:
local TS = game:GetService("TeleportService")
local code
game:GetService("ReplicatedStorage"):WaitForChild("GamemodeTP"):WaitForChild("FreeDrive").OnServerEvent:Connect(function(Player, map)
code = TS:ReserveServer(6203111795)
TS:TeleportToPrivateServer(6203111795, code, {Player}, map)
end)
Everything is teleporting, but TeleportData comes up as nil.
If you can help, please let me know. Thanks, WE