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

Expected <eof> got, 'end' how can I fix this? [SOLVED]

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.DoorClose, doorTweenInfo, {CFrame = doorModel.DoorOpen.CFrame})

doorModel.Square.Touched:Connect(function(hit)
    if hit.Name == "Key" and hit.BrickColor == doorModel.Square.BrickColor then
    doorModel.Square.Transparency = 0
    hit:Destroy()
    end
end)

doorModel.Triangle.Touched:Connect(function(hit)
    if hit.Name == "Key" and hit.BrickColor == doorModel.Triangle.BrickColor then
    doorModel.Triangle.Transparency = 0
    hit:Destroy()
    end
end)
doorModel.Circle.Touched:Connect(function(hit)
    if hit.Name == "Key" and hit.BrickColor == doorModel.Circle.BrickColor then
    doorModel.Circle.Transparency = 0
    hit:Destroy()
    end
end)
    if
    doorModel.Circle.Transparency(0) and doorModel.Square.Transparency(0) and doorModel.Triangle.Transparency(0) then
    script["DoorOpen"]:Play()
    doorTween:Play()
    end
end)~~~~~~~~~~~~~~~~~

I need constructive help, not comments about how stupid I am.

2 answers

Log in to vote
0
Answered by
Sparks 534 Moderation Voter
3 years ago
Edited 3 years ago

If this is the whole script, remove the "end)" at the bottom. The last if-statement is not nested within a function based off this snippet so there is no need for there to be that "end)".

0
I did that and it says: W006: Statements spans multiple lines; use indentation to silence PatheticallyChildish 4 — 3y
0
That is just a warning. If you have a statement that is broken into multiple lines, it is advised to use indentation to distinguish larger statements from others. Sparks 534 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
    if
    doorModel.Circle.Transparency(0) and doorModel.Square.Transparency(0) and doorModel.Triangle.Transparency(0) then
    script["DoorOpen"]:Play()
    doorTween:Play()
    end
end)~~~~~~~~~~~~~~~~~

You got 'end)' at the last line of the script but no function on top of it

0
So im guessing you forgot to write a function for the last one Azure_Kite 885 — 3y

Answer this question