Help to fix script

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()
2 Likes

please help, I can’t fix it anymore

1 Like

can you show a video? I dont understand the problem entirely.

1 Like

I’m sorry but it doesn’t work at all it doesn’t work

1 Like

that is, I am pumping power, it does not show how much I get

1 Like

I am not sure where you got the script. It is simply entirely wrong and your formatting makes me think you were not the one who wrote it.

1 Like

I wrote in capital letters, so I highlighted the errors right now I fixed it, check it doesn’t work

1 Like

Did you even write this? Did you run the code? Did you get any obvious compilation errors?

Because you and I know that you cannot comment on two lines unless it’s a long string, and literally nobody has multiline statements like that.

1 Like

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)

end

showGUI()

1 Like

here is the script that was the first, I found it

1 Like