and so hello everyone, I want to add a spinner animation, but here’s the trouble, when I start pumping strength, I pump everything together, that is, endurance, running speed, etc., help fix it, here’s my script
local textLabel = script.Parent
local tweenService =
game:GetService("TweenService")
local workspace =
game:GetService("Workspace")
local textSize = textLabel.Size
local screenDimensions =
workspace.CurrentCamera.ViewportSize
local fadeDuration = 0.5
local spinDuration = 1.5
local borderPadding = 100
local totalCount = 5 -- Total number of times
the effect should happen
local currentCount = 0 -- Current count of the
effect
local function showGUI()
local startPos = UDim2.new(math.random(),
0, math.random(), 0)
local endPos = UDim2.new(math.random(),
0, math.random(), 0)
local startRotation = math.random(0, 360)
local endRotation = startRotation + 360
local safeBoundsX = screenDimensions.X -
textSize.X.Offset - borderPadding * 2
local safeBoundsY = screenDimensions.Y -
textSize.Y.Offset - borderPadding * 2
startPos = UDim2.new(
math.random(),
safeBoundsX > 0 and math.random(borderPadding, safeBoundsX + borderPadding) or borderPadding,
math.random(),
safeBoundsY > 0 and math.random(borderPadding, safeBoundsY + borderPadding) or borderPadding
)
textLabel.Position = startPos
textLabel.Rotation = startRotation
textLabel.ImageTransparency = 1
textLabel.Visible = true
local fadeInInfo = TweenInfo.new(fadeDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local fadeOutInfo = TweenInfo.new(fadeDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local spinInfo = TweenInfo.new(spinDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local fadeInProperties = { TextTransparency = 0 }
local fadeOutProperties = { TextTransparency = 1 }
local spinProperties = { Rotation = endRotation }
local fadeIn = tweenService:Create(textLabel, fadeInInfo, fadeInProperties)
local fadeOut = tweenService:Create(textLabel, fadeOutInfo, fadeOutProperties)
local spin = tweenService:Create(textLabel, spinInfo, spinProperties)
fadeIn:Play()
fadeIn.Completed:Connect(function()
spin:Play()
spin.Completed:Connect(function()
fadeOut:Play()
fadeOut.Completed:Connect(function()
currentCount = currentCount + 1
if currentCount < totalCount then
showGUI()
else
textLabel.Visible = false
end
end)
end)
end)
end
showGUI()
local imageLabel = script.Parent
local tweenService = game:GetService(“TweenService”)
local workspace = game:GetService(“Workspace”)
local imageSize = imageLabel.Size
local screenDimensions = workspace.CurrentCamera.ViewportSize
local fadeDuration = 0.5
local spinDuration = 1.5
local borderPadding = 100
local totalCount = 5 – Total number of times the effect should happen
local currentCount = 0 – Current count of the effect
local function showGUI()
local startPos = UDim2.new(math.random(), 0, math.random(), 0)
local endPos = UDim2.new(math.random(), 0, math.random(), 0)
local startRotation = math.random(0, 360)
local endRotation = startRotation + 360
local safeBoundsX = screenDimensions.X - imageSize.X.Offset - borderPadding * 2
local safeBoundsY = screenDimensions.Y - imageSize.Y.Offset - borderPadding * 2
startPos = UDim2.new(
math.random(),
safeBoundsX > 0 and math.random(borderPadding, safeBoundsX + borderPadding) or borderPadding,
math.random(),
safeBoundsY > 0 and math.random(borderPadding, safeBoundsY + borderPadding) or borderPadding
)
imageLabel.Position = startPos
imageLabel.Rotation = startRotation
imageLabel.ImageTransparency = 1
imageLabel.Visible = true
local fadeInInfo = TweenInfo.new(fadeDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local fadeOutInfo = TweenInfo.new(fadeDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local spinInfo = TweenInfo.new(spinDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local fadeInProperties = { ImageTransparency = 0 }
local fadeOutProperties = { ImageTransparency = 1 }
local spinProperties = { Rotation = endRotation }
local fadeIn = tweenService:Create(imageLabel, fadeInInfo, fadeInProperties)
local fadeOut = tweenService:Create(imageLabel, fadeOutInfo, fadeOutProperties)
local spin = tweenService:Create(imageLabel, spinInfo, spinProperties)
fadeIn:Play()
fadeIn.Completed:Connect(function()
spin:Play()
spin.Completed:Connect(function()
fadeOut:Play()
fadeOut.Completed:Connect(function()
currentCount = currentCount + 1
if currentCount < totalCount then
showGUI()
else
imageLabel.Visible = false
end
end)
end)
end)