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

Expected to close got end?

Asked by 4 years ago

local part = script.Parent

if game.PurpleKey.ClickDetector.MouseClick:Connect(function(plr) keyModule.Clicked = true wait(1) part:remove()

if game.PurpleKey.ClickDetector.MouseClick:Connect(function(plr) keyModule.Clicked = false wait(1) part:add() end
end

1 answer

Log in to vote
0
Answered by 4 years ago

In Lua, when you are connecting a function in that way ':Connect(function()' you have to put a closing bracket after the end. It closes the opening bracket that is before the word 'function', and thus closes the function.

Ad

Answer this question