TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 08:49 PM |
How would I acheive this? So far this isn't working..
--server script local RE = game.ReplicatedStorage.RemoteEvent
RE.OnServerEvent:connect(function(Gui) for i,v in pairs(game.Players:GetChildren()) do Gui.Parent = v.PlayerGui end end)
--localscript local player = game.Players.LocalPlayer local Gui = player.PlayerGui:WaitForChild("Gui"):Clone()
local RE = game.ReplicatedStorage:WaitForChild("RemoteEvent")
RE.OnClientEvent:connect(function(newColor3) Gui.Color3 = newColor3 RE:FireServer(Gui) end) |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 03 Jun 2015 09:00 PM |
--Server script
local RE = game.ReplicatedStorage.RemoteEvent
RE.OnServerEvent:connect(function(plr, Gui)
RE:FireAllClients(Gui)
end)
--Localscript
local player = game.Players.LocalPlayer local Gui = player.PlayerGui:WaitForChild("Gui"):Clone()
local RE = game.ReplicatedStorage:WaitForChild("RemoteEvent")
RE.OnClientEvent:connect(function(g) g:clone().Parent = player.PlayerGui end)
Gui.Color3 = newColor3 RE:FireServer(Gui:Clone())
|
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 09:04 PM |
| The gui doesn't exist on the server, so you're effectively sending the server a nil value. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:02 PM |
it says g is a nil value when I use a test server...ugh.
--local script local RE = game.ReplicatedStorage:WaitForChild("RemoteEvent") RE.OnClientEvent:connect(function(g) print(g)--nil g:Clone().Parent = player.PlayerGui end)
local gui = player.PlayerGui:WaitForChild("Gui"):Clone() gui.Name = "c2" RE:FireServer(gui:Clone()) |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:08 PM |
any ideas? Here is the server script you provided..
local RE = game.ReplicatedStorage.RemoteEvent
RE.OnServerEvent:connect(function(plr, Gui) RE:FireAllClients(Gui) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 10:08 PM |
| That's funny! It's almost as if I already told you that would happen. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:14 PM |
| Yes, but by putting the gui on the sever, do you literally mean pasting into it, or using a remote event to put it in the server? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:25 PM |
| nQ you are probably my only hope at this. I don't know what to do anymore. |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 03 Jun 2015 10:26 PM |
| Um, I guess Ill take a look into the problem here... |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 10:28 PM |
| You can't send userdata through the pipeline. It must be dumbed down to a table or similar. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:31 PM |
| well give it a shot. All I ever do is mess things up anymore..no wonder I can't make decent games |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 03 Jun 2015 10:31 PM |
| Random question, but where are these scripts located? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:32 PM |
| the local script is inside a TextButton. The ServerScript is just located in the workspace |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:41 PM |
| ohhhhh so basically the server fires the event, it connects to all the players and a gui is cloned to each player. So, what I have to do is connect a event to fire the server event and clone the gui to the server, which will fire the client event. Heh finally realized the problem..but now how to clone it.. |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 10:42 PM |
| What kind of properties of the gui do you need to send? |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 03 Jun 2015 10:45 PM |
i thinK:
RE.OnServerEvent:connect(function(Gui) for i,v in pairs(game.Players:GetChildren()) do local newgui = Gui:Clone() newgui.Parent = v.PlayerGui end end) |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:46 PM |
local cell = player.PlayerGui:WaitForChild("Cell"):Clone() cell.Name = "c2" cell.Player.Text = player.Name --localplayer cell.Rating.Text = rank.Value --int value cell.Time.Text = mins.Value.."+"..secs.Value --2 int values cell.Position = UDim2.new(0,0,0.052,0) --pos |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 10:58 PM |
| @Dark still says its a nil value. So then how will the server be able to find the gui then? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jun 2015 11:02 PM |
| would it be because I am cloning the gui twice? Its cloned already, and then cloned again in the server event? |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 03 Jun 2015 11:12 PM |
Just wondering, but why are you using OnClientEvent. I haven't learned RemoteEvents that much yet, but aren't you supposed to something like "FireClient" or something...? Perhaps Im wrong on that. |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 03 Jun 2015 11:13 PM |
| Also, trying printing (local gui = player.PlayerGui:WaitForChild("Gui"):Clone()) |
|
|
| Report Abuse |
|
|