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

Touched event calling function with part touched plus IntValue argument?

Asked by 4 years ago
Edited 4 years ago


i = 5 Local function onTouched(partHit,i) Print(i) game.Workspace. Part.connect(0nTouched(i)) end ————————————————————— What’s wrong with this? I get i = nil inside the function

0
Could you explain what you are trying to do and format your whole script into the Lua code block (last icon that is a blue sphere and has 'Lua" on it)? AntiWorldliness 868 — 4y
0
I’m trying to pass a parameter in addition to the touched part with the Touched event. The script shown is a simplified version just containing my issue. i is actually from For i , v Table:GetChildren() White_Pointer -1 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

i = 5 Function onTouched(partHit, i) Print(i) end script~~~~~~~~~~~~~~~~~

.Parent.Touched:Connect(onTouched(i) ~~~~~~~~~~~~~~~~~

Ad

Answer this question