Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is Camera:Interpolate() killing the player?

Asked by 4 years ago
Edited 4 years ago

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:

01local module = require(game.ServerStorage.Table)
02local MonitorData = module.ReturnTableOfMonitors()
03local MonitorParts = {}
04local MonitorFocusParts = {}
05for i = 1, #MonitorData do
06    for x = 1, #MonitorData do
07        table.insert(MonitorParts, MonitorData[i][x])
08        print(MonitorParts[x])
09        table.insert(MonitorFocusParts, MonitorData[i][x])
10        print(MonitorFocusParts[x])
11    end
12end
13local player = game.Players.LocalPlayer
14local Camera = game.Workspace.Camera
15local PartValue = script.Parent.Parent.PartValue
16script.Parent.MouseButton1Click:Connect(function()
17    PartValue.Value = PartValue.Value - 1
18    Camera:Interpolate(MonitorParts[PartValue.Value], MonitorFocusParts[PartValue.Value], 1)
19end)

MODULESCRIPT:

1local module = {}
2local TableOfMonitorsCameras = {game.Players.LocalPlayer.ItemRacks.MonitorCamera1.CFrame, game.Workspace.ItemRacks.MonitorCamera2.CFrame}
3local TableOfMonitorsFocusParts = {game.Players.LocalPlayer.ItemRacks.CameraFocusPart1.CFrame, game.Players.LocalPlayer.ItemRacks.CameraFocusPart2.CFrame}
4local ReturnParts = nil
5function module.ReturnTableOfMonitors()
6    ReturnParts = false and {TableOfMonitorsCameras, TableOfMonitorsFocusParts} or nil
7    return ReturnParts
8end
9return module
0
CurrentCamera* Ziffixture 6913 — 4y
0
It works in other scripts when I don't use CurrentCamera iNot_here 93 — 4y
0
You have the ModuleScript in ServerStorage. That's the problem, the client can't see what's in ServerStorage or ServerScriptService Spjureeedd 385 — 4y
0
I changed it to move into ReplicatedStorage and it's still killing the client. iNot_here 93 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question