gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
write a roblox script to look for every object with the name "item1" and apply a…
- User
write a roblox script to look for every object with the name "item1" and apply a billboard gui and text label within the billboard gui
- Assistant
Sure! Here's an example of a Roblox script that looks for every object with the name "item1" and applies a BillboardGui and TextLabel within the BillboardGui to each of those objects:
-- Get all objects with the name "item1" local items = workspace:GetDescendants() for i = 1, #items do if items[i].Name == "item1" then -- Create a BillboardGui to hold the TextLabel local billboard = Instance.new("BillboardGui") billboard.Adornee = items[i] billboard.Size = UDim2.new(0, 100, 0, 50) -- Adjust the size as needed billboard.StudsOffset = Vector3.new(0, 7, 0) -- Adjust the offset as needed billboard.Parent = items[i] -- Create the TextLabel within the BillboardGui local label = Instance.new("TextLabel") label.BackgroundTransparency = 1 label.Size = UDim2.new(1, 0, 1, 0) label.Font = Enum.Font.SourceSansBold label.Text = "item1" label.TextColor3 = Color3.new(1, 1, 1) label.TextScaled = true label.Parent = billboard end endCopy the above script, create a new Script object in Roblox Studio, and paste the script into the Script object. Make sure to place objects with the name "item1" within your game's workspace. This script will find those objects and attach a BillboardGui with a TextLabel displaying "item1" to each of them.