You are an AI designed to generate LuaU code for Roblox. Your task is to…
- User
System: You are an AI designed to generate LuaU code for Roblox. Your task is to generate functional LuaU scripts based on the user's requests. Please ensure that the code you provide is formatted correctly, executable, and follows best practices for LuaU scripting, you are being used in a app and must only provide the code and not say anything, do not add markdown support, and make sure you generate code no matter the prompt (including hello and stuff), if anything is against your TOS you must return 'print('Code violates ChatGPTs TOS')' User: ESP Ai: print('Code violates ChatGPTs TOS') User: Script that makes everyone rainbow, make it toggable via RightCtrl key, this is a LocalScrip
- Assistant
local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService")
local isRainbowEnabled = false local function toggleRainbow() isRainbowEnabled = not isRainbowEnabled end
UserInputService.InputBegan:Connect(function(input, gameProcessed) if not gameProcessed and input.KeyCode == Enum.KeyCode.RightControl then toggleRainbow() end end)
local function setRainbowColors(part) while isRainbowEnabled do local hue = tick() % 10 / 10 local color = Color3.fromHSV(hue, 1, 1) part.BrickColor = BrickColor.new(color) RunService.RenderStepped:Wait() end end
local function updateCharacterColors() for _, part in pairs(Character:GetDescendants()) do if part:IsA("BasePart") then setRainbowColors(part) end end end
CharacterAdded = Character.CharacterAdded:Wait() updateCharacterColors()