Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I access the Players Debounce?

I notice that Dev scripters are able to make a player not be able to use a certain move. Say if I made a punch script and it hit a player they wouldn't be able to use there move. And I find going into the backpack finding there tool is just a bad way of doing it. I notice Dev have a more better way of doing this, but I don't under stand how. Thanks for helping me.

1 answer

Hello, GGButNO_RE!

Debounce is an example, i mean...

example1 = false -- Aka Debounce
Part = Instance.new("Part") -- Lets start with a part!
Part.Parent = workspace -- The part spawns at the Workspace/Baseplate!

Part.Touched:Connect(function(hit) -- A function, it detects when the part is touched, (you can change hit to anything you want)
if hit.Parent:FindFirstChild("Humanoid") and example1 == false then -- And here, if example1 == false then, prints, so, you can use this method to stop a function from working temporarily!
print("Someone touched me!") -- Bingo!
example1 = true -- This function won't work anymore!
end
end)

-- Didn't check on studio, don't just copy that :l

So... hope i helped!

-- Note : You can also change the example1 to true or false, its all based on your function!

---- AIphanium

------ Tell me if you have more questions.

13 comments

0

It should be example1 == false, not example1 = false. On line 6.

0

And you'll get an error on line 7, Print is a nil value.

0

incapaz, that is not a nice reason to vote down, remember, its an example, and just as YOU said, its not a request site.

1

It kind of was, you would be giving OP code that throws errors. And that had nothing to do with SH not being a request site.

0

Your just being rude.

0

Now tell me, what kind of error?

0

You'd get an error for not using == in conditionals, and Print is a nil value.

0

Have you checked the script again, pal?

0

Well, you have edited it. You wouldn't have, had I not told you.

0

Look, i DID mention that i didn't check that on studio.

0

Anyways, thank you for helping :l

0

Yes you did, but it doesn't mean you shouldn't check if it'll throw errors.

0

Incapaz, example1 == false is in an if statement, it needs two equals

This discussion is preserved as it was. New answers, comments, and votes are closed.