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
 

Is 'TouchEnded' just not a well made function?

Previous Thread :: Next Thread 
skill24 is not online. skill24
Joined: 14 Jun 2009
Total Posts: 13608
18 Jul 2016 02:16 PM
Its triggering even though nothing has touched it to begin with.

Here's my code if interested..

local bars = script.Parent.Parent
local active = true

script.Parent.Touched:connect(function(hit)
if hit.Name == "Right Leg" and active == true then
active = false
dropBars()
end
end)


script.Parent.TouchEnded:connect(function(hit)
if hit.Name == "Right Leg" and active == false then
wait(2)
active = true
raiseBars()
end
end)


function dropBars()
for i = 0, 7, 0.5 do
bars.CFrame = bars.CFrame - Vector3.new(0, i, 0)
wait()
end
end

function raiseBars()
for i = 7, 0, -0.5 do
bars.CFrame = bars.CFrame + Vector3.new(0, i, 0)
wait()
end
end


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
18 Jul 2016 02:18 PM
Use magnitude instead or Region3. Touched is unreliable and buggy


Report Abuse
skill24 is not online. skill24
Joined: 14 Jun 2009
Total Posts: 13608
18 Jul 2016 05:20 PM
How do you use Region3 to refer to the position of the part? Not familiar with it


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