I'll try my best to explain this. In my scripts, I made a pop up gui that sets a CameraSubject on a part. I want it where you would click a next button and it would make your CameraSubject on another part and so on to the parts after. If you click a previous button, it will make your CameraSubject go back to the first part and so on to the parts before. I've tried using a number value method where a certain part was defined as a number value. I'm currently trying to use tables and object values but I still have no clue on what to do.
Current script:
reference = {"M9","Desert Eagle","Beretta 93R","M16A3","M1014","Galil AR","M249 SAW"} --nothing here just something to help me correctly spell the names
guns = {"M9"} --a new table that could be added to
gui = script.Parent
value = gui:WaitForChild("Cam") --object value
Next = gui:WaitForChild("Next")
previous = gui:WaitForChild("Previous")
name = gui:WaitForChild("Name")
local cam = game.Workspace.CurrentCamera
name.Text = value.Value.Name
cam.CameraSubject = value.Value
--no idea how to transition the value in order from the reference table on the first line
Next.MouseButton1Click:connect(function()
name.Text = value.Value.Name
cam.CameraSubject = value.Value
end)
previous.MouseButton1Click:connect(function()
name.Text = value.Value.Name
cam.CameraSubject = value.Value
end)

1 comment
Thanks I edited it a little but it still works