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

Is this good organization for a future big script?

local module = {}



local Directory = {
	
	    Monster = {
		["Flower1"] = {
		End = CFrame.new(-203.79, 6.395, -96.96);
		Focus = CFrame.new(-232.4, 6.395, -96.96);
		Time = 2
		};
	
		["Part"] = {
		End = CFrame.new(-203.79, 6.395, -51.57);
		Focus =	CFrame.new(-235.05, 6.395, -51.57);
		Time = 1
		}
		
		
	}; -- Monster Closer
	
		Powers =  {
			["part2"] = {
				End = CFrame.new(543, -4,54);
				Focus = CFrame.new(54, -3, 435);
				Time = 2
				}
			};
	
} --Directory Closer

function module.Cam(Location, Camera, Option)
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera:Interpolate(Directory[Option][tostring(Location)].End, Directory[Option][tostring(Location)].Focus, Directory[Option][tostring(Location)].Time)
end




return module

A location is the location of the part that was touched, camera is the normal camera and option is if it is either a monster or power. I use collectionservice to set the values between monsters and powers.

Overall, is this good organized?

1 answer

Looks good to me, just remember to abide by the DRY principle (Do not repeat yourself)

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