Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] I have tried fixing the issue at line 19 countless times any help?

local doorModel = script.Parent

local TweenService = game:GetService("TweenService") local doorTweenInfo = TweenInfo.new( 1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0 )

local doorTween = TweenService:Create(doorModel.DoorClosed, doorTweenInfo, {CFrame = doorModel.DoorOpen.CFrame})

doorModel.Keyhole.Touched:Connect(function(hit) if hit.Name == "Key" and hit.BrickColor == doorModel.Keyhole.BrickColor then doorModel.Keyhole:Destroy() end doorModel.WoodPlanks.Touched:Connect(function(hit) ((Line 19)) if hit.Name == "Hammer" then doorModel.WoodPlanks:Destroy() script["DoorOpen"]:Play() doorTween:Play() end end

at Line 19 (Labelled above) it keeps saying: expected ')' (to close '(' at line 19) got , I have tried many things, such as moving the end and connecting the two "Key and Hammer", any other salutions?

1 comment

0

Thank you for the Help!

2 answers

✓ Accepted answer

It looks like you forgot to add an end, and a ')'.

Basically, whenever you are creating an Event you need to add ')' to the last end as so.

doorModel.WoodPlanks.Touched:Connect(function(hit)

end)


--Whenever you create an Event you need to add a ')' to the last end.

local doorModel = script.Parent

local TweenService = game:GetService("TweenService") local doorTweenInfo = TweenInfo.new( 1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0 )

local doorTween = TweenService:Create(doorModel.DoorClosed, doorTweenInfo, {CFrame = doorModel.DoorOpen.CFrame})

doorModel.Keyhole.Touched:Connect(function(hit)
	if hit.Name == "Key" and hit.BrickColor == doorModel.Keyhole.BrickColor then
		doorModel.Keyhole:Destroy() 
	end 
end) --Here you forgot an end.
	
doorModel.WoodPlanks.Touched:Connect(function(hit)
	if hit.Name == "Hammer" then
		doorModel.WoodPlanks:Destroy()
		script["DoorOpen"]:Play()
		doorTween:Play()
	end
end) --Here you forgot to add ')' to end.

You forgot an extra end.

local doorModel = script.Parent

local TweenService = game:GetService("TweenService") 
local doorTweenInfo = TweenInfo.new( 1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0 )

local doorTween = TweenService:Create(doorModel.DoorClosed, doorTweenInfo, {CFrame = doorModel.DoorOpen.CFrame})

doorModel.Keyhole.Touched:Connect(function(hit) 
	if hit.Name == "Key" and hit.BrickColor == doorModel.Keyhole.BrickColor then 
		doorModel.Keyhole:Destroy() 
	end 
end)
	
doorModel.WoodPlanks.Touched:Connect(function(hit) 
	if hit.Name == "Hammer" then doorModel.WoodPlanks:Destroy() 
		script["DoorOpen"]:Play() 
		doorTween:Play()
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.