#GetLocalPlayerTeleportData() only sends one value from the table in the params

17 messages · Page 1 of 1 (latest)

lusty panther
#
local teleportService = game:GetService("TeleportService")
local part = script.Parent
local isPlayerCrouching = true
local teleportData = {
    isPlayerCrouching = false
}

part.Touched:Connect(function(hit)
    local human = hit.Parent:FindFirstChild("Humanoid")
    local character = hit.Parent
    local dada = game.Players:GetPlayerFromCharacter(character)
    local cash = dada.leaderstats.Cash.Value
    local meow
    if table.find(teleportData,cash) then
        print("yes")
    else
        print("no.")
        table.insert(teleportData,cash)
    end
    if human and table.find(teleportData,cash) then
        print("item is found and human teleporting..")
        for i,v in pairs(teleportData) do
            print(i,v," amigo")
        end
        local char = hit.Parent
        local player = game.Players:GetPlayerFromCharacter(char)
        teleportService:Teleport(12267774167,player,teleportData)
    
    end
    print(teleportData.isPlayerCrouching)
end)
lusty panther
#

so the problem is

#

before i teleport the player, the 2 values in the teleportData table exist

#

but

#
local teleportService = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
local cashValue = game.ReplicatedStorage:WaitForChild("CashValue")

local teleportData = teleportService:GetLocalPlayerTeleportData()
for i,v in pairs(teleportData) do
    print(i,v,"  moama brodare")
end

if teleportData.isPlayerCrouching == false then
    print("player not crouching")
    cashValue:FireServer(teleportData.cash,player)
else
    print("isplayercrouching is true or it was not found")
end

if teleportData then
    print("there is the table")
end
#

when i get teleported

#

the isPlayerCrouching variable dissapears

#

any ideas ? smad

mossy plaza
lusty panther
#

i dont know what is that

dire harborBOT
#

studio** You are now Level 3! **studio

lusty panther
lusty panther
#

so if i dont to table.insert(teleportData,cash) all the values in teleportData are being sent otherwiset it only sends the cash value

olive wren