How to fix this teleport script?

Try running your script inside a LocalScript so you can actually detect the events. I think users have network ownership over their character so they will be able to move themselves just not other admins to them.

Why is your script disabled? That might be the actual issue.

It’s a player list and the handler enables the script as soon as the frame gets duplicated and all the informations are getting filled up.
Basically, another script enables it.

First make a local script in the teleport frame. After that put a remote event ( DO NOT RENAME IT )
in the teleport frame. Then put this code in the local script:

local localValue = script.Parent.Parent.localValue.Value
local playerValue = script.Parent.Parent.playerValue.Value

local function TeleportTo()
	script.Parent.RemoteEvent:FireServer(localValue.Character.Torso.CFrame,playerValue.Character.Torso.CFrame)
end

local function Bring()
	script.Parent.RemoteEvent:FireServer(playerValue.Character.Torso.CFrame,localValue.Character.Torso.CFrame)
end

script.Parent.To.MouseButton1Down:connect(TeleportTo)
script.Parent.Bring.MouseButton1Click:Connect(Bring)

Then in the normal script put this:

script.Parent.RemoteEvent.OnServerEvent:Connect(function(v, t)
    v = t
end)
1 Like

I’m going to try that tomorrow because I am currently not on my PC! Thank you!

You are very welcome. If it doesn’t work I can try scripting it for you.

1 Like

It sadly does not work either. (I think, the client can not access the character)

Try making the player value:

local playerValue = game.Players.LocalPlayer

1 Like

I did that and now Bring works (it teleports me to the player though) but teleport does not work

Try putting this in the local script:

local playerValue = game.Players.LocalPlayer

local function TeleportTo()
	script.Parent.RemoteEvent:FireServer(playerValue.Character.Torso.CFrame,localValue.Character.Torso.CFrame)
end

local function Bring()
	script.Parent.RemoteEvent:FireServer(localValue.Character.Torso.CFrame,playerValue.Character.Torso.CFrame)
end

script.Parent.To.MouseButton1Down:connect(TeleportTo)
script.Parent.Bring.MouseButton1Click:Connect(Bring)

And what is localValue

localValue = script.Parent.Parent.playerValue.Value

or

local localValue = game.Players.LocalPlayer
local playerValue = script.Parent.Parent.playerValue.Value

I messed up, keep that 2 lines as they are, replace the other

It should be

local localValue = script.Parent.Parent.localValue.Value
local playerValue = game.Players.LocalPlayer
LocalScript
local localValue = game.Players.LocalPlayer
local playerValue = script.Parent.Parent.playerValue.Value

local function TeleportTo()
	script.Parent.RemoteEvent:FireServer(localValue, playerValue)
end

local function Bring()
	script.Parent.RemoteEvent:FireServer(playerValue, localValue)
end

script.Parent.To.MouseButton1Down:connect(TeleportTo)
script.Parent.Bring.MouseButton1Click:Connect(Bring)
Script
script.Parent.RemoteEvent.OnServerEvent:Connect(function(v, t)
	v.Character.Torso.CFrame = t.Character.Torso.CFrame
end)

This way “bring” works as a teleport the one who presses the button to the one in the list where he presses bring. “teleport to” does not work

local localValue = script.Parent.Parent.playerValue.Value
local playerValue = game.Players.LocalPlayer

You mean this? Otherwise there would be two times the same value.

No, the thing that i sent was what i meant.

But then both object would be the same!?

With this “teleport to” works as intended but “bring” does noting.

What is the local value variable for?

localValue = The player who presses. So it’s the LocalPlayer.
playerValue = The playerlist object. All the buttons are inside of the frame belonging to the playerValue. There are exactly so many frames for the list that each player has its own.