local Players = game:GetService("Players") local ReplicatedStorage =…
- User
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local SoundService = game:GetService("SoundService") local player = Players.LocalPlayer local petsFolder = workspace:WaitForChild("Pets") local SettingsUI = player.PlayerGui:WaitForChild("SettingsUI") local SettingsFrame = SettingsUI:WaitForChild("SettingFrame") local HidePetsButton = SettingsFrame:WaitForChild("HidePets") local HideValue = HidePetsButton:WaitForChild("Hide") local HideMusicButton = SettingsFrame:WaitForChild("HideMusic") local HideMusicValue = HideMusicButton:WaitForChild("Hide")
local function updateButtonAppearance(button, value) if value then button.Text = "On" button.BackgroundColor3 = Color3.new(0, 1, 0) -- Green else button.Text = "Off" button.BackgroundColor3 = Color3.new(1, 0, 0) -- Red end end
local function togglePetVisibility() for _, petModel in ipairs(petsFolder:GetChildren()) do for _, part in ipairs(petModel:GetDescendants()) do if part:IsA("BasePart") then part.Transparency = HideValue.Value and 1 or 0 elseif part:IsA("Decal") or part:IsA("Texture") then part.Transparency = HideValue.Value and 1 or 0 elseif part:IsA("ParticleEmitter") or part:IsA("Trail") then part.Enabled = not HideValue.Value end end end end
local function toggleMusic() local music = SoundService:FindFirstChild("Uptown") if music then if HideMusicValue.Value then music:Play() else music:Stop() end else warn("Music 'Uptown' not found in SoundService") end end
HidePetsButton.MouseButton1Click:Connect(function() HideValue.Value = not HideValue.Value updateButtonAppearance(HidePetsButton, HideValue.Value) togglePetVisibility() end)
HideMusicButton.MouseButton1Click:Connect(function() HideMusicValue.Value = not HideMusicValue.Value updateButtonAppearance(HideMusicButton, HideMusicValue.Value) toggleMusic() end)
-- Initialize button appearances and states updateButtonAppearance(HidePetsButton, HideValue.Value) updateButtonAppearance(HideMusicButton, HideMusicValue.Value) togglePetVisibility() toggleMusic()
-- Listen for new pets being added petsFolder.ChildAdded:Connect(function(child) task.wait() -- Give a short delay for the pet to fully load togglePetVisibility() end) (is it possible for the music to stop where it was already playing? what i mean is that. let's just say the music is playing. it's length is like. 3:00. the player stopped it at 2:31. and. when they play it. it should continue as where they left. 2:32. 2:33. is it possible?)
- Assistant