Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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?

0
Thank you for the Help! PatheticallyChildish 4 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

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.
Ad
Log in to vote
0
Answered by
Sparks 534 Moderation Voter
3 years ago

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)

Answer this question