of     1   

iIikeyou
#67543381Saturday, May 05, 2012 7:24 PM GMT

Alright,the script doesn't work at all... I use a second message to show when the script breaks, it never shows up (t, I mean) The script is supposed to put a period at the end of the sentance if one isn't there, capitalize the second letter after each period, make it all lowercase, capitalize the first letter, capitalize all the i's in the message, and put the player's name before the message it then removes any other messages by this admin before putting this new message in the workspace, if one is there. Here is the script, please mind the unnecessary length, I do like to make my scripts as best as I can; yet apparently I can't. game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(q) local t=Instance.new("Message",game.Workspace) local m=q:lower() t.Text=q wait(3) if m:sub(1,2)=="m/"then for i=3,100 do if m:sub(m:len())~="."then pcall(function()m:sub(m:len()+1)="."end) t.Text=m wait(3) end pcall(function()m:sub(1)=m:sub(1):upper()end) t.Text=m wait(3) if m:sub(i,i)=="."and i~=m:len()and i+1==" "and i+2 then pcall(function()m:sub(i+2)=m:sub(i+2):upper()end) t.Text=m wait(3) end if m:sub(i,i)=="i"then pcall(function()m:sub(i)=m:sub(i):upper()end) t.Text=m wait(3) t:Remove() end local f=Instance.new("Message",game.Workspace) if game:GetService("Workspace"):FindFirstChild("AnameNoBoDyElSeWillHAVe")then pcall(function()game:GetService("Workspace"):FindFirstChild("AnameNoBoDyElSeWillHAVe"):Remove()end) end pcall(function()f.Text=p.Name..": "..m end) pcall(function()f.Name="AnameNoBoDyElSeWillHAVe"end) pcall(function()game:GetService("Debris"):AddItem(f,5)end) end end end) end)
iIikeyou
#67543505Saturday, May 05, 2012 7:25 PM GMT

Here's the script without the message t and waits I used for testing... game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(q) local m=q:lower() if m:sub(1,2)=="m/"then for i=3,100 do if m:sub(m:len())~="."then pcall(function()m:sub(m:len()+1)="."end) end pcall(function()m:sub(1)=m:sub(1):upper()end) if m:sub(i,i)=="."and i~=m:len()and i+1==" "and i+2 then pcall(function()m:sub(i+2)=m:sub(i+2):upper()end) end if m:sub(i,i)=="i"then pcall(function()m:sub(i)=m:sub(i):upper()end) end local f=Instance.new("Message",game.Workspace) if game:GetService("Workspace"):FindFirstChild("AnameNoBoDyElSeWillHAVe")then pcall(function()game:GetService("Workspace"):FindFirstChild("AnameNoBoDyElSeWillHAVe"):Remove()end) end pcall(function()f.Text=p.Name..": "..m end) pcall(function()f.Name="AnameNoBoDyElSeWillHAVe"end) pcall(function()game:GetService("Debris"):AddItem(f,5)end) end end end) end)
iIikeyou
#67550027Saturday, May 05, 2012 8:52 PM GMT

Bump.
iIikeyou
#67550734Saturday, May 05, 2012 9:02 PM GMT

game.Players.PlayerAdded:connect(function(p)--Gets players p.Chatted:connect(function(q)--Gets messages local m=q:lower()--Just to make things easier if m:sub(1,2)=="m/"then--Testing to see if the command is being said for i=3,100 do--Will be used later on, to find certain characters in the message multiple times if m:sub(m:len())~="."then--Tests if the last character of the message is a period or not pcall(function()m:sub(m:len()+1)="."end)--Adds a period if one doesn't exist at the end end pcall(function()m:sub(1)=m:sub(1):upper()end)--Capitalizes the first character of the message if m:sub(i,i)=="."and i~=m:len()and i+1==" "and i+2 then--Tests if there's any periods in the sentance pcall(function()m:sub(i+2)=m:sub(i+2):upper()end)--Capitalizes the second letter after each period, if any end if m:sub(i,i)=="i"then--Finds all the "i"s in the message pcall(function()m:sub(i)=m:sub(i):upper()end)--Capitalizes them, since everything is lowercase end local f=Instance.new("Message",game.Workspace)--Makes the message if game:GetService("Workspace"):FindFirstChild("AnameNoBoDyElSeWillHAVe")then--Finds any previous messages by this script pcall(function()game:GetService("Workspace"):FindFirstChild("AnameNoBoDyElSeWillHAVe"):Remove()end)--Removes them, to stop spam end pcall(function()f.Text=p.Name..": "..m end)--Puts the name of whom spoke before the message pcall(function()f.Name="AnameNoBoDyElSeWillHAVe"end)--So this message won't be confused with other items when the script removes it to stop spam pcall(function()game:GetService("Debris"):AddItem(f,5)end)--Auto-delete incase the message isn't removed because someone uses the command again end end end) end) That explains what everything is for, since this is all a bit confusing the way I put it together... Sorry for that.
crazyman32
#67551059Saturday, May 05, 2012 9:07 PM GMT

If you learned gsub, life would be so much easier for ya :P
wwemaniac99
#67551310Saturday, May 05, 2012 9:11 PM GMT

Crazy, can you explain how your API Bug Tester works? I can't figure out how to use it on my broken scripts.
iIikeyou
#67551925Saturday, May 05, 2012 9:20 PM GMT

Eh, well gsub basically.. well, is this the right format for it, anyway? string.gsub(m,"i","I") Would that change the i's in the string(message) into I's?
crazyman32
#67556954Saturday, May 05, 2012 10:40 PM GMT

Yes, it's basically 'replace' like in most languages. Java: (STRING).replace("This","That"); Lua: (String):gsub("This","That")

    of     1