Hello! How can I make this script have an abbreviation? I already have a script for it but I am not sure how to make work for this, especially when it changes value because it has an animation when the value changes. Here is the script I used before that had a abbreviation
while wait() do
local player = game.Players.LocalPlayer
local Short = require(game.ReplicatedStorage.Short)
script.Parent.Text = " "..Short.en(player:WaitForChild("leaderstats"):FindFirstChild("Coins").Value)
end
and the new script
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local TIME = 1
local EASINGSTYLE = Enum.EasingStyle.Quart -- Tween easing style
local EASINGDIRECTION = Enum.EasingDirection.InOut -- Tween easing direction
local Leaderstats = Players.LocalPlayer:WaitForChild("leaderstats")
local MoneyInt = Leaderstats:WaitForChild("Coins")
local MoneyText = script.Parent
local TransitionAmount = Instance.new("IntValue") -- We create a new IntValue which represents the value of the player's money before it got changed
-- The text of the TextLabel cannot be tweened due to being a string, so we use an IntValue instead.
TransitionAmount.Value = MoneyInt.Value
MoneyInt.Changed:Connect(function(amount) -- Wait for the player's money to change
local tween = TweenService:Create(
TransitionAmount,
TweenInfo.new(TIME, EASINGSTYLE, EASINGDIRECTION),
{Value = amount}
) -- Create a tween that changes TransitionAmount's value to the new money value.
tween:Play()
end)
TransitionAmount.Changed:Connect(function(amount) -- This function will fire every time the value of TransitionAmount changes, so during the tween.
MoneyText.Text = tostring(amount)
end)
If you need any clarification just ask me and I will respond, any help is appreciated!