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: Tell me what's wrong with this script?

Previous Thread :: Next Thread 
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:43 AM
host = Workspace.rtardbob123
orbowner = {'rtardbob123'}


function onChatted(msg, speaker)
for i, v in pairs(orbowner) do
if v:lower() == Player.Name.lower() then
if msg:sub(1, 4) == '//ff' then
Instance.new('ForceField', host)
end
end
end

game.Players.Chatted:connect(function(msg) onChatted(msg, player) end) end
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:44 AM
Chatted is an event of Player, not Players. Change your connection line.
Report Abuse
ConnorJ14 is not online. ConnorJ14
Joined: 05 Jul 2013
Total Posts: 1025
09 Jul 2013 12:45 AM
Why did you make orbowner a table instead of just a string?
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:46 AM
didn't work
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:46 AM
why not @ connor
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:47 AM
@Connor: Because this way you can have multiple people who can use it.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:47 AM
What is your new code?
Report Abuse
ConnorJ14 is not online. ConnorJ14
Joined: 05 Jul 2013
Total Posts: 1025
09 Jul 2013 12:47 AM
Okay. I'm just asking because I'm learning scripting right now and tables are one of the things I'm studying.
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:48 AM
function onChatted(msg, speaker)
for i, v in pairs(orbowner) do
if v:lower() == Player.Name.lower() then
if msg:sub(1, 4) == '//ff' then
Instance.new('ForceField', host)
end
end
end

game.Player.Chatted:connect(function(msg) onChatted(msg, player) end) end
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:48 AM
I love tables.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:50 AM
No, no, no. What you do is first connect Players.PlayerAdded, getting the player in the process. Then you connect Player.Chatted, getting the message. Then you call your script (Although you could combine the connection lines and the function into one, reducing lag and unneeded lines of code)
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:53 AM
still didn't work
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:55 AM
...New code?
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:56 AM
function onChatted(msg, speaker)
for i, v in pairs(orbowner) do
if v:lower() == Player.Name.lower() then
if msg:sub(1, 4) == '//ff' then
Instance.new('ForceField', host)
end
end
end

game.Players.PlayerAdded:connect(function(msg)game.Player.Chatted:connect(function(msg) onChatted(msg, player) end) end) end




tbh
i hate functions
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 12:57 AM
Change msg in the PlayerAdded event to player, and game.Player to just player

New to events?
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 12:59 AM
ya im new to events
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 01:01 AM
omg
still doesn't work
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
09 Jul 2013 01:15 AM
;-;
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Jul 2013 01:17 AM
Output?
(View->Output)
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