|
| 21 Dec 2015 11:21 AM |
When I hover over the part the mouse.target specifies it doesnt show the gui script: local mouse = game:GetService("Players").LocalPlayer:GetMouse() if mouse.Target == workspace.CurtinOne then game.StarterGui.Buttons.E.Visible = true else game.StarterGui:GetChildren().Visible = false end |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 21 Dec 2015 11:23 AM |
game.StarterGui:GetChildren().Visible = false
What are you trying to do here? |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2015 11:23 AM |
| I am trying to hide the guis when the mouse isnt hovering over the part |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 21 Dec 2015 11:27 AM |
It's a bit more complicated than that. You see, the GetChildren method returns a table of all of the ids of the parts. It doesn't return each individual part and iterate over them. You have to take initiative and iterate over all of the IDs that GetChildren returns.
Plus, ScreenGuis don't have a Visible property |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2015 11:31 AM |
My new script is local mouse = game:GetService("Players").LocalPlayer:GetMouse() if mouse.Target == workspace.CurtinOne then game.StarterGui.Buttons.E.Visible = true else game.StarterGui.Buttons.E.Visible = false end but it still wont work |
|
|
| Report Abuse |
|
|
| |
|
IoIiderp
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 8613 |
|
|
| 21 Dec 2015 11:45 AM |
It will only check once.
Try this:
local mouse = game:GetService("Players").LocalPlayer:GetMouse() mouse.Button1Down:connect(function() if mouse.Target == workspace.CurtinOne then game.StarterGui.Buttons.E.Visible = true else game.StarterGui:GetChildren().Visible = false end end) |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2015 11:49 AM |
local player = game:GetService("Players").LocalPlayer local mouse = player:GetMouse() mouse.Move:connect(function() if mouse.Target and mouse.Target.Name == "CurtinOne" then player.PlayerGui.Buttons.E.Visible = true else local children = player.PlayerGui:GetChildren() local contents = {] for _,v in pairs(children) do if v.Visible == true then table.insert(contents, v.Name) for i = 1,#contents do local gui = player.PlayerGui if gui:FindFirstChlid(contents[i]) then gui[contents[i]].Visible = false end end end end end end)
Did you know the chance of you being born was 1 in 400 trillion? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 21 Dec 2015 11:53 AM |
It may have a couple of misspells in it, but after you fix those it works.
And your welcome.
Did you know the chance of you being born was 1 in 400 trillion? |
|
|
| Report Abuse |
|
|