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: help with onTouch script please

Previous Thread :: Next Thread 
mario55j is not online. mario55j
Joined: 13 Aug 2012
Total Posts: 143
04 Jun 2015 05:04 AM
so i have this tool in my hand its a ball i want if someone touch's the tool he would just disappear i know its

function onTouch (hit)



end


script.Parent.Touch:connect(onTouch)



am new i know this far i know this makes it if something touch's this ball wotever i tell the function to do it would i just don't know a script to make a player disappear and dying not limbs disappear



sorry am new so sorry if it takes a while to understand it
Report Abuse
mario55j is not online. mario55j
Joined: 13 Aug 2012
Total Posts: 143
04 Jun 2015 05:05 AM
sorry i mean

script.Parent.Touched:connect(onTouch)
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
04 Jun 2015 05:10 AM
you mean, if any character touches the ball, he/she becomes invisible?

or should their character be removed from the game temporarily?

or should they just be killed and respawned?
Report Abuse
mario55j is not online. mario55j
Joined: 13 Aug 2012
Total Posts: 143
04 Jun 2015 05:12 AM
killed and respawned but the way there killed is they just disappear and die
Report Abuse
glurbman is not online. glurbman
Joined: 02 Nov 2010
Total Posts: 1903
04 Jun 2015 05:19 AM
use this :

function onTouch(hit)

if hit.Parent:findFirstChild("Humanoid") then
hit.Parent["Left Leg"].Transparency = 1
hit.Parent["Right Leg"].Transparency = 1
hit.Parent["Torso"].Transparency = 1
hit.Parent["Left Arm"].Transparency = 1
hit.Parent["Right Arm"].Transparency = 1
hit.Parent["Head"].Transparency = 1
hit.Parent["Left Leg"].CanCollide = false
hit.Parent["Right Leg"].CanCollide = false
hit.Parent["Torso"].CanCollide= false
hit.Parent["Left Arm"].CanCollide = false
hit.Parent["Right Arm"].CanCollide = false
hit.Parent["Head"].CanCollide = false
end
end

script.Parent.Touched:connect(onTouch)



this:
function onTouched(hit)
local d = hit.Parent:GetChildren()
for i=1, #d do
if (d[i].className == "Pants") then
d[i]:remove()
end
end
end

script.Parent.Touched:connect(onTouched)

this:
function onTouched(hit)
local d = hit.Parent:GetChildren()
for i=1, #d do
if (d[i].className == "Shirt") then
d[i]:remove()
end
end
end

script.Parent.Touched:connect(onTouched)

this:

function onTouched(hit)
local d = hit.Parent:GetChildren()
for i=1, #d do
if (d[i].className == "ShirtGraphic") then
d[i]:remove()
end
end
end

script.Parent.Touched:connect(onTouched)

and finally this:

function onTouched(hit)

hit:BreakJoints()



end
end



connection = script.Parent.Touched:connect(onTouched)


yeah just put every script ..eh yeah into a script and put the scripts into your part !!! then every player you hit will get terminated!

ps. yes i know theres a much easier way to do this but i think the combination of these scripts will also work !

Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
04 Jun 2015 05:19 AM
the best way to respawn a character and making it look like he disappears (so no rolling limbs) is to use game.Player[Player.name]:LoadCharacter(). this skips the dieing part and generates a new char and spawns that new char. anyways, code below. make sure to use a normal script and not a localscript, and that the script is directly inside the ball.

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if game.Players:FindFirstChild(hit.Parent.Name) then
game.Players[hit.Parent.Name]:LoadCharacter()
end
end
end)


Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
04 Jun 2015 05:20 AM
@ Glurb, he wants to respawn character without seeing limbs roll. :LoadCharacter does exactly that.

Report Abuse
glurbman is not online. glurbman
Joined: 02 Nov 2010
Total Posts: 1903
04 Jun 2015 05:21 AM
p.s i think the very first script is almost enough to make them dissapear ^^
Report Abuse
glurbman is not online. glurbman
Joined: 02 Nov 2010
Total Posts: 1903
04 Jun 2015 05:23 AM
dude if you put all these scripts into a part and touch someone with it then there will be absolutely no limbs left to roll away!!!! everything of the touched palyer will just dissapear there will be absolutely no pixel left!
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
04 Jun 2015 05:24 AM
still, it takes atleast 4 times more CPU power than a simple :LoadCharacter().
Report Abuse
glurbman is not online. glurbman
Joined: 02 Nov 2010
Total Posts: 1903
04 Jun 2015 05:24 AM
ps. ohno your script is usually much better ^^ but mine combination could also work.
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
04 Jun 2015 05:25 AM
yeah, but just very inefficient.
Report Abuse
glurbman is not online. glurbman
Joined: 02 Nov 2010
Total Posts: 1903
04 Jun 2015 05:26 AM
yeah the cpu power usage would be much higher ....but i just wanted to help ..and my scripts where atleast better thann nothing^^
Report Abuse
mario55j is not online. mario55j
Joined: 13 Aug 2012
Total Posts: 143
04 Jun 2015 06:24 AM
thanks alot
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