Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i send data through teleport service?

Asked by
Delude_d 112
6 years ago
--- START
local player = game.Players.LocalPlayer
local rep = game:GetService("ReplicatedStorage")
local events = rep:WaitForChild("RemoteEvents")
local cacEvent = events:WaitForChild("CAC")
local player = game.Players.LocalPlayer
    local data = player:WaitForChild("CACData")
    local hairValue = data:WaitForChild("Hair")
    local hairColorValue = data:WaitForChild("HairColor")
    local ShirtValue = data:WaitForChild("Shirt")
    local PantValue = data:WaitForChild("Pant")

data = {
["Hair"] = hairValue.Value;
["HairColor"] = hairColorValue.Value;
["Shirt"] = ShirtValue.Value;
["Pant"] = PantValue.Value;
}
script.Parent.MouseButton1Down:Connect(function()
game:GetService("TeleportService"):Teleport(2017040087,player, data)
end)
-----  OTHER PLACE

local rep = game:GetService("ReplicatedStorage")
local events = rep:WaitForChild("RemoteEvents")
local cacEvent = events:WaitForChild("CAC")
local player = game.Players.LocalPlayer


local data = game:GetService("TeleportService"):GetLocalPlayerTeleportData()

hairValue = data["Hair"]
hairColorValue = data["HairColor"]
ShirtValue = data["Shirt"]
PantValue = data["Pant"]

cacEvent:FireServer(hairValue, hairColorValue, ShirtValue, PantValue)
print(data["Hair"])


Although this works, the print and everything. The data sent through is not identical to the one from the start place. Why does this happen and how do i fix it?

0
I belive that you have to store the data in a datastore before teleporting the player LollipopCraft 1 — 6y

Answer this question