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

Unable to cast value to Object? Unsure what this error means?

Basically, this script should prompt you if you don't own a game pass id and if you do it will change a value in workspace. Unsure what this error means? Here is the code:


	local id = 5242880
 local UserId = game.Players.LocalPlayer.UserId
script.Parent.MouseButton1Click:Connect(function()
	  game:GetService("MarketplaceService"):PromptGamePassPurchase(UserId, id)
       script.Parent.Parent.Status.Text = "In order to be a Middle rank you need to buy the gamepass."
 if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(UserId,id) then
  game.Workspace.Middle.Value = true
    else
    
wait(7)
 script.Parent.Parent.Status.Text = ""
end
end)

1 comment

0

Where is the script located?

1 answer

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