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
01--- START
02local player = game.Players.LocalPlayer
03local rep = game:GetService("ReplicatedStorage")
04local events = rep:WaitForChild("RemoteEvents")
05local cacEvent = events:WaitForChild("CAC")
06local player = game.Players.LocalPlayer
07    local data = player:WaitForChild("CACData")
08    local hairValue = data:WaitForChild("Hair")
09    local hairColorValue = data:WaitForChild("HairColor")
10    local ShirtValue = data:WaitForChild("Shirt")
11    local PantValue = data:WaitForChild("Pant")
12 
13data = {
14["Hair"] = hairValue.Value;
15["HairColor"] = hairColorValue.Value;
View all 21 lines...
01-----  OTHER PLACE
02 
03local rep = game:GetService("ReplicatedStorage")
04local events = rep:WaitForChild("RemoteEvents")
05local cacEvent = events:WaitForChild("CAC")
06local player = game.Players.LocalPlayer
07 
08 
09local data = game:GetService("TeleportService"):GetLocalPlayerTeleportData()
10 
11hairValue = data["Hair"]
12hairColorValue = data["HairColor"]
13ShirtValue = data["Shirt"]
14PantValue = data["Pant"]
15 
16cacEvent:FireServer(hairValue, hairColorValue, ShirtValue, PantValue)
17print(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