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 <eof>, I have tried many things, such as moving the end and connecting the two "Key and Hammer", any other salutions?
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)