RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a building tool that places 5 types of cubes"
-- local script local player = game:GetService("Players").LocalPlayer local mouse = player:GetMouse() local tool = Instance.new("Tool") tool.Name = "Cube Placer" tool.RequiresHandle = false tool.Parent = player.Backpack local cubeTypes = {"Red", "Blue", "Green", "Yellow", "Purple"} local function placeCube() local cube = Instance.new("Part") cube.Size = Vector3.new(1, 1, 1) cube.BrickColor = BrickColor.new(cubeTypes[math.random(#cubeTypes)]) cube.Anchored = true cube.Position = mouse.Hit.p cube.Parent = game.Workspace end tool.Activated:Connect(placeCube)