#Is there a way a part be only touched once?

1 messages · Page 1 of 1 (latest)

dusky breach
#

Ive tried using the CanTouch method, which makes the script be launched multiple times but less frequent through Touched:Connect events, heard about Once:Connect too, but i want the player be able to touch the part so script will fire only once, and the part being able to be touched later on

clever marlinBOT
#

studio** You are now Level 7! **studio

oak condor
#

debounce

dusky breach
#

is it complicated

oak condor
#

no

#

simple if statement and check boolean

dusky breach
#

is it possible you make a small example or what not

#

since im kinda new

oak condor
#

do you have basic knowledge in coding

dusky breach
#

im getting the fundamentals down

#

yes

#

i just didnt get to debouncing yet

#

since am reading the robloxs api in order kind of

oak condor
#

store a variable named up to you, for me cooldown and store a false variable meaning the cooldown isnt activated

#

under touchedevent function check if the varaible is false the nset the varaible to true

#

wait a few second and set it back to false

dusky breach
#

oh

#

thats

#

easy enough

#

ty

oak condor
dusky breach
#

it actually worked after some trial and error

#

thanks again

hushed rune
#

well that works aswell

#

but if you mean actually only ONCE

#

then you can use :Once

oak condor
hushed rune
#

not :Once

oak condor
#

probably misread the name

hushed rune
#

nvm, i read the message again, it seems like he wants it to be only touched once, but then be activated later on

hushed rune
#

intervals it seems like

#

so u right

#

u rightt

#

u riiighhtttt

oak condor
#

no im wrong

hushed rune
#

fym

#

ok

#

walks

oak condor
#

yeah im wright

hidden stratus
#

part.touched:once

hollow niche