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: Mouse Enter question

Previous Thread :: Next Thread 
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
10 Jun 2014 07:32 AM
Hello!

I want to make a GUI that when you MouseEnter (and MouseLeave, for sure) a player, a ScreenGui pops on your screen with the TextLabel telling you his name and rank in X group.

What should be the last line, when we have to connect stuff?

Ex: script.Parent.MouseEnter:connect()


Would it be something like: Humanoid.MouseEnter:connect() ?

Tkx, Crate.
Report Abuse
BLOXLUA is not online. BLOXLUA
Joined: 16 Mar 2013
Total Posts: 453
10 Jun 2014 07:33 AM
You can't ":MouseEnter()" a player.
Report Abuse
eletrowiz is not online. eletrowiz
Joined: 08 Dec 2008
Total Posts: 12438
10 Jun 2014 07:33 AM
GUI.MouseEnter:connect()

same for leave.
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
10 Jun 2014 07:34 AM
What would be the command then?

I have seen it on many places, when you put your cursor on someone, you could get his name and rank from a certain group.
Report Abuse
BLOXLUA is not online. BLOXLUA
Joined: 16 Mar 2013
Total Posts: 453
10 Jun 2014 07:34 AM
@eletro, he's asking for your mouse to hover over a player.
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
10 Jun 2014 07:37 AM
@Ele Is the GUI from "GUI.MouseEnter:connect()" my GUI or the player's GUI?
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
10 Jun 2014 07:37 AM
Yeah ahah :P
Report Abuse
BLOXLUA is not online. BLOXLUA
Joined: 16 Mar 2013
Total Posts: 453
10 Jun 2014 07:38 AM
Alrighty. (This has to be in a LocalScript, inside the StarterGui preferably)

--First, you need a mouse.

MOS=game.Players.LocalPlayer:GetMouse() --Your mouse!

while wait() do
if MOS.Target then
if MOS.Target.Parent:FindFirstChild("Humanoid") or MOS.Target.Parent.Parent:FindFirstChild("Humanoid") then
--Code for Gui to appear
else
--Code for Gui to close
end
end
end
Report Abuse
eletrowiz is not online. eletrowiz
Joined: 08 Dec 2008
Total Posts: 12438
10 Jun 2014 07:38 AM
Oh you mean when the mouse is over the player.

Ehh, that is a localscript that checks the mouse.Target, and if it is a player makes the gui and other stuff appear at the mouse's x and y position as a gui.
Report Abuse
eletrowiz is not online. eletrowiz
Joined: 08 Dec 2008
Total Posts: 12438
10 Jun 2014 07:39 AM
Blox beat me to it, but yeah. Though that wait() is gonna slow your frame rate...
Report Abuse
YeahNick is not online. YeahNick
Joined: 28 Feb 2009
Total Posts: 2536
10 Jun 2014 07:40 AM
(Local script)

local Player = Game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local curPlayer = ""

Mouse.Changed:connect(function()
if Mouse.Target.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(Mouse.Target.Parent.Name) then
curPlayer = Mouse.Target.Parent.Name
end
end)


That would be the main idea/solution.
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
10 Jun 2014 07:40 AM
Ahh!! Sounds legit! Thank you guys :) Going to work with it and tell you how it looks like!

Thank you again,
Crate.
Report Abuse
BLOXLUA is not online. BLOXLUA
Joined: 16 Mar 2013
Total Posts: 453
10 Jun 2014 07:41 AM
Well, you can do it in the "MOS.Move:connect()" and "MOS.Move:connect()", if you'd like.
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
10 Jun 2014 07:46 AM
I tried your script, Blox :)
Trying it right now. However, if anyone wish to come and test it, you are free to come! (I need an Humanoid to try it xD)

http://www.roblox.com/Gods-and-Guns%E1%B5%87%E1%B5%89%E1%B5%97%E1%B5%83-place?id=159198476
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
16 Jun 2014 01:13 PM
Aye aye it worked! Thank you!
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