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

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

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

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..

5 comments

0

I think the the markeplace service

0

@Asta_TheDenomic wdym? Did you tried the script?

0

yes

0

ty it works

0

You can accept the answer by pressing a button under..

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