my script isnt opening the gui when the player first joins the game
here is the script:
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local PlayedBadge = 2151334567
local function AddUI(pl)
script.WelcomeIntroGui:Clone().Parent = pl:WaitForChild("PlayerGui")
local PlayerGui = pl:WaitForChild("PlayerGui")
local Frame = PlayerGui:WaitForChild("WelcomeIntroGui").Welcome
Frame:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",.5,true)
end
game.Players.PlayerAdded:Connect(function(player) -- checks when a player joins
if not BadgeService:UserHasBadgeAsync(player.UserId,PlayedBadge) then -- they don't have the badge
AddUI(player) -- adding the ui
else
print("player owns badge")
end
end)
** You are now Level 12! **