Help: How can I make script that creating buttons with ids

local faces = {
	["SuperSuperHappyFace"] = {
		FaceID = 494290547,
	},
}

....

I don’t know how to insert the table and everyface make a new template:
image
and put the template button in this frame and make the button’s name to “FaceID” in the table:
image
Can someone tell me how to make this?

1 Like

Here’s an example of how you can create a button for each face in the table and set its name to the corresponding FaceID.

local faces = {
	["SuperSuperHappyFace"] = {
		FaceID = 494290547,
	},
	-- add more faces here
}

local player = game:GetService("Players").LocalPlayer
local screenGui = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui")
local frame = Instance.new("Frame") -- create a new frame to hold the buttons
frame.Parent = screenGui

for faceName, faceInfo in pairs(faces) do
	local button = Instance.new("TextButton") -- create a new button
	button.Name = tostring(faceInfo.FaceID) -- set the button's name to the FaceID
	button.Text = faceName -- set the button's text to the face's name
	button.Parent = frame -- parent the button to the frame
end

This script will create a new button for each face in the faces table, set its name to the FaceID, and its text to the face’s name. The buttons will be parented to a new frame in the player’s ScreenGui. You can customize the appearance and functionality of the buttons as preferred.

1 Like

Thanks, Working u a live saver

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.