You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear! I want player moves to another place.
-
What is the issue? Include screenshots / videos if possible! When the player tries to teleport by pressing the TextButton, the teleport fails with error code 773. Additionally, when pressing F9 to check the Developer Console, the following error is displayed: Teleport failed because Teleport validation failed (Unauthorized).
-
What solutions have you tried so far? Did you look for solutions on the Creator Hub? I’ve tried troubleshooting the issue by publishing the place I’m trying to teleport to, changing the teleport function, etc.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Below are my scripts.
Local Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local teleportEvent = ReplicatedStorage:WaitForChild("TeleportToMap")
local scrollingFrame = script.Parent
local menuFrame = scrollingFrame.Parent
local infoFrame = menuFrame:WaitForChild("InfoFrame")
local mapData = {
["Map1"] = {
Name = "Tokyo Expressway",
Description = "asdf",
Image = "rbxassetid://17173786916",
PlaceId = 140400468621527
}
}
local selectedMapName = nil
for _, mapButton in ipairs(scrollingFrame:GetChildren()) do
if mapButton:IsA("TextButton") then
mapButton.MouseButton1Click:Connect(function()
local mapName = mapButton.Name
local info = mapData[mapName]
if info then
selectedMapName = mapName
for _, frame in ipairs(infoFrame:GetChildren()) do
if frame:IsA("Frame") then
frame.Visible = false
end
end
local targetFrame = mapButton:FindFirstChild("Object") and mapButton.Object.Value
if targetFrame and targetFrame:IsA("Frame") then
targetFrame.Visible = true
local nameLabel = targetFrame:FindFirstChild("Name")
local descLabel = targetFrame:FindFirstChild("MapDescription")
local imageLabel = targetFrame:FindFirstChild("MapThumbnail")
if nameLabel then nameLabel.Text = info.Name end
if descLabel then descLabel.Text = info.Description end
if imageLabel then imageLabel.Image = info.Image end
end
end
end)
end
end
local playButton = infoFrame:FindFirstChild("Play")
if playButton then
playButton.MouseButton1Click:Connect(function()
if selectedMapName and mapData[selectedMapName] then
local placeId = mapData[selectedMapName].PlaceId
if placeId then
teleportEvent:FireServer(placeId)
else
warn("PlaceId 없음: " .. selectedMapName)
end
else
warn("맵이 선택되지 않았습니다.")
end
end)
end
Server Script:
-- ServerScriptService.TeleportHandler
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local teleportEvent = ReplicatedStorage:WaitForChild("TeleportToMap")
teleportEvent.OnServerEvent:Connect(function(player, placeId)
if typeof(placeId) == "number" then
TeleportService:Teleport(placeId, player)
else
warn("Invalid placeId received:", placeId)
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.