Why doesn’t my script change make the frame dissappear in my Script? i am trying to make a script that simply changes the text and dissappears
There are no errors, and i have the badge (this prints) print(player.Name, "has badge", badgeId)
local Players = game:GetService("Players")
local startergui = game:GetService("StarterGui")
local BadgeService = game:GetService("BadgeService")
local badgeId = 478480426619405
local function onPlayerAdded(player)
local welcomeframe = startergui.WelcomeGui.WelcomeFrame
local frame = welcomeframe.Frame
local frameText = frame.TextLabel
frame.Visible = true
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, badgeId)
end)
if not success then
frameText.Text = "Welcome to the tower"
wait(2)
frameText.Text = "In this game, you will have 8 minutes to complete the entire tower."
wait(2)
frameText.Text = "If you do not finish, it is okay! You can try again!"
wait(2)
frame.Visible = false
return
end
if hasBadge then
print(frameText.Text)
frameText.Text = "Thank you for playing again!"
print(player.Name, "has badge", badgeId)
wait(3)
frame.Visible = false
end
end
Players.PlayerAdded:Connect(onPlayerAdded)