Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't this work in Server but it does in Studio? Confused.

I'm making this tip box where you click the box and a GUI appears to select the type of tip. I've done that part (it works). But when I scripted Marketplace it doesn't work in Server but does in Studio. I'm confused. And it's in a LocalScript if it helps to figuring this out.

local id1 = 342011634 
local id2 = 342011882 --Developer Product IDs
local id3 = 342023684

script.Parent.smol.MouseButton1Click:Connect(function()
	game.MarketplaceService:PromptProductPurchase(script.Parent.Parent.Parent, id1)
end)

script.Parent.grande.MouseButton1Click:Connect(function()
	game.MarketplaceService:PromptProductPurchase(script.Parent.Parent.Parent, id2)
end)

script.Parent.venti.MouseButton1Click:Connect(function()
	game.MarketplaceService:PromptProductPurchase(script.Parent.Parent.Parent, id3)
end)

1 comment

1 answer

Make the scripts localscript.

local Player = game:GetService("Players").LocalPlayer

local id1 = 342011634 
local id2 = 342011882
local id3 = 342023684

script.Parent.smol.MouseButton1Click:Connect(function()
    game.MarketplaceService:PromptProductPurchase(Player.UserId, id1)
end)

script.Parent.grande.MouseButton1Click:Connect(function()
    game.MarketplaceService:PromptProductPurchase(Player.UserId, id2)
end)

script.Parent.venti.MouseButton1Click:Connect(function()
    game.MarketplaceService:PromptProductPurchase(Player.UserId, id3)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.