Teleport failed due to an unexpected error. (Error Code: 769) In Main Game

Hello, I made a game and I’m developing that game every day and I don’t know why, but I have a bug or virus like that;
resim_2022-02-05_090544
The scripts of my Testing and Main game are the same, but I only have this problem in the main game. There is no such problem in my test server How Can I Solve that?

5 Likes

Check if both games have API access enabled under game settings, or try making the teleport destination game public.

1 Like

Here is the main game and testing game, they are looking same What I need to do now

Testing Place

How have you made the different teleport games? The destination game must be in the same universe as the spawn game.

I maked a half rp and half pvp game and there’s no teleporting system also we doesn’t use toolbox scripts and this Error kinda weird, Maybe it was because I gave the teleport command to the admins, so there is a script called teleport in serverscriptservice. When an Admin type /to plrName, it teleports to the player, I couldn’t understand whats the problem

How are you teleporting the player? If it’s not from one game to the other, you shouldn’t be using TeleportService.

I use a command like this to teleport, Example;
Humrp.CFrame = TargetHumrp.CFrame
And when this Error comes up I can see an error like this in console


The Client Side Error

Some script in your game is trying to teleport players out of your game to some other game.

How can I find this script? Only Artic’s Anti-Fly and Realism Mod Scripts Toolbox I don’t think they have the problem

Post your entire script here, not just the teleport line.
Are you using a Script or a LocalScript?
Are you using any Plugins that are questionable? Some Plugins or Toolbox items have malicious scripts in them, or insert scripts into parts or folders in your game.
Try searching through the game in Studio when you are testing it. Use the Search bar in the Explorer Window to try to find anything named “Script”.

There are many scripts in the game, I searched for “Teleport” by doing ctrl+f and I couldn’t find any results, but the Artic’s Anti-fly script is here this is toolbox and an anti exploiting script
image

Server Side Script

local Module = require(script:FindFirstChild("Average"):WaitForChild("ModuleScript"))

local MaxY = 12 --IMPORTANT: (You will have to change this 100%) Change this to an value to where maximum Y normal player can achieve also include their jump which about 3 studs 


local MaxBoolCaughts = 3 -- Chnage this to how many times you allow player to do mistake before adding a score to script counter
local MaxCounter = 4 -- Change this to maximum counter (caughts)

--**Don't change these if you are not sure what you are doing**
--If player goes lower of any of those values while deviding values with other players makes it suspicious and and has higher chance of getting kicked  
--Minimum value is 0 and maximum 1 at this valueses, please keep it same as they are or try to experiment with changing small values (decimal valueses)

local AvreageDifference = 0.60 --This value is checking while diveding average value with localplayer's Y axis position
local AverageBoolAndGameTime = 0.50 -- This value is checking diveding time in restricted area with whole game time

