hello i cant figure out this error it is confusing cause i did so many tests and checks here is the error i'm getting Workspace.Door.doorscript:2: attempt to index nil with 'Name'
local door = script.Parent
local Name = game.Players.LocalPlayer.Name
local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local openpos = {CFrame = CFrame.new(-166, 7, 195.5)}
local closepos = {CFrame = CFrame.new(-197, 7, 195.5)}
local open = tweenservice:Create(script.Parent,tweeninfo,openpos)
local close = tweenservice:Create(script.Parent,tweeninfo,closepos)
local function touch(hit)
-- open
if Name == "AxisAgent" or Name == "babychickless" or Name == "Diamondboy431" or Name == "CoolBeckett102" then
open:Play()
else
close:Play()
end
wait(0.1)
-- close
end
local function close(hit)
close:Play()
end
script.Parent.Touched:Connect(touch)
script.Parent.Hitbox2.Touched:Connect(close)

2 comments
Thank You For The Help
Np, can u probably give me reputation as i helped you pls?