I just started learning how to use Remove Events and Functions for FE and I'm having trouble. I'm not entirely sure on how to start. I want to teleport a player to a certain CFrame location when they press a textbutton. I'm also pretty sure I didn't define the player correctly. I didn't know how to define the player from the script, I was confused.
Script in ServerScriptService
local RemoteFunction = Instance.new('RemoteFunction', workspace)
RemoteFunction.Name = "Teleport"
function RemoteFunction.OnServerInvoke(player)
player.Character.Torso.CFrame = CFrame.new(4775.45, 200.88, -61.63)
end
Script in TextButton
script.Parent.MouseButton1Click:connect(function()
workspace:WaitForChild("Teleport"):InvokeServer()
end)
