yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 13 Mar 2015 02:33 PM |
Mouse.KeyDown:connect(function(Key) if Key == "f" then print("Worked") game.Workspace.Part.BillboardGui.Frame.TextLabel.Text = "Planted" end end)
Doesnt work |
|
|
| Report Abuse |
|
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 13 Mar 2015 02:35 PM |
Is it in a localscript?
Dolph Lundgren of OT. |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2015 02:36 PM |
ew KeyDown
CentOS-Web = /var/www/html/ |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 13 Mar 2015 02:37 PM |
yes ofc
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()
while wait(0.1) do if Mouse.Target == workspace.Part then workspace.Part.BillboardGui.Frame.Visible = true else if Mouse.Target ~= workspace.Part then workspace.Part.BillboardGui.Frame.Visible = false end end end
Mouse.KeyDown:connect(function(Key) if Key == "f" then print("Worked") game.Workspace.Part.BillboardGui.Frame.TextLabel.Text = "Planted" end end) |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
| |
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 13 Mar 2015 02:58 PM |
Oh, your script won't get past the while loop. It's repeating the lines infinitely.
You can use a coroutine or simply place the while loop at the end. I recommend coroutine.
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()
coroutine.wrap(function() while wait(0.1) do if Mouse.Target == workspace.Part then workspace.Part.BillboardGui.Frame.Visible = true else if Mouse.Target ~= workspace.Part then workspace.Part.BillboardGui.Frame.Visible = false end end end end)()
Mouse.KeyDown:connect(function(Key) if Key == "f" then print("Worked") game.Workspace.Part.BillboardGui.Frame.TextLabel.Text = "Planted" end end) |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2015 03:00 PM |
| @iiEssence, He could also just move the event above the while loop. |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 13 Mar 2015 03:02 PM |
| "You can use a coroutine or simply place the while loop at the end." |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2015 03:03 PM |
| Oops, didn't read that part. Sorry xD |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 13 Mar 2015 03:52 PM |
| is the localscript in workspace |
|
|
| Report Abuse |
|
|