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

Expected ')' (to close '(' at line 1), got <eof>?

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

and the remove function stops working

1 comment

0

is that the entire script? if not can you provide a pastebin link to the full script?

2 answers

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)

2 comments

0

This wouldn''t even work, there cant be three ends and 2 structures.

0

ah. i see it now, i was in a rush when i made it!

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.

1 comment

0

This doesn't solve the error

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