Size = {0.3, 0}, {0.4, 0}
Position = {0.35, 0}, {0.3, 0}
BackgroundColor3 = Color3.fromRGB(40, 40, 40)
BackgroundTransparency = 0.1ScreenGui
├── Frame (SettingsWindow)
├── Title (TextLabel)
├── SoundButton
├── MusicButton
├── GraphicsButton
├── UIListLayoutlocal button = script.Parent
local soundEnabled = true
button.Text = "Звук: ВКЛ"
button.MouseButton1Click:Connect(function()
soundEnabled = not soundEnabled
if soundEnabled then
button.Text = "Звук: ВКЛ"
game.SoundService.Volume = 1
else
button.Text = "Звук: ВЫКЛ"
game.SoundService.Volume = 0
end
end)local button = script.Parent
local music = workspace:WaitForChild("Music")
local enabled = true
button.MouseButton1Click:Connect(function()
enabled = not enabled
if enabled then
music.Volume = 1
button.Text = "Музыка: ВКЛ"
else
music.Volume = 0
button.Text = "Музыка: ВЫКЛ"
end
end)local button = script.Parent
local frame = script.Parent.Parent.SettingsWindow
button.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
end)local DataStoreService = game:GetService("DataStoreService")
local settingsStore = DataStoreService:GetDataStore("PlayerSettings")
game.Players.PlayerAdded:Connect(function(player)
local data = settingsStore:GetAsync(player.UserId)
if data then
player:SetAttribute("SoundEnabled", data.Sound)
else
player:SetAttribute("SoundEnabled", true)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
settingsStore:SetAsync(player.UserId, {
Sound = player:GetAttribute("SoundEnabled")
})
end)frame:TweenPosition(UDim2.new(0.35,0,0.3,0), "Out", "Quad", 0.3)game:GetService("Lighting").Brightness = 2