game.Players.PlayerAdded:Connect(function(Player)
    local ValueS = Instance.new("IntValue") -- This value represents value of how many suspicous caughts for exploiting player recieved 
    local BoolCounter = Instance.new('IntValue')-- This value represents how many time player was in restricted area
    local BoolTurnedOFF = Instance.new('IntValue')-- This value represents how many time player was NOT in restricted area
    local Yaxis = Instance.new("IntValue") -- This value represents Localplayer's Y axis 
    local InGameTime = Instance.new('IntValue') -- This value represents how long player was in game
    local OnTouchedTime = Instance.new('IntValue') -- This value represents time when player goes in restricted area
    local OnOutTouchedTime = Instance.new('IntValue') --This value represents exact time when player leaves restricted area 
    local BoolValueS = Instance.new('BoolValue') -- This value is turned on TRUE when player is in restricted area else it turned on FALSE

    ValueS.Parent = script
    ValueS.Name = Player.Name
    
    BoolValueS.Parent = ValueS
    BoolValueS.Name = "RestrictedArea"

    BoolCounter.Parent = BoolValueS
    BoolCounter.Name = "Time"
    
    BoolTurnedOFF.Parent = BoolValueS
    BoolTurnedOFF.Name = "TurnedOFF"

    InGameTime.Parent = BoolValueS
    InGameTime.Name = "TimeInGame"

    Yaxis.Parent = BoolValueS
    Yaxis.Name = "Y"

    OnTouchedTime.Parent = BoolValueS
    OnTouchedTime.Name = "OnTouchedTime" 

    OnOutTouchedTime.Parent = BoolValueS
    OnOutTouchedTime.Name = "OnOutTouchedTime"

Player.CharacterAdded:Connect(function(Character)
   

local function WeldToHuman(A,B) 
    B.CFrame = A.CFrame
    local  Weld = Instance.new("Weld")
    Weld.Part0 = A
    Weld.C0 = A.CFrame:Inverse()
    Weld.Part1 = B
    Weld.C1 = B.CFrame:Inverse()
    Weld.Parent = A
    return Weld
end

while true do
wait(1)

local function YaxisExists()
   if (Character:FindFirstChild('HumanoidRootPart')) ~= nil then --Check if HumanoidRootPart exists in player
     local Yaxis = Character:FindFirstChild('HumanoidRootPart').Position.Y
     return Yaxis
   else
	if (Character:FindFirstChild("Part")) ~= nil then
	  local YPartPosition = Character:FindFirstChild("Part").Position.Y --Check if Part exists in player
	  return YPartPosition
	     end
	end
  return false
end

local success, message = pcall(YaxisExists)
Yaxis.Value = message
script:FindFirstChild("Average").Value = tonumber(Module.Average(0,0,0))-- Call to get average value of all Y axis

if (success) ~= true then
	if (script:FindFirstChild(Player.Name)) ~= nil then -- Check if player's value still exists in script
     script[Player.Name]:Destroy() -- Destroy player from server's script
	 warn('Player: '.. Player.Name .. ' was caught exploiting with HumanoidRootPart')
     Player:Kick("We caught you exploiting with HumanoidRootPart")
	 --Add here things to happen once player is kicked or in PlayerRemoving function
   end
end

if (BoolTurnedOFF.Value) > 40 then --Check if palyer is in safe area for 40 seconds
	if (ValueS.Value) > 0 then -- Check if caughtsa are equals to 0
	ValueS.Value = ValueS.Value - 1
	BoolTurnedOFF.Value = 0
	end
end

while (BoolValueS.Value) == false do
	script:FindFirstChild("Average").Value = tonumber(Module.Average(0,0,0)) -- Call to get average value of all Y axis
	local success, message = pcall(YaxisExists)
	wait(1)
    InGameTime.Value = InGameTime.Value + 1 
	BoolTurnedOFF.Value = BoolTurnedOFF.Value + 1  
	
if (BoolTurnedOFF.Value) > 40 then --Check if palyer is in safe area for 40 seconds
	if (ValueS.Value) > 0 then -- Check if caughtsa are equals to 0
	ValueS.Value = ValueS.Value - 1
	BoolTurnedOFF.Value = 0
	end
end
	
	if (success) ~= false then -- Check if Y value exists
	 if (message) > (MaxY) then -- Check if  localplayer's Y axis is higher than Server's Max Y height
		if (BoolValueS.Value) ~= true or (BoolValueS.Value) ~= false then -- Pretty much useless if statment but okay		
		 BoolValueS.Value = true
		if (OnTouchedTime.Value) == 0 then -- Check if value was changed or not
		 OnTouchedTime.Value = BoolCounter.Value -- Changes time to time once player entered in restricted area 
		end
	     if (ValueS.Value) > (MaxCounter) then -- Check if player got caught as it's Server's max number of caughts 
		  if (BoolCounter.Value/InGameTime.Value) < (AverageBoolAndGameTime) then -- Devided Time how many time player was in restricted area with his whole game time 
			local avg = script.Average.Value
			if (avg/message) < (AvreageDifference) then -- Average value devided with player's current Y axis value
			if (script:FindFirstChild(Player.Name)) ~= nil then -- Check if player's value still exists in script
		       script[Player.Name]:Destroy() -- Destroy player from server's script
		       warn('Player: '.. Player.Name .. ' was caught exploiting')
		       Player:Kick("We caught you exploiting")
		       --Add here things to happen once player is kicked or in PlayerRemoving function
		        end
		      end
		     end
		   end
	    end
     end
   end
end

while (BoolValueS.Value) == true do
	script:FindFirstChild("Average").Value = tonumber(Module.Average(0,0,0))-- Call to get average value of all Y axis
	local success, message = pcall(YaxisExists)-- success = true or false, message = avreage value of Y axis 
	wait(1)
	
    InGameTime.Value = InGameTime.Value + 1
 if (Character:FindFirstChild("Humanoid").FloorMaterial) == Enum.Material.Air then
	if (Character:FindFirstChild("HumanoidRootPart").Velocity.Y) == 0 or (Character:FindFirstChild("Part").Velocity.Y) == 0 or ((0 < (Character:FindFirstChild("Part").Velocity.Y) and (Character:FindFirstChild("Part").Velocity.Y)  < 0.11)) or ((0 < (Character:FindFirstChild("HumanoidRootPart").Velocity.Y) and (Character:FindFirstChild("HumanoidRootPart").Velocity.Y) < 0.11)) then
	BoolCounter.Value = BoolCounter.Value + 1
	end
end

  if (BoolCounter.Value) > (MaxBoolCaughts) then --Check for how many times player was caught in restricted area if above MaxBoolCaughts it adds + 1 to ValueS's value
	ValueS.Value = ValueS.Value + 1
	BoolCounter.Value = 0
	wait(1)
 end

if (BoolTurnedOFF.Value) > 40 then --Check if palyer is in safe area for 40 seconds
	if (ValueS.Value) > 0 then -- Check if caughtsa are equals to 0
	ValueS.Value = ValueS.Value - 1
	BoolTurnedOFF.Value = 0
	end
end
	
    if (message) < (MaxY) then -- Check if player is still in restricted area
	  BoolValueS.Value = false
	  OnOutTouchedTime.Value = InGameTime.Value
	  local Counters = OnOutTouchedTime.Value-OnTouchedTime.Value
	if (Counters) > 100 then  -- Check how long player was in restricted area 
	  while (Counters) > 100 do -- Loop for penalty if there is one of coruse
	   ValueS.Value = ValueS.Value + 1
	   Counters = Counters - 100
	   wait(0.1)
	  end
	end
	  OnOutTouchedTime.Value = 0
	  OnTouchedTime.Value = 0 
   end
    
 	if (success) ~= false then -- Check if Y value exists
	 if (message) > (MaxY) then -- Check if  localplayer's Y axis is higher than Server's Max Y height
		if (BoolValueS.Value) ~= true or (BoolValueS.Value) ~= false then -- Pretty much useless if statment but okay		
		 BoolValueS.Value = true
		if (OnTouchedTime.Value) == 0 then -- Check if value was changed or not
		 OnTouchedTime.Value = BoolCounter.Value -- Changes time to time once player entered in restricted area 
		end
	     if (ValueS.Value) > (MaxCounter) then -- Check if player got caught as it's Server's max number of caughts 
		  if (BoolCounter.Value/InGameTime.Value) < (AverageBoolAndGameTime) then -- Devided Time how many time player was in restricted area with his whole game time 
			local avg = script.Average.Value
			if (avg/message) < (AvreageDifference) then -- Average value devided with player's current Y axis value
			if (script:FindFirstChild(Player.Name)) ~= nil then -- Check if player's value still exists in script
		       script[Player.Name]:Destroy() -- Destroy player from server's script
		       warn('Player: '.. Player.Name .. ' was caught exploiting')
		       Player:Kick("We caught you exploiting")
		       --Add here things to happen once player is kicked or in PlayerRemoving function
		        end
		      end
		     end
		   end
	     end
       end
     end
   end
end	

   end)
end)

