#My debounce wont debounce, script runs with no time limit
117 messages · Page 1 of 1 (latest)
Your debounce implementation is wrong, find how to do it properly or read whatever you read again
remove every debouce and only have three
one is gonna be if debouce == false then debouce = true
then at the end of the first if statement debouce = false
and add a one wait at the end
blackest code I've ever seen
local debounce = false
local function getsCalledAlot()
if debounce then return end
debounce = true
--do stuf
debounce = false
end
how does that return end owrk
** You are now Level 14! **
what does return do
does the lines under it still run
no
Not if it returned
Which it will only if debounce is on
ohh i see
you could do it the other way
and wrap the code in the if then
but i think its cleaner to just return
How did u get S1 without knowing about return
lel
Yea you wanna try not to nest all the code.
okay mr s1 big pants lets go fix my balloon
** You are now Level 3! **
Where?
so sorry, i tried to make it WITHOUT the internet so i just messed it up im quite new to this, thank you for the tip!
just make sure that if you need more than 1 debounce in a large function to name them properly
at that point tho probably better to seperate the stuff into multiple functions
can i just debounce the button?
alright, how do i set the time in there just add a wait?
what do you need a time for
if you want like a cooldown duration or something
ya just slap in a wait before you change the debounce back
okay perfect
whats the dif between task.wait and wait
truely don't know lol
@brazen grove
hows this look?
ima jus test idk why i asked xd
works perfect, ill remember that for next time thank you for helping me learn
epic
hey @brazen grove i had a quick question
yo
i have this bilboard GUI adorned to a part, and i want to make it something you can press E for as well
How do i go about that?
same as a regular ui button
im not sure how to do it in general..
wasnt sure if it being adorned changed anything
should i go to dev hub?
yes it both E and Click
you already got it clickable
okay ya
hmm
you could use proximity prompts for the quick and ez
how do those work?
basically if you get within range itlll listen for input
i could but i wanted to add a custom E UI
i can change the time too?
so add the prompt then use promt.triggered?
yup
theres also the promptShown event too
if you wanted to change the ui
to indicate its like clickable or w/e
so can i disable the UI then make the time on it 0 so they can instant click?
then just add my script
i dont think the prox prompt has any sort of cooldown property anyways
ya you can make them hold it
okay i see
but you dont have to
ya the prompt goes in the workspace somewhere
anyone can interact with it
but the code for it you want in a localscript
theres actually like a global proximityprompt detector thing you can use too
so you dont have ot reference the prompt itself
so if you did like proxPromptService.PromptTriggered:Connect(function(prompt, player) end)
that might be a bit much tho lol
for 1 night