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
 

How do I make this function recognize "Mouse"?

Previous Thread :: Next Thread 
Bloxfinity is not online. Bloxfinity
Joined: 22 Mar 2011
Total Posts: 130
17 Dec 2016 11:29 PM
I need the "Shoot" function to use "Mouse" while it is being run but without having it written under the "Equipped" function. I don't understand why it doesn't work... it says that Mouse is a nul value...

function Shoot()
local ray = Ray.new(Tool.Muzzle.CFrame.p, (Mouse.Hit.p - Tool.Muzzle.CFrame.p).unit
--------------
- OTHER-------
- LINES-------
- IN BETWEEN--
--------------

Tool.Equipped:connect(function(Mouse)
--------------
- OTHER-------
- LINES-------
- IN BETWEEN--
--------------
Shoot()

Thanks!
Report Abuse
xInitiated_Inspire is not online. xInitiated_Inspire
Joined: 17 Jul 2014
Total Posts: 1276
17 Dec 2016 11:30 PM
Mouse is not a function. You got to add what you did there in local ray = Ray.new(Tool.Muzzle.CFrame.p, (Mouse.Hit.p - Tool.Muzzle.CFrame.p).unit
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
17 Dec 2016 11:31 PM
function Shoot(Mouse)
local ray = Ray.new(Tool.Muzzle.CFrame.p, (Mouse.Hit.p - Tool.Muzzle.CFrame.p).unit
--------------
- OTHER-------
- LINES-------
- IN BETWEEN--
--------------

Tool.Equipped:connect(function(Mouse)
--------------
- OTHER-------
- LINES-------
- IN BETWEEN--
--------------
Shoot(Mouse)
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