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 » Scripters
Home Search
 

Re: Why doesnt this work?

Previous Thread :: Next Thread 
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 05:51 PM
game.Players.PlayerAdded:connect(function()
while true do
wait()
game.Players.LocalPlayer.Chatted:connect(function(ui)
for i,v in pairs(game.Players:GetChildren()) do
p = Instance.new("Part",v.Character.Head)
if game.Players.LocalPlayer.Chatted == "brick" then
while true do
wait()
p

end)
end
end
end)



Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
11 Jan 2016 05:54 PM
no need for the first loop.




#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217")
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
11 Jan 2016 05:56 PM
What exactly are you trying to do? Even removing the errors, the script doesn't make much sense. Are you trying to put a brick on top of the player when they chat "Brick"?
Report Abuse
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 05:57 PM
new revised version:
game.Players.PlayerAdded:connect(function()

game.Players.LocalPlayer.Chatted:connect(function(ui)
for i,v in pairs(game.Players:GetChildren()) do
if v.Chatted == "brick" then
while true do
wait()
p = Instance.new("Part",v.Character.Head)


end
end
end

end)

error:
18:55:38.027 - Workspace.Script:17: 'end' expected (to close 'function' at line 1)





Report Abuse
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 05:58 PM
@^^ yes exactly..


Never really use this, so im stupid


Report Abuse
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 05:58 PM
Its supposed to make a never ending bricks fly out of the players head when they chat "brick"


Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
11 Jan 2016 06:01 PM
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == "brick" and player.Character then
local p = Instance.new("Part",player.Character)
p.Position = player.Character:FindFirstChild("Torso")
end
end)
end)
Report Abuse
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 06:02 PM
ty


Report Abuse
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 06:07 PM
Tweeked the code you had and this works:

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == "brick" then
for i,v in pairs(game.Players:GetChildren()) do

while true do
wait()
p = Instance.new("Part",v.Character.Head)

end
end
end
end)
end)



thanks, just edited a little :)


Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
11 Jan 2016 06:09 PM
I lateposted and missed the "never ending" part, sorry.
Report Abuse
Metology is not online. Metology
Joined: 06 Oct 2014
Total Posts: 3255
11 Jan 2016 06:21 PM
its fine


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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