generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Is there any way to prevent double tap activation of a tool?

Previous Thread :: Next Thread 
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Oct 2015 01:51 PM
So when you double tap the M1, tool fires twice.
I want to prevent it from doing that. The tool is supposed to fire once, not twice.
I think it's something related to latency - in Studio yo can't double tap fire.

ToolEquipped - obvious, right?
CheckIfAlive() - it checks if our character is alive


function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then return end

local TargetPos = InvokeClient("MousePosition")
if not TargetPos then return end
TargetPos = TargetPos.Position
local Direction = (TargetPos - Handle.Position).unit

Tool.Enabled = false
Fire(Direction)
Tool.Grip = FireGrip
wait(CoolDown/2)
Tool.Grip = OriginalGrip
wait(CoolDown/2)
Tool.Enabled = true
end
Report Abuse
Vezious is not online. Vezious
Joined: 09 Nov 2013
Total Posts: 606
03 Oct 2015 01:55 PM
Debounce?
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
04 Oct 2015 04:41 AM
But I made one :/
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
04 Oct 2015 04:48 AM
Oh wait, I added a new debounce called "Fired".

It seems like the problem is 75% solved.
Report Abuse
Vezious is not online. Vezious
Joined: 09 Nov 2013
Total Posts: 606
06 Oct 2015 04:13 PM
Its amazing what one word can do, huh?
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
09 Oct 2015 01:41 PM
The IsAlive() function was causing the problem.
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
09 Oct 2015 01:42 PM
EDIT: I mean CheckAlive()
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image