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 5 years ago
Edited 5 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.

01local Door = game.Workspace.Door
02 
03Door.Touched:Connect(function(touched)
04    if touched.Parent:FindFirstChild("Humanoid") then
05        if player.ID == 560637180 then
06            Door.CanCollide = false
07            Door.Transparency = 0.8
08            wait(2.5)
09            Door.CanCollide = true
10            Door.Transparency = 0
11        end
12    end
0
I edited my answer. LikeToScript 108 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
01local Door = game.Workspace.Door
02 
03Door.Touched:Connect(function(touched)
04    local pname = touched.Parent.Name
05    local player = game.Players[pname]
06    if touched.Parent:FindFirstChild("Humanoid") then
07        if player.UserId == 560637180 then
08            Door.CanCollide = false
09            Door.Transparency = 0.8
10            wait(2.5)
11            Door.CanCollide = true
12            Door.Transparency = 0
13        end
14    end
15end)
0
It errors at line 5, attempt to index nil with 'ID'. Nicklaus_s 17 — 5y
0
Thank you! Nicklaus_s 17 — 5y
Ad

Answer this question