So, I am trying to create an instance in workspace called part, but it gives me an error. I tried searching what’s wrong, but I found many more people who had this problem in more complex scripts that I can’t read. I know it’s underlining the dot behind “Size”. Does anyone know why?
Script:
local workspaceService = game:GetService("Workspace")
local instance = Instance.new("Part", workspaceService)
local instance.Size = Vector3.new(2, 2, 2)
local instance.Name = "Instancy"
Error:
ServerScriptService.Script:13: Expected identifier when parsing expression, got '.'
But wouldn’t the “local” prevent the changes being done globally? I heard that you should use local whenever you can so that everything is clean and not crowded in the global scope.
Nope. It’s only the scope of the variable (namely, instance). The scope of the properties can either be client sided or server sided, which shouldn’t have much impact for you at this point.