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: Untouch?

Previous Thread :: Next Thread 
WaddelsGaming is not online. WaddelsGaming
Joined: 08 Oct 2013
Total Posts: 90
10 Jun 2016 03:03 AM
How do I make a function that will fire when
someone untouched a part?




Report Abuse
soved is not online. soved
Joined: 04 Jan 2013
Total Posts: 216
10 Jun 2016 03:11 AM
local Part = script.Parent

Part.TouchEnded:connect(function()
-- Do stuff.
end)
Report Abuse
soved is not online. soved
Joined: 04 Jan 2013
Total Posts: 216
10 Jun 2016 03:12 AM
The event will Fire a few times, so just add a Debounce.

Hope this helps.
Report Abuse
ElectroTM is not online. ElectroTM
Joined: 23 Nov 2012
Total Posts: 1135
10 Jun 2016 03:15 AM
local Part = script.Parent
local deb=false
Part.TouchEnded:connect(function()
if not deb then
-- Do stuff.
deb=true
wait(.2)--or something
deb=false
end
end)


Report Abuse
Autreus is not online. Autreus
Joined: 27 Feb 2015
Total Posts: 290
10 Jun 2016 04:13 AM
I think I know what you mean..

Insert a ClickDetector and a Script inside,

script.Parent.ClickDetector.MouseClick:connect(function()
script.Parent.
end)

This will be what you will be starting with. Between the end) and script.Parent you will want to type of thing you want to happend. If you want it to be clickable (toggle between true, false) :


script.Parent.ClickDetector.MouseClick:connect(function()
if script.Parent.(whatyouwant) == 0 then
script.Parent.(whatyouwant)
else
script.Parent.(whatyouwant)
end end)
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
10 Jun 2016 05:47 AM
if (plr.Torso.Position - pad.Position).magnitude < 3 then print'stepped off' end
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
10 Jun 2016 06:06 AM
greater than, not less than
Report Abuse
jbjgang2 is not online. jbjgang2
Joined: 07 Feb 2010
Total Posts: 8948
10 Jun 2016 07:11 AM
@lem0nzzx

that would be pretty innefficent seeing as it would fire only when your 3 studs away from the parts origin and not touching it

a correct way of doing that would be

(plr.Torso.Position - pad.Position).magnitude > pad.Size.X/2

but this would only work if the part was a perfect cube
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