script.Parent.MouseButton1Click:Connect(function() local plr = script.Parent.Parent.Parent.Parent.Parent local chr = plr.Character if plr.PlayerOwnsTheMaskPass.Value == true then local newmask = script.Parent.TOKYOGHOULMASK:Clone() newmask.Parent = chr newmask.Mask.Weld.Part1 = chr.Head script.Parent.Text = "Remove" script.Parent.removefunc.Disabled = false script.Disabled = true else script.Parent.Text = "You do not own this gamepass!" local market = game:GetService("MarketplaceService") local id = 7538706 market:PromptGamePassPurchase(plr,id) wait(4) script.Parent.Text = "Tokyo Ghoul Mask" end end)
I click it and then it works but the console comes out with
Players.LegoUnicornRoblox.PlayerGui.CharacterCreation.GamepassFrame.TokyoMask.r:8: Expected ')' (to close '(' at line 1), got <eof>
and the remove function stops working
script.Parent.MouseButton1Click:Connect(function() local plr = script.Parent.Parent.Parent.Parent.Parent local chr = plr.Character if plr.PlayerOwnsTheMaskPass.Value == true then local newmask = script.Parent.TOKYOGHOULMASK:Clone() newmask.Parent = chr newmask.Mask.Weld.Part1 = chr.Head script.Parent.Text = "Remove" script.Parent.removefunc.Disabled = false script.Disabled = true else script.Parent.Text = "You do not own this gamepass!" local market = game:GetService("MarketplaceService") local id = 7538706 market:PromptGamePassPurchase(plr,id) wait(4) script.Parent.Text = "Tokyo Ghoul Mask" end end end)
You forgot the parameter Player. Next time when you are making an event even if you don’t use the parameters you should still include them.
Here is your script fixed:
script.Parent.MouseButton1Click:Connect(function(player) local plr = script.Parent.Parent.Parent.Parent.Parent local chr = plr.Character if plr.PlayerOwnsTheMaskPass.Value == true then local newmask = script.Parent.TOKYOGHOULMASK:Clone() newmask.Parent = chr newmask.Mask.Weld.Part1 = chr.Head script.Parent.Text = "Remove" script.Parent.removefunc.Disabled = false script.Disabled = true else script.Parent.Text = "You do not own this gamepass!" local market = game:GetService("MarketplaceService") local id = 7538706 market:PromptGamePassPurchase(plr,id) wait(4) script.Parent.Text = "Tokyo Ghoul Mask" end end)
You can ask clarification anytime.