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

Disconnected event because of exception, why?

Asked by
thePyxi 179
10 years ago

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. Why does it keep saying this phrase? Here's the script:

01function onTouch(Part)
02 
03    run = game:GetService("RunService")
04    c = Workspace.Camera
05    c.CameraType = "Scriptable"
06    Pos = Vector3.new(0, 50, -50)
07    Targ = game.Workspace.Dead1.Torso.Position
08    Zaxis = -50
09    Zoom = 40
10for tehloop = 1, 100 do
11    if tehloop < 100 then  
12    Zoom = Zoom -0.5
13    c.FieldOfView = Zoom
14    Zaxis = Zaxis +1
15    Pos = Vector3.new(0, 50, Zaxis)
View all 28 lines...

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

0
Please edit your original question instead of asking a new one, in the future. adark 5487 — 10y
2
This should be a LocalScript and c should be `Workspace.CurrentCamera` Shawnyg 4330 — 10y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

Like Shawnyg said, at line 5 in that block, you need Workspace.CurrentCamera.

As well, this has to be in a LocalScript to work.

Ad

Answer this question