Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 13 days ago
Edited 13 days 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 -1 — 13d

2 answers

Log in to vote
0
Answered by
daireks 25
13 days 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
13 days 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