Hello, here is the script I have so far and im getting this error:
15:48:37.186 - Player is not a valid member of DataModel
Can anybody help me?
Here is my script:
script.Parent.Touched:Connect(function(hit) if hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then game:GetService("MarketplaceService"):PromptProductPurchase(game.Player:FindFirstChild(hit.Parent.Name), 408797380) end end)
You missed "s" letter on line 3 and all your script is scattered. Here is the right working script
local MPS = game:GetService("MarketplaceService") local productId = 408797380 script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then MPS:PromptProductPurchase(player, productId) end end end)
You can read more here