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: FILTERING ENABLED Parenting a gui to the playergui

Previous Thread :: Next Thread 
Cyber6210 is not online. Cyber6210
Joined: 11 Apr 2016
Total Posts: 110
23 Oct 2017 10:01 AM
So i have a button and on click it should clone the gui from ServerStorage and put it into the players PlayerGui. Does anyone know how to fix this script?

local Message1 = game.ReplicatedStorage:WaitForChild("Message1")

Message1.OnServerEvent:connect(function()
game.ServerStorage.Message1:Clone().Parent = game.Players. --How do i get it in the player that clicked the button?

end)

I have a RemoteEvent in replicated storage and a local script along with a text button in a surface gui in a part in workspace but im pretty sure they work.

This is the script in ServerScriptService that needs to clone it into the player but im having difficulties getting it into the player.
Report Abuse
mybowls72 is online. mybowls72
Joined: 05 Aug 2013
Total Posts: 2688
23 Oct 2017 10:03 AM
Stop.
Report Abuse
helloburp is not online. helloburp
Joined: 26 Aug 2011
Total Posts: 14376
23 Oct 2017 10:05 AM
Just start with it in the player, no need to do all this complicated stuff.
Report Abuse
Cyber6210 is not online. Cyber6210
Joined: 11 Apr 2016
Total Posts: 110
23 Oct 2017 10:05 AM
No because i need it to appear only when its clicked.
Report Abuse
IsraelGamer101 is not online. IsraelGamer101
Joined: 19 Sep 2016
Total Posts: 138
23 Oct 2017 10:06 AM
Message1.OnServerEvent:connect(function()
local clonee = game.ServerStorage.Message1:Clone()
clonee.Parent = game:GetService("Players").LocalPlayer

end)
Report Abuse
IsraelGamer101 is not online. IsraelGamer101
Joined: 19 Sep 2016
Total Posts: 138
23 Oct 2017 10:07 AM
clonee.Parent = game:GetService("Players").LocalPlayer.PlayerGui
Report Abuse
IsraelGamer101 is not online. IsraelGamer101
Joined: 19 Sep 2016
Total Posts: 138
23 Oct 2017 10:09 AM
try this and tell me if its working
Report Abuse
Cyber6210 is not online. Cyber6210
Joined: 11 Apr 2016
Total Posts: 110
23 Oct 2017 12:05 PM
O yeah do i need a click detector?
Report Abuse
Cyber6210 is not online. Cyber6210
Joined: 11 Apr 2016
Total Posts: 110
23 Oct 2017 12:08 PM
Cuz right now its no use.
Report Abuse
IsraelGamer101 is not online. IsraelGamer101
Joined: 19 Sep 2016
Total Posts: 138
23 Oct 2017 12:31 PM
put the local script inside the textbutton
and in the local script:
local Message1 = game.ReplicatedStorage:WaitForChild("Message1")

script.Parent.MouseButton1Click:connect(function()
Message1:FireServer()
end)
Report Abuse
IsraelGamer101 is not online. IsraelGamer101
Joined: 19 Sep 2016
Total Posts: 138
23 Oct 2017 01:02 PM
i made it work!! what you need is script in ServerScriptService
script:

game.Players.PlayerAdded:connect(function(plr)
local NewClone = game.ServerStorage.ScreenGui:Clone()
NewClone.Parent = plr.PlayerGui
end)


and script inside the textbutton
script:

script.Parent.MouseButton1Click:connect(function()
local player = game:GetService("Players").LocalPlayer
player.PlayerGui.ScreenGui.Enabled = true
end)

and you need to disabled the ScreenGui
enjoy :p
Report Abuse
Cyber6210 is not online. Cyber6210
Joined: 11 Apr 2016
Total Posts: 110
24 Oct 2017 03:11 AM
Thank you!
I sort of gave up and was going to try collision instead of buttons but you help! =P
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