So basically I'm trying to teleport myself to someone when they click a TextButton which will be the Help button. I made this Local Script below to activate a Server Script to teleport me to the person who presses the button:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Teleport = game.ReplicatedStorage.Teleport
local button = script.Parent
local player = game.Players.LocalPlayer
local toggle = false
button.MouseButton1Click:connect(function()
local Players = game:GetService("Players")
if Players.Kaisarys then
print("Kaisarys was found.")
Teleport:FireServer(player)
end
end)
After they press the button if I am in-game it will fire the RemoteEvent that will activate the following Server Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Teleport = ReplicatedStorage.Teleport
local function TeleportAdmin(player)
local Players = game:GetService("Players")
if Players.Kaisarys then
game.Workspace.Kaisarys.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.player.HumanoidRootPart.CFrame)
end
end
Teleport.OnServerEvent:Connect(TeleportAdmin)
The problem is that it seems to work until the teleport is about to be done, the Output says that the player is not a valid member of Workspace, but considering that I got the player using the Local Script and transferred it to the Server Script, shouldn't the Server Script find the player?
I just wanted to make it so the teleport work, but if you have some spare time and is willing to help me with that I wanted to know how to use a table to store admin names so I could include the name of other people to the table so they would get teleported if I were offline.

2 comments
It says that HumanoidRootPart is not a valid part of Player if I don't add Character while if I add player.Character it says: ServerScriptService.Script:7: invalid argument #1 to 'new' (Vector3 expected, got CFrame)
Sorry for that. Look at the new edit, I forgot .Character.