|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 04 May 2014 10:07 PM |
| No one here has any scripting knowledge? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 04 May 2014 10:21 PM |
| Sorry, when I change the text, I forgot to put VIPGui when referring to it. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|