In a script, I have this Disclaimer GUI pop up. Within that is a text button that says 'I AGREE'. Everything is fine. Then, I have the Developer Product item pop up for them to purchase, and the transaction is fine. The error is that I'm not recieving the item you're supposed to get. Here's a portion from the script:
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") -- error occurs here MarketplaceService.ProcessReceipt = function(receiptInfo) if p.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == id then --extra stuff here. No problem below this
The error is:
"DataStore can't be accessed from client"
It's a LocalScript Tips?
DataStore cannot be accessed from LocalScripts only regular Scripts. Try using a RemoteFunction if you want it to work correctly.
You can't access a data store from a LocalScript. The wiki on Data Stores suggest you can only access data stores from a server script.
Reference: http://wiki.roblox.com/index.php?title=Data_store