|
| 27 Oct 2015 07:51 PM |
script.Parent.Touched:connect(function() local x = 0 local count = 10 while x < count do script.Parent.BrickColor = BrickColor.new("Dark blue") wait(.2) script.Parent.BrickColor = BrickColor.new("Really red") wait(.2) x = x + 1 end script.Parent.Parent.Head.Position = Vector3.new("1,1,1") end)
The brick is supposed to spazz out the different colors, then the player thinks everything is fine, then all of a sudden his head pops off. The problem is with the player connection...hmmmmm |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Oct 2015 07:56 PM |
| Your reply is irrelevant and thus ignored. Null post null |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2015 07:59 PM |
script.Parent.Touched:connect(function(hit) if game.Players:FindFirstChild(hit.Parent.Name) then
end end) |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 27 Oct 2015 08:42 PM |
script.Parent.Touched:connect(function(plr) print(plr.Name.." touched me!") local x = 0 local count = 10 while x < count do script.Parent.BrickColor = BrickColor.new("Dark blue") wait(.1) script.Parent.BrickColor = BrickColor.new("Really red") wait(.1) x = x + 1 end plr.Parent.Head.Position = Vector3.new("1,1,1") end) |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2015 08:43 PM |
| A vector3 value should not be put in quotes |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2015 08:43 PM |
| ^ that would just print the name of the part that touches it not the player name |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 27 Oct 2015 08:45 PM |
Yes, because it doesn't print out the model. It prints out the part that touched it. Since it will most likely be a child of the player, the path is now
plr.Parent.Head
Now it has access to the head therefore it can rip it off :)
Also @airstriker4, Didn't know that. I guess you learn something new everyday. :D |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2015 08:47 PM |
| yes but what if the player doesn't touch the part and something else does, the script would error |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 27 Oct 2015 08:49 PM |
Also to prevent errors, I'd rather you use this one:
script.Parent.Touched:connect(function(plr) print(plr.Name.." touched me!") local x = 0 local count = 10 while x < count do script.Parent.BrickColor = BrickColor.new("Dark blue") wait(.1) script.Parent.BrickColor = BrickColor.new("Really red") wait(.1) x = x + 1 end if plr.Parent:FindFirstChild("Head") ~= nil then plr.Parent.Head.Position = Vector3.new( 1, 1, 1 ) else print("No playerhead found") end end) |
|
|
| Report Abuse |
|
|
wubby301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1907 |
|
|
| 27 Oct 2015 09:22 PM |
script.Parent.Touched:connect(function(plr) print(plr.Name.." touched me!") local x = 0 local count = 10 while x < count do script.Parent.BrickColor = BrickColor.new("Dark blue") wait(.1) script.Parent.BrickColor = BrickColor.new("Really red") wait(.1) x = x + 1 end if plr.Parent:FindFirstChild("Head") ~= nil then plr.Parent.Head:BreakJoints() else print("No playerhead found") end end) |
|
|
| Report Abuse |
|
|