Script is in StarterPlayerScripts for not duplicating icons!
local Icon = require(game.ReplicatedStorage.Icon)
local PlayerGui = game.Players.LocalPlayer:FindFirstChild("PlayerGui")
local EmotesUI = PlayerGui:FindFirstChild("AnimationsGui").Enabled
local Music = Icon.new()
Music:setLabel("Music")
local Emotes = Icon.new()
Emotes:setLabel("Emotes")
Emotes.selected:Connect(function()
EmotesUI = not EmotesUI
end)
local Icon = require(game.ReplicatedStorage.Icon)
local PlayerGui = game.Players.LocalPlayer.PlayerGui
local EmotesUI = PlayerGui:WaitForChild("AnimationsGui")
local Music = Icon.new()
Music:setLabel("Music")
local Emotes = Icon.new()
Emotes:setLabel("Emotes")
Emotes.selected:Connect(function()
EmotesUI.Enabled = not EmotesUI.Enabled
end)
local Icon = require(game.ReplicatedStorage.Icon)
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local EmotesUI = PlayerGui:WaitForChild("AnimationsGui")
local Music = Icon.new()
Music:setLabel("Music")
local Emotes = Icon.new()
Emotes:setLabel("Emotes")
Emotes.selected:Connect(function()
EmotesUI.Enabled = not EmotesUI.Enabled
end)
Sometimes the StarterGui won’t exactly replicate instantly to the Player’s Gui as soon as the Player first joins the game, which is why you call WaitForChild() for the script to yield its line of code until that specific object has been found
If I were to insert this into a Empty Baseplate:
local Part = workspace:WaitForChild("Part")
It’d result as an “infinite yield warning”, cause there’s no Part that I inserted just yet and it’ll keep looping until the Part has been found, or I insert a “timeout” parameter