I know there are multiple topics on this same error but I scrolled through quite a few of them and none of them were closely related to my situation
Basically I’m trying to set a parts transparency under a variable and I’m getting an error message saying that = is an invalid parsing expression
Here is my script:
local ts = game:GetService("TweenService")
local players = game:GetService("Players")
local player = players:FindFirstChild("LocalPlayer")
local producer = script.Parent.Parent.producer
local producerChildren = producer:GetChildren()
local button = script.Parent
button.Touched:Connect(function()
local function producerTween()
for i,v in pairs(script.Parent.Parent.producer:GetDescendants()) do
local producerInfo = TweenInfo.new(
0.5, -- time
Enum.EasingStyle.Linear, -- easing style
Enum.EasingDirection.InOut, -- easing direction
0 ,-- repeat count
false, -- reverses
0 -- delay
)
local producerGoal = v.Transparency = 1
local producerTween = ts:Create(v, producerInfo, producerGoal)
producerTween:Play()
end
end
local buttonInfo = TweenInfo.new(
0.5, -- time
Enum.EasingStyle.Linear, -- easing style
Enum.EasingDirection.InOut, -- easing direction
0 ,-- repeat count
false, -- reverses
0 -- delay
)
local buttonGoal = button.Transparency = 1
local buttonTween = ts:Create(button, buttonInfo, buttonGoal)
producerTween()
buttonTween:Play()
task.wait(.5)
button.CanTouch = false
end)
The error is on lines 24 and 41 so I expect I’m doing something wrong instead of a typo and since I’m relatively new to programming any feedback would be appreciated
Edit: Turns out the embedded code doesnt show the line numbers so the errors are popping up on the lines with the variable names containing Goal in them (producerGoal and buttonGoal)