local player = game.Players.LocalPlayer local char = player.Character or…
- User
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local humanoidRootPart = char:WaitForChild("HumanoidRootPart") local teleportpart = workspace:WaitForChild("TeleportPart") -- Название части, к которой нужно телепортироваться local targetPart = workspace:WaitForChild("TargetPart") -- Часть, по которой игрок будет кликать local screenGui = player:WaitForChild("PlayerGui"):WaitForChild("Blackout") local frame = screenGui:WaitForChild("Blackout") local tweenService = game:GetService("TweenService") local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut) local function fadeOut() local tween = tweenService:Create(frame, tweenInfo, {BackgroundTransparency = 0}) tween:Play() tween.Completed:Wait() end local function fadeIn() local tween = tweenService:Create(frame, tweenInfo, {BackgroundTransparency = 1}) tween:Play() tween.Completed:Wait() end local function teleportToTarget() fadeOut() task.wait(0.5) -- Можно добавить небольшую задержку для плавности humanoidRootPart.CFrame = teleportpart.CFrame + Vector3.new(8, 0, 0) -- Телепорт к части с небольшой поправкой fadeIn() end local function onPartClicked() teleportToTarget() end -- Подключаем событие клика к целевой части if targetPart:IsA("BasePart") then targetPart.MouseClick:Connect(onPartClicked) end не появялется черный экран при телепорте
- Assistant
It looks like you’re trying to create a fade-out effect during a teleportation sequence in Roblox, but you’re experiencing an issue where the black screen doesn’t appear. Here are a few suggestions to troubleshoot and resolve the problem:
-
Check GUI Layering: Ensure the
Blackoutframe is correctly layered above other UI elements. Verify its property and ensure it’s higher than other frames, so it appears on top.
-