text
stringlengths
54
19.6k
user: How do I implement session lock datastore pattern in Roblox Luau? response: -- Prevents data loss from concurrent server access local DataStoreService = game:GetService("DataStoreService") local Players = game:GetService("Players") local store = DataStoreService:GetDataStore("Profiles") local sessions = {} loc...
input_text: How do I implement zone / region detection system in Roblox Luau? end: local Players = game:GetService("Players") local RunService = game:GetService("RunService") -- Define zones as parts in workspace local zones = workspace:WaitForChild("Zones"):GetChildren() local playerZones = {} local function isInP...
user: How do I implement loot drop system with rarity in Roblox Luau? model: local Players = game:GetService("Players") local LOOT_TABLE = { { name = "Gold Coin", rarity = 60, value = 10 }, { name = "Silver Coin", rarity = 25, value = 5 }, { name = "Gem", rarity = 10, value = 50 }, ...
task: How do I implement simple cutscene system in Roblox Luau? output_text: -- LocalScript local TweenService = game:GetService("TweenService") local Players = game:GetService("Players") local player = Players.LocalPlayer local camera = workspace.CurrentCamera local function runCutscene(shots) -- Disable player ...
user: How do I implement npc dialogue system in Roblox Luau? output: -- LocalScript local Players = game:GetService("Players") local player = Players.LocalPlayer local TweenService = game:GetService("TweenService") local dialogues = { Merchant = { { text = "Welcome, traveler! Looking to buy something?" },...
begin: How do I implement day night cycle in Roblox Luau? output: -- Server Script local Lighting = game:GetService("Lighting") local TweenService = game:GetService("TweenService") local DAY_LENGTH = 120 -- seconds for a full day local DAY_START = 6 -- 6 AM local NIGHT_START = 20 -- 8 PM local function setT...
prompt: How do I implement weather system (rain, fog, storm) in Roblox Luau? answer: local Lighting = game:GetService("Lighting") local TweenService = game:GetService("TweenService") local weatherPresets = { clear = { fogEnd = 1000, fogColor = Color3.fromRGB(200, 210, 230), brigh...
start: How do I implement admin commands system in Roblox Luau? answer: local Players = game:GetService("Players") local ADMINS = { 123456789, 987654321 } -- UserId list local function isAdmin(player) for _, id in ipairs(ADMINS) do if player.UserId == id then return true end end return player:Ge...
query: Create an unanchored gold Plastic Block part sized 4x4x10 at position -38,69,24 in Roblox Luau. solution: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,215,0) part.Size = Vector3.new(4,4,10) part.Position = Vector3.new(-3...
instruction: Tween Size with Back Out easing, 1.5s duration, 2 repeats, reversing in Roblox. model: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(1.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 2, true, 0) local goal = {Size = Vector3.new(8,8,8)} lo...
task: Make a gray CorrodedMetal part with a Fire effect attached in Roblox Luau. model: local part = Instance.new("Part") part.Material = Enum.Material.CorrodedMetal part.Color = Color3.fromRGB(128,128,128) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = workspace l...
user: Spawn a orange brick ball part at (5,25,-10) size (1,6,6) in Roblox. model: local part = Instance.new("Part") part.Shape = Enum.PartType.Ball part.Material = Enum.Material.Brick part.Color = Color3.fromRGB(255,128,0) part.Size = Vector3.new(1,6,6) part.Position = Vector3.new(5,25,-10) part.Anchored = false part....
query: Create a pink cobblestone cylinder at (0,25,-5) size (4,1,1) in Roblox. output: local part = Instance.new("Part") part.Shape = Enum.PartType.Cylinder part.Material = Enum.Material.Cobblestone part.Color = Color3.fromRGB(255,100,200) part.Size = Vector3.new(4,1,1) part.Position = Vector3.new(0,25,-5) part.Anchor...
start: Tween Position with Linear InOut easing, 1.5s duration, 3 repeats, reversing in Roblox. finish: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(1.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 3, true, 0) local goal = {Position = Vector3.new...
begin: Detect Home key press to trigger an action in Roblox output_text: local UserInputService = game:GetService("UserInputService") UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.Home then print("Home pressed - trigger an acti...
user: Tween Transparency with Bounce In easing, 3s duration, 1 repeats, non-reversing in Roblox. completion: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(3, Enum.EasingStyle.Bounce, Enum.EasingDirection.In, 1, false, 0) local goal = {Transparency = 0.8} ...
begin: Tween Position with Quad In easing, 1.5s duration, infinite repeats, reversing in Roblox. output: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In, -1, true, 0) local goal = {Position = Vector3.new(1...
query: Build a system that a part that is white, transparency 0.5, CanCollide=false, Reflectance=0. output_text: local part = Instance.new("Part") part.Color = Color3.fromRGB(255, 255, 255) part.Transparency = 0.5 part.CanCollide = false part.Reflectance = 0 part.Anchored = true part.Parent = workspace
instruction: Create an anchored yellow Plastic Block part sized 8x1x4 at position -31,53,38 in Roblox Luau. end: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,255,0) part.Size = Vector3.new(8,1,4) part.Position = Vector3.new(-31...
input_text: Create an unanchored blue Wood Block part sized 1x4x2 at position -41,100,26 in Roblox Luau. result: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(0,0,255) part.Size = Vector3.new(1,4,2) part.Position = Vector3.new(-41,100,...
start: Create an anchored gray Wood Block part sized 1x1x8 at position -42,88,-5 in Roblox Luau. end: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(128,128,128) part.Size = Vector3.new(1,1,8) part.Position = Vector3.new(-42,88,-5) part...
prompt: Make a gray Plastic part with a Sparkles effect attached in Roblox Luau. completion: local part = Instance.new("Part") part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(128,128,128) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = workspace lo...
input_text: Create an anchored brown Plastic Block part sized 6x2x4 at position 16,87,-34 in Roblox Luau. result: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(139,69,19) part.Size = Vector3.new(6,2,4) part.Position = Vector3.new(16...
input_text: Create an unanchored blue Plastic Block part sized 10x1x2 at position -10,81,41 in Roblox Luau. finish: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(0,0,255) part.Size = Vector3.new(10,1,2) part.Position = Vector3.new(-...
instruction: Apply a BodyVelocity of (22, 38, 44) to a part. completion: local part = workspace:WaitForChild("PhysicsPart") local bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.Velocity = Vector3.new(22, 38, 44) bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) bodyVelocity.P = 1250 bodyV...
start: Tween Position with Back InOut easing, 5s duration, infinite repeats, reversing in Roblox. output_text: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(5, Enum.EasingStyle.Back, Enum.EasingDirection.InOut, -1, true, 0) local goal = {Position = Vector...
input_text: Create a TextLabel saying "Exit" with SourceSansBold font with background Color3.fromRGB(50,200,50) in Roblox GUI. answer: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextLabel") elem.Size = UDim2.new(0.5,0,0,5...
user: Create an anchored yellow Plastic Block part sized 1x1x1 at position -18,5,46 in Roblox Luau. output_text: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,255,0) part.Size = Vector3.new(1,1,1) part.Position = Vector3.new(-18...
query: Script a cylinder with sand material colored lime at (10,25,20) size (2,4,8) in Roblox. model: local part = Instance.new("Part") part.Shape = Enum.PartType.Cylinder part.Material = Enum.Material.Sand part.Color = Color3.fromRGB(0,255,128) part.Size = Vector3.new(2,4,8) part.Position = Vector3.new(10,25,20) part...
task: Create an unanchored white Plastic Block part sized 2x4x1 at position 4,18,-18 in Roblox Luau. result: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.new(1,1,1) part.Size = Vector3.new(2,4,1) part.Position = Vector3.new(4,18,-18) part....
input_text: Make a white Concrete part with a Smoke effect attached in Roblox Luau. result: local part = Instance.new("Part") part.Material = Enum.Material.Concrete part.Color = Color3.new(1,1,1) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = workspace local fx = I...
instruction: Create a projectile weapon that fires a ball at speed 150 dealing 50 damage on hit. response: local tool = script.Parent local damage = 50 local speed = 150 local debounce = false tool.Activated:Connect(function() if debounce then return end debounce = true local character = tool.Parent ...
start: Tween CFrame with Circular In easing, 1s duration, infinite repeats, non-reversing in Roblox. response: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.In, -1, false, 0) local goal = {CFrame = part.C...
start: Make a orange CorrodedMetal part with a PointLight effect attached in Roblox Luau. response: local part = Instance.new("Part") part.Material = Enum.Material.CorrodedMetal part.Color = Color3.fromRGB(255,128,0) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = w...
task: Create an anchored green Wood Block part sized 6x4x10 at position -49,8,-16 in Roblox Luau. model: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(0,255,0) part.Size = Vector3.new(6,4,10) part.Position = Vector3.new(-49,8,-16) part...
input_text: Make a white DiamondPlate part with a SpotLight effect attached in Roblox Luau. answer: local part = Instance.new("Part") part.Material = Enum.Material.DiamondPlate part.Color = Color3.new(1,1,1) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = workspace ...
start: Create an unanchored orange Wood Block part sized 2x1x6 at position -24,51,-38 in Roblox Luau. model: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,128,0) part.Size = Vector3.new(2,1,6) part.Position = Vector3.new(-24,51,-38...
instruction: Spawn a green slate cylinder part at (5,10,-10) size (8,6,1) in Roblox. end: local part = Instance.new("Part") part.Shape = Enum.PartType.Cylinder part.Material = Enum.Material.Slate part.Color = Color3.fromRGB(0,255,0) part.Size = Vector3.new(8,6,1) part.Position = Vector3.new(5,10,-10) part.Anchored = t...
query: Create a TextLabel saying "Help" with PatrickHand font with background Color3.fromRGB(0,120,255) in Roblox GUI. solution: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextLabel") elem.Size = UDim2.new(0.3,0,0.08,0) e...
user: Create a yellow forcefield part with Sparkles effect in Roblox output_text: local part = Instance.new("Part") part.Material = Enum.Material.ForceField part.Color = Color3.fromRGB(255,255,0) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = workspace local fx = ...
start: Create a black grass cylinder at (10,20,0) size (8,6,6) in Roblox. end: local part = Instance.new("Part") part.Shape = Enum.PartType.Cylinder part.Material = Enum.Material.Grass part.Color = Color3.new(0,0,0) part.Size = Vector3.new(8,6,6) part.Position = Vector3.new(10,20,0) part.Anchored = true part.Parent = ...
prompt: Tween Size with Sine InOut easing, 0.25s duration, 2 repeats, non-reversing in Roblox. model: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 2, false, 0) local goal = {Size = Vector3.new(8,8,...
start: Create an unanchored orange Plastic Block part sized 10x1x6 at position -31,14,-29 in Roblox Luau. response: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,128,0) part.Size = Vector3.new(10,1,6) part.Position = Vector3.new...
instruction: Tween Position with Sine In easing, 2s duration, 2 repeats, non-reversing in Roblox. finish: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 2, false, 0) local goal = {Position = Vector3.new(10...
prompt: Make a purple DiamondPlate part with a Sparkles effect attached in Roblox Luau. result: local part = Instance.new("Part") part.Material = Enum.Material.DiamondPlate part.Color = Color3.fromRGB(128,0,255) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = worksp...
instruction: Create a TextButton saying "Submit" with PatrickHand font with background Color3.fromRGB(128,0,255) in Roblox GUI. solution: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextButton") elem.Size = UDim2.new(0,150...
start: Create a TextButton saying "Score: 0" with Ubuntu font with background Color3.fromRGB(128,0,255) in Roblox GUI. result: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextButton") elem.Size = UDim2.new(0,200,0,60) elem...
query: Implement a way to a tween that loops 3 times. response: local TweenService = game:GetService("TweenService") local part = workspace:WaitForChild("LoopPart") local tweenInfo = TweenInfo.new( 1, -- Duration Enum.EasingStyle.Sine, -- EasingStyle Enum.EasingDirec...
prompt: Create an anchored teal Plastic Block part sized 12x2x4 at position -49,25,-36 in Roblox Luau. end: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(0,128,128) part.Size = Vector3.new(12,2,4) part.Position = Vector3.new(-49,25,...
begin: Create an unanchored pink Wood Block part sized 6x4x2 at position -42,57,4 in Roblox Luau. completion: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,100,200) part.Size = Vector3.new(6,4,2) part.Position = Vector3.new(-42,57,...
input_text: Create an unanchored brown Wood Block part sized 8x1x10 at position -31,10,46 in Roblox Luau. solution: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(139,69,19) part.Size = Vector3.new(8,1,10) part.Position = Vector3.new(-3...
task: Create an anchored black Plastic Block part sized 6x4x10 at position 48,30,45 in Roblox Luau. answer: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.new(0,0,0) part.Size = Vector3.new(6,4,10) part.Position = Vector3.new(48,30,45) part....
prompt: Tween Transparency with Elastic In easing, 0.5s duration, 1 repeats, reversing in Roblox. response: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(0.5, Enum.EasingStyle.Elastic, Enum.EasingDirection.In, 1, true, 0) local goal = {Transparency = 0.8}...
start: Create an anchored green Wood Block part sized 1x4x8 at position -2,66,31 in Roblox Luau. finish: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(0,255,0) part.Size = Vector3.new(1,4,8) part.Position = Vector3.new(-2,66,31) part.A...
start: Tween a part's Size with Cubic InOut easing over 2s in Roblox response: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(2, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut) local goal = {Size = Vector3.new(8,8,8)} local tween = TweenService:Create(...
query: Tween a part to position (-2, 39, -12) over 1.6 seconds using Bounce easing (InOut). output: local TweenService = game:GetService("TweenService") local part = workspace:WaitForChild("MovingPart") local tweenInfo = TweenInfo.new( 1.6, Enum.EasingStyle.Bounce, Enum.EasingDirection.InOut ) local goa...
start: Create an unanchored green Wood Block part sized 8x6x8 at position 18,82,42 in Roblox Luau. answer: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(0,255,0) part.Size = Vector3.new(8,6,8) part.Position = Vector3.new(18,82,42) part...
start: Script a ball with pebble material colored pink at (0,50,10) size (1,6,1) in Roblox. end: local part = Instance.new("Part") part.Shape = Enum.PartType.Ball part.Material = Enum.Material.Pebble part.Color = Color3.fromRGB(255,100,200) part.Size = Vector3.new(1,6,1) part.Position = Vector3.new(0,50,10) part.Ancho...
query: Create an unanchored teal Plastic Block part sized 1x4x4 at position -16,18,-47 in Roblox Luau. output_text: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(0,128,128) part.Size = Vector3.new(1,4,4) part.Position = Vector3.new(...
instruction: Create a TextButton saying "Pause" with RobotoMono font with background Color3.fromRGB(255,128,0) in Roblox GUI. model: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextButton") elem.Size = UDim2.new(0.2,0,0.1,...
input: Tween Reflectance with Cubic InOut easing, 4s duration, 2 repeats, reversing in Roblox. model: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(4, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 2, true, 0) local goal = {Reflectance = 0.9} local t...
user: Play a sound with volume 0.8, pitch 1.0, looped=false. solution: local sound = Instance.new("Sound") sound.SoundId = "rbxassetid://0" -- Replace with your sound asset ID sound.Volume = 0.8 sound.PlaybackSpeed = 1.0 sound.Looped = false sound.Parent = workspace sound:Play() -- Clean up when done if not sound.Lo...
input_text: Create an unanchored cyan Plastic Block part sized 4x2x6 at position 7,18,-33 in Roblox Luau. model: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(0,255,255) part.Size = Vector3.new(4,2,6) part.Position = Vector3.new(7,1...
input_text: Tween a part's color to RGB(188, 223, 204) over 2.4 seconds. output: local TweenService = game:GetService("TweenService") local part = workspace:WaitForChild("ColorPart") local tweenInfo = TweenInfo.new(2.4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut) local goal = { Color = Color3.fromRGB(188...
instruction: Create an unanchored purple Plastic Block part sized 12x6x8 at position 2,88,12 in Roblox Luau. model: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(128,0,255) part.Size = Vector3.new(12,6,8) part.Position = Vector3.new...
task: Tween CFrame with Circular In easing, 4s duration, 1 repeats, reversing in Roblox. finish: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(4, Enum.EasingStyle.Circular, Enum.EasingDirection.In, 1, true, 0) local goal = {CFrame = part.CFrame*CFrame.new...
query: Tween CFrame with Bounce Out easing, 2s duration, 3 repeats, reversing in Roblox. answer: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(2, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out, 3, true, 0) local goal = {CFrame = part.CFrame*CFrame.new(...
prompt: Create a TextButton saying "Pause" with GothamBold font with background Color3.fromRGB(255,128,0) in Roblox GUI. completion: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextButton") elem.Size = UDim2.new(0.2,0,0,50...
instruction: Tween Position with Elastic Out easing, 2s duration, infinite repeats, non-reversing in Roblox. end: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(2, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out, -1, false, 0) local goal = {Position = V...
input: Tween a part's Color with Cubic In easing over 0.5s in Roblox output: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.In) local goal = {Color = Color3.fromRGB(255,0,0)} local tween = TweenService:Crea...
input: Create an anchored gold Plastic Block part sized 2x1x6 at position -43,78,32 in Roblox Luau. result: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,215,0) part.Size = Vector3.new(2,1,6) part.Position = Vector3.new(-43,78,3...
question: Tween a part's Position with Back Out easing over 2s in Roblox response: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(2, Enum.EasingStyle.Back, Enum.EasingDirection.Out) local goal = {Position = Vector3.new(10,5,0)} local tween = TweenService:C...
question: Create a TextLabel saying "Buy" with Bangers font with background Color3.fromRGB(30,30,40) in Roblox GUI. finish: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextLabel") elem.Size = UDim2.new(0.5,0,0.08,0) elem.P...
question: Create an anchored gold Wood Block part sized 4x2x10 at position -4,2,5 in Roblox Luau. response: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,215,0) part.Size = Vector3.new(4,2,10) part.Position = Vector3.new(-4,2,5) pa...
question: Create a olive glass wedgepart at position (-36, 37, 5) with size (18, 9, 11), anchored=true. output_text: local part = Instance.new("WedgePart") part.Size = Vector3.new(18, 9, 11) part.Position = Vector3.new(-36, 37, 5) part.Color = Color3.fromRGB(128, 128, 0) part.Material = Enum.Material.Glass part.Anchor...
input: Tween Size with Sine Out easing, 2.5s duration, 3 repeats, reversing in Roblox. answer: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(2.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 3, true, 0) local goal = {Size = Vector3.new(8,8,8)} local t...
question: Tween Position with Back In easing, 0.25s duration, 3 repeats, reversing in Roblox. answer: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.In, 3, true, 0) local goal = {Position = Vector3.new(10,5...
input: Create an anchored pink Wood Block part sized 1x2x2 at position -12,77,-11 in Roblox Luau. result: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,100,200) part.Size = Vector3.new(1,2,2) part.Position = Vector3.new(-12,77,-11)...
instruction: Script a ball with cobblestone material colored black at (-10,5,0) size (6,6,1) in Roblox. completion: local part = Instance.new("Part") part.Shape = Enum.PartType.Ball part.Material = Enum.Material.Cobblestone part.Color = Color3.new(0,0,0) part.Size = Vector3.new(6,6,1) part.Position = Vector3.new(-10,5...
begin: Create a TextButton saying "Buy" top-left in Roblox GUI output: local Players = game:GetService("Players") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local screenGui = Instance.new("ScreenGui") screenGui.Parent = playerGui local elem = Instance.new("TextButton") elem....
start: Tween Color with Exponential InOut easing, 5s duration, 0 repeats, reversing in Roblox. result: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut, 0, true, 0) local goal = {Color = Color3.from...
start: Script for Show different ways to define and use functions in Luau. answer: -- Basic function local function greet(name) return "Hello, " .. name .. "!" end -- Function with multiple returns local function divide(a, b) if b == 0 then return nil, "Cannot divide by zero" end return a / b,...
prompt: Tween Transparency with Back In easing, 3s duration, 3 repeats, non-reversing in Roblox. end: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(3, Enum.EasingStyle.Back, Enum.EasingDirection.In, 3, false, 0) local goal = {Transparency = 0.8} local twe...
user: Create a TextButton saying "Play" centered in Roblox GUI result: local Players = game:GetService("Players") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local screenGui = Instance.new("ScreenGui") screenGui.Parent = playerGui local elem = Instance.new("TextButton") elem....
instruction: Play a sound with volume 0.9, pitch 1.9, looped=true. result: local sound = Instance.new("Sound") sound.SoundId = "rbxassetid://0" -- Replace with your sound asset ID sound.Volume = 0.9 sound.PlaybackSpeed = 1.9 sound.Looped = true sound.Parent = workspace sound:Play() -- Sound will loop continuously
user: Make a teal DiamondPlate part with a SpotLight effect attached in Roblox Luau. completion: local part = Instance.new("Part") part.Material = Enum.Material.DiamondPlate part.Color = Color3.fromRGB(0,128,128) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = works...
query: Create an anchored yellow Plastic Block part sized 2x1x8 at position -25,16,-33 in Roblox Luau. response: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,255,0) part.Size = Vector3.new(2,1,8) part.Position = Vector3.new(-25...
input: Create an anchored black Wood Block part sized 4x1x10 at position 11,27,-17 in Roblox Luau. output_text: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.new(0,0,0) part.Size = Vector3.new(4,1,10) part.Position = Vector3.new(11,27,-17) par...
input_text: Create an anchored orange Plastic Block part sized 12x6x6 at position 13,70,-11 in Roblox Luau. response: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Plastic part.Color = Color3.fromRGB(255,128,0) part.Size = Vector3.new(12,6,6) part.Position = Vector3.n...
input_text: Can you write code to a purple corrodedmetal wedgepart at position (-35, 31, -22) with size (15, 17, 15), anchored=true. finish: local part = Instance.new("WedgePart") part.Size = Vector3.new(15, 17, 15) part.Position = Vector3.new(-35, 31, -22) part.Color = Color3.fromRGB(128, 0, 128) part.Material = Enum...
input_text: Create an anchored red Wood Block part sized 4x6x1 at position 49,47,8 in Roblox Luau. response: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,0,0) part.Size = Vector3.new(4,6,1) part.Position = Vector3.new(49,47,8) par...
question: Create an unanchored blue Wood Block part sized 12x1x10 at position -9,86,45 in Roblox Luau. finish: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(0,0,255) part.Size = Vector3.new(12,1,10) part.Position = Vector3.new(-9,86,45...
instruction: Create a cyan fabric wedgepart at position (19, 99, 17) with size (5, 12, 6), anchored=true. solution: local part = Instance.new("WedgePart") part.Size = Vector3.new(5, 12, 6) part.Position = Vector3.new(19, 99, 17) part.Color = Color3.fromRGB(0, 255, 255) part.Material = Enum.Material.Fabric part.Anchore...
instruction: Tween a part's Position with Cubic InOut easing over 1s in Roblox end: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut) local goal = {Position = Vector3.new(10,5,0)} local tween = TweenServi...
query: Create an anchored pink Wood Block part sized 8x2x10 at position 18,78,-2 in Roblox Luau. solution: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,100,200) part.Size = Vector3.new(8,2,10) part.Position = Vector3.new(18,78,-2)...
query: Give me a script for a custom Signal/Event class in Luau for communication between scripts. response: -- ModuleScript: Signal local Signal = {} Signal.__index = Signal function Signal.new() local self = setmetatable({}, Signal) self._connections = {} self._nextId = 1 return self end function S...
begin: Create an unanchored red Wood Block part sized 2x6x2 at position 30,92,34 in Roblox Luau. response: local part = Instance.new("Part") part.Shape = Enum.PartType.Block part.Material = Enum.Material.Wood part.Color = Color3.fromRGB(255,0,0) part.Size = Vector3.new(2,6,2) part.Position = Vector3.new(30,92,34) part...
question: Make a green Concrete part with a Highlight effect attached in Roblox Luau. finish: local part = Instance.new("Part") part.Material = Enum.Material.Concrete part.Color = Color3.fromRGB(0,255,0) part.Size = Vector3.new(4,4,4) part.Position = Vector3.new(0,5,0) part.Anchored = true part.Parent = workspace loca...
query: Create a TextButton saying "Help" with LuckiestGuy font with background Color3.fromRGB(0,0,0) in Roblox GUI. solution: local screenGui = Instance.new("ScreenGui") screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") local elem = Instance.new("TextButton") elem.Size = UDim2.new(0.5,0,0,60) elem....
begin: Tween Reflectance with Sine InOut easing, 0.75s duration, infinite repeats, non-reversing in Roblox. end: local TweenService = game:GetService("TweenService") local part = workspace.MyPart local info = TweenInfo.new(0.75, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, false, 0) local goal = {Reflectance...