I was trying to make a script that would move the camera around sideways with buttons in a shop-like style, but whenever the left button's interpolation is finished, it loop kills the player while giving them a black screen. It used to work before I tried to sync it with a ModuleScript for ease of editing the shop. LOCALSCRIPT IN RIGHT BUTTON:
local module = require(game.ServerStorage.Table)
local MonitorData = module.ReturnTableOfMonitors()
local MonitorParts = {}
local MonitorFocusParts = {}
for i = 1, #MonitorData do
for x = 1, #MonitorData do
table.insert(MonitorParts, MonitorData[i][x])
print(MonitorParts[x])
table.insert(MonitorFocusParts, MonitorData[i][x])
print(MonitorFocusParts[x])
end
end
local player = game.Players.LocalPlayer
local Camera = game.Workspace.Camera
local PartValue = script.Parent.Parent.PartValue
script.Parent.MouseButton1Click:Connect(function()
PartValue.Value = PartValue.Value - 1
Camera:Interpolate(MonitorParts[PartValue.Value], MonitorFocusParts[PartValue.Value], 1)
end)
MODULESCRIPT:
local module = {}
local TableOfMonitorsCameras = {game.Players.LocalPlayer.ItemRacks.MonitorCamera1.CFrame, game.Workspace.ItemRacks.MonitorCamera2.CFrame}
local TableOfMonitorsFocusParts = {game.Players.LocalPlayer.ItemRacks.CameraFocusPart1.CFrame, game.Players.LocalPlayer.ItemRacks.CameraFocusPart2.CFrame}
local ReturnParts = nil
function module.ReturnTableOfMonitors()
ReturnParts = false and {TableOfMonitorsCameras, TableOfMonitorsFocusParts} or nil
return ReturnParts
end
return module

4 comments
CurrentCamera*
It works in other scripts when I don't use CurrentCamera
You have the ModuleScript in ServerStorage. That's the problem, the client can't see what's in ServerStorage or ServerScriptService
I changed it to move into ReplicatedStorage and it's still killing the client.