Expected identifier when parsing expression, got ','

So, I was testing my game I got this error, it was happening with one TweenPosition. I checked it and I couldn’t find anything wrong.
I noticed every other :TweenPosition had the Enum white, instead of the default blue.
I went to the first line, and typed Enum and it was still white. I have no idea what I’ve done but could this error, on the first line, be influenced by an error in the code below?

15 Likes

What was the code you were using so we can see what you did wrong.

7 Likes

This could be an extra or missing “end”, but we need code to be sure

8 Likes

It’s a 650 line code, the fact that is happening in the first line is what is throwing me off. I’m not sure what to send but I’ll try and look for missing ends

6 Likes

The syntax error means an identifier was expected when parsing an expression but you put a , instead. Just post the line that has a red underline.

6 Likes

These are the lines that have the error, top one has it but if I delete that one the next one has the code

checkinProgress.confirm.Cancel:TweenPosition(0.188, 0,1.034, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
	checkinProgress.confirm.Confirm:TweenPosition(0.565, 0,1.034, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
4 Likes

You have an extra parenthesis.

Also you use a UDim2 value for the position.

checkinProgress.confirm.Cancel:TweenPosition(UDim2.new(0.188, 0,1.034, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
checkinProgress.confirm.Confirm:TweenPosition(UDim2.new(0.565, 0,1.034, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
6 Likes

Omg stupid me, I’ve used :TweenPosition like 50 times in that script alone. Thank you

8 Likes

I know this is an old topic, but it doesnt work for me, when I delete the ) it just gives more errors. here is my script:

local RNS
local tool = script.Parent
local anim = tool:WaitForChild("Throwanim")
local player1 =  game.Players.LocalPlayer
local char = player1.Character or player1.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local loadanim = humanoid:LoadAnimation(anim)
local mouse = player1:GetMouse()

tool.Activated:Connect(function(player)
	if not loadanim.IsPlaying then
		loadanim:Play()
		local Throw = tool.Handle and tool.Handle.Main:Clone()
		local TweenService = game:GetService("TweenService")
		local Part = script.Parent.Handle
		local Info = TweenInfo.new(
			2,
			Enum.EasingStyle.Linear,
			Enum.EasingDirection.In,
			0,
			false
		)
		Throw.Parent = workspace
		local newpos = mouse.Hit.Position
		local tween = TweenService:Create(Throw, Info, {Position = newpos})
		tween:Play()
		
		Throw.Touched:Connect(function(hit)
			if hit.Parent:FindFirstChild("Humanoid") then
				if hit.Parent.Team ~= player1.Team then
					print(hit)
				end
			end
		end)
	end)


You’re missing another end) for the Activated connection.

local RNS
local tool = script.Parent
local anim = tool:WaitForChild("Throwanim")
local player1 =  game.Players.LocalPlayer
local char = player1.Character or player1.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local loadanim = humanoid:LoadAnimation(anim)
local mouse = player1:GetMouse()

tool.Activated:Connect(function(player)
	if not loadanim.IsPlaying then
		loadanim:Play()
		local Throw = tool.Handle and tool.Handle.Main:Clone()
		local TweenService = game:GetService("TweenService")
		local Part = script.Parent.Handle
		local Info = TweenInfo.new(
			2,
			Enum.EasingStyle.Linear,
			Enum.EasingDirection.In,
			0,
			false
		)
		Throw.Parent = workspace
		local newpos = mouse.Hit.Position
		local tween = TweenService:Create(Throw, Info, {Position = newpos})
		tween:Play()
		
		Throw.Touched:Connect(function(hit)
			if hit.Parent:FindFirstChild("Humanoid") then
				if hit.Parent.Team ~= player1.Team then
					print(hit)
				end
			end
		end)
	end -- Parenthesis was not supposed to be here
end) -- End the connection scope
1 Like

Tysm for being quick, you are a lifesaver!