I have the same issue again. It is showing an error while I did everything exactly as it showed in the tutorial: Teleporting Between Places
I have another game that the script works on with the custom teleport screen and it works there.
I tried copying every single thing and putting it in the new game.
Still does not work and is showing errors.
Everything in Game Settings/Security is enabled except Allow Third Party Sales.
I am honestly not a scripter but how can it work on 1 game and not work on 2nd?
You’re probably getting the WaitForChild error because a script can not find the humanoid. By default WaitForChild waits 5 seconds to find something. For more information check out this post: Instance | Roblox Creator Documentation
Also can I see your script please?
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local Players = game:GetService(“Players”)
local teleportPart = script.Parent
local targetPlaceID = 7394018757 – Change this to your place ID
– Require teleport module
local TeleportModule = require(ReplicatedStorage:WaitForChild(“TeleportModule”))
local function onPartTouch(otherPart)
– Get player from character
local player = Players:GetPlayerFromCharacter(otherPart.Parent)
if player and not player:GetAttribute("Teleporting") then
player:SetAttribute("Teleporting", true)
-- Teleport the player
local teleportResult = TeleportModule.teleportWithRetry(targetPlaceID, {player})
player:SetAttribute("Teleporting", nil)
end
local teleportResult = TeleportModule.teleportWithRetry(targetPlaceID, {player})
end)
2nd script is:
local isReserved = game.PrivateServerId ~= “” and game.PrivateServerOwnerId == 0
local TS = game:GetService(“TeleportService”)
local Players = game:GetService(“Players”)
local DSS = game:GetService(“DataStoreService”)
local DS = DSS:GetGlobalDataStore()
– Get the saved code
local code = DS:GetAsync(“ReservedServer”)
if type(code) ~= “string” then – None saved, create one
code = TS:ReserveServer(game.PlaceId)
DS:SetAsync(“ReservedServer”,code)
end
local function Joined(plr)
– Everytime they chat, we want to know
plr.Chatted:Connect(function(msg)
if msg == “reserved” then – Aha, that’s our cue
TS:TeleportToPrivateServer(game.PlaceId,code,{plr})
end
end)
end
– Connect all current and future players
Players.PlayerAdded:Connect(Joined)
for k,v in pairs(Players:GetPlayers()) do
Joined(v)
end
That is what I was doing the whole time. I never did teleporting in studio, I only did it on the Roblox Client. Well, at least attempted to do it but it did not work.