Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 12:49 PM |
game.Players.PlayerAdded:connect(function(player) local record = Instance.new("StringValue") record.Value = player.Name record.Parent = Folder end)
in the brick you'll want a humanoid or a surfacegui while true do wait(10) local list = Folder:GetChildren script.Parent.Name = list[math.random(1,#list)] end
can anyone fix this script, I added this into a brick and added a surface gui,stringvalue,folder, it highlights the word "in", it doesn't work. |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 12:50 PM |
or fix this game.Players.PlayerAdded:connect(function(player) local record = Instance.new("StringValue") record.Value = player.Name record.Parent = the folder or model where you want to keep this stuff end)
and in the brick you'll want a humanoid or a surfacegui while true do wait(10) local list = folder or model where you keep the names:GetChildren script.Parent.Name = list[math.random(1,#list)] end
(folder or model name is "Brick") |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 18 Feb 2016 12:50 PM |
"local list = Folder:GetChildren"
should be
local list = Folder:GetChildren() |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 12:51 PM |
Try
while true do record.Value = player.Name |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 12:52 PM |
:
game.Players.PlayerAdded:connect(function(player) local record = Instance.new("StringValue") record.Value = player.Name record.Parent = Folder end)
while true do wait(10) local list = Folder:GetChildren() script.Parent.Name = list[math.random(1,#list)] end
did this: now it highlights the word folder with blue color, and I did put stringvalue, folder, surfacegui into my brick, it still doesn't show anything on the brick |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 18 Feb 2016 12:54 PM |
script.Parent.Name = list[math.random(1,#list)]
should be
script.Parent.Name = list[math.random(1,#list)].Value
because you want the VALUE of the item |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 12:55 PM |
I did this:
game.Players.PlayerAdded:connect(function(player) local record = Instance.new("StringValue") while true do record.Value = player.Name record.Parent = Folder end)
while true do wait(10) local list = Folder:GetChildren() script.Parent.Name = list[math.random(1,#list)] end
now it highlights the ")" next to the word "end"
output:
Workspace.Brick.Script:6: unexpected symbol near ')' |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 12:56 PM |
You forgot an 'end' to close your loop in the playeradded event.
|
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 18 Feb 2016 12:57 PM |
jsut do this:
game.Players.PlayerAdded:connect(function(player) local record = Instance.new("StringValue", Folder) record.Value = player.Name end)
while wait(10) do local list = Folder:GetChildren() script.Parent.Name = list[math.random(1,#list)].Value end
--What it should do is change parent's name to one a random players name. |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 12:57 PM |
did this:
game.Players.PlayerAdded:connect(function(player) local record = Instance.new("StringValue") record.Value = player.Name record.Parent = Folder end)
while true do wait(10) local list = Folder:GetChildren() script.Parent.Name = list[math.random(1,#list)].Value end
it highlights "Folder" words with blue color |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
| |
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 12:59 PM |
| @Darkenus, I added that, it still highlights the words folder with blue color, don't really know if it is working |
|
|
| Report Abuse |
|
|
| |
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 01:00 PM |
| what do you mean with "define folder" |
|
|
| Report Abuse |
|
|
| |
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 01:02 PM |
| advanced, I put a ")" to there, now it only red highlights that ")" |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 18 Feb 2016 01:03 PM |
| Ugh, just copy and paste your ENTIRE script so we can see. |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 01:04 PM |
beginning: game.Players.PlayerAdded:connect(function(player)) local record = Instance.new("StringValue") record.Value = player.Name record.Parent = Brick23 end)
while true do wait(10) local list = Brick23:GetChildren script.Parent.Name = list[math.random(1,#list)] end
now: game.Players.PlayerAdded:connect(function(player)) local record = Instance.new("StringValue") while true do record.Value = player.Name record.Parent = Folder end)
while true do wait(10) local list = Folder:GetChildren() script.Parent.Name = list[math.random(1,#list)] end)
(highlights ")", (player))) |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 18 Feb 2016 01:05 PM |
*sigh*
1. You did not define 'Folder'.
2. 'script.Parent.Name' points to the script's NAME, so all you're doing is changing the scripts name. |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 18 Feb 2016 01:09 PM |
just this:
game.Players.PlayerAdded:connect(function(player)) local record = Instance.new("StringValue") while true do record.Value = player.Name record.Parent = Folder end)
while true do wait(10) local list = Folder:GetChildren() script.Parent.Script = list[math.random(1,#list)] end) |
|
|
| Report Abuse |
|
|