Krimulous
|
  |
| Joined: 17 Mar 2011 |
| Total Posts: 7993 |
|
|
| 28 Jul 2014 03:59 PM |
I finished a script that lets you input a name into a textbox and then puts that into a billboard GUI, and it worked fine in solo mode.
But in an actual server, the script doesn't work. D:
In case you need to examine the script: player = script.Parent.Parent.Parent.Parent.Parent character = player.Character
script.Parent.FocusLost:connect(function() local bg = Instance.new("BillboardGui") bg.Parent = character.Head bg.Size = UDim2.new(1, 0, 1, 0) bg.StudsOffset = Vector3.new(0, 2, 0) local frame = Instance.new("Frame") frame.Parent = bg frame.Size = UDim2.new(1, 0, 1, 0) frame.BackgroundTransparency = 1 local text = Instance.new("TextLabel") text.Parent = frame text.Position = UDim2.new(0.25, 0, 0.25, 0) text.Size = UDim2.new(0.5, 0, 0.5, 0) text.Text = script.Parent.Text text.BackgroundTransparency = 1 text.TextColor3 = Color3.new(1, 1, 1) text.Font = "ArialBold" text.FontSize = "Size24" end)
Anyone have any suggestions or quick fixes for this problem? |
|
|
| Report Abuse |
|
|
Krimulous
|
  |
| Joined: 17 Mar 2011 |
| Total Posts: 7993 |
|
|
| 28 Jul 2014 04:05 PM |
b bu bum bump :>
The inner machinations of my mind are an enigma |
|
|
| Report Abuse |
|
|
Krimulous
|
  |
| Joined: 17 Mar 2011 |
| Total Posts: 7993 |
|
|
| 28 Jul 2014 04:11 PM |
: - (
The inner machinations of my mind are an enigma |
|
|
| Report Abuse |
|
|
Krimulous
|
  |
| Joined: 17 Mar 2011 |
| Total Posts: 7993 |
|
|
| 28 Jul 2014 04:28 PM |
frowny face : - (
The inner machinations of my mind are an enigma |
|
|
| Report Abuse |
|
|
moontj11
|
  |
| Joined: 02 Jul 2011 |
| Total Posts: 8 |
|
| |
|
| |
|
blackybae
|
  |
| Joined: 10 Jun 2011 |
| Total Posts: 145 |
|
| |
|
Scriptury
|
  |
| Joined: 21 Aug 2013 |
| Total Posts: 220 |
|
|
| 28 Jul 2014 04:46 PM |
I predict that this is in a normal script. What you have to understand is that in solo mode, normal scripts can use some of the events that localscripts can use, but on an actual server they can't. One of these events are FocusLost. You need to put this code in a localscript, and put the localscript in a suitable place. However this may mess up with multiple users. The other alternative is to make a button that you can click to submit text, rather than using FocusLost. I hope this helped. I too have had a lot of problems with solo mode too. |
|
|
| Report Abuse |
|
|
dansk
|
  |
| Joined: 24 Dec 2008 |
| Total Posts: 548 |
|
|
| 28 Jul 2014 05:02 PM |
If it works in the solo mode but not in the server, its because sometimes the scripts dont detect the variables once it enters in game. You can either check what the problem is in the output and fix it yourself or replace this with the variables part.
local player = game.Players:FindFirstChild(script.Parent.Parent.Parent.Parent.Parent) local character = game.Workspace:FindFirstChild(player.Name)
While not player and character do player = game.Players:FindFirstChild(script.Parent.Parent.Parent.Parent.Parent) character = game.Workspace:FindFirstChild(player.Name) wait() end
What this does is that it constantly checks for player and character until they fully load. |
|
|
| Report Abuse |
|
|
Scriptury
|
  |
| Joined: 21 Aug 2013 |
| Total Posts: 220 |
|
|
| 29 Jul 2014 04:53 AM |
To do the button method, you need to first create a submit button next to the text field. Then you need to attach the MouseButton1Click event to that submit button so when it is clicked, the desired result is given, much like loosing the focus from the text field. So it would look something like this in your script:
player = script.Parent.Parent.Parent.Parent.Parent character = repeat wait() until player.Character
script.Parent.Parent.Submit.MouseButton1Click:connect(function() local bg = Instance.new("BillboardGui") bg.Parent = character.Head bg.Size = UDim2.new(1, 0, 1, 0) bg.StudsOffset = Vector3.new(0, 2, 0) local frame = Instance.new("Frame") frame.Parent = bg frame.Size = UDim2.new(1, 0, 1, 0) frame.BackgroundTransparency = 1 local text = Instance.new("TextLabel") text.Parent = frame text.Position = UDim2.new(0.25, 0, 0.25, 0) text.Size = UDim2.new(0.5, 0, 0.5, 0) text.Text = script.Parent.Text text.BackgroundTransparency = 1 text.TextColor3 = Color3.new(1, 1, 1) text.Font = "ArialBold" text.FontSize = "Size24" end)
However a much easier solution would be for you to just change the whole script from a normal script to a localscript as localscripts have access to FocusLost. |
|
|
| Report Abuse |
|
|