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 got end?

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

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.

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