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

Why wont my script end? i am making a part that will increase max zoom onTouch [closed]

Asked by 4 years ago
1<pre class="brush: lua"></pre>

local function onPartTouch(otherPart)

01local partParent = otherPart.Parent
02local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
03 
04if ( humanoid ) then
05game.StarterPlayer.CameraMode = Classic
06game.StarterPlayer.CameraMaxZoomDistance = 100
07         end
08     end
09 
10 
11 
12 
13 
14 
15 
16Part.Touched:Connect(onPartTouch())
17end)  

Closed as Non-Descriptive by Nguyenlegiahung and JesseSong

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

2 answers

Log in to vote
0
Answered by
CedCed6 32
4 years ago

Maybe line 16 and 17 are way too down. Im not really sure....

0
@Ceded6 Nope still has a red line under end, thats ok dangboxxer2786 4 — 4y
0
oof CedCed6 32 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

I'm pretty sure that Part.Touched:Connect(onPartTouch()) should be above if ( humanoid ) then hope this works!

0
It now says"Unknown Global Part" And "Unknown Global Classic" dangboxxer2786 4 — 4y