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
|
  |
| 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 |
|
|
|
| 21 Nov 2016 08:02 PM |
| We don't answer questions from R15 users, sorry. |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|