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 » Scripting Helpers
Home Search
 

Re: Scripts running in 3rd person.

Previous Thread :: Next Thread 
FunguyI is not online. FunguyI
Joined: 11 Sep 2009
Total Posts: 1412
06 Feb 2012 06:58 PM
I can easily make a lava brick but I want a script that will insert a brick, and kill the player when this brick is touched, without breaking, kinda like a lava brick. Idon't konw what's wrong, I get no error in the output window, the lava just does not work.

local part = Instance.new('Part', Workspace)
part.Anchored = true
part.Touched:connect(function()
function onTouched(part)

local h = part.Parent:findFirstChild("Humanoid")

if h~=nil then
h.Health = 0
end end

end)
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
06 Feb 2012 07:05 PM
script.Parent.Touched:connect(function(hit)
human = hit.Parent:findFirstChild("Humanoid")
if human then
human.Parent:BreakJoints()
wait(0.5)
part = Instance.new("Part, workspace)
part.Anchored = true
end
end)
Report Abuse
FunguyI is not online. FunguyI
Joined: 11 Sep 2009
Total Posts: 1412
06 Feb 2012 07:07 PM
That was not the answerI was looking for. I was asking how you make all that happens >>OUTSIDE<< the brick, not under it. I wanna the script to be a child of workspace, insert a brick, and make a player die everytime the brick is touched, I will toy with it some more.
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
06 Feb 2012 07:09 PM
I don't get what you're saying.. :l
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
06 Feb 2012 07:09 PM
Wait, what "brick"? Touch a brick to insert one..? Please explain.

† KMXD †
Report Abuse
FunguyI is not online. FunguyI
Joined: 11 Sep 2009
Total Posts: 1412
06 Feb 2012 07:13 PM
Insert>Script , insert hte script as a cihld of workspace, write the script to insert a brick wit hcertain properties, and to kill somebody every itme they touch that brick, but the csirpt does that while functioning outside the brick, as in, the script's parent is not the brick, i the script's parent is workspace.


local part = Instance.new('Part', game.Workspace)
part.Anchored = true
part.Touched:connect(function()
function onTouched(part)

local h = part.Parent:findFirstChild("Humanoid")

if h~=nil then
h.Health = 0
end end

end)
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
06 Feb 2012 07:17 PM
Ok, so you mean like use a script for a brick but the script is a child of workspace and not the brick?

part = game.Workspace:findFirstChild("PARTNAMEHERE")

part.Touched:connect(function(hit)
human = hit.Parent:findFirstChild("Humanoid")
if human then
human.Parent:BreakJoints()
end
end)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
06 Feb 2012 07:18 PM
Oh looky, Two broke the joints of a character this time. :3

† KMXD †
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
06 Feb 2012 07:19 PM
yay for mee
Report Abuse
FunguyI is not online. FunguyI
Joined: 11 Sep 2009
Total Posts: 1412
06 Feb 2012 07:23 PM
THank you but i don't want to break the joints,I want to break their health. I think I could try a new approach.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
06 Feb 2012 07:23 PM
Break their heal.. Dude, both will kill you.

† KMXD †
Report Abuse
FunguyI is not online. FunguyI
Joined: 11 Sep 2009
Total Posts: 1412
06 Feb 2012 07:27 PM
Yes, but what if a vehicle or something touches it with the break joints on there? CRUNCH
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
06 Feb 2012 07:30 PM
This already would prevent that.

human = hit.Parent:findFirstChild("Humanoid")
if human then

† KMXD †
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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