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

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

Asked by 4 years ago
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!

0
Can you check what exists in Workspace -> Buy1 -> Pop? It seems that isn't there. gskw 1046 — 4y
0
Nguy, theres 2 text buttons and one text box and a white background Fshduia 9 — 4y
0
Is the name is "VipButton" ? Nguyenlegiahung 1091 — 4y
0
Yes Fshduia 9 — 4y

1 answer

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

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

0
Now its saying this Argument 1 missing or nil Fshduia 9 — 4y
Ad

Answer this question