Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How i can send multiple leaderstats to another place?

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?

2 comments

0

If this is within the same universe then you can use a data store a they are shared within the universe.

0

Dude i do not know how.

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.