Hold on just booted my PC.
So this is the main util:
local Core = { ... }
local Server, Script = game, script
self = {}
self.__index = self
self.Player = Server:GetService('Players').LocalPlayer
self.Character = self.Player.Character or self.Player.CharacterAdded:Wait(2)
self.Player.CharacterAdded:Connect(function(Character, ...)
self.Character = Character
end)
for __,Module in (Script:GetChildren(...)) do
if Module:IsA('ModuleScript') then
self[Module.Name] = setmetatable(self, {})
require(Module):init(self, ...)
end
end
self.Camera:Enable(...)
self.Chunk:Load("Ol' Oak Village", ...)
return Core
and for an example this is the Camera (Doesn’t include the indoor function on this version.)
local Core = { ... }
local Server, Script = game, script
function Core:init(__index, ...)
self = __index
local Camera = Server:GetService('Workspace'):WaitForChild('Camera')
local Connection = nil
local Offset = Vector3.new(0, 20, -15)
local Shake = Vector2.new(0, 0)
function self.Camera:Enable(...)
Camera.CameraType = Enum.CameraType.Scriptable
Connection = Server:GetService('RunService').PreRender:Connect(function(...)
local HumanoidRootPart = self.Character:FindFirstChild('HumanoidRootPart')
if HumanoidRootPart then
Camera.CFrame = CFrame.lookAt((HumanoidRootPart.Position + Offset) + Vector3.new(Shake.X, Shake.Y, 0), HumanoidRootPart.Position + Vector3.new(Shake.X, Shake.Y, 0))
end
end)
end
function self.Camera:Disable(...)
pcall(function(...)
Connection:Disconnect(...)
Camera.CameraType = Enum.CameraType.Custom
Offset = Vector3.new(0, 20, -15)
Shake = Vector2.new(0, 0)
end)
end
function self.Camera:Shake(int, Time, ...)
for i = 1, Time do
task.wait(...)
Shake = Vector2.new(math.random(-int, int)/10, math.random(-int, int)/10)
end
Shake = Vector2.new(0, 0, 0)
end
self.Player.Chatted:Connect(function(Msg, ...)
if Msg == '/shake' then
self.Camera:Shake(10, 100, ...)
end
end)
end
return Core