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: Funny Kill Brick Problem, Get Children?

Previous Thread :: Next Thread 
iScriptStuffz is not online. iScriptStuffz
Joined: 11 Sep 2015
Total Posts: 348
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
Deafgift100 is not online. Deafgift100
Joined: 09 May 2010
Total Posts: 3958
27 Oct 2015 07:53 PM
ironic names kill me
Report Abuse
iScriptStuffz is not online. iScriptStuffz
Joined: 11 Sep 2015
Total Posts: 348
27 Oct 2015 07:56 PM
Your reply is irrelevant and thus ignored. Null post null
Report Abuse
ShadowAlphaLord is not online. ShadowAlphaLord
Joined: 20 Jun 2013
Total Posts: 124
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 is not online. 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
airstriker4 is not online. airstriker4
Joined: 27 Jul 2012
Total Posts: 5831
27 Oct 2015 08:43 PM
A vector3 value should not be put in quotes
Report Abuse
ShadowAlphaLord is not online. ShadowAlphaLord
Joined: 20 Jun 2013
Total Posts: 124
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 is not online. 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
ShadowAlphaLord is not online. ShadowAlphaLord
Joined: 20 Jun 2013
Total Posts: 124
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 is not online. 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 is online. 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
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