Start GUI and turning camera?
So, I've found a camera thing on free models, And basically it spins round a block until someone presses a button on a GUI.
However, the button does not seem to be working..
01 | local target = Workspace.ViewBlock |
02 | local camera = Workspace.Camera |
03 | camera.CameraSubject = target |
07 | camera.CoordinateFrame = CFrame.new(target.Position) |
08 | * CFrame.Angles( 0 ,angle, 0 ) |
10 | angle = angle+math.rad(. 2 ) |
This script is copied into StarterPlayer and StarterPack and is a normal script
01 | script.Parent.MouseEnter:connect( function () |
02 | script.Parent.TextColor 3 = BrickColor.new( 'Light stone grey' ).Color |
04 | script.Parent.MouseLeave:connect( function () |
05 | script.Parent.TextColor 3 = BrickColor.new( 'Institutional white' ).Color |
08 | function onButton 1 Down() |
10 | local zcam = Workspace.Camera |
11 | zcam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid |
12 | zcam.CameraType = "Custom" |
14 | script.Parent.Parent.Parent.Parent.Parent.Backpack.CamFix:remove() |
15 | script.Parent.Parent:remove() |
18 | script.Parent.MouseButton 1 Down:Connect(onButton 1 Down) |
Is a local script inside the button...
So basically, What am I doing wrong to make the GUI disappear and the camera stop spinning?
Thanks in advance! c: