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

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

Asked by 5 years ago
01script.Parent.MouseButton1Click:Connect(function()
02    local plr = script.Parent.Parent.Parent.Parent.Parent
03    local chr = plr.Character
04 
05if plr.PlayerOwnsTheMaskPass.Value == true then
06    local newmask = script.Parent.TOKYOGHOULMASK:Clone()
07    newmask.Parent = chr
08    newmask.Mask.Weld.Part1 = chr.Head
09script.Parent.Text = "Remove"
10script.Parent.removefunc.Disabled = false
11script.Disabled = true
12else
13    script.Parent.Text = "You do not own this gamepass!"
14    local market = game:GetService("MarketplaceService")
15    local id = 7538706
16    market:PromptGamePassPurchase(plr,id)
17    wait(4)
18    script.Parent.Text = "Tokyo Ghoul Mask"
19    end
20end)

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 &lt;eof>

and the remove function stops working

0
is that the entire script? if not can you provide a pastebin link to the full script? ArtBlart 533 — 5y

2 answers

Log in to vote
1
Answered by
NSMascot 113
5 years ago
01script.Parent.MouseButton1Click:Connect(function()
02    local plr = script.Parent.Parent.Parent.Parent.Parent
03    local chr = plr.Character
04 
05if plr.PlayerOwnsTheMaskPass.Value == true then
06    local newmask = script.Parent.TOKYOGHOULMASK:Clone()
07    newmask.Parent = chr
08    newmask.Mask.Weld.Part1 = chr.Head
09script.Parent.Text = "Remove"
10script.Parent.removefunc.Disabled = false
11script.Disabled = true
12else
13    script.Parent.Text = "You do not own this gamepass!"
14    local market = game:GetService("MarketplaceService")
15    local id = 7538706
View all 21 lines...
0
This wouldn''t even work, there cant be three ends and 2 structures. 123nabilben123 499 — 5y
0
ah. i see it now, i was in a rush when i made it! NSMascot 113 — 5y
Ad
Log in to vote
-1
Answered by 5 years ago

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:

01script.Parent.MouseButton1Click:Connect(function(player)
02    local plr = script.Parent.Parent.Parent.Parent.Parent
03    local chr = plr.Character
04 
05if plr.PlayerOwnsTheMaskPass.Value == true then
06    local newmask = script.Parent.TOKYOGHOULMASK:Clone()
07    newmask.Parent = chr
08    newmask.Mask.Weld.Part1 = chr.Head
09script.Parent.Text = "Remove"
10script.Parent.removefunc.Disabled = false
11script.Disabled = true
12else
13    script.Parent.Text = "You do not own this gamepass!"
14    local market = game:GetService("MarketplaceService")
15    local id = 7538706
16    market:PromptGamePassPurchase(plr,id)
17    wait(4)
18    script.Parent.Text = "Tokyo Ghoul Mask"
19    end
20end)

You can ask clarification anytime.

0
This doesn't solve the error hiimgoodpack 2009 — 5y

Answer this question