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 » Scripting Helpers
Home Search
 

Re: Gui for each player

Previous Thread :: Next Thread 
veerstrong is not online. veerstrong
Joined: 23 Jun 2009
Total Posts: 2450
18 Aug 2012 02:16 AM
Can someone tell me how to make a GUI pop-up in everyone player's GUI through a script?
I am new to GUI's so, please tell.
Also, it would be helpful if you inserted a TextButton in it, that says
script.Parent.Parent.Parent.Parent.Parent.Parent.Name " Has done it!"
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 02:19 AM
use a for loop to cycle through every player, and create a PlayerGui with a TextLabel in it with your text. You'll also need to size and position the TextLabel.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
18 Aug 2012 02:29 AM
Monkey probably just had the most inefficient solution to this problem that has ever been conceived. Unfortunately it is also the most widely used and easiest to understand.

The way I would do it is hook up BindableEvents inside every player's PlayerGui when they spawn, then connect the events to display the GUI when fired. Then you hook up the events to fire when a value in the workspace is changed. Once that's done you can just change the value to easily, quickly, and efficiently display the GUI. An extra pro to this is the ability to pass arguments through events, so you can pass a string argument that would end up as the text on the GUI or whatever.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 02:36 AM
> "it is also the most widely used and ***easiest to understand***"

Hmm, why did I not post something I would use?
:|
Report Abuse
StygianBlade is not online. StygianBlade
Joined: 15 Sep 2011
Total Posts: 426
18 Aug 2012 02:44 AM
"Monkey probably just had the most inefficient solution to this problem that has ever been conceived. Unfortunately it is also the most widely used and easiest to understand."

