#open when first join (please dont ignore)

15 messages · Page 1 of 1 (latest)

halcyon spruce
#

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)

halcyon spruce
#

what???

buoyant fox
# halcyon spruce what???

Make the GUI visible by default and use a LocalScript to remove it if the badge is owned, otherwise proceed with the tween

halcyon spruce
#

how would i do that im kind of new

#

@buoyant fox

buoyant fox
#

Sorry, man. I'm on vacation right now

mossy oasis
#

@buoyant fox I was wondering what if i set an gui visble on the server by using a remoteveent will the gui be visible to everyone?

buoyant fox
#

TL;DR: No; not as long as it's a ScreenGui (descendant) we're talking about

mossy oasis
#

So i need to fire it back to allclients? And make it visible on the client?

oak capeBOT
#

studio** You are now Level 12! **studio

mossy oasis
#

Like use FireAllClients() and call the onClientEvent on the local script

buoyant fox