local TeleportService = game:GetService(“TeleportService”)
local gameID = 5801493534
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(gameID, player)
print("Teleported to LAND.")
end
end
script.Parent.Touched:connect(onTouched)
Hi there. I completely forgot to make a transition for the teleporting and I am on borrowed time because tomorrow I am planned to open a preview of my experience. Is there any chance someone has an easy method for making a black fade-in for the teleport script? Thank you so much. Be safe!
Sorry, but please search beforehand. There are countless resources about a fading transition.
Here’s an article from the API reference that should be help. You can tweenservice if you want or you could simply use a for loop to achieve the fading affect. Since your grabbing the player, you could index a frame from their playerGui and create the fading transition.
I recommend using LocalPlayerArrivedFromTeleport. You can then use a tween to achieve the fading away effect. I wouldn’t recommend a for loop as they are line consuming and aren’t as customizable.
Here is some simple code to achieve the effect you want!
local Frame = path.to.frame --the frame you're fading away
local TweenService = game:GetService('TweenService')
TweenService:Create(Frame,TweenInfo.new(1),{BackgroundTransparency = 1}):Play()