Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Tween script making argument 3 missing or nil error?

(server script)

local TweenService = game:GetService("TweenService")
local Door1 = script.Parent.Door1
local Door2 = script.Parent.Door2
local openTime = 1.3
local closeTime = 1.3
local opened = false
local debounce = false

local clearance = {
	["L1"] = true
}

Settings = {
	Tweening = {
		openInfo = TweenInfo.new(openTime,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut),
		closeInfo = TweenInfo.new(openTime,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut),
		Doorclose = {CFrame = Door1.CFrame},
		Dooropen = {CFrame = Door1.CFrame * CFrame.new(-1.3, 1.3, 0)},
		Door2close = {CFrame = Door2.CFrame},
		Door2open = {CFrame = Door2.CFrame * CFrame.new(-1.3, 1.3, 0)},
	}
	
}

local Door1Close = TweenService:Create(Door1,Settings.Tweening.closeInfo,Settings.Tweening.Door1Close)
local Door1Open = TweenService:Create(Door1,Settings.Tweening.closeInfo,Settings.Tweening.Door1Open)
local Door2Close = TweenService:Create(Door2,Settings.Tweening.closeInfo,Settings.Tweening.Door2Close)
local Door2Open = TweenService:Create(Door2,Settings.Tweening.closeInfo,Settings.Tweening.Door2Open)


function OpenDoor()
	Door1Open:Play()
	Door2Open:Play()
end

function CloseDoor()
	Door1Close:Play()
	Door2Close:Play()
end

script.Parent.CardReader.Scanner.Touched:Connect(function(touch)
	if touch.name == "Handle" and clearance[touch.Parent.Name] then
		if not debounce and opened then
			wait(0.5)
			CloseDoor()
			opened = false
			debounce = false
			wait(3)
		end
	elseif touch.name == "Handle" and not clearance[touch.Parent.Name] then
		wait(0.5)
		wait(3)
	end
end)

script.Parent.CardReader.Scanner.Touched:Connect(function(touch)
	if touch.name == "Handle" and clearance[touch.Parent.Name] then
		if not debounce and not opened then
			wait(0.5)
			OpenDoor()
			opened = true
			debounce = false
			wait(3)
		end
	elseif touch.name == "Handle" and not clearance[touch.Parent.Name] then
		wait(0.5)
		wait(3)
	end
end)

script.Parent.CardReader2.Scanner.Touched:Connect(function(touch)
	if touch.name == "Handle" and clearance[touch.Parent.Name] then
		if not debounce and opened then
			wait(0.5)
			CloseDoor()
			opened = false
			debounce = false
			wait(3)
		end
	elseif touch.name == "Handle" and not clearance[touch.Parent.Name] then
		wait(0.5)
		wait(3)
	end
end)

script.Parent.CardReader2.Scanner.Touched:Connect(function(touch)
	if touch.name == "Handle" and clearance[touch.Parent.Name] then
		if not debounce and not opened then
			wait(0.5)
			OpenDoor()
			opened = true
			debounce = false
			wait(3)
		end
	elseif touch.name == "Handle" and not clearance[touch.Parent.Name] then
		wait(0.5)
		wait(3)
	end
end)

2 comments

0

show the module script

0

ok i updated the post also its not a module script

1 answer

✓ Accepted answer

In your settings, you never specified Settings.Tweening.Door1Close or Settings.Tweening.Door1Open

Instead you named them Dooropen and Doorclose.

This discussion is preserved as it was. New answers, comments, and votes are closed.