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: Projecting A GUI Message.

Previous Thread :: Next Thread 
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 01:04 PM
So I want to ge this function to be a message function. But I cant name the function. I want it to be a message script. I think It should project to all the players at once. Not to sure. But, with I want it to get called like this... msg("text", 3, 0.05) like that. But... I cant call it with the msg() function because i had to change it with a Coroutine. So how would I call the function msg()? Instead of calling nothing. I dont know how. And I tried calling it a thread function. But it didn't help. Please help! Thanks!

coroutine.resume(coroutine.create(function(text, time, typespeed)
tick:Play()
pl = game.Players:GetChildren()
for i = 1,#pl do
s = Instance.new("ScreenGui")
s.Parent = pl[i].PlayerGui
s.Name = "Message"
f = Instance.new("Frame")
f.Parent = s
f.BackgroundTransparency = 1
f.Size = UDim2.new(0.5, 0, 0.04,0)
f.Position = UDim2.new(0.25, 0, 0.05, 0)
f.BackgroundColor3 = Color3.new(0,0,0)
f.BorderSizePixel = 0
txt = Instance.new("TextLabel")
txt.Parent = f
txt.FontSize = 6
txt.Font = "ArialBold"
txt.TextColor3= Color3.new(1,1,1)
txt.Position = UDim2.new(0.5, 0, 0.5, 0)
txt.TextTransparency = 0
txt.Text = ""
for u = 1,0,-0.1 do
wait()
f.BackgroundTransparency = u
txt.TextTransparency = u
end
for i = 1,string.len(text),1 do
txt.Text = string.sub(text,1,i)
wait(typespeed)
end
wait(time)
for u = 0,1,0.1 do
wait()
f.BackgroundTransparency = u
txt.TextTransparency = u
end
s:remove()
end
end))
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 03:37 PM
Help... --Bump--
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 03:39 PM
Please...
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
29 Sep 2012 03:41 PM
output?
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 03:44 PM
Output Summary : Can't use msg("text", 3, 0.5) The function itself isnt message anymore. When I add, function msg(text, time, typespeed) before it, it will not work. It will sound and then no message and it will continue to do that.
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
29 Sep 2012 03:45 PM
It's in a coroutine, so it won't give the output anything...
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 03:46 PM
No it does, it wont let me call the function with msg(info).
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 03:47 PM
I want it to let me call it with msg(dfladfma) so I can make it easier to do. And I want it to show to alllll the players at once.
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 07:30 PM
Still looking for help.
Report Abuse
ToontownROXYA is not online. ToontownROXYA
Joined: 02 Aug 2010
Total Posts: 434
29 Sep 2012 07:33 PM
Bump merpy
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
29 Sep 2012 09:16 PM
What you're doing right now won't actually declare any function that the rest of your code can call, it will just declare a temporary function and start it right away without any arguments getting passed to it. What you want is something like this:

function ShowMessage(text, time, typespeed)
Spawn(function()

...rest of code

end)
end

Where you're declaring the function as normal, but when the fuction gets called, rather than doing the work in the call, it creates a new thread to do the work (use spawn for this as shown rather than coroutine.*), and the returns right away.

Alternatively you could just make the call blocking (that's what you call it when it may not return right away) and call it like this rather than normally when you don't want to halt the calling code:

Spawn(function() ShowMessage("Blah", 10, 0.2) end)
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