RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"the player can reverse time by clicking a Textbutton called "REVERSE" inside of a Screengui"
-- local script inside the TextButton called "REVERSE" local reverseButton = script.Parent local player = game:GetService("Players").LocalPlayer local timeService = game:GetService("TweenService") local function reverseTime() local currentTimeOfDay = game.Lighting.TimeOfDay local targetTime = currentTimeOfDay - 1 if targetTime < 0 then targetTime = 23 end local tweenInfo = TweenInfo.new(1) local tweenGoals = {TimeOfDay = targetTime} local tween = timeService:Create(game.Lighting, tweenInfo, tweenGoals) tween:Play() end reverseButton.MouseButton1Click:Connect(reverseTime)