I am trying to prompt a purchase to the player when they press a purchase buttom in a screengui.
I am getting the erorr Unable to cast string to int64, the ID changes because its stored as a StringValue.
Here is my code
local Player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function()
local ID = tostring(script.Parent.Parent.Parent.Frame.TopValue.Value)
MarketplaceService:PromptPurchase(Player, ID)
end)
local Player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function()
local ID = tostring(script.Parent.Parent.Parent.Frame.TopValue.Value)
local Number_ID = tonumber(ID)
if Number_ID then
MarketplaceService:PromptPurchase(Player, ID)
else
print("Failed to turn ID into a number!")
end
end)