Script issue (teleporting between games with custom teleport screen)

Hello.

I have the same issue again. It is showing an error while I did everything as it showed in the tutorial: Teleporting Between Places

I basically copied everything from the old game to the new game, every single bit of that script and even double checked it. The thing is, the script works in the other game, once you step on the brick, it shows the custom teleport screen and teleports you after a few seconds. I would also like to mention that 3rd party teleports are enabled.

I am honestly not a scripter I just don’t understand how can the script work on the old game but can’t work in the new game.

Help would be very appreciated.

Screenshot 2022-07-29 014833

Can you show the script?

This one is for the base part:

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

end

teleportPart.Touched:Connect(onPartTouch)

This one is for the server script service script:

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)

– Require teleport module

local TeleportModule = require(ReplicatedStorage:WaitForChild(“TeleportModule”))

– Fire the module function on server event

local teleportEvent = ReplicatedStorage:WaitForChild(“TeleportEvent”)

teleportEvent.OnServerEvent:Connect(function(player, targetPlaceID)

local teleportResult = TeleportModule.teleportWithRetry(targetPlaceID, {player})

end)

Apparently, seems like the module contains some errors.

Do you know how to solve them?

the require arg is having an error
do you have the modulescript in replicatedstorage Called TeleportModule?

Yes, I do have that script in the replicated storage.

Hello? Are you there? I need help.