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

How do i make a spectating system like piggy?

im new on making scripts and i try my best to do it on my own, but i can't understand anything the output is telling me, here's the script i made (there's only one dummy in the workspace and a screengui with a button):

`local Dummy1 = workspace.Dummy1 local camera = workspace.CurrentCamera local player = game:GetService("Players") local Spectate = script.Parent local ScreenGui = game.StarterGui.ScreenGui local ExitSpect = ScreenGui.ExitSpect local ChangeButton = ScreenGui.ChangeButton local ChangeButtonLeft = ScreenGui.ChangeButton.ChangeButtonLeft local ChangeButtonRight = ScreenGui.ChangeButton.ChangeButtonRight

Dummysheadpostiion = Dummy1.Head.Position

script.Parent.MouseButton1Click:Connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = Dummysheadpostiion`

1 comment

0

not a request site, also use code blocks

1 answer

✓ Accepted answer

Okay I'm going to try my best to understand what you're doing.

Two very important links to you:

https://developer.roblox.com/en-us/api-reference/class/Camera https://developer.roblox.com/en-us/api-reference/property/Camera/CameraSubject

One potential issue is why is there a ` in front of the Dummy variable

Next time use the lua code block function

The CameraSubject link should provide an easier way for you to do this. If you have further problems message me.

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