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: Simple Problem with GUI Message

Previous Thread :: Next Thread 
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
04 May 2014 09:38 PM
The only problems with this script is that it doesn't show the text form the other gui mentioned in the script, and it doesn't remove itself. Can someone help?

function mgdp()
coroutine.resume(coroutine.create(function()
local MsgText = Game.Lighting.MessageGui.TextLabel
local plr = game.Players:GetChildren()
if Game.Lighting:findFirstChild("VIPGui") ~= nil then
for i,plr in pairs (Game.Players:GetPlayers()) do
MsgText.Text = game.Lighting.VIPGui.MsgBox.Text---- This is where the text won't work

wait(0.1)
game.Lighting.MessageGui:clone().Parent = plr.PlayerGui
wait(4)
plr.PlayerGui.MessageGUI:Destroy()---- It doesn't remove itself right here for some reason. Help?

end
end
end))
end

script.Parent.MouseButton1Click:connect(mgdp)
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
04 May 2014 09:50 PM
Bump.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
04 May 2014 10:01 PM
Now, if I put "MsgText.Text = Gui.Text.."

It puts a random number, like this: 0.385759573

Please help!
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
04 May 2014 10:07 PM
No one here has any scripting knowledge?
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
04 May 2014 10:20 PM
I won't mess with coroutines, as a tutor is still teaching me them, but why not use a for loop?

local vipgui = game.Lighting:FindFirstChild("VIPGui")
local MsgText = game.Lighting.MessageGui.TextLabel
local clonegui = game.Lighting.MessageGui:Clone()

if vipgui ~= nil then
MsgText.Text = game.Lighting.MsgGui.MessageBox.Text --I think you messed up, because if i'm correct, MessageGui is a ScreenGui?
end

for i,v in pairs(game.Players:GetPlayers()) do
clonegui.Parent = v.PlayerGui
end

wait(4)

for i,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.MessageGui:Destroy()
end

wait(0.1)
for im,
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
04 May 2014 10:21 PM
Sorry, when I change the text, I forgot to put VIPGui when referring to it.
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
04 May 2014 10:24 PM
Sorry I sorta messed up my answer.

local vipgui = game.Lighting:FindFirstChild("VIPGui")
local MsgText = game.Lighting.MessageGui.TextLabel
local clonegui = game.Lighting.MessageGui:Clone()

if vipgui ~= nil then
MsgText.Text = game.Lighting.VIPGui.MsgBox.Text
end

wait(0.1)
for i,v in pairs(game.Players:GetPlayers()) do
clonegui.Parent = v.PlayerGui
end

wait(4)

for i,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.MessageGui:Destroy()
end

You can add the coroutines and guibutton etc, I think a for loop would work better for what you're trying to do.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 May 2014 12:07 AM
I use coroutines because they are useful for looping functions more smoothly. Without coroutines, functions can sometimes break when used too much.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 May 2014 12:17 AM
Thanks man. I never thought to use i,v in pairs to remove it. All I need help with now is stopping it from showing random numbers everytime
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