Screen click detect

function shoot() local op = Instance.new(“Part”,Workspace) op.Size = Vector3.new(10, 10, 10) op.AssemblyLinearVelocity = Vector3.new(0, 0, 200) end local ile = game:GetService(“UserInputService”) ile.InputBegan:Connect(function(input, gameProcessed) while true do if input.UserInputType == Enum.UserInputType.MouseButton1 then shoot() end end)

My goal is to make a block shoot out when i click, but theres an error saying “Expected identifier when parsing expression, got ‘)’” Ive watched tutorails on how to fix it but im not good in lua so i didnt really understand that well. Any help? Thanks.

1 Like

You need to add another end argument at the end of your script.

Thank you! No errors now, and it works

Glad to help! Always remember that when you are using functions and you get that error it is because you did not properly close off one of the functions in your script. (TL;DR u need to remove a end or add more if this happens again)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.