-
What do you want to achieve? Keep it simple and clear!
I’m trying to create an in-game shop for my in-game social hangout game, where you can literally buy classic roblox gears, like the Turkey, Tripmine, Pizza, Hyperlaser, you name it! -
What is the issue? Include screenshots / videos if possible!
I keep getting the “Unable to cast value to object” error, although everything might be correct. I don’t know why it is causing this error. I am using a clickdetector to prompt a Developer Product purchase. -
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I tried searching up if the clickdetector returned a Character Model or a Player instance as the “player” parameter, seeing if that would work, otherwise I did nothing else.
script.Parent.MouseClick:Connect(function(player)
-- get marketplace service, and prompt a dev-product purchase
-- with the model's product-id as the dev product id
local marketPlaceService = game:GetService("MarketplaceService")
local player_UserId = player.UserId
marketPlaceService:PromptProductPurchase(player_UserId, 3314521536)
end)
The error is happening at line 7, and I don’t know whether or not to try to fix the player_UserId object or the integer dev-product item Id.
Any help is appriciated.