Module Script;

local module = {}

module.Average = function(a,b,c)-- a=0, b=0, c=0
local Players = game.Players:GetChildren() --Get all players

for i=1,#Players do
	if game.ServerScriptService:FindFirstChild("Artic's Anti-Fly"):FindFirstChild(tostring(Players[i])) ~= nil then --Check if Player exists in main script
	local Y = game.ServerScriptService:FindFirstChild("Artic's Anti-Fly"):FindFirstChild(tostring(Players[i])):FindFirstChild("RestrictedArea"):FindFirstChild("Y").Value -- Get value of player's Y value
	a = a + tonumber(Y) -- A letter represents a sum of all valueses in game 
	c = #Players -- C letter represents number of all players in game
	end
end

return a/c -- returns average Y value of all players in game 

end

return module

I made all the other scripts myself and I haven’t had a problem until today I still don’t know the problem
And I have these plugins;

Check to see if your plugins were actually made by the real creators in “Manage Plugins”.

There could be a chance you downloaded a plugin by a fake one, because there’s a tactic people use where they take a plugin makers username and make it a group, then upload the plugins they have an infect it with a virus so it looks actually real.

1 Like


image
Yeah there’s the all plugins now, I can’t see anything harmful. Is there anything you suggest I do?

Have you checked all the creators?
Did you use anything from the toolbox?

Also, check through every script in the game like this

image

Check through every single one.

Okay Done I checked every single script and I can’t find anything about “Teleport”

Did you check in Edit mode in Studio, or when you were Playing in Studio? If it’s a plugin installing the script it may only happen while the game is running.

I checked it in Edit Mode and This Error only happens sometimes not always

I wonder if “Allow Third Party Teleports” has to be turned on even though you were making a teleport between Places in the same experience. I got the same error this morning (even though I was testing a teleport that went to a completely different game) then I realized it was because the “Allow Third Party Teleports” was disabled in the game settings.

Yes the “Allow Third Party” option is turned off but the problem is there is no script trying to teleport players in diffrent game, here is the weird part :confused: And this problem started happening out of nowhere, so I woke up one morning and saw that a player posted this bug to the bug-report room in my discord server.

Note: My plugins are not infected or I don’t use any toolbox scripts

2 Likes

Well it’s been a long time and this issue was fixed automatically, it’s a bit confusing as the game doesn’t havea virus or toolbox item but it was fixed automatically a long time ago, and I’m closing this thread as I see no one has posted anything new, thanks to everyone who tried to help!

1 Like