Trying to make a counter for how many times you have touched "Brick1", but every time the script runs it resets to zero. Was wondering how i can declare the variable only once and have it NOT reset when the script runs again.
My code:
TimesFound = 0
Increment = 1
TimesFound = TimesFound + Increment
Part = game.Workspace.Brick1
function RandMove()
print(TimesFound + Increment)
Part.Position = Vector3.new(math.random(0, 100), 5, math.random(0, 100))
end
RandMove()
Touched = Part.Touched:Connect(RandMove)

8 comments
thanks
wait... getting a new error: Expected identifier when parsing expression, got '=' on line 3
i edited it should work now
i edited it should work now
i edited it should work now
i edited it should work now
i edited it should work now
i edited it should work now