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.

1 comment
OnServerEvent should be OnClientEvent.