generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Clone Gui To Players With Remote Event

Previous Thread :: Next Thread 
TimeTicks is not online. 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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
03 Jun 2015 08:53 PM
HELP
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
03 Jun 2015 08:55 PM
b2
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
03 Jun 2015 08:58 PM
b3
Report Abuse
rayk999 is not online. 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
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
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 is not online. 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 is not online. 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
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
03 Jun 2015 10:08 PM
That's funny! It's almost as if I already told you that would happen.
Report Abuse
TimeTicks is not online. 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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
03 Jun 2015 10:18 PM
please help.. :/
Report Abuse
TimeTicks is not online. 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 is not online. 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
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
03 Jun 2015 10:42 PM
What kind of properties of the gui do you need to send?
Report Abuse
Darkenus is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image