Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --coroutine.wrap(function()while wait(5) do math.randomseed(tick()+math.random(-5,5))end end)()
- local keyboard={[0]='~!@#$%^&*()_+',[1]='`1234567890',[2]=[[ qwertyuiop[]\]],[3]='Aasdfghjkl;\'',
- [4]='Zzxcvbnm,./'}
- for layer,v in pairs(keyboard) do
- keyboard[layer]={}
- for letter in string.gmatch(v,'(.)') do
- keyboard[layer][#keyboard[layer]+1]=letter
- end
- end
- local function MiniRandom(r1,r2,step)
- local p={}
- for i = r1,r2,step do p[#p+1]=i end
- return p[math.random(#p)]
- end
- function AttemptLetter(l)
- --print'----------'
- if l == ' ' or nil then return ' ' end
- local pos,layer
- for lay,letters in pairs(keyboard) do
- for ind,let in pairs(letters) do
- if let:lower()==l:lower() then
- pos,layer=ind,lay
- break
- end
- end
- end
- --print('index '..tostring(pos))
- if not layer or not pos then return l end
- local layer_miss=math.random(1,55)==33
- if layer_miss then
- --print'missed layer'
- local up=math.abs(1-layer)--I didn't include 0 because yea
- local down=math.abs(3-layer)
- local new_layer
- local p
- new_layer=layer+((up==0 and -1)or (down==0 and 1)or 1)
- while keyboard[new_layer]==nil do
- --print'new layer'
- new_layer=layer+math.random(-4,4)
- end
- local original=keyboard[layer]
- local offset=keyboard[new_layer]
- local testpos1=pos
- local testpos2=pos
- local p2
- local p3
- while p==nil do
- testpos1=testpos1+1
- if offset[testpos1] ~= nil then
- p2=testpos1
- --break
- end
- testpos2=testpos2-1
- if offset[testpos2] ~= nil then
- p3=testpos2
- --break
- end
- if p2 and not p3 then
- --print'p2 avaiblab;e'
- p=p2 break
- elseif not p2 and p3 then
- --print'p3 avaible'
- p=p3 break
- elseif p2 and p3 then
- --print'both available'
- local r=math.random(1,2)==2
- if r then
- p=p2
- else
- p=p3
- end
- break
- end
- end
- --print('p: '..tostring(p))
- --print'--------'
- return (l:upper()==l and keyboard[new_layer][p]:upper()) or keyboard[new_layer][p]
- else
- --print'no jump'
- local min=1
- local max=#keyboard[layer]
- local p=pos
- local left=math.abs(min-p)
- local right=math.abs(max-p)
- local rand=math.random(1,6)
- local p2
- local p3
- if rand==6 then
- --print'shift 2'
- if left == 0 and right>=2 then
- --print'move right'
- p=p+2
- elseif right==0 and left>=2 then
- --print'move left'
- p=p-2
- else
- --print'move left/right'
- p2=math.min(p+2,max)
- p3=math.max(p-2,min)
- local rand2=math.random(1,2)
- p=(rand2==1 and p2) or p3
- --print('p: '..tostring(p))
- end
- else
- if left==0 and right>=1 then
- --print'move right'
- p=p+1
- elseif right==0 and left>=1 then
- --print'move left'
- p=p-1
- else
- --print'left/right'
- p2=math.min(p+1,max)
- p3=math.max(p-1,min)
- local rand2=math.random(1,2)
- p=(rand2==1 and p2) or p3
- end
- end
- --print('p: '..tostring(p))
- --print'---------'
- return (l:upper()==l and keyboard[layer][p]:upper()) or keyboard[layer][p]
- end
- end
- --[[for _,v in pairs(keyboard) do
- for __,vv in pairs(v) do
- local a=AttemptLetter(vv)
- local b=AttemptLetter(vv)
- local c=AttemptLetter(vv)
- if a==nil or b==nil or c==nil then print('wtf?? '..vv,_)end
- end
- end]]--
- local function Type(t,o,p,f)
- local progress=p or 1
- for i = progress,string.len(t) do
- wait(MiniRandom(.06,.1,.01))
- o.Text=string.sub(t,1,i)..' |'
- local chance=math.random(1,3)
- if chance==3 and i~=1 and string.sub(t,i,i)~=' ' then
- local d=math.random(1,6)
- if d==1 or d==2 then
- local add
- if d==1 then
- add=math.random(2,5)
- else
- add=math.random(2,3)
- end
- if string.sub(t,i+add,i+add)~=nil then
- local c=string.sub(t,1,i-1)
- --local add=math.random(2,3)
- for i2 = 1,add do
- --print('this is nil sometimes?: '..tostring(string.sub(t,i+(i2),i+(i2))))
- c=c..AttemptLetter(string.sub(t,i+(i2),i+(i2)))
- o.Text=c..' |'
- wait(MiniRandom(.08,.15,.01))
- end
- wait(.3+MiniRandom(-.2,.25,.1))
- for i3 = 1,add do
- wait(MiniRandom(.09,.2,.01))
- o.Text=string.sub(c,1,string.len(c)-i3)..'|'
- end
- Type(t,o,i,f)
- break
- end
- else
- o.Text=string.sub(t,1,i-1)..AttemptLetter(string.sub(t,i,i))..' |'
- wait(.3+MiniRandom(-.2,.25,.1))
- o.Text=string.sub(t,1,i-1)..'|'
- wait(.1+MiniRandom(-.08,.04,.01))
- Type(t,o,i)
- break
- end
- end
- end
- o.Text=string.sub(t,1,string.len(t))
- end
- local a=Instance.new('ScreenGui',game.StarterGui)
- local tl=Instance.new('TextLabel',a)
- tl.Position=UDim2.new(0.5,0,0.5,0)
- tl.Size=UDim2.new(1,0,1.4,0)
- tl.Position=tl.Position-UDim2.new(0,tl.AbsoluteSize.X/2,0,tl.AbsoluteSize.Y/2)
- tl.BackgroundTransparency=1
- tl.TextWrapped=true
- tl.FontSize=Enum.FontSize.Size36
- tl.TextXAlignment=Enum.TextXAlignment.Left
- Type('Hello redditors! this is a test to simulate typos! Me may be bad at typing, but me are master scripter!!! :D me=master, ok :D :D :D oopsy doops. There was once an ugly barnacle so ugly that everyone died, the end. - patrick star It\'s fun scripting on roblox :D Test 123, I wont miss this letter "p"',tl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement