You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I’m trying to make a robux marketplace system similar to pls buy me or starving artists
- What is the issue? Include screenshots / videos if possible!
I’ve run into an error
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Nothing found in developer fourm
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!
This is the script used to send the message to the server:
local Button = script.Parent
local UploadedItem = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("UploadedItem")
local plr = game:GetService("Players").LocalPlayer
Button.MouseButton1Click:Connect(function()
local ItemsFrame = script.Parent.Parent
local CurrentSelected = ItemsFrame:FindFirstChild("Selected")
if CurrentSelected then
CurrentSelected.Name = CurrentSelected.Config.ItemKey.Value
end
Button.Name = "Selected"
local PriceSelected = ItemsFrame.Parent.PricesFrame:FindFirstChild("Selected")
if PriceSelected then
UploadedItem:FireServer(PriceSelected.Id, Button.Config.ItemKey.Value)
end
end)
This is the server recieving the message and sending one back to the client:
UploadedItem.OnServerEvent:Connect(function(plr, GamepassId, Card)
local PlayerName = plr.Name
local Info = MarketplaceService:GetProductInfo(GamepassId.Value, Enum.InfoType.GamePass)
local Price = Info.PriceInRobux
local CardURL = UploadItemTemplates[Card].Image
local CardBackgroundColour3 = UploadItemTemplates[Card].BackgroundColor3
UploadedItem:FireAllClients(PlayerName, Price, GamepassId, CardURL, CardBackgroundColour3, Card)
end)
This is the script for the client recieving that event
local UploadedItem = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("UploadedItem")
UploadedItem.OnClientEvent:Connect(function(PlayerName, Price, GamepassId, CardURL, CardBackgroundColor3, Card)
local SellerTemplate = script.Parent.ShopFrame.Template
local NewSellFrame = SellerTemplate:Clone()
NewSellFrame.Name = "SellFrame"
NewSellFrame.Parent = SellerTemplate.Parent
NewSellFrame.GamepassId.Value = GamepassId.Value
local Info = NewSellFrame.Info
Info.ItemPrice.Text = Price
Info.Seller.Text = PlayerName
Info.Parent.Showcase.ItemLabel.Image = CardURL
Info.Parent.Showcase.BackgroundColor3 = CardBackgroundColor3
Info.ItemKey.Value = Card
NewSellFrame.Visible = true
end)
This is where it gets weird. On the client that sent the first message, it runs without errors. On any other client, I get an error.
The error: Players.Player1.PlayerGui.MarketplaceGui.MarketplaceFrame.LocalScript:9: attempt to index nil with ‘Value’