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: Get mouse position?

Previous Thread :: Next Thread 
Avocation is not online. Avocation
Joined: 22 Mar 2011
Total Posts: 107
14 Feb 2015 10:02 PM
I tried to get a GUI to follow the players mouse but it said that Position is not part of Mouse

This is my script:

local Mouse = script.Parent.Parent.Parent.Parent:GetMouse()

repeat
wait()
if script.Parent.mouseState.Value == true then
script.Parent.Position = Mouse.Position
end
until script.Parent.Parent == nil
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Feb 2015 10:05 PM
local mouse = game.Player.LocalPlayer:GetMouse()

mouse.Move:connect(function()
if script.Parent.mouseState.Value == true then
script.Parent.Parent.Position = UDim2.new(0,mouse.X,0,mouse.Y)
end
end)
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
14 Feb 2015 11:25 PM
It kinda irritates me how it's needed to use offset.
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
14 Feb 2015 11:49 PM
Dividing the X Offset by 1000 and the Y by 500 seems to fix the issue.
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