|
| 29 Sep 2014 03:11 PM |
So i have this script :
Model = game.Workspace.Scares
game.Players.PlayerAdded:connect(function(plr) local nub = math.random(1,#Model:GetChildren()) local lol = nub:Clone() lol.Parent = plr lol.Disabled = false end)
What it should do is when a player enters it at random selects a script and undisable it. It's stopped working for some reason. Can anyone tell me why and how to fix it? |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 29 Sep 2014 03:12 PM |
game.Players.PlayerAdded:connect(function(plr) local chil = Model:GetChildren() local nub = chil[math.random(1,#Model:GetChildren())] local lol = nub:Clone() lol.Parent = plr lol.Disabled = false end)
|
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 29 Sep 2014 03:14 PM |
Sorry typed in a hurry
game.Players.PlayerAdded:connect(function(plr) local chil = Model:GetChildren() local nub = chil[math.random(1,#chil)] local lol = nub:Clone() lol.Parent = plr lol.Disabled = false end) |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2014 03:18 PM |
Did this : Model = game.Workspace.Scares
game.Players.PlayerAdded:connect(function(plr) local chil = Model:GetChildren() local nub = chil[math.random(1,#chil)] local lol = nub:Clone() lol.Parent = plr lol.Disabled = false end)
So in Workspace Theres a model called Scares and it has 2 scripts inside of it. For some reason it didn't undisable any of them. |
|
|
| Report Abuse |
|
|
| |
|
Bobobob12
|
  |
| Joined: 23 Jan 2008 |
| Total Posts: 5350 |
|
|
| 29 Sep 2014 03:27 PM |
Model = game.Workspace.Scares
game.Players.PlayerAdded:connect(function(plr) local chil = Model:GetChildren() local nub = chil[math.random(1,#chil)] local lol = nub:Clone() lol.Disabled = false lol.Parent = plr end)
disable it before you parent it, parenting it causes it to run
|
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Sep 2014 03:40 PM |
| What i do to check it is i press Play in Studio and look at the scares scripts and click on each one of them, looking at the properties window to see if they're disabled. Both of them are. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 29 Sep 2014 04:30 PM |
| Sorry for the bumps, i dont understand why this wont work lol |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|