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: Anyway to shorten this?

Previous Thread :: Next Thread 
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 06:51 PM
msg = script.Parent

msg.Text = "h"
msg.Text = "hi"
msg.Text = "hi "
msg.Text = "hi d"
msg.Text = "hi de"
msg.Text = "hi der"
Report Abuse
BetaGrey361 is not online. BetaGrey361
Joined: 27 Jun 2014
Total Posts: 118
31 Jul 2014 06:55 PM
since there isn't any "wait()" in it, it instantly becomes "hi der". So, you can skip everything before the final 'msg.Text', because that wouldn't be shown.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 06:59 PM
msg.Text = "h"
wait(0.1)
msg.Text = "hi"
wait(0.1)
msg.Text = "hi "
wait(0.1)
msg.Text = "hi d"
wait(0.1)
msg.Text = "hi de"
wait(0.1)
msg.Text = "hi der"
wait(0.1)
print("done")

how bout that?
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
31 Jul 2014 07:01 PM
alt+f4

hi junior
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 07:01 PM
any help?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
31 Jul 2014 07:02 PM
http://wiki.roblox.com/index.php?title=String_manipulation

local FullText = "hi der"
local FullTextLength = string.len(FullText)
for i = 1, FullTextLength do
msg.Text = string.sub(FullText, 1, i)
wait(.1)
end
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
31 Jul 2014 07:03 PM
txt = "Test"
len = string.len(txt)
len2 = 1
for i = 0,len do
print(string.sub(txt,1,len2))
len2 = len2+1
end
len2 = 0
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
31 Jul 2014 07:03 PM
local msg='hi der'
for i=1,#msg do
print(msg:sub(1,i))
wait(.1)
end
Report Abuse
greencoolman8 is not online. greencoolman8
Joined: 22 Sep 2012
Total Posts: 82
31 Jul 2014 07:03 PM
local msgs = {"h","hi","hi d","hi de","hi der"}
c=1
while wait(.1) do
c=c+1
end
msg.Text = msgs[c]
Report Abuse
789cab is not online. 789cab
Joined: 13 Jul 2009
Total Posts: 3145
31 Jul 2014 07:03 PM
local msg = Instance.new("Message", script.Parent)

a = .5

msg.Text = "h"
wait(a)
msg.Text = "hi"
wait(a)
msg.Text = "hi "
wait(a)
msg.Text = "hi d"
wait(a)
msg.Text = "hi de"
wait(a)
msg.Text = "hi der"

|| 6,700/10,000 RAP | | Send me trades! || R$856
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 07:03 PM
nvm for my latest post, the timing is real.

thanks swmaniac.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 07:04 PM
wow its like 4 posts in 5 seconds.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
31 Jul 2014 07:04 PM
Did I just ninja 4 separate people?
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
31 Jul 2014 07:07 PM
txt = "I got ninja'd" len = string.len(txt) for i = 0,len do print(string.sub(txt,1,i)) wait(.1) end
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
31 Jul 2014 07:08 PM
function type(m, s, p)
local p = (p or "Text")
for x = 1, #s, 1 do
m[p] = s:sub(1, x)
wait(1/30)
end
end


local msg = Instance.new("Message", Workspace)
type(msg, "hello there!")


local model = Instance.new("Model", Workspace)
type(model, "Hello there!", "Name")
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 07:11 PM
@maniac

when i used yours I got this
01:06:46.047 - Players.Player1.PlayerGui.script:381: bad argument #1 to 'len' (string expected, got nil)
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 07:12 PM
Thank you everybody
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
31 Jul 2014 07:15 PM
@Miro

Post the code around where you inserted my script. My code works as far as I can tell.
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
31 Jul 2014 07:16 PM
wow, everyone who posted were between 2008-2014'ers
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
31 Jul 2014 07:18 PM
I made this a couple of weeks ago when I was bored and just mashing things together, it looks cool

I wanna make a less thrown together one but I'm too lazy



function randomString(length)
local returnString = ""
for _ = 1, math.abs(math.ceil(length)) do
local number, LETTER, letter, choice = math.random(49, 57), math.random(65, 90), math.random(97, 122), math.random(0, 2)
returnString = returnString .. string.char(choice == 0 and number or (choice == 1 and LETTER or letter))
end
return returnString
end

function code(o, p, t)
local s = "0123456789QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm"
local c = ""
for x = 1, #t do
if t:sub(x, x):byte() ~= 32 then
for y = 1, 10 do
local r = math.random(1, #s)
o[p] = c .. randomString((#t - x) + 1)
wait(1/30)
end
end
c = t:sub(1, x)
o[p] = c
end
end
Instance.new("Message", Workspace)
code(workspace.Message, "Text", "Hello this is a test")
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 08:20 PM
@maniac

Nvm about that i found an error in my script so dont wrry bout tht.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Jul 2014 08:21 PM
I like the code 128gb.
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