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 4 years ago
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 &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 — 4y

2 answers

Log in to vote
1
Answered by
NSMascot 113
4 years ago
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)

0
This wouldn''t even work, there cant be three ends and 2 structures. 123nabilben123 499 — 4y
0
ah. i see it now, i was in a rush when i made it! NSMascot 113 — 4y
Ad
Log in to vote
-1
Answered by 4 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:


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.

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

Answer this question