Hello, thank you for taking the time to try and help me,
I have a module script that holds the settings for a door in my experience,
I get an error in the module script and in the game even though “debounce” and “setting” exists inside the module.
Below is the error and code inside the module script
local Door = script.Parent.Door
local setting = {
door = Door,
doorPart = Door.Door,
hinge = Door.Hinge,
prompt = Door.Door.ClickDetector,
activationDistance = 5,
timeToOpen = 3,
openAngle = -80,
isOpen = false,
debounce = false,
getOpen = function()
return setting.isOpen
end,
setOpen = function(value)
setting.isOpen = value
end,
getDebounce = function()
return setting.debounce
end,
setDebounce = function(value)
setting.debounce = value
end
}
return setting
I might be not seeing it even though it could be right infront of me so thank you.
local Door = script.Parent.Door
local module = {}
local Settings = {
door = Door,
doorPart = Door.Door,
hinge = Door.Hinge,
prompt = Door.Door.ClickDetector,
activationDistance = 5,
timeToOpen = 3,
openAngle = -80,
isOpen = false,
debounce = false,
}
function module.getOpen()
return Settings.isOpen
end
function module.setOpen(value)
Settings.isOpen = value
end
function module.getDebounce()
return Settings.debounce
end
function module.setDebounce(value)
Settings.debounce = value
end
return module , Settings
Script (local or server):
local ModuleLocation = script.Parent
local Module = require(ModuleLocation)
Module.getOpen()
Module.setOpen()
Module.getDebounce()
Module.setDebounce()