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: HELP

Previous Thread :: Next Thread 
Eventive is not online. Eventive
Joined: 28 Jul 2011
Total Posts: 9827
21 Nov 2016 07:57 PM
How do you make it so there is a selectionbox over a certain part when a players mouse hovers over it?

(Not every part just certain ones)


Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
21 Nov 2016 08:01 PM
http://wiki.roblox.com/index.php?title=API:Class/SelectionBox


Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
21 Nov 2016 08:02 PM
We don't answer questions from R15 users, sorry.
Report Abuse
Eventive is not online. Eventive
Joined: 28 Jul 2011
Total Posts: 9827
21 Nov 2016 08:02 PM
-_-


Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
21 Nov 2016 08:03 PM
local Player = Game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:connect(function(X,Y)


local model = game.Workspace.Urbrick-- the brick u want



if Mouse.Target and Mouse.Target == game.Workspace.Urbrick--again
then

Player.PlayerGui.ScreenGui.ame.Text = Mouse.Target.Name
Player.PlayerGui.ScreenGui.ame.Visible = true -- Change frame to whatever you want visible
Player.PlayerGui.ScreenGui.ame.Position = UDim2.new(0,Mouse.X,0,Mouse.Y)
else


Player.PlayerGui.ScreenGui.ame.Visible = false -- Change frame to whatever you want visible
end
end
end)
Report Abuse
Eventive is not online. Eventive
Joined: 28 Jul 2011
Total Posts: 9827
21 Nov 2016 08:11 PM
That worked, Gree.
I changed it to what I needed, but now how do I make it when the mouse isn't over the selected part and the selectionbox goes away?

I have this:

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:connect(function(X,Y)
local model = game.Workspace.Shuttle.Door


if Mouse.Target and Mouse.Target == game.Workspace.Shuttle.Door
then
game.Workspace.Shuttle.Door.SelectionBox.Visible = true
end
end)



Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
21 Nov 2016 08:14 PM
elseif Mouse.Target and Mouse.Target ~= Workspace. then

Player.PlayerGui.ScreenGui..Visible = false

right here bro
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
21 Nov 2016 08:15 PM
local selectedPart = nil
local selectionBox = Instance.new("SelectionBox")
local mouse = game.Players.LocalPlayer:GetMouse()

function onHeartbeat()
if mouse.Target ~= nil then
if mouse.Target ~= selectedPart then
selectedPart = mouse.Target
selectionBox.Parent = selectedPart
end
else
if selectedPart then
selectionBox.Parent = nil
end
end
end

game:GetService("RunService").Heartbeat:connect(onHeartbeat)
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
21 Nov 2016 08:16 PM
local selectedPart = nil
local selectionBox = Instance.new("SelectionBox")
local mouse = game.Players.LocalPlayer:GetMouse()

function onHeartbeat()
if mouse.Target ~= nil then
if mouse.Target ~= selectedPart then
selectedPart = mouse.Target
selectionBox.Parent = selectedPart
end
else
if selectedPart then
selectedPart = nil
selectionBox.Parent = nil
end
end
end

game:GetService("RunService").Heartbeat:connect(onHeartbeat)
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