This is the full script Im not sure why its still happening
local TweenService = game:GetService("TweenService")
local Formatter = require(game.ReplicatedStorage.Server.Modules.Helpers.Formatter)
local module = {}
module.Profiles = {}
local function animateCount(label, start, finish)
local diff = finish - start
local duration = math.clamp(math.abs(diff) / 50, 0.2, 1)
local steps = 30
for i = 1, steps do
local alpha = i / steps
local current = math.floor((start + diff * alpha) * 10 + 0.5) / 10
if math.abs(finish) >= 1000 then
label.Text = Formatter.checkzeros(current, 1)
else
label.Text = string.format("%.1f", current)
end
task.wait(duration / steps)
end
if math.abs(finish) >= 1000 then
label.Text = Formatter.checkzeros(finish, 1)
else
label.Text = tostring(finish)
end
end
local function animateAddText(CoinsAdd, startPos)
CoinsAdd.TextTransparency = 1
CoinsAdd.UIStroke.Transparency = 1
CoinsAdd.Size = UDim2.new(0, 0, 0, 0)
CoinsAdd.Position = startPos
local popTweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out)
local floatTweenInfo = TweenInfo.new(0.75, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local fadeTweenInfo = TweenInfo.new(0.4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0.5)
TweenService:Create(CoinsAdd, TweenInfo.new(0.1), {TextTransparency = 0, Size = UDim2.new(0, 80, 0, 40)}):Play()
TweenService:Create(CoinsAdd.UIStroke, TweenInfo.new(0.1), {Transparency = 0}):Play()
TweenService:Create(CoinsAdd, popTweenInfo, {Size = UDim2.new(0, 100, 0, 50)}):Play()
task.wait(0.25)
local floatGoal = startPos + UDim2.new(0, 0, -0.05, 0)
TweenService:Create(CoinsAdd, floatTweenInfo, {Position = floatGoal}):Play()
TweenService:Create(CoinsAdd, fadeTweenInfo, {TextTransparency = 1}):Play()
TweenService:Create(CoinsAdd.UIStroke, fadeTweenInfo, {Transparency = 1}):Play()
task.wait(1)
CoinsAdd:Destroy()
end
function module.GiveRolls(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
local Coins = player.PlayerGui.ButtonsGUI.Currency.Rolls
local old = profile.Data.Rolls
profile.Data.Rolls += amount
local CoinsAdd = Coins.Add:Clone()
CoinsAdd.Parent = Coins
CoinsAdd.Visible = true
CoinsAdd.Text = "+" .. amount
CoinsAdd.Rotation = math.random(-10, 10)
CoinsAdd.Position = UDim2.new(0.66, math.random(-10, 10), 0.108, math.random(-5, 5))
task.spawn(function()
animateAddText(CoinsAdd, UDim2.new(0.66, 0, 0.108, 0))
end)
script.Sound:Play()
animateCount(Coins.TextLabel, old, profile.Data.Rolls)
end
function module.RemoveRolls(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
local Coins = player.PlayerGui.ButtonsGUI.Currency.Rolls
local old = profile.Data.Rolls
profile.Data.Rolls -= amount
local CoinsAdd = Coins.Add:Clone()
CoinsAdd.Parent = Coins
CoinsAdd.Visible = true
CoinsAdd.Text = "-" .. amount
CoinsAdd.Rotation = math.random(-10, 10)
CoinsAdd.Position = UDim2.new(0.66, math.random(-10, 10), 0.108, math.random(-5, 5))
task.spawn(function()
animateAddText(CoinsAdd, UDim2.new(0.66, 0, 0.108, 0))
end)
script.Sound:Play()
animateCount(Coins.TextLabel, old, profile.Data.Rolls)
end
function module.GiveRoPoints(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
local Coins = player.PlayerGui.ButtonsGUI.Currency.Coins
local old = profile.Data.Credits
profile.Data.Credits += amount
player.leaderstats["💰 RoPoints"].Value = profile.Data.Credits
local CoinsAdd = Coins.Add:Clone()
CoinsAdd.Parent = Coins
CoinsAdd.Visible = true
CoinsAdd.Text = "+" .. amount
CoinsAdd.Rotation = math.random(-10, 10)
CoinsAdd.Position = UDim2.new(0.454, math.random(-10, 10), 0.563, math.random(-5, 5))
task.spawn(function()
animateAddText(CoinsAdd, UDim2.new(0.454, 0, 0.563, 0))
end)
script.Sound:Play()
animateCount(Coins.TextLabel, old, profile.Data.Credits)
end
function module.RemoveRoPoints(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
local Coins = player.PlayerGui.ButtonsGUI.Currency.Coins
local old = profile.Data.Credits
profile.Data.Credits -= amount
player.leaderstats["💰 RoPoints"].Value = profile.Data.Credits
local CoinsAdd = Coins.Add:Clone()
CoinsAdd.Parent = Coins
CoinsAdd.Visible = true
CoinsAdd.Text = "-" .. amount
CoinsAdd.Rotation = math.random(-10, 10)
CoinsAdd.Position = UDim2.new(0.454, math.random(-10, 10), 0.563, math.random(-5, 5))
task.spawn(function()
animateAddText(CoinsAdd, UDim2.new(0.454, 0, 0.563, 0))
end)
script.Sound:Play()
animateCount(Coins.TextLabel, old, profile.Data.Credits)
end
function module.GiveRollsDones(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
profile.Data.RollsDone += amount
player.leaderstats["🎲 Rolls"].Value = profile.Data.RollsDone
end
function module.GetRolls(player: Player)
local profile = module.Profiles[player]
if not profile then return end
return profile.Data.Rolls
end
function module.GetRoPoints(player: Player)
local profile = module.Profiles[player]
if not profile then return end
return profile.Data.Credits
end
function module.AdjustRolls(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
local Coins = player.PlayerGui.ButtonsGUI.Currency.Rolls
profile.Data.Rolls = amount
Coins.TextLabel.Text = profile.Data.Rolls
end
function module.AdjustRoPoints(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
local Coins = player.PlayerGui.ButtonsGUI.Currency.Coins
profile.Data.Credits = amount
player.leaderstats["💰 RoPoints"].Value = profile.Data.Credits
Coins.TextLabel.Text = Formatter.checkzeros(profile.Data.Credits, 1)
end
function module.AdjustTimer(player: Player, amount: number)
local profile = module.Profiles[player]
if not profile then return end
profile.Data.Timer = amount
end
function module.GetLoginTimes(player: Player)
local profile = module.Profiles[player]
if not profile then return end
return profile.Data.LoginTimes
end
function module.GetTimer(player: Player)
local profile = module.Profiles[player]
if not profile then return end
return profile.Data.Timer
end
return module
---