I'm trying to make a teleport which is FE compatible. When I tested it in studio, it worked, but going in-game, it doesn't. Is there something I'm doing wrong?
local player = game.Players.LocalPlayer local char = player.Character script.Parent.MouseButton1Click:connect(function(mouse) game.ReplicatedStorage:WaitForChild("Teleport"):FireServer() end) game.ReplicatedStorage:WaitForChild("Teleport").OnServerEvent:connect(function() if script.Parent.Clicked.Value == false then char.Torso.CFrame = CFrame.new(Vector3.new(245.826, 77.351, 13.6)) script.Parent.Clicked.Value = true script.Parent.Text = "Teleport to Runway" elseif script.Parent.Clicked.Value == true then char.Torso.CFrame = CFrame.new(Vector3.new(26.8, 74.977, 41.499)) script.Parent.Clicked.Value = false script.Parent.Text = "Teleport to Island" end end)
"Teleport" is currently a RemoteEvent.
ServerEvents don't fire to localscripts. You'll need to put them in seperate scripts, one being server-sided. Only ClientEvents will fire to a localscript, so you'd need to change it to OnClientEvent for it to work