RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"instead of Player.UserID can you use the name"
-- server script local TweenService = game:GetService("TweenService") local gui = script.Parent.selectGUI local Light = script.Parent.Parent.Parent.Light local Settings = require(script.Parent.Parent.Settings) local brightnessValue = 5 -- Initial brightness value local function changeLightColor(color) Light.SurfaceLight.Color = color end local function toggleTween(guiInstance) local endPos = UDim2.new(0.26, 0, 0.246, 0) local tweeninfo = TweenInfo.new(0.9, Enum.EasingStyle.Quint) local tweenlol = TweenService:Create(guiInstance.ImageLabel, tweeninfo, {Position = endPos}) tweenlol:Play() end local function increaseBrightness() brightnessValue = math.min(brightnessValue 1, 7) Light.SurfaceLight.Brightness = brightnessValue -- Add this line to update the SurfaceLight end local function decreaseBrightness() brightnessValue = math.max(brightnessValue - 1, 1) Light.SurfaceLight.Brightness = brightnessValue -- Make sure this line is present end local function onClick(click) local player = click.Player local playerGui = player:WaitForChild("PlayerGui") if Settings.WhitelistedPlayers[player.Name] or player:IsInGroup(Settings.MinID) then if not playerGui:FindFirstChild("selectGUI") then local clonedGui = gui:Clone() clonedGui.Parent = playerGui toggleTween(clonedGui) local RedButton = clonedGui.ImageLabel.Red local BlueButton = clonedGui.ImageLabel.Blue local PurpleButton = clonedGui.ImageLabel.Purple local HexTextBox = clonedGui.ImageLabel:WaitForChild("HexTextBox") local ConfirmButton = clonedGui.ImageLabel.ConfirmButton local IncreaseButton = clonedGui.ImageLabel.BrightnessDisplay.Increase local DecreaseButton = clonedGui.ImageLabel.BrightnessDisplay.Decrease RedButton.MouseButton1Click:Connect(function() changeLightColor(Color3.fromRGB(255, 0, 0)) -- Red end) BlueButton.MouseButton1Click:Connect(function() changeLightColor(Color3.fromRGB(0, 0, 255)) -- Blue end) PurpleButton.MouseButton1Click:Connect(function() changeLightColor(Color3.fromRGB(128, 0, 255)) -- Purple (adjust RGB values as needed) end) local Increase = clonedGui.Increase local Decrease = clonedGui.Decrease Increase.OnServerEvent:Connect(function(player, brightnessValue) increaseBrightness(brightnessValue) end) Decrease.OnServerEvent:Connect(function(player, brightnessValue) decreaseBrightness(brightnessValue) end) local RemoteEvent = clonedGui.ChangeColor RemoteEvent.OnServerEvent:Connect(function(player, color) changeLightColor(color) end) local exitButton = clonedGui.ImageLabel.Exit exitButton.MouseButton1Click:Connect(function() clonedGui:Destroy() end) end end end script.Parent.ClickDetector.MouseClick:Connect(onClick)