nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 18 Feb 2014 07:13 PM |
When the part is touched the walkspeed changes to 0 that works but the charters parts not anchoring/changing color don't work. I am not sure why :/
sp = script.Parent
sp.Touched:connect(function(player) local die = player.Parent:FindFirstChild("Humanoid") local parts = player.Parent:FindFirstChild(ClassName == "Part") if (die ~= nil) then die.WalkSpeed = 0 parts.Anchored = true parts.BrickColor = "Black" wait() Parts.Reflectance = 0.6 wait(2) die.Health = 0 end end)
Here is the output: 19:10:12.424 - Workspace.Block.Script:8: attempt to index local 'parts' (a nil value) 19:10:12.428 - Script 'Workspace.Block.Script', Line 8 19:10:12.428 - stack end 19:10:12.429 - Disconnected event because of exception
insertCreativeSiggyHere |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 18 Feb 2014 07:17 PM |
Hello nocnoc bb <3
the 4th line of code to the end uses a capitol "P" and the others do not. |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 18 Feb 2014 07:18 PM |
ty <3
insertCreativeSiggyHere |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 18 Feb 2014 07:19 PM |
still doesn't work
output: 19:19:10.944 - Workspace.Block.Script:8: attempt to index local 'parts' (a nil value) 19:19:10.944 - Script 'Workspace.Block.Script', Line 8 19:19:10.944 - stack end 19:19:10.945 - Disconnected event because of exception
insertCreativeSiggyHere |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2014 07:20 PM |
"local parts = player.Parent:FindFirstChild(ClassName == "Part") "
pretty sure findFirstChild doesn't work like this.
#nerdsunited |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 18 Feb 2014 07:20 PM |
"parts.BrickColor = "Black"" needs to be: parts.BrickColor = BrickColor.new ('Black')
Also, you never defined parts. |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 18 Feb 2014 07:21 PM |
I tried IsA
insertCreativeSiggyHere |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 18 Feb 2014 07:22 PM |
Oh, you did, but not correctly. If you want to get all the children named 'Part' in the model, then use :GetChildren and in pairs.
for i,parts in pairs (script.Parent:GetChildren ()) do --stuff end |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 18 Feb 2014 07:22 PM |
I think you need to edit the brick color and do a brickcolor = brickcolor3.new "wutever m8"
and I also noticed the 6th line of code (the one Identifying the local parts)
I think you should do
local parts = player.Parent:FindFirstChild("Part")
|
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 18 Feb 2014 07:24 PM |
| Woopsies, I meant 'Color3.new' |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 18 Feb 2014 07:25 PM |
local parts = player.Parent if parts.className=='BasePart'
ii |
|
|
| Report Abuse |
|
|