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

When I try to get teleportdata from a player it takes the deafult value and not the changed how fix?

how do I make it take the changed value?

local teleport = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
local Data = {
face = script.Parent.Parent.Value.Value
    

}

script.Parent.MouseButton1Click:Connect(function()
	
	

    teleport:Teleport(4834144822, player, Data)

end)

My code

1 answer

Here's a guide:https://developer.roblox.com/en-us/api-reference/class/TeleportService

local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
 
local placeId = 0 -- replace here
local userId = 1 -- replace with player's userId
 
-- find the player
local player = Players:GetPlayerByUserId(userId)
 
-- teleport the player
TeleportService:Teleport(placeId, player)

5 comments

0

I already know how to teleport but when I get GetLocalPlayerTeleportData ( ) from something it takes the deafult value and not the changed one like for example the deafult value is 0 and on the server I changed it to 1 and when I teleport to another place it shows it 0 and not 1

0

Make sure its in a local script in starterplayerscripts when using getlocalteleportdata

0

It is but I am still getting the deafult value instead the value I changed in game

0

What value?

0

A string value that I change on an other place like I change it to other asset id's and the asset id that I putted on that value is not there when I get teleported and I get the deafult value of the string

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