#GetLocalPlayerTeleportData() only sends one value from the table in the params
17 messages · Page 1 of 1 (latest)
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)
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 ? 
you can't use string indexes
i dont know what is that
** You are now Level 3! **
but if i send a table with multiple variables with values,it only sends the cash value,which is 20
so if i dont to table.insert(teleportData,cash) all the values in teleportData are being sent otherwiset it only sends the cash value
U can use string
