function Reroll:ExtrasReroll(player, name, description, color)
--// Player Information
local playerGui = player:FindFirstChild("PlayerGui") :: PlayerGui
--// Gui Information
local rerollButton = playerGui.BottomGui.BottomFrame.RerollButton :: TextButton
local blackFrame = playerGui.CenterGui.BlackFrame :: Frame
local nameText = blackFrame.NameText :: TextLabel
local descriptionText = blackFrame.DescriptionText :: TextLabel
--// Code:
for _, text in blackFrame:GetChildren() do
if text:IsA("TextLabel") then
nameText.Text = name
descriptionText.Text = description
text.TextColor3 = color
rerollButton.Visible = false
TweenService:Create(blackFrame, TweenInfo.new(0.35), {BackgroundTransparency = 0}):Play()
TweenService:Create(text, TweenInfo.new(0.25), {TextTransparency = 0}):Play()
wait(3)
TweenService:Create(blackFrame, TweenInfo.new(0.25), {BackgroundTransparency = 1}):Play()
TweenService:Create(text, TweenInfo.new(0.25), {TextTransparency = 1}):Play()
rerollButton.Visible = true
end
end
end
Put --!strict at the top of your script and start fixing all the warnings.
Take advantage of type casting. (player: Player, name: string, description: string, color: Color3)
Favor task.wait() over wait().
Additionally, you’re using those four tweens over and over again. Presumably. I suggest creating all four of them as local variables outside of the script and just calling :Play() on the variable when needed.