|
| 22 Dec 2016 11:06 AM |
| Is there a way to make it so that when a player sits in a chair their keyboard connects to the screen gui? And they can type on it? |
|
|
| Report Abuse |
|
|
Sublivion
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 2390 |
|
| |
|
|
| 22 Dec 2016 11:11 AM |
| I understand that, but the keyboard won't just "connect automatically" to the surfacegui. My mistake i meant Surface GUI! |
|
|
| Report Abuse |
|
|
Sublivion
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 2390 |
|
| |
|
|
| 22 Dec 2016 11:18 AM |
| A little more detail? Thanks! |
|
|
| Report Abuse |
|
|
Sublivion
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 2390 |
|
|
| 22 Dec 2016 11:20 AM |
srry was eating
You would do something like this
local string local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(obj, gpe) string + string.. obj.KeyCode end)
-Sublivion |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2016 11:28 AM |
| Im unfamiliar with this, How would i set this up so that when a player sits in a chair their keyboard connects with the surface gui? |
|
|
| Report Abuse |
|
|
Sublivion
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 2390 |
|
|
| 22 Dec 2016 11:30 AM |
You would just check for joints in the seat, then use user input service to detect the input that the user is making then ouput it to the surfacegui.
-Sublivion |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2016 11:58 AM |
| Having trouble with this, do you mind setting it up? |
|
|
| Report Abuse |
|
|
Sublivion
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 2390 |
|
|
| 22 Dec 2016 12:00 PM |
Can't do it for you
-Sublivion |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2016 12:17 PM |
Chair.ChildAdded:connect(function(child) if child.Name == "SeatWeld" then Player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) -- Connect an event here for the player's keyboard input end end)
Will wait for a Weld named "SeatWeld" to be added to the chair and will get the player from the child's parent.
As for UserInputService, you can easily learn that on roblox wiki. |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2016 05:36 PM |
--[[Variables Here]]--
local Chair = script.Parent local string local UIS = game:GetService("UserInputService") local G = game.Workspace.G.Sign.SurfaceGui --[[Functions Here]]-- Chair.ChildAdded:connect(function(child) if child.Name == "SeatWeld" then local Player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) -- Connect an event here for the player's keyboard input-- print("Got Player")
wait()
--[[Output Whatever the player is typing onto the Surfacegui Textbox]]--
end end)
Thank you, This is what i got so far, stuck on the actual outputting of it onto the textbox
|
|
|
| Report Abuse |
|
|
austinfl
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 191 |
|
|
| 22 Dec 2016 05:43 PM |
One idea is in the start of the game having the screen GUI already with the player, just not visible. Then your seat just makes it visible.
Also you shouldn't make a script wait for players to type. It should be that the player types something, clicks a button (a GUI button if you want) and then another script sends the data back to the chair or whatever you want to do with the text. |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2016 05:46 PM |
| I've done that before, and ahhhh good to know. This is different. It's a surface GUI. |
|
|
| Report Abuse |
|
|