I have made a little money UI, that pops up randomly on the screen. But the thing is, it pops up, but not at a random position.
I have a code here for this
local Tbcl = game.Workspace.Tutorial.TutorialButton.ClickDetector
local Tbclc1 = game.Workspace.Tutorial.TutorialButtonClone1.ClickDetector
local Tbclc2 = game.Workspace.Tutorial.TutorialButtonClone2.ClickDetector
local localplayergui = game.Players.LocalPlayer.PlayerGui
local Moneymainstorage = game.ReplicatedStorage.MoneyMain
Tbcl.MouseClick:Connect(function()
local MoneyMain = Moneymainstorage:Clone()
MoneyMain.Parent = localplayergui
MoneyMain.Sound:Play()
local XPos = math.random(0.1, 0.9)
local YPos = math.random(0.1, 0.9)
MoneyMain.MoneySign.Position = UDim2.new(XPos, 0, YPos, 0)
for a = 1,50,1 do
MoneyMain.MoneySign.TextTransparency = MoneyMain.MoneySign.TextTransparency - 0.02
wait()
end
wait(2)
for b = 1,50,1 do
MoneyMain.MoneySign.TextTransparency = MoneyMain.MoneySign.TextTransparency + 0.02
wait()
end
print("+3")
MoneyMain:Destroy()
end)
But it always ends up in the same corner.