|
| 25 Sep 2013 05:26 PM |
game.Players.PlayerAdded:connect(function(plr) wait(2) if plr.Name == "snowboarder199" then plr.Chatted:connect(function(message) local msg = string.lower(message) if string.sub(msg, 1) == "Load:Random" then local model = Instance.new("Model", Workspace) model.Name = "Loaded" for i = 1, 20 do local w = Instance.new("Part",model) w.Anchored = true w.CanCollide = true w.TopSurface = 0 w.BottomSurface = 0 w.BrickColor = BrickColor.new("Black") w.Size = Vector3.new(math.random(10,15), 20, 1) w.CFrame = CFrame.new(math.random(-56,56), 22, math.random(56,120)) * CFrame.Angles(math.rad(math.random(1,360)),0,0) local sb = Instance.new("SelectionBox", w) sb.Adornee = w sb.Color = BrickColor.new("Institutional white") wait(0.2) end end end) end end)
So I just want the game to detect that if a new player joined then if the players name is equal to my name then if i chat a command line then the parts generate... but nothing happens So I think im doing the "new player added chat" wrong but the output is saying nothing Help would be much appreciated c: |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2013 05:32 PM |
Wait if im not mistaken it should be:
game.Players.PlayerAdded:connect(function(plr) wait(2) plr.Chatted:connect(function(message) if plr.Name == "snowboarder199" then local msg = string.lower(message) if string.sub(msg, 1) == "Load:Random" then local model = Instance.new("Model", Workspace) model.Name = "Loaded" for i = 1, 20 do local w = Instance.new("Part",model) w.Anchored = true w.CanCollide = true w.TopSurface = 0 w.BottomSurface = 0 w.BrickColor = BrickColor.new("Black") w.Size = Vector3.new(math.random(10,15), 20, 1) w.CFrame = CFrame.new(math.random(-56,56), 22, math.random(56,120)) * CFrame.Angles(math.rad(math.random(1,360)),0,0) local sb = Instance.new("SelectionBox", w) sb.Adornee = w sb.Color = BrickColor.new("Institutional white") wait(0.2) end end end end) end)
But its still not quite working :/ |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2013 05:58 PM |
| Im so dumb, I fixed it. Thanks for looking at it though |
|
|
| Report Abuse |
|
|