of     1   

DrFeynman
#139080581Thursday, July 03, 2014 7:35 AM GMT

I've been coding at a system that when you put you mouse over a model a billboard GUI would appear and says that models name, and I'm honestly not that great at scripting but I've been at it for a while and this is what I was able to come up with.. Have a local script in the starter GUI that ran a anonymous function on a players mouse.hit(), but mouse = a nil value. How would I access the properties of the mouse, and is there a better way of doing this?
eugenevorld
#139095630Thursday, July 03, 2014 1:41 PM GMT

If you're trying to get the mouse, try using the 'GetMouse' method of the local player since you are using a local script. Something like this... local mouse = game.Players.LocalPlayer:GetMouse() Wiki page on 'GetMouse' http://wiki.roblox.com/index.php?title=GetMouse_(Method)/Player
DrFeynman
#139109103Thursday, July 03, 2014 4:30 PM GMT

Returns mouse as a nil
DrFeynman
#139138202Thursday, July 03, 2014 8:35 PM GMT

Nvm no it doesn't this is the code I came up with, still needs a lot of thinks but here: (Localscript in startergui) local mouse = game.Players.LocalPlayer:GetMouse() function showdata() if mouse.Target.Parent.ClassName == "Model" then print(mouse.Target.Parent.Name) end end -- I don't know how to call this function
DrFeynman
#139138710Thursday, July 03, 2014 8:39 PM GMT

Quasiduck
#139139428Thursday, July 03, 2014 8:46 PM GMT

local mouse = game.Players.LocalPlayer:GetMouse() function showdata() if mouse ~= nil then if mouse.Target.Parent.className == "Model" then print(mouse.Target.Parent.Name) end end end mouse.Move:connect(showdata)
Quasiduck
#139139720Thursday, July 03, 2014 8:48 PM GMT

Next, the billboard gui would have to go in the players playergui for it to be local.. Just set the billboardgui.Adornee to the mouse.Target for it to display over the mouse's target Set the billboard gui's text to be the mouse.Target.Parent.Name for the name to display
DrFeynman
#139140774Thursday, July 03, 2014 8:58 PM GMT

Thank you so much, Anything I can do to repay?
Quasiduck
#139141118Thursday, July 03, 2014 9:01 PM GMT

It's fine, you came to a place where help is free. Btw, i made a mistake! if mouse ~= nil then Change this line to if mouse.Target ~= nil then This is so it doesn't error when u hover over the sky.
DrFeynman
#139145758Thursday, July 03, 2014 9:41 PM GMT

local mouse = game.Players.LocalPlayer:GetMouse() function showdata() if mouse.Target ~= nil then if mouse.Target.Parent.className == "Model" then print("datamodel working") script.Datagui:Clone() end end end mouse.Move:connect(showdata) How would I clone a GUI into playergui, so when I hover over something it pops up with a gui at the mouse?
Quasiduck
#139146046Thursday, July 03, 2014 9:44 PM GMT

Oh, at the mouse? so you don't want billboard gui's. In that case; local mouse = game.Players.LocalPlayer:GetMouse() function showdata() if mouse.Target ~= nil then if mouse.Target.Parent.className == "Model" then print("datamodel working") data = script.Datagui:Clone() data.Parent = game.Players.LocalPlayer.PlayerGui end end end mouse.Move:connect(showdata)
DrFeynman
#139147288Thursday, July 03, 2014 9:54 PM GMT

And to keep the cloning at a minimum? This is what I'm trying to replicate (sorry) http://www.roblox.com/Fading-Embers-place?id=102210997
Quasiduck
#139147389Thursday, July 03, 2014 9:55 PM GMT

local mouse = game.Players.LocalPlayer:GetMouse() function showdata() if mouse.Target ~= nil then if mouse.Target.Parent.className == "Model" then print("datamodel working") if game.Players.LocalPlayer.PlayerGui:findFirstChild("Datagui") == nil then data = script.Datagui:Clone() data.Parent = game.Players.LocalPlayer.PlayerGui end end end end mouse.Move:connect(showdata)
eugenevorld
#139200616Friday, July 04, 2014 9:37 AM GMT

So you want some form of tooltip that appears whenever you hover over an object. If you are trying to replicate the Gui in Fading embers, it won't be that easy since there are probably more than one script keeping track of things. Things such as the name of the object and some characteristics. If you are just trying to replicate the tooltip that comes up, it shouldn't be too hard. You just check which model the part belongs to with this function... function GetParentModel(instance) if instance.Parent ~= workspace then GetParentModel(instance) elseif instance.ClassName == "Model" then return instance end end Although it checks for the highest parent so it might be inappropriate. Rename the model to what you want to show up on the tooltip and just create a TextLabel beside the mouse with the model's name.

    of     1