script.Parent.MouseButton1Click:Connect(function()
game.Workspace.GlobalVariables.Emotes.a1.Enabled = true
game.Workspace.GlobalVariables.Emotes.a2.Enabled = false
game.Workspace.GlobalVariables.Emotes.a3.Enabled = false
game.Workspace.GlobalVariables.Emotes.a4.Enabled = false
game.Workspace.GlobalVariables.Emotes.a5.Enabled = false
game.Workspace.GlobalVariables.Emotes.a6.Enabled = false
game.Workspace.GlobalVariables.Emotes.a7.Enabled = false
game.Workspace.GlobalVariables.Emotes.a8.Enabled = false
game.Workspace.GlobalVariables.Emotes.a9.Enabled = false
game.Workspace.GlobalVariables.Emotes.a10.Enabled = false
game.Workspace.GlobalVariables.Emotes.a11.Enabled = false
game.Workspace.GlobalVariables.Emotes.a12.Enabled = false
game.Workspace.GlobalVariables.Emotes.a13.Enabled = false
game.Workspace.GlobalVariables.Emotes.None.Enabled = false
end)```
local GlobalVariables = workspace:FindFirstChild("GlobalVariables")
local Emotes = GlobalVariables:FindFirstChild("Emotes")
script.Parent.MouseButton1Click:Connect(function()
Emotes:FindFirstChild("a1").Enabled = true -- Enabled select emote separately
for i, EmoteObj in pairs(Emotes:GetChildren()) do
if not EmoteObj.Name == "a1" then -- Put name of emote it should skip
EmoteObj.Enabled = false
end
end
end)
This is a simpler way for disabling all other emotes. A simple loop checking the names of the contents of the grouping, if the name doesn’t match then set to false. Replace the name of the emote with what you want to be true
Okay thank you this worked! And just an FYI it underlined line 7 and just said it was " not X == Y is equivalent to X ~= Y" it still worked as normal but other than that it worked well now I won’t have big blocks of code like I did previously
1 Like