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

Disconnected event because of exception, help?

Asked by
thePyxi 179
10 years ago
function OnTouched(Touched)

run = game:GetService("RunService")
c = Workspace.Camera
c.CameraType = "Scriptable"
Pos = Vector3.new(0, 50, -50)
Targ = game.Workspace.Dead1.Torso.Position
Zaxis = -50
Zoom = 40
for tehloop = 1, 100 do
    if tehloop < 100 then   
    Zoom = Zoom -0.5
    c.FieldOfView = Zoom
    Zaxis = Zaxis +1
    Pos = Vector3.new(0, 50, Zaxis)
    c.CoordinateFrame = CFrame.new(Pos.Targ)
    else
    Zoom = Zoom -1
    c.FieldOfView = Zoom
    end
    run.Stepped:wait(0.1)
end
wait(10)
c.FieldOfView = 50
c.CameraType = "Custom"
end

I am new to scripting Lua on ROBLOX. I've been trying to code a Scriptable Camera but it keeps saying, in the Output window, "Disconnected event because of exception. I am testing in 'Solo Play' and Server Play. Here's the script:

If anyone can help me with this, that would be very helpful. Thank you!

0
Put your code in a code block. Perci1 4988 — 10y
0
To clarify, click the Lua button above the text display when you edit your question, and put all if your code inside the two lines it creates, leaving the squiggles each on their own lines. adark 5487 — 10y
0
Sorry, there you go. thePyxi 179 — 10y

Answer this question