Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
|
| 15 May 2014 05:05 PM |
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) key = key:lower() if key == "e" then --key function GetGui() for i, v in pairs(script:GetChildren()) do if v:IsA("ScreenGui") then return v end end return nil end Gui = GetGui() Gui.Name = script.Parent.Parent.Name .. "GUI" script.Parent.Parent.Changed:connect(function() GetGui().Name = script.Parent.Parent.Name .. "TalkGui" end) while true do wait(.1) for i, v in pairs(game.Players:GetChildren()) do if v.Character ~= nil then if v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude <= 5 and v.PlayerGui:FindFirstChild(Gui.Name) == nil then Gui:Clone().Parent = v.PlayerGui
elseif v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude > 5 and (script.Parent.Position - v.Character.Torso.Position).magnitude < 7 then if v.PlayerGui:FindFirstChild(Gui.Name) then v.PlayerGui[Gui.Name]:Remove() end
end end end end
end end)
------------
Okay, so I need the Gui to go away after "E" is pressed again. |
|
|
| Report Abuse |
|
|
yurhomi10
|
  |
| Joined: 10 Dec 2008 |
| Total Posts: 13886 |
|
|
| 15 May 2014 05:07 PM |
if active == true then --make it close here else --make it open here end |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
|
| 15 May 2014 05:50 PM |
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) script.Parent.OpenGui.Visible = true key = key:lower() if key == "e" then --key if active == true then function GetGui() for i, v in pairs(script:GetChildren()) do if v:IsA("ScreenGui") then return v end return nil end Gui = GetGui() Gui.Name = script.Parent.Parent.Name .. "GUI" script.Parent.Parent.Changed:connect(function() GetGui().Name = script.Parent.Parent.Name .. "TalkGui" end) while true do wait(.1) for i, v in pairs(game.Players:GetChildren()) do if v.Character ~= nil then if v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude <= 5 and v.PlayerGui:FindFirstChild(Gui.Name) == nil then end Gui:Clone().Parent = v.PlayerGui if OpenGui == Visible then script.Parent.textlabel.text = ("Press [E] to close the information screen") key = key:lower() if key == "e" then script.Parent.Name:Remove()
elseif v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude > 5 and (script.Parent.Position - v.Character.Torso.Position).magnitude < 7 then if v.PlayerGui:FindFirstChild(Gui.Name) then v.PlayerGui[Gui.Name]:Remove() end
end end end end
end end)
---------
I added in a part that's supposed to remove the "opengui", a screengui with a textlabel that tells the player to press E and also added in something that changes opengui's text, which made this more confusing..
and now end) is underlined in red and output keeps spamming me -_-
Help? |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
|
| 15 May 2014 05:59 PM |
Should I incorporate stringvalues with the text into this? I think that's what I should do.
But how do I use those strings to affect OpenGui's test? it's all under the one main script posted..
stringvalue values:
EOPEN: Press [E] to open the information screen
ECLOSE: Press [E] to close the information screen
----------------------
And even if I figure out how to incorporate them, how will it affect the entry and leaving of opengui, and opengui's affect on the InfoGUI's entry and leaving? |
|
|
| Report Abuse |
|
|
|
| 15 May 2014 06:05 PM |
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(k) if k:lower() == "e" then game.Players.LocalPlayer.PlayerGui.GuiNameHere.FrameNameHere.Visible = not game.Players.LocalPlayer.PlayerGui.GuiNameHere.FrameNameHere.Visible end) |
|
|
| Report Abuse |
|
|
|
| 15 May 2014 06:06 PM |
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(k) if k:lower() == "e" then game.Players.LocalPlayer.PlayerGui.GuiNameHere.FrameNameHere.Visible = not game.Players.LocalPlayer.PlayerGui.GuiNameHere.FrameNameHere.Visible end end)
--forgot an end |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
|
| 15 May 2014 06:13 PM |
Thanks cool, but two questions
1: where do I add that script 2:is it for opengui or just for getting the infogui to close? |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
|
| 15 May 2014 10:17 PM |
| Bump.. even though I'll probably be ignored |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
|
| 15 May 2014 10:26 PM |
| Why am I being ignored.. is it because I'm not good at this? |
|
|
| Report Abuse |
|
|
|
| 15 May 2014 10:35 PM |
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) script.Parent.OpenGui.Visible = true key = key:lower() if key == "e" then --key if active == true then function GetGui() for index, t in next, script:GetChildren() do if t:IsA("ScreenGui") then return v end return nil end Gui = GetGui() Gui.Name = script.Parent.Parent.Name .. "GUI" script.Parent.Parent.Changed:connect(function() GetGui().Name = script.Parent.Parent.Name .. "TalkGui" end) while true do wait(.1) for index,v in next, game.Players:GetPlayers() do if v.Character ~= nil then if v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude <= 5 and v.PlayerGui:FindFirstChild(Gui.Name) == nil then end Gui:Clone().Parent = v.PlayerGui if OpenGui == Visible then script.Parent.textlabel.text = ("Press [E] to close the information screen") key = key:lower() if key == "e" then script.Parent.Name:Remove()
elseif v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude > 5 and (script.Parent.Position - v.Character.Torso.Position).magnitude < 7 then if v.PlayerGui:FindFirstChild(Gui.Name) then v.PlayerGui[Gui.Name]:Remove() end
end end end end
end end)
What is the error message?
|
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 16 May 2014 06:41 AM |
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) script.Parent.OpenGui.Visible = true key = key:lower() if key == "e" then --key if active == true then function GetGui() for index, t in next, script:GetChildren() do if t:IsA("ScreenGui") then return v end return nil end Gui = GetGui() Gui.Name = script.Parent.Parent.Name .. "GUI" script.Parent.Parent.Changed:connect(function() GetGui().Name = script.Parent.Parent.Name .. "TalkGui" end) while true do wait(.1) for index,v in next, game.Players:GetPlayers() do if v.Character ~= nil then if v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude <= 5 and v.PlayerGui:FindFirstChild(Gui.Name) == nil then end Gui:Clone().Parent = v.PlayerGui if OpenGui == Visible then script.Parent.textlabel.text = ("Press [E] to close the information screen") key = key:lower() if key == "e" then script.Parent.Name:Remove()
elseif v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude > 5 and (script.Parent.Position - v.Character.Torso.Position).magnitude < 7 then if v.PlayerGui:FindFirstChild(Gui.Name) then v.PlayerGui[Gui.Name]:Remove() end
end end end end end end end)
Another error? Idk, i just guessed this. |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
|
| 17 May 2014 10:48 AM |
key = key if key pressed then gui get removed end of script |
|
|
| Report Abuse |
|
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|
Gybro
|
  |
| Joined: 23 Apr 2014 |
| Total Posts: 808 |
|
| |
|