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

Confused on why it says this, "Expected 'end' (to close 'function' at line 3), got <eof>"?

Asked by 4 years ago
Edited 4 years ago

I am fairly new to scripting but I am confused on why it is asking for me to close the function on line 3. | Also I want these actions to happen server wide so it is why this is running a regular script.

local Door = game.Workspace.Door

Door.Touched:Connect(function(touched)
    if touched.Parent:FindFirstChild("Humanoid") then
        if player.ID == 560637180 then
            Door.CanCollide = false
            Door.Transparency = 0.8
            wait(2.5)
            Door.CanCollide = true
            Door.Transparency = 0
        end
    end
0
I edited my answer. LikeToScript 108 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local Door = game.Workspace.Door

Door.Touched:Connect(function(touched)
    local pname = touched.Parent.Name
    local player = game.Players[pname]
    if touched.Parent:FindFirstChild("Humanoid") then
        if player.UserId == 560637180 then
            Door.CanCollide = false
            Door.Transparency = 0.8
            wait(2.5)
            Door.CanCollide = true
            Door.Transparency = 0
        end
    end
end)
0
It errors at line 5, attempt to index nil with 'ID'. Nicklaus_s 17 — 4y
0
Thank you! Nicklaus_s 17 — 4y
Ad

Answer this question