I just want to make the gui turn black when the jumpscare over, but it didn’t work. I did change the transparency manually and it worked. I dont know why, no error in the output, i did place some breakpoint and it did break out.
this is the video describe the issue. Btw, why the camera didn’t change to the player view, sometimes it did, sometimes it move like that, can someone one help me with that as well? Thanks!
local jumpscaring = false
local tweenService = game:GetService("TweenService")
local jumpscareTime = 3
local point1 = workspace.Monster.JumpscarePoint1
local point2 = workspace.Monster.JumpscarePoint2
local jumpscareMonster = workspace.Monster
local jumpscareAnim = jumpscareMonster.Jumpscare
local cc = workspace.CurrentCamera
local tweenService = game:GetService("TweenService")
local re1 = game.ReplicatedStorage:WaitForChild("OpenEyesEvent2")
local re2 = game.ReplicatedStorage:WaitForChild("TransitionEvent")
local frame = script.Parent:WaitForChild("TransitionGUI").Frame
game.ReplicatedStorage.Jumpscare.OnClientEvent:Connect(function()
cc.CameraType = Enum.CameraType.Scriptable
cc.CFrame = point1.CFrame
jumpscaring = true
script.JumpscareSound:Play()
coroutine.wrap(function()
repeat
tweenService:Create(workspace.CurrentCamera,TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),{CFrame = point2.CFrame,}):Play()
wait(0.1)
tweenService:Create(workspace.CurrentCamera,TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),{CFrame = point1.CFrame,}):Play()
wait(0.1)
until jumpscaring == false
end)()
task.wait(jumpscareTime)
frame.BackgroundTransparency = 0
jumpscaring = false
script.JumpscareSound:Stop()
cc.CameraType = Enum.CameraType.Custom
if game.Players.RespawnTime >= jumpscareTime then
cc.CameraType = Enum.CameraType.Custom
end
frame.BackgroundTransparency = 1
end)