Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my script not working . the game is asking me to add an argument but I don't understand?

Asked by 2 years ago

script: local GamePassService = game:GetService('GamePassService') local CatGamepass = 26348478

script.Parent.MouseButton1Click:Connect(function(player)
if GamePassService:PlayerHasPass(player, CatGamepass, true) then player.leaderstats.FaceValue.Value = "Uwu" else game:GetService("MarketplaceService"):PromptPurchase(player, CatGamepass) end

end)

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

MouseButton1Click doesn't return a player object.

If this is a localscript, you can do game.Players.LocalPlayer

local GamePassService = game:GetService('GamePassService')
local CatGamepass = 26348478
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    if GamePassService:PlayerHasPass(player, CatGamepass, true) then             
        player.leaderstats.FaceValue.Value = "Uwu"
    else        
        game:GetService("MarketplaceService"):PromptPurchase(player, CatGamepass)
    end

end)

Btw, since I don't really know about marketplaceservice, IDK if the argument is correct.

the only thing I see is that you put an invalid argument for the player part

also, please use the code block feature next time..

0
I think the the markeplace service Asta_TheDemonic 0 — 2y
0
@Asta_TheDenomic wdym? Did you tried the script? AProgrammR 398 — 2y
0
yes Asta_TheDemonic 0 — 2y
0
ty it works Asta_TheDemonic 0 — 2y
0
You can accept the answer by pressing a button under.. AProgrammR 398 — 2y
Ad

Answer this question