Hi scripters and developers, could you please help me with the script as from this video
I’m creating a game similar to this one and I would like to ask how to make the same pop-up, but I looked at all the forums and YouTube didn’t find it anywhere, could you help me?
#1 you need to show us where you are and not just ask for a script … #2 this is way harder than I was thinking … lol
This is what I got …
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()
And here is the whole set up. spin.rbxm (4.8 KB)
I seem to have a problem with it staying within the defined boarder of the screen.
Maybe someone else can take it from here …