local module = {}
function module.goToLocation(location)
workspace.Camera.CFrame = workspace.Locations[location].TeleportPosition.CFrame
end
function module.goToLocation2(location)
workspace.Camera.CFrame = workspace.Locations[location].TeleportPosition.CFrame
end
return module
each function’s code is the exact same, word for word, letter for letter, but only the top one works. why?
Anyway even if the top one works I had a similar issue where the camera sometimes moved and sometimes didn’t and it was fixed by the exact thing I suggested.
Can you send the script you are calling the module procedures from?
module scripts dont really work when used from the command bar, if you edit the module after already requiring it in the command bar it wont update and any function you added will not be accessible, even if you re-require it
This is correct. If you want to run ModuleScript static code from the command line, you have to use require(moduleScript:Clone()) each time, to get a fresh copy, because for each copy the code runs just once per Studio session.
It’s not a bug though, it’s intended behavior that ModuleScripts only run once per VM instance and cache their return value. If the behavior was changed to automatically duplicate the module, it would mean you could no longer use variables in the scope of the module to hold state, which would make modules work differently from the command bar than everywhere else, which is even worse.