Creating a button to make a command work from basic admin essentials

So i have a question about if its possible to make a ui button trigger a basic admin essentials command. i have tried alot but cant find any solutions

So for being clear. I want to make a Screengui with a textbutton, and if u click the textbutton it needs to make a command work same as if u for example would do :reset.

Is there anyone that can help?

You can check path.to.button.MouseButton1Click:Connect(function()
– this would run when you press the button if you put the path.to.button to the path
end)

no clue if this is what ur asking but if you need to know how to detect a button press this is how to do it

Hey! Thanks for the quick response. I dont think this is completely what im looking for. Im looking for a solution for Basic Admin Essentials Specifically.

Hey there! This is easy. Contact cloudedscripter. On discord.

if you are using the new TextChatService in your place this script can be put under the button you want to use

local TextChatService = game:GetService("TextChatService")

script.Parent.Activated:Connect(function()
	local RBXGeneral:TextChannel = TextChatService.TextChannels:FindFirstChild('RBXGeneral')
	if RBXGeneral then
		RBXGeneral:SendAsync(':respawn')
	end
end)

this will do the respawn command but you can change it and modify to use multi commands from basic admin

you can also modify the chatchannel you want it sent in