How to fix the Error in this script

This Script somebody helped me make Shows an error on the script.
Here is the script:

local Part = script.Parent
Part.Touched:Connect(function(Hit)
	local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
	if Player then
		local Arm = Player.Character:FindFirstChild("Left Arm2")
		if Arm then
			Arm.Transparency = 0 
		end

And here is the Error:

Error: (7,22) Syntax error: Expected ‘end’ (to close ‘then’ at line 4), got ; did you forget to close ‘then’ at line 6?

you forgot “end” thats why the error occur

You forgot to end) your function and conditional checks OOF

local Part = script.Parent
Part.Touched:Connect(function(Hit)
	local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
	if Player then
		local Arm = Player.Character:FindFirstChild("Left Arm2")
		if Arm then
			Arm.Transparency = 0 
		end
    end
end)
1 Like

Oh I didn’t notice that. Thank you.