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

Why is Camera:Interpolate() killing the player?

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

0

CurrentCamera*

0

It works in other scripts when I don't use CurrentCamera

0

You have the ModuleScript in ServerStorage. That's the problem, the client can't see what's in ServerStorage or ServerScriptService

0

I changed it to move into ReplicatedStorage and it's still killing the client.

1 answer

✓ Accepted answer

Maybe try using the old one since i really dont know how i whould fix this. And if you got this from a youtube tutorial or what not maybe ask the creator himself... If its not(which i dont think so just in case) maybe try reverting it back so the old one without the module script cause it might take time to figure it out myself but i will try my best to! im very sorry if i didnt do much help myself i cant figure it out as well but i will update you once i do! :D

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