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 » Scripting Helpers
Home Search
 

Re: Checking if the Mouse is Active

Previous Thread :: Next Thread 
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
01 Nov 2011 10:00 PM
Can you just type "if mouse then" to verify if the mouse is active, or does that not always return a correct result?
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
01 Nov 2011 10:01 PM
Obviously I'm referring to if you're using the mouse variable in the Selected event.

script.Parent.Selected:connect(function(mouse)
if mouse then
print("All is well.");
end
end);
Report Abuse
Serbin is not online. Serbin
Joined: 14 Oct 2011
Total Posts: 40
01 Nov 2011 10:04 PM
script.Parent.MouseClick:connect(function()
print("All is well.");
end);

?
Report Abuse
Serbin is not online. Serbin
Joined: 14 Oct 2011
Total Posts: 40
01 Nov 2011 10:04 PM
script.Parent.MouseClick:connect(function()
print("All is well.");
end)

Why did you have a semicolon at the end?
Report Abuse
kingmod123 is not online. kingmod123
Joined: 16 May 2009
Total Posts: 699
01 Nov 2011 11:11 PM
Cuz he doesn't know C# or C++ or C...
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
01 Nov 2011 11:12 PM
King don't forget Javascript.
Report Abuse
kingmod123 is not online. kingmod123
Joined: 16 May 2009
Total Posts: 699
01 Nov 2011 11:16 PM
Ehh... I havn't used Javascript so I don't know what it's like.
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
01 Nov 2011 11:19 PM
Iv been learning Javascript.

    < ​script type="text/javascript"​ ​>
     var tuna = "I am a fish" ;
     var bacon = "baconator" ;
    var hame = "hamburgrlator" ;
    document . write (tuna+bacon+hame)
    <​/script​>
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
02 Nov 2011 12:23 AM
=_=

Blobbyblob is a much better scripter than the two of you combined.

Anyways, I don't see any reason why that wouldn't work :l

"I WILL GIVE YOU BACON." - Deadmau5
~Scarfacial
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
02 Nov 2011 10:59 AM
(I know im bumping this...)

But bikerking200 you could just use
< script >
You dont need to define that,that it is javascript....
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
02 Nov 2011 01:54 PM
Lua allows you to use semicolons at the end of commands, guys. Might be nice to know, seeing as you can occasionally get an error if you don't use them.


Anyway, after wasting a whole 5 minutes, I found out:

No, it does not. If you want to check if the mouse is still active, you have to do an ugly hack.

if pcall(function() local x=mouse.Target; end) then
print("Mouse exists");
else
print("Mouse is no longer active.");
end

Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
02 Nov 2011 02:35 PM
@sue8, Oh never thought oh that.
Report Abuse
damanofrunescape is not online. damanofrunescape
Joined: 29 Jul 2008
Total Posts: 7338
01 May 2012 09:27 PM
Does blobbyblob's method still work?

I've run across this problem myself, but it would seem blobbyblob's method doesn't work right now (or I'm doing something wrong).
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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