hi guys, i am a very beginner at scripting. I work with a regular script right now and there is my problems with code :
I'm making TV right now. It shows first nine slides (myFunction) but when player touched the part (Detector) i want myFunction to be disabled. How to disable first function? Is it even possible? I'm so confused... Please answer me, if there is any ways to solve this issue.
local Screen = script.Parent.Screen
local Slides = script.Parent.Slides
local Detector = script.Parent.Detector
function myFunction()
while true do
local Slide = 1
for item, child in pairs(Slides:GetChildren()) do
Screen.Slide.Texture = child.Texture
Slide = Slide + 1
if Slide >= 9 then
wait(0.15)
break
end
wait(0.15)
end
end
end
myFunction()
local function onTouch(hit)
???????
end
Detector.Touched:connect(onTouch)

3 comments
Thanks for attempt, but it still doesn't work...uh..i mean TV's still working
maybe put the if not activated line inside the for loop?
nope