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

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

Asked by 3 years ago

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

Log in to vote
0
Answered by
Sulfone 141
3 years ago

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"].

Ad

Answer this question