Hi, so I made a LocalScript which is this
local MPS = game:GetService("MarketplaceService")
game.ReplicatedStorage.AddButton.OnClientEvent:Connect(function()
for i, button in pairs(workspace:GetDescendants()) do
if button:IsA("TextButton") then
print(button.Name)
button.MouseButton1Down:Connect(function()
print("Clicked")
MPS:PromptPurchase(game.Players.LocalPlayer, button:GetAttribute("Id"))
end)
end
end
end)
workspace.DescendantAdded:Connect(function(des)
if des:IsA("TextButton") then
print(des.Name)
des.MouseButton1Down:Connect(function()
print("Clicked")
MPS:PromptPurchase(game.Players.LocalPlayer, des:GetAttribute("Id"))
end)
end
end)
--MPS:PromptPurchase(game.Players.LocalPlayer, child:GetAttribute("Id"))
The biggest problem I’m facing is that this script only works for me, I mean the MouseButton1Down event. Why this doesn’t work for any player rather than me? Everytime I click the button, it prints. But when another player does, nothing happens.
Is this a bug or something in my script?
Thanks.