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: .Chatted

Previous Thread :: Next Thread 
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
19 May 2012 02:22 PM
Allowed = {"tehepicford", "OtherPlayer"}
Online = {}


game.Players.PlayerAdded:conenct(function(player)
for i,v in ipairs(Allowed) do
if player.Name == v then

table.insert(Online, player.Name)
end
end

for i,v in ipairs(Online) do
[Online].Chatted:conenct(function(msg)

H = Instance.new("Message", Workspace)
H.Text = "Worky!"

end)
end
end)


Im not good at all on .Chatted
I would like this fixed.
Not a BETTER version, Just a fixed version.

And IF there is only a way to make a new one.
Tell me what the other lines mean.

Thanks =D
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
19 May 2012 02:30 PM
Allowed = {"tehepicford", "OtherPlayer"}
Online = {}


game.Players.PlayerAdded:conenct(function(player)
for i,v in ipairs(Allowed) do
if player.Name == v then

table.insert(Online, player.Name)
end
end

for i,v in ipairs(Online) do
[Online].Chatted:connect(function(msg) --Said connect wrong.

H = Instance.new("Message", Workspace)
H.Text = "Worky!"

end)
end
end)


Im not good at all on .Chatted
I would like this fixed.
Not a BETTER version, Just a fixed version.

And IF there is only a way to make a new one.
Tell me what the other lines mean.

Thanks =D
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
19 May 2012 02:31 PM
Allowed = {"tehepicford", "OtherPlayer"}
Online = {}
game.Players.PlayerAdded:conenct(function(player)
for i,v in ipairs(Allowed) do
if player.Name == v then
table.insert(Online, player.Name)
end
end
for i,v in ipairs(Online) do
[Online].Chatted:conenct(function(msg) --Miss-spelled?
H = Instance.new("Message", Workspace)
H.Text = "Worky!"
end)
end
end)

MrMcAero
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
19 May 2012 02:59 PM
Nobody got it... :/ I'm going to re-write it, and explain it with comments line-by-line.

    Allowed = { --declare allowed table
        ["tehepicford"] = true, --index first value
        ["OtherPlayer"] = true --index second value
    } --end allowed table's scope
    Online = {} --declare online table
    
    game.Players.PlayerAdded:connect(function(player) --fire PlayerAdded event when players join
        if Allowed[player.Name] then --if the player's name can be indexed in the Allowed table
            table.insert(Online, player) --insert the player into the online table
        end --end if scope
        for k,v in pairs(Online) do --iterate through online table, creating variables k and v for key and value respectively
            v.Chatted:connect(function(msg) --fire Chatted event when v chats
                msg = Instance.new("Message", workspace) --crete Message in Workspace
                msg.Text = "Worky!" --change the message's Text property to "Worky!"
            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