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.
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”)