Hi, I'm new to LUA and I don't know much. Does anyone know how to fix this code?
local Info = TweenInfo.new(2)
local DoorA = script.Parent.Parent.Door
local Info = TweenInfo.new(2)
local Key = Character:FindFirstChild("Keycard")or Player.Backpack:FindFirstChild("Keycard")
Door.Touched:Connect(function(Hit)
if Key then
script.Parent.ClickDetector.MouseClick:Connect(function()
script.Parent.CanCollide = false
local Change = {Position = Vector3.new(2.721, 3.705, 27.59)}
local Tween = Service:Create(DoorA, Info, Change)
Tween:Play()
end)
local Info = TweenInfo.new(2)
wait(15)
script.Parent.ClickDetector.MouseClick:Connect(function()
script.Parent.CanCollide = false
local Change = {Position = Vector3.new(2.721, 3.705, 31.704)}
local Tween = Service:Create(DoorA, Info, Change)
Tween:Play()
end)
end
I get this message at output: 18:57:13.454 - Workspace.Model.Script:28: 'end' expected (to close 'function' at line 6) near '<eof>'
