Gui Button Is Letterly not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
  • making a function where you can spend robux to put your asset on the leaderboard or something
  1. What is the issue? Include screenshots / videos if possible!
  • The buttons to open the gui and run everything is not working
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
  • I tried debug but it wont print anything
  • I tried EVERTHING

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

NOTE: The Scripts are not done, and I’m currently working on them

Script 1:

local ProductFrame = script.Parent.ProductFrame
local Accept = script.Parent.Accept
local Plr = game.Players.LocalPlayer
local Products = game.ReplicatedStorage.ProductEvents
local Products1 = game.ReplicatedStorage.ProductFunctions

Products.WarnPlayer.OnClientEvent:Connect(function()
	ProductFrame.Parent.Title1.Visible = true
	ProductFrame.Parent.Title1.Text = "Some of your asset are not for sale, or your inventory is private/closed."
end)

Products.Open.OnClientEvent:Connect(function(Plar)
	print(Plar) -- debug
	Products.SetAsset:FireServer(Plr.Name, Plr.UserId)
end)

while wait() do
	local Send = Products1.SelectAsset:InvokeServer()
	Accept.Activated:Connect(function()
		if Send ~= nil then
			Accept.Text = "Accepted"
			script.Parent.Visible = false
			Products.AddAssetOnList:FireServer(Send)
		else
			Accept.Text = "Choose an asset"
			wait(2)
			Accept.Text = "Accept"
		end
	end)
end

Script2:

local Players = game:GetService("Players")
local Frame = script.Parent.Frame
local ProductEvent  = game.ReplicatedStorage:WaitForChild("ProductEvents")
local ProductDatastore = game:GetService("DataStoreService"):GetDataStore("ProductDS")
local Board = script.Parent:WaitForChild("Frame"):WaitForChild("Main"):WaitForChild("Board")

Board:WaitForChild("TextButton").Activated:Connect(function(Plr)
	print(Plr) -- debug
	ProductEvent.Open:FireClient(Plr)
end)

You maybe dont want this script but i will put it:

local Market = game:GetService("MarketplaceService")
local HTTPService = game:GetService("HttpService")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EventsFolder = ReplicatedStorage:FindFirstChild("ProductEvents")

game.Players.PlayerAdded:Connect(function(plr)
	local PF = Instance.new("Folder", plr)
	PF.Name = "ProductFolder"
	local HttpService = game:GetService("HttpService")

	local CanSeeInventory = "https://inventory.roproxy.com/v1/users/"..plr.UserId.."/can-view-inventory"
	local Response = HttpService:RequestAsync({
		Url = CanSeeInventory,
		Method = "GET"
	});
	if Response.Success then -- If it doesnst work, then idk	
		local Body = HttpService:JSONDecode(Response.Body) -- Decoding the table
		if Body.canView == true then

			local function CloneAssets(Gui, Contents, Template)
				for _, player in pairs(game:GetService("Players"):GetPlayers()) do
					for _, Asset in pairs(Contents) do
						local data = Market:GetProductInfo(Asset, Enum.InfoType.Asset)
						if data and data.IsForSale then
							local Gui = Template:Clone()
							Gui.Parent = Gui
							Gui.Name = table.find(Contents, Asset)
							Gui.PurchaseButton.Text = data.PriceInRobux .. "$"
							Gui.Visible = true
							Gui.ImportantValues:FindFirstChild("AssetId").Value = Asset
						end
					end
				end
				for _, Asset in ipairs(Contents) do
					local data = Market:GetProductInfo(Asset, Enum.InfoType.Asset)
					if data and data.IsForSale then
						local MainGui = Gui
						MainGui.Name = table.find(Contents, Asset)
						MainGui.PurchaseButton.Text = data.PriceInRobux .. "$"
						MainGui.Visible = true
						MainGui.ImportantValues:FindFirstChild("AssetId").Value = Asset
					end
				end
			end


			local SubCategories = {
				"2";
				"11";
				"12"
			}

			local function GetContent(username, userid, tshirts, cursor)
				for i = 1,3 do
					local Contents = {}
					cursor = cursor or ""

					local Url = "https://catalog.roproxy.com/v1/search/items/details?Category=3&Subcategory=".. SubCategories[i].. "&Sort=4&Limit=30&CreatorName=%s&cursor=%s"
					local requestUrl = Url:format(username, cursor)

					local success, result = pcall(function()
						return HTTPService:GetAsync(requestUrl, true)
					end)

					if success then
						if result then
							local success2, result2 = pcall(function()
								return HTTPService:JSONDecode(result)
							end)
							local suc, er = pcall(function()
								for _, tshirt in ipairs(result2.data) do
									table.insert(Contents, tshirt.id)
								end
							end)
							if not suc then
								warn(er)
							end
							return Contents
						end
					end
				end
			end



			EventsFolder:WaitForChild("SetAsset").OnServerEvent:Connect(function(username, userid)
				local Boothname, Contents = GetContent(username, userid)
				if Contents then
					CloneAssets(plr.PlayerGui.LiveDonationScreen.Main.ProductFrame, Contents, plr.PlayerGui.LiveDonationScreen.Main.ProductFrame.Layout)
				end
			end)
			
		else
			game.ReplicatedStorage:WaitForChild("ProductEvents"):WaitForChild("WarnPlayer"):FireClient(plr)
		end
	end
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

You can’t interact with gui elements on the server (Script 2). This is the most obvious issue, but I don’t really understand your code. There is nothing with gui buttons in any of your scripts.

Ok, i will make that when the client press the server its gonna send tyhe messages to the server and boom

nvm it didnt work can anyone help me

You know what i replaced it with a attachment and a proximity prompt