When the camera is on, the tween doesn’t work, but when the camera is off, the tween works
Code:
local textButton = script.Parent
local Sky = game.Lighting.Sky
local GoTo = game.Workspace.TeleportParts:WaitForChild("GoToErrorTower")
local UIS = game:GetService("UserInputService")
local camera = game.Workspace.Camera
local camFolder = game.Workspace.CameraFolder
local MusorClose = game.Workspace.MusorClose
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(1)
local ColorCorrection = game.Lighting:WaitForChild("ColorCorrection", 2)
textButton.MouseButton1Click:Connect(function()
TweenService:Create(ColorCorrection, Info, {Brightness = -1}):Play()
wait(2)
camera.CameraType = Enum.CameraType.Custom
local player = game.Players.LocalPlayer
Sky.SkyboxBk = "rbxassetid://2499304014"
Sky.SkyboxDn = "rbxassetid://2499304014"
Sky.SkyboxFt = "rbxassetid://2499304014"
Sky.SkyboxLf = "rbxassetid://2499304014"
Sky.SkyboxRt = "rbxassetid://2499304014"
Sky.SkyboxUp = "rbxassetid://2499304014"
Sky.SunTextureId = "rbxassetid://2499304014"
player.Character.HumanoidRootPart.CFrame = GoTo.CFrame + Vector3.new(0,3,0)
script.Parent.Parent.Parent.Parent.SurfaceLight.Enabled = false
MusorClose.CanCollide = true
MusorClose.Transparency = 0
game:GetService("RunService"):BindToRenderStep("MouseLock", Enum.RenderPriority.Camera.Value + 1, function()
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
end)
wait(2)
TweenService:Create(ColorCorrection, Info, {Brightness = 0}):Play()
end)
Please send the camera properties list while you press the text button on the first video,
It has to do something with the Camera properties difference between the two cases/situations
local inputservice = game:GetService("UserInputService")
local VirusEnd = script.Parent.Parent
local camera = game.Workspace.Camera
local camFolder = game.Workspace.CameraFolder
local Tween = game:GetService("TweenService")
local Info = TweenInfo.new(1)
local Lighting = game.Lighting.ColorCorrection
local Close = Tween:Create(Lighting, Info, {Brightness = -1})
local Open = Tween:Create(Lighting, Info, {Brightness = 0})
inputservice.InputBegan:connect(function(i,g)
if i.UserInputType == Enum.UserInputType.Keyboard then
if i.KeyCode == Enum.KeyCode.E then
local Mag = (VirusEnd.PC.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
if Mag <= VirusEnd.PC.Range.Value then
Close:Play()
script.Parent.HighlightScript:Destroy()
script.Parent.ClickDetector:Destroy()
script.Parent.Highlight:Destroy()
script.Parent.BillboardGui:Destroy()
wait(0.5)
VirusEnd.PC.RemoteEvent:FireServer()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = camFolder.CamPC.CFrame
game:GetService("RunService"):BindToRenderStep("MouseLock", Enum.RenderPriority.Camera.Value + 1, function()
inputservice.MouseBehavior = Enum.MouseBehavior.Default
wait(1)
Open:Play()
end)
end
end
end
end)
I meant that live time when u test the game open the workspace through the explorer and take a picture of the Camera properties and look for any differences between the two cases, anyway try this:
local textButton = script.Parent
local Sky = game.Lighting.Sky
local GoTo = game.Workspace.TeleportParts:WaitForChild("GoToErrorTower")
local UIS = game:GetService("UserInputService")
local camera = game.Workspace.Camera
local camFolder = game.Workspace.CameraFolder
local MusorClose = game.Workspace.MusorClose
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(1)
local ColorCorrection = game.Lighting:WaitForChild("ColorCorrection", 2)
textButton.MouseButton1Click:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
TweenService:Create(ColorCorrection, Info, {Brightness = -1}):Play()
wait(2)
camera.CameraType = Enum.CameraType.Custom
local player = game.Players.LocalPlayer
Sky.SkyboxBk = "rbxassetid://2499304014"
Sky.SkyboxDn = "rbxassetid://2499304014"
Sky.SkyboxFt = "rbxassetid://2499304014"
Sky.SkyboxLf = "rbxassetid://2499304014"
Sky.SkyboxRt = "rbxassetid://2499304014"
Sky.SkyboxUp = "rbxassetid://2499304014"
Sky.SunTextureId = "rbxassetid://2499304014"
player.Character.HumanoidRootPart.CFrame = GoTo.CFrame + Vector3.new(0,3,0)
script.Parent.Parent.Parent.Parent.SurfaceLight.Enabled = false
MusorClose.CanCollide = true
MusorClose.Transparency = 0
game:GetService("RunService"):BindToRenderStep("MouseLock", Enum.RenderPriority.Camera.Value + 1, function()
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
end)
wait(2)
TweenService:Create(ColorCorrection, Info, {Brightness = 0}):Play()
end)
This? the script you sent me doesn’t work.