I'm trying to make a script that once you make a basketball go into a basket, you will get a cool camera rotation around your person while playing some good music. I tested it out and it doesn't work. Can someone help?
debounce = false
function onTouched(hit)
if debounce==false then
local part = workspace.Hoop.Net.Ghostbrick
part.Anchored = true
part1.Touched:connect(function()
print("Part was touched.")
play.soundid = (141789936) wait(9.6) end) end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
script.LocalScript:clone().Parent = character
end)
end)
local cam = workspace.CurrentCamera
local target = workspace.player
local camera = workspace.CurrentCamera
camera.CameraSubject = target
local angle = 0
local part = workspace.Hoop.Net.InitialString
part.Anchored = true
part.Touched:connect(function()
print("Part was touched.")
end)
while wait() do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(95, angle, 180) --Rotate by the angle
* CFrame.new(0, 0, -5) --Move the camera backwards 5 units
angle = angle + math.rad(1)
end
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom" end

1 comment
@Line 08: Where is it connecting to, or is it making a new Sound? If its making a new sound, it would be
play=Instance.new("Sound",PARENTHERE)play.SoundId="http://www.roblox.com/asset/?id=SOUNDID"and when you want it to play you would doplay:Play().