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

Why does it say teleport restricted?

Asked by 3 years ago
Edited 3 years ago

My script makes it so it tps the player to another place inside of the game but when the player touches the part it says teleport restricted how do i fix it?

I cant make the place public because its a place and because that isnt what i would want if i would work.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local teleportPart = script.Parent
local targetPlaceID = 7284287504 

local TeleportModule = require(ReplicatedStorage:WaitForChild("TeleportModule"))

local function onPartTouch(otherPart)
    local player = Players:GetPlayerFromCharacter(otherPart.Parent)

    if player and not player:GetAttribute("Teleporting") then
        player:SetAttribute("Teleporting", true)

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

        player:SetAttribute("Teleporting", nil)
    end
end

teleportPart.Touched:Connect(onPartTouch)
0
This better not be impossible... CalvinMeowzWorth 2 — 3y

1 answer

Log in to vote
0
Answered by
4jnx 50
3 years ago
Edited 3 years ago

Hello there!

If your trying to teleport in studio you cant it doesn't allow it but if this isn't the problem then you probably have third party teleports of in your game settings

to turn this on go to the home tab > game settings > security > Allow third party teleports

Hope this helped.

Ad

Answer this question