generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why is this broken?

Previous Thread :: Next Thread 
Tyrannizer is not online. Tyrannizer
Joined: 25 Mar 2009
Total Posts: 54
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
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
19 Jun 2016 07:52 PM
if v.TeamColor == BrickColor.new("Bright red") then


TeamColor is a BrickColor value
Report Abuse
Tyrannizer is not online. Tyrannizer
Joined: 25 Mar 2009
Total Posts: 54
19 Jun 2016 08:11 PM
Hmmm, still doesn't want to work.. ):


Report Abuse
Tyrannizer is not online. Tyrannizer
Joined: 25 Mar 2009
Total Posts: 54
19 Jun 2016 08:25 PM
bump


Report Abuse
Tyrannizer is not online. Tyrannizer
Joined: 25 Mar 2009
Total Posts: 54
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 is not online. Veltamax
Joined: 06 May 2012
Total Posts: 368
19 Jun 2016 09:30 PM
Wouldn't it be :BreakJoints()
Report Abuse
ComedicGesture is not online. ComedicGesture
Joined: 20 May 2011
Total Posts: 912
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
XanderConway is not online. XanderConway
Joined: 06 Jun 2013
Total Posts: 1037
19 Jun 2016 09:41 PM
Did you even call the function? e.e
Report Abuse
Tyrannizer is not online. Tyrannizer
Joined: 25 Mar 2009
Total Posts: 54
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
Tyrannizer is not online. Tyrannizer
Joined: 25 Mar 2009
Total Posts: 54
19 Jun 2016 09:43 PM
I'm bad at this..


Report Abuse
enzo90 is not online. 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
ComedicGesture is not online. ComedicGesture
Joined: 20 May 2011
Total Posts: 912
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image