System: You will be given a Luau script (that has been decompiled). You will rename the…
- User
System: You will be given a Luau script (that has been decompiled). You will rename the variables and functions to sound better, make the script more coherent, and add comments to areas of the script. Return the fixed script without adding ``` as we handle that. If no script has been given, do not produce any output. Do not respond with anything but the script User: --decompiled with swift using medal decompiler --MEDAL GITHUB: https://github.com/shrimp-nz/medal --Give them a star!
local v1 = game:GetService("Players").LocalPlayer game:GetService("StarterGui"):SetCore("ResetButtonCallback", false) local v_u_2 = workspace.CurrentCamera local v_u_3 = v1.Character.Humanoid local v_u_4 = game:GetService("TweenService") local v_u_5 = game:GetService("ReplicatedStorage").Values.Rumble local v_u_6 = game:GetService("ReplicatedStorage").Values.TweenCamera local v7 = game:GetService("ReplicatedStorage").Flashbacks.Flashback local v_u_8 = game:GetService("ReplicatedStorage").Flashbacks.EndFlashback v_u_2.CameraType = Enum.CameraType.Scriptable v_u_2.CFrame = v7.CFrame v_u_5:GetPropertyChangedSignal("Value"):Connect(function() -- upvalues: (copy) v_u_5, (copy) v_u_2, (copy) v_u_3 if v_u_5.Value == true then script.Rumble.Disabled = false wait(3) v_u_2.CameraType = Enum.CameraType.Attach else script.Rumble.Disabled = true wait(5) v_u_2.CameraSubject = v_u_3 v_u_2.CameraType = "Custom" game:GetService("StarterGui"):SetCore("ResetButtonCallback", true) script:Destroy() end end) v_u_6:GetPropertyChangedSignal("Value"):Connect(function() -- upvalues: (copy) v_u_6, (copy) v_u_4, (copy) v_u_2, (copy) v_u_8 if v_u_6.Value == true then local v9 = v_u_4:Create(v_u_2, TweenInfo.new(20, Enum.EasingStyle.Linear), { ["CFrame"] = v_u_8.CFrame }) v9:Play() v9.Completed:Wait() end v_u_2.CameraType = Enum.CameraType.Track v_u_2.CameraSubject = v_u_8 end)
Assistant:
- Assistant
local player = game:GetService("Players").LocalPlayer game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
local camera = workspace.CurrentCamera local humanoid = player.Character.Humanoid local tweenService = game:GetService("TweenService") local rumbleValue = game:GetService("ReplicatedStorage").Values.Rumble local tweenCameraValue = game:GetService("ReplicatedStorage").Values.TweenCamera local flashbackData = game:GetService("ReplicatedStorage").Flashbacks.Flashback local endFlashbackData = game:GetService("ReplicatedStorage").Flashbacks.EndFlashback
-- Set the camera to scriptable mode and position it at the flashback's location camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = flashbackData.CFrame
-- Connect to the rumble value change event rumbleValue:GetPropertyChangedSignal("Value"):Connect(function() -- Triggered when the rumble value changes if rumbleValue.Value == true then script.Rumble.Disabled = false wait(3) -- Delay for 3 seconds while rumble is active camera.CameraType = Enum.CameraType.Attach -- Change camera to attach mode else script.Rumble.Disabled = true wait(5) -- Delay for 5 seconds after rumble ends camera.CameraSubject = humanoid -- Set camera subject back to humanoid camera.CameraType = Enum.CameraType.Custom -- Reset camera to custom mode game:GetService("StarterGui"):SetCore("ResetButtonCallback", true) -- Enable reset button script:Destroy() -- Remove the script from the game end end)
-- Connect to the tween camera value change event tweenCameraValue:GetPropertyChangedSignal("Value"):Connect(function() -- Triggered when the tween camera value changes if tweenCameraValue.Value == true then local tween = tweenService:Create(camera, TweenInfo.new(20, Enum.EasingStyle.Linear), { ["CFrame"] = endFlashbackData.CFrame -- Tween to the end flashback's position }) tween:Play() -- Start the tween tween.Completed:Wait() -- Wait for the tween to finish end camera.CameraType = Enum.CameraType.Track -- Change camera type to track mode camera.CameraSubject = endFlashbackData -- Set the camera subject to end flashback data end)