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: What's wrong with this script

Previous Thread :: Next Thread 
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
07 Jun 2013 09:38 AM
B0B = {"rtardbob123"}
function onChatted(msg, player)
for i, v in pairs(B0B) do
if v:lower == player.Name:lower() then
if msg:sub(1, 2) == "m/" then
loadstring(cmd1)()
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
07 Jun 2013 09:41 AM
Uhm, this is totally not valid Lua. Check the output, you need 4 ends to end your function, for loop and 2 if lines.
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
07 Jun 2013 09:42 AM
@Job
It says i need a function argument near '=='
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
07 Jun 2013 09:46 AM
on the
for i,v in pairs(B0B)
B0B has to be a place like
B0B = game.Players:findFirstChild("rtardbob123")
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
07 Jun 2013 09:47 AM
B0B = {"rtardbob123"}
function onChatted(msg, player)
for i, v in pairs(B0B) do
if v:lower == player.Name:lower() then
if msg:sub(1, 2) == "m/" then
loadstring(cmd1)()

The problem that I see, here, is that 'cmd1' doesn't exist, you're missing four 'end's, and you need to call the onChatted function. Where's the rest of the script?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
07 Jun 2013 09:47 AM
Table B0B is fine, by the way.
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
07 Jun 2013 09:48 AM
heres the whole script

print("Loading commands")
cmd1 = [[ Instance.new("Message", Workspace ]]
cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]]
cmd3 = [[ Instance.new("Hint", Workspace) ]]
shutdown = [[ Workspace:ClearAllChildren() ]]
banland = [[ game.Players:ClearAllChildren() ]]
print("Commands loaded.")

B0B = {"rtardbob123"}
function onChatted(msg, player)
for i, v in pairs(B0B) do
if v:lower == player.Name:lower() then
if msg:sub(1, 2) == "m/" then
loadstring(cmd1)()
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
07 Jun 2013 09:55 AM
and i know im missing 4 ends
i want to fix it before adding ends
Report Abuse
qdhxx is not online. qdhxx
Joined: 02 Jul 2010
Total Posts: 56658
07 Jun 2013 10:13 AM
It can't work without ends.

http://www.youtube.com/watch?v=nalf5DAkQ40
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
07 Jun 2013 10:14 AM
with ends it still errors

Error:
09:55:25.642 - Workspace.Script:14: function arguments expected near '=='
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
07 Jun 2013 10:15 AM
print("Loading commands")
cmd1 = [[ local m = Instance.new("Message", Workspace ]]
cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]]
cmd3 = [[ local h = Instance.new("Hint", Workspace) ]]
shutdown = [[ Workspace:ClearAllChildren() ]]
banland = [[ game.Players:ClearAllChildren() ]]
print("Commands loaded.")

B0B = {"rtardbob123"}
function onChatted(msg, player)
for i, v in pairs(B0B) do
if v:lower == player.Name:lower() then
if msg:sub(1, 2) == "m/" then
loadstring(cmd1)()

--------------------------OR--------------------------

remove the shortcuts and put cmd1 ... etc inside the function like so.

print("Loading commands")
cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]]
cmd3 = [[ Instance.new("Hint", Workspace) ]]
shutdown = [[ Workspace:ClearAllChildren() ]]
banland = [[ game.Players:ClearAllChildren() ]]
print("Commands loaded.")

B0B = {"rtardbob123"}
function onChatted(msg, player)
for i, v in pairs(B0B) do
if v:lower == player.Name:lower() then
if msg:sub(1, 2) == "m/" then
Instance.new("Message", Workspace
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
07 Jun 2013 10:18 AM
Still errors @ pre
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
07 Jun 2013 10:23 AM
Friday Jun 07 15:08:56 2013 - Workspace.Script:2: '=' expected near 'if'
Friday Jun 07 15:08:56 2013 - Workspace.Script:2: unexpected symbol near 'if'
Friday Jun 07 15:08:56 2013 - Workspace.Script:2: function arguments expected near 'if'
Errors on the beginning of a line are often because an incomplete previous line.

From the wiki maybe this will help
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
07 Jun 2013 10:25 AM
lol it helped me...

on cmd1 you are missing parenthesis to close the Instance.new("Message", workspace)
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
07 Jun 2013 10:27 AM
print("Loading commands")
cmd1 = [[ Instance.new("Message", Workspace).Text = "Hello" ]]
cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]]
cmd3 = [[ Instance.new("Hint", Workspace).Text = "Hello" ]]
shutdown = [[ Workspace:ClearAllChildren() ]]
banland = [[ game.Players:ClearAllChildren() ]]

print("Commands loaded.")

B0B = {"rtardbob123"}

function onChatted(msg, player)
local msg = msg:lower()
if string.sub(msg,1,2) == "m/" then
loadstring(cmd1)()
end
end

game.Players.ChildAdded:connect(function(Player)
local Player = Player --This is probably not needed, it's just a habit of mine.
Player.CharacterAdded:wait()
for k,v in pairs(BOB) do if v:lower()==Player.Name:lower() then

Player.Chatted:connect(function(msg)
onChatted(msg,Player)
end)

end end
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