|
| 19 Jun 2016 07:48 PM |
function onTouched(hit) if hit.Name == "Puck" then for i,v in pairs(game.Players:GetChildren()) do if(tostring(v.TeamColor)=="Bright red")then v.Character:BreakJoints() end end end
|
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 07:52 PM |
if v.TeamColor == BrickColor.new("Bright red") then
TeamColor is a BrickColor value |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 08:11 PM |
Hmmm, still doesn't want to work.. ):
|
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Jun 2016 09:29 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent.Name == 'GoalKill' then for i,v in pairs (game.Players:GetChildren()) do if v.TeamColor == BrickColor.new('Bright red') then v.Character:BreakJoint() end end end end)
I've gotten this, but then again fails to work! D:
|
|
|
| Report Abuse |
|
|
Veltamax
|
  |
| Joined: 06 May 2012 |
| Total Posts: 368 |
|
|
| 19 Jun 2016 09:30 PM |
| Wouldn't it be :BreakJoints() |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 09:33 PM |
| @Tyran you didn't call the function xD. I always used to forget to call the function too so now all I do is whenever I start a new function I add the call line from the very beginning |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 09:41 PM |
| Did you even call the function? e.e |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 09:42 PM |
function onTouched(hit) script.Parent.Touched:connect(function(hit) if hit.Parent.Name == 'GoalKill' then for i,v in pairs (game.Players:GetChildren()) do if v.TeamColor == BrickColor.new('Bright red') then v.Character:BreakJoints() script.Parent.Touched:connect(onTouched) end end end end) end
So this?
|
|
|
| Report Abuse |
|
|
| |
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 19 Jun 2016 09:52 PM |
@Tyran You can't call a function before it happens.
function onTouched(hit)
if hit.Parent.Name == 'GoalKill' then for i,v in pairs (game.Players:GetChildren()) do if v.TeamColor == BrickColor.new('Bright red') then v.Character:BreakJoints() script.Parent.Touched:connect(onTouched) end end end end
|
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 10:13 PM |
Try this
function onTouched(hit) if hit.Parent.Name == 'GoalKill' then for i,v in pairs (game.Players:GetChildren()) do if v.TeamColor == BrickColor.new('Bright red') then v.Character:BreakJoints() end end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 19 Jun 2016 10:21 PM |
db = true script.Parent.Touched:connect(function(hit) if db and hit.Parent.Name == 'GoalKill' then db = not db for i,v in pairs (game.Players:GetChildren()) do if v.Character and v.TeamColor == BrickColor.new'Bright red' then v.Character:BreakJoints() end end wait(5) db = not db end end) |
|
|
| Report Abuse |
|
|