#GUI Rotation problems.

1 messages · Page 1 of 1 (latest)

gentle elk
#

Whenever the Rotation of my Clock Hands reaches 0, it gets put back to 360, making it go around back, and it's genuienly annoying. how do i fix this?

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

local conn
local conn2

local player : Player = game:GetService("Players").LocalPlayer

local remotes = ReplicatedStorage:WaitForChild("Remotes")
local eventOngoing = ReplicatedStorage:WaitForChild("EventInfos").EventOngoing
local eventstarted, eventended = remotes:WaitForChild("Logic").EventStarted, remotes:WaitForChild("Logic").EventEnded

    
local MainGui = player.PlayerGui.MainGui
local MainFrame = MainGui:WaitForChild("Main")
local MainLabels = MainFrame.MainLabels
local Currencies = MainGui.Currencies
local Healthbar = MainFrame.HealthBar
local Staminabar = MainFrame.StaminaBar

local Gui = script.Parent

local MainGui = Gui:WaitForChild("Main")
local Minute = MainGui:WaitForChild("Minute")
local Seconds = MainGui:WaitForChild("Seconds")

local Info = ReplicatedStorage:WaitForChild("EventInfos")
local time = Info:WaitForChild("EventTime")


local function UpdateClock(secondsRemaining)
    local minutes = math.floor(secondsRemaining / 60)
    local seconds = secondsRemaining % 60

    local SecondsTween = TweenService:Create(Seconds, TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Rotation = seconds * 6}) -- the issue
    local MinutesTween = TweenService:Create(Minute, TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Rotation = minutes * 6}) -- can also be the issue.
    SecondsTween:Play()
    MinutesTween:Play()
--[[
    Seconds.Rotation = seconds * 6
    Minute.Rotation = minutes * 6]]
end


time:GetPropertyChangedSignal("Value"):Connect(function()
    UpdateClock(time.Value)
end)


UpdateClock(time.Value)

MainGui.Position -= UDim2.new(0, 0,2, 0)

--- etc...
static valve
#

i mean it still does work even after the limit