I want to make it so when the player uses a part that has proximity it teleports them to the other part named (Togamedoor) with a fancy fade in and out transition.
Ive added a screenGUI and a frame for transition and named the screenGUI Transition and the frame is Fade
but all it does it teleport me without transition
ive tried rewriting the code and reading to see if there are any errors and yet it still wont work
Heres both parts to the script part A is for teleporting and Script B is for transition.
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(Player)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.ReplicatedStorage.ShowTransition:FireClient(player)
task.wait(.5)
local character = player.Character
character.HumanoidRootPart.CFrame = game.Workspace.Togamedoor.CFrame
end
end)
local remoteevent = game.ReplicatedStorage.ShowTransition
remoteevent.OnClientEvent:Connect(function()
local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local fadein = tweenservice:Create(script.Parent, tweeninfo, {BackroundTransparency = 0})
local fadeout = tweenservice:Create(script.Parent, tweeninfo, {BackroundTransparency = 1})
fadein:Play()
task.wait(1)
fadeout:Play()
end)