Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I get this error when typing a command (in the desc) how do i fix it?

15:38:56.085 - game.StarterGui.Shop.MainFrame.SafeArea.ItemInformation.ItemViewport.Orange Swo:1: Incomplete statement: expected assignment or a function call

game.StarterGui.Shop.MainFrame.SafeArea.ItemInformation.ItemViewport.Orange SwordHandle.CFrameValue.Value = game.Workspace.CurrentCamera.CFrame

1 answer

✓ Accepted answer

a.b is short for a["b"], but only works if the right side would work as a valid variable name. So a.b would work (meaning a["b"]), but not a.b c (you would need to do a["b c"]).

So Lua reads it as something else: it's reading it the same way as it would read

game.StarterGui.Shop.MainFrame.SafeArea.ItemInformation.ItemViewport.Orange

SwordHandle.CFrameValue.Value = game.Workspace.CurrentCamera.CFrame

which someone reading would, like Lua did, think the person forgot = something ("expected assignment") or brackets if they don't know what indexing game multiple times gives ("expected a function call").

It can be fixed by replacing ItemViewport.Orange SwordHandle with ItemViewport["Orange SwordHandle"].

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