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

Weird error comes up when i try run my script.? This title system annoys me

local VipButton = game.Workspace.Buy1.Pop:FindFirstChild("VipButton")
VipButton.MouseButton1Click:connect(function() 
local player = game.Players.LocalPlayer
game:GetService("MarketplaceService"):PromptGamePassPurchase(player,8975888) 
end)

Players.fshduia.Backpack.LocalScript:2: attempt to index nil with 'MouseButton1Click' Thats the error!

4 comments

0

Can you check what exists in Workspace -> Buy1 -> Pop? It seems that isn't there.

0

Nguy, theres 2 text buttons and one text box and a white background

0

Is the name is "VipButton" ?

0

Yes

1 answer

✓ Accepted answer

The problem here is might be: The script can't find VipButton, make sure you have the correct name, correct Parent and you might have to use :WaitForChild() Ps: MouseButton1Click isn't a event of Click Detector (If it is a clickDetector), it is MouseClick i think

1 comment

0

Now its saying this Argument 1 missing or nil

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