Iterate through players and create a GUI for each of them. . .? If you consider that ineffecient then you've probably been coding more than what's good for you. What you posted is just extra work, and if anything I'd call that ineffecient.. no offence
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 02:48 AM
The layout he proposed is inefficient in terms of script length and simplicity, but very effective in terms of quality, expandability, and longevity (Guis don't disappear when the player respawns)
Report Abuse
veerstrong is not online. veerstrong
Joined: 23 Jun 2009
Total Posts: 2450
18 Aug 2012 02:49 AM
How would I make the GUI cooler though?

t = game.Players.LocalPlayer.Name
active = false
debounce = false
function smelly(iscool)
if debounce == false then
if active == false then
debounce = true
Workspace.shiny.Value = false
for i = 0,25 do
for _,v in pairs(Workspace.Walls:GetChildren()) do
v.CFrame = v.CFrame*CFrame.new(0,1,0)
end
wait()
end
game.Lighting.Map2:Clone().Parent = Workspace

for i = 0,32 do
Workspace.Door1.CFrame = Workspace.Door1.CFrame*CFrame.new(-1,0,0)
Workspace.Door2.CFrame = Workspace.Door2.CFrame*CFrame.new(1,0,0)
wait()
end
wait(1)
local screen, text = Instance.new('ScreenGui'), Instance.new('TextLabel')
text.Text = script.Parent.Parent.Parent.Parent.Parent.Name .. " Has pushed the button!"
text.Position = UDim2.new(0, 300, 0, 50)

wait(.5)

for i,v in ipairs(game.Players:GetPlayers()) do
local lscreen, ltext = screen:clone(), text:clone()
ltext.Parent = lscreen
lscreen.Parent = v.PlayerGui
end
debounce = false
active = true
else
if debounce == false then
if active == true then
m = Instance.new("Message", game.Workspace)
m.Text = t.. " is deactivating Map 2"
wait(3)
m:Remove()
wait(1)
for i = 0,32 do
Workspace.Door1.CFrame = Workspace.Door1.CFrame*CFrame.new(1,0,0)
Workspace.Door2.CFrame = Workspace.Door2.CFrame*CFrame.new(-1,0,0)
wait()
end

Workspace.Map2:Remove()
for i = 0,25 do
for _,v in pairs(Workspace.Walls:GetChildren()) do
v.CFrame = v.CFrame*CFrame.new(0,-1,0)
wait(.01)
end
end
active = false
debounce = false
Workspace.shiny.Value = true
end
end
end
end
end
script.Parent.MouseButton1Click:connect(smelly)
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 02:51 AM
Where is this script located.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
18 Aug 2012 02:53 AM
"What you posted is just extra work, and if anything I'd call that ineffecient.. no offence"

Say you're doing some CFrame animation and you need an efficient way to make it as smooth as possible.

You can either type "3.141592 65459" or "math.pi". math.pi is less efficient because it calls from the C-side but "3.141592 65459" is more work. The easiest way isn't always the most efficient way.

And what if he has a massive game? I'm making a massive game and I have to use methods like this or server-client communication is virtually nonexistent. The most efficient way is always the way you should go, even if it takes more time.
Report Abuse
StygianBlade is not online. StygianBlade
Joined: 15 Sep 2011
Total Posts: 426
18 Aug 2012 03:08 AM
"You can either type "3.141592 65459" or "math.pi". math.pi is less efficient because it calls from the C-side but "3.141592 65459" is more work. The easiest way isn't always the most efficient way."

Oh come now, if you're going to bother with something as small as writing out the digits of pi instead of simply using math.pi you hardly deserve to be called a scripter ;) I know the easier way isn't always the best but you've always got to use common sense with stuff like that, espcially when it starts affecting readability.

"And what if he has a massive game? I'm making a massive game and I have to use methods like this or server-client communication is virtually nonexistent."

hehe I'll have to disagree with you here. I'm also making a big game(on a different account) with a bunch of GUI's and none of them go that far. Well actually I did end up using server-side scripts to generate an entire Shop-GUI and most all my other GUI objects(It was a bit of a drag, but worth it). Anyways it may be because I've never actually worked with bindable events but IMO what you posted seems to have little to no benifits compared to the normal way of doing things
Report Abuse
StygianBlade is not online. StygianBlade
Joined: 15 Sep 2011
Total Posts: 426
18 Aug 2012 03:10 AM
Also @ Thread Creator;

Stick to one thread?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 03:19 AM
^ yes plz

BindableEvents nor BindableFunctions can communicate client-server :c
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
18 Aug 2012 03:27 AM
"Oh come now, if you're going to bother with something as small as writing out the digits of pi instead of simply using math.pi you hardly deserve to be called a scripter ;) I know the easier way isn't always the best but you've always got to use common sense with stuff like that, espcially when it starts affecting readability."

It was an example, not meant to be perceived as a perfect representation of every possible situation. And yes, calling the C-side 30,000 times would slow down you game much more than doing 30,000 maths. Of course you aren't doing this for everything but if you don't care about optimization and efficiency then you might as well be.


"IMO what you posted seems to have little to no benifits compared to the normal way of doing things"

If you were to make a game with monkey's method and then make the same game with mine, you would see a massive increase in performance.


"BindableEvents nor BindableFunctions can communicate client-server :c"

You sure? Because I'm pretty sure I have a working game that uses them. Not uploaded right now, but it works.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 03:39 AM
@arceus
Stop comparing yourself to my suggestion, I made a low-level suggestion, with room for IMPROVEMENT SO THEY CAN LEARN. Sorry. Next time I promise to blast learning kids with complicated technical jargon to make the perfect solution, just for you. No, stop criticizing me helping them with an example of exactly what they asked for in a simple way, and nothing more. In no way am I saying your solution is not as good as my beginner suggestion. You gave detailed instructions and suggested that you could go far beyond what they asked for, and I agree that is would be beautiful. I know what I am doing, please don't compare one quick suggestion I gave to yourself. Also, I challenge you to a maths duel.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
18 Aug 2012 03:41 AM
"Stop comparing yourself to my suggestion, I made a low-level suggestion, with room for IMPROVEMENT SO THEY CAN LEARN. Sorry. Next time I promise to blast learning kids with complicated technical jargon to make the perfect solution, just for you. No, stop criticizing me helping them with an example of exactly what they asked for in a simple way, and nothing more. In no way am I saying your solution is not as good as my beginner suggestion. You gave detailed instructions and suggested that you could go far beyond what they asked for, and I agree that is would be beautiful. I know what I am doing, please don't compare one quick suggestion I gave to yourself. Also, I challenge you to a maths duel."

Cool. I accept you math challenge.
Report Abuse
Ubayla is not online. Ubayla
Joined: 01 Dec 2008
Total Posts: 157
18 Aug 2012 04:53 AM
Why type 3.14159265358979 when you can just do mathpi = math.pi? It only calls it once.

Wow! Nerd debate! I love scripters. By the way, can I know the winner of the math duel?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 04:58 AM
It died and we became friends. ._.
I CHALLENGE YOU TO A DUEL ​>8D
Report Abuse
Ubayla is not online. Ubayla
Joined: 01 Dec 2008
Total Posts: 157
18 Aug 2012 05:00 AM
Me? I accept, as long as it's only things like 2 + 2 = 5, 9001 ^ 0 = 1 * 3.1 ^ 0, etc.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 05:05 AM
WAT ----- is your name?

WAT ----- is your favourite calar?

WAT ----- is the airspeed velocity of an unladen swallow?
Report Abuse
Ubayla is not online. Ubayla
Joined: 01 Dec 2008
Total Posts: 157
18 Aug 2012 05:07 AM
1. Ubayla. 2. Black. 3. South African or European?
Report Abuse
Ubayla is not online. Ubayla
Joined: 01 Dec 2008
Total Posts: 157
18 Aug 2012 05:10 AM
By the answer for #3 I mean What do you mean? An African or European swallow?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 05:28 AM
AHHHHHHHHHHHHHHHHHHHHHHHHHHhhhhhhhhhhh
Report Abuse
Ubayla is not online. Ubayla
Joined: 01 Dec 2008
Total Posts: 157
18 Aug 2012 05:36 AM
Do I win?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 05:41 AM
"posebly" as I have seen it spelled before.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
18 Aug 2012 05:43 AM
Now let's look at Fourier Transforms! yaaaay!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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