Returning a Table in a ModuleScript Prints Every Argument Instead of Only One

I’m trying to return specific individual attributes via a function in a modulescript, but when I print it from a server script it returns all of the args rather than the specific value I requested. It’s probably a simple fix but I figured I’d ask anyways. Thanks for any tips!

local doorModule = {}

function doorModule.getDoor(doorInstance)
	local doorProperties = {
		doorType = doorInstance:GetAttributes("DoorType"),
		interactDebounce = doorInstance:GetAttributes("InteractDebounce"),
		locked = doorInstance:GetAttributes("Locked"),
		openSpeed = doorInstance:GetAttributes("OpenSpeed"),
		resetTime = doorInstance:GetAttributes("ResetTime")
	}
	
	return doorProperties.doorType
end

return doorModule

image

How are you calling the function? When I tested the code provided, it returned only the doorType


This is how I’m doing it

This needs to be GetAttribute, not GetAttributes

hahaha somehow I missed there being a plural and non-plural version, thanks a bunch

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.