--variables
local marketplaceservice = game:GetService("MarketplaceService")
local Luigi = game.Lighting.StarterCharacter
local player = game.Players.LocalPlayer
local gamepass = 9693560
script.Parent.MouseButton1Click:Connect(function() --starts all this up when they click
marketplaceservice:PromptGamePassPurchase(player, gamepass) --sends them the purchase
marketplaceservice.PromptGamePassPurchaseFinished:Connect(function(player, gamepass, wasPurchased) -- wasPurchased is for whether or not the player purchased the game pass
if wasPurchased == true then
game.StarterPlayer.StarterCharacter:Destroy() --destroys the normal startercharacter
Luigi.Parent = game.StarterPlayer --adds the new startercharacter
else
print("Did not buy gamepass!")
end
end)
end)
localscript in texbutton. works but there's an output error!
08:51:25.200 - StarterCharacter is not a valid member of StarterPlayer

4 comments
Storing things in lighting is an outdated practice. You should be storing in server storage or replicated storage. If that is a local script it then the storage should be replicated. Pretty sure. That won’t solve it but yeah.
ok
Which replicated?? First or storage
No, ReplicatedFirst is generally used for things like loading screens since those instances are the first ones replicated to the client. For long term assets use ReplicatedStorage.