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

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

Asked by 4 years ago

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

Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago

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)
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 PROYO2J 0 — 4y
0
Make sure its in a local script in starterplayerscripts when using getlocalteleportdata JesseSong 3916 — 4y
0
It is but I am still getting the deafult value instead the value I changed in game PROYO2J 0 — 4y
0
What value? JesseSong 3916 — 4y
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 PROYO2J 0 — 4y
Ad

Answer this question