I'm trying to make a brick where if you click it, it teleports you to another location, with a sound and a gui that fades to black, then back out and becomes inactive. But, also being able to go back to the other location you teleported from. I have a remote event, where it does the teleporting and activates the GUI. And I have a red and blue brick with click detectors in them.
basically if you click the blue brick (tpB) it takes you to the red brick (tpA), but before it does, it will have the gui fade in and play a walking sound (like walking down/up stairs), and then it teleports you, and the gui fades out.
-- variables
local TPs = game.Workspace.Teleports.Teleport1
local tpA = TPs.TeleportA
local tpB = TPs.TeleportB
local TPEvent = game.ReplicatedStorage.Events.TPClicked
local Player = game:GetService("Players").LocalPlayer
local tp = game.StarterGui.Teleport2.ScreenGui
local g = tp.ScreenGui.Frame
TPEvent.OnClientEvent:Connect(function() -- function
-- prints whoever clicked the brick
tp.Enabled = true
for transparency = 0,1 do
g.BackgroundTransparency = transparency + 1/0 -- for the gui
end
-- putting the sound somewhere around here...?
local hum = script.Parent:FindFirstChild("Humanoid") -- calling on humanoid and root part below
if hum then
local hmr = script.Parent:FindFirstChild("HumanoidRootPart")
if hmr then
hmr.Cframe = tpA.Cframe -- teleporting the player to the location of TeleportA
end
for transparency = 0,1 do
g.BackgroundTransparency = transparency - 1/0
end
tp.Enabled = false
end
end)
This is a local gui called "Teleport2", located in StarterGui, has the screen gui + frame
-- Variables
local plr = game.Players
local TPEvent = game.ReplicatedStorage.Events.TPClicked
local CD = script.Parent
-- function
CD.MouseClick:Connect(function(player)
print(player.Name.. " has clicked the part!")
TPEvent:FireClient(player) -- fires the event and idk what to put there
end)
This is the second script in the clickdetector of the blue brick, called TPClicked.
The problem is that it doesn't teleport you at all, and doesn't even show the frame fading in or out. It just says this: 18:53:02.382 - FireClient: player argument must be a Player object
Some pictures below (Gyazo links)

8 comments
Your problem is in the second script: local plr = game.Players You forgot to get the LocalPlayer from Players Service, so you will get a service itself instead the player.
This is how you get the LocalPlayer: local plr = game.Players.LocalPlayer
And I suggest you should use :GetPlayer() instead of :GetChildren() to get the table of player from Players service
I see, I will try that
You can’t retrieve the LocalPlayer through a ServerScript
So it has to be a local script too?
Contact my discord @Ziffixture#0152. I have already found all your collateral issues too, I’m on mobile at the moment and it is difficult to format my explanation, It’ll make it faster for the both of us
Ok I did