In this script I am trying to teleport to another block when you touch the teleporter, Everything works except for the gui turning visible, I dont know what the problem is and i’ve messed around with the script a lot.
local TeleportDestination = script.Parent.Parent.Teleporter2
local debounce = false
local TweenService = game:GetService('TweenService')
local Frame = game.StarterGui.TeleporterScreen.Frame
script.Parent.Touched:Connect(function(Hit)
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Player and not debounce then
local CurrentlyTeleporting = Player.Character:FindFirstChild("CurrentlyTeleporting")
if not CurrentlyTeleporting then return end
if CurrentlyTeleporting.Value then
TweenService:Create(
Frame
TweenInfo.new(2),
{BackgroundTransparency = 1}
):Play() -- Plays your tween
debounce = true
CurrentlyTeleporting.Value = true
Player.Character.HumanoidRootPart.CFrame = TeleportDestination.CFrame + Vector3.new(5,0,0)
wait(3)
CurrentlyTeleporting = false
debounce = false
end
end
end)
Lines that are important: everything under CurrentlyTeleporting.Value then, this is where the problem occurs, no error messages or nothing, just nothing happens and you get teleported
What the gui looks like(from explorer)
Frame inside a screengui