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

How i can send multiple leaderstats to another place?

Asked by 6 years ago
Edited 6 years ago

Hello again.

I have a script thats teleport player when touch.

This teleport player on touch, and when moved to place his data value loaded.

game:GetService("TeleportService"):Teleport(1265012521,game.Players[hit.Parent.Name],game.Players[hit.Parent.Name].leaderstats.Money.Value)

Of course its works, but how did i can send money and another stats too?

0
If this is within the same universe then you can use a data store a they are shared within the universe. User#5423 17 — 6y
0
Dude i do not know how. EeeeeBoil 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You'd need to throw everything into a table. This script puts all leaderstats into a table and teleports with that.

local TPData={}
for i,v in pairs(game.Players[hit.Parent.Name].leaderstats:GetChildren()) do
TPData[v.Name]=v.Value
end
game:GetService("TeleportService"):Teleport(1265012521,game.Players[hit.Parent.Name],TPData)
Ad

Answer this question