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: Best way to move a Brick that can still trigger .Touched events?

Previous Thread :: Next Thread 
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 02:44 PM
Moving with CFrames repeatedly doesnt work with .Touched, any help/ideas?
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 03:04 PM
20 Minute Bump.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
25 Oct 2011 03:10 PM
The best way to move a brick that can still trigger. Touched events is:

function OnTouch()

script.Parent.Parent.EXAMPLE.position(MoveTo:workspace.EXAMPLE2.position.)

end

script.Parent.Touched:Connect(OnTouch)
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 03:18 PM
that just moves it to one spot and i believe you read it wrong.

Ima see if i can make this more clear;

i want a method of movement that can let an anchored brick trigger .Touched Events during its movement.

The movement of the brick is controlled by a seperate script and i am keeping it that way,
because the brick that moves contains a particular script of which uses .Touched
and that is why im asking for help.

Stuff like bodyforce or bodyvelocity or what? I need to be pointed in the right direction.
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 03:26 PM
Bump of 40 Minutes.
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 03:51 PM
1 Hour and 10 Minutes.
Well, near enough.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
25 Oct 2011 04:02 PM
So you want to know when that brick that is being moved hits another object... Just move the brick with velocity.
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 05:31 PM
That doesnt either work!
Report Abuse
GeneralXtreme is not online. GeneralXtreme
Joined: 05 Oct 2009
Total Posts: 137
25 Oct 2011 05:35 PM
Magnitude.

while wait() do
players = game.Players:GetChildren()
for i=1,#players do
if players[i].Character then
if (players[i].Character.Torso.Position - script.Parent.Position).magnitude <= 10 then
print("PlayerNear") --Probably will print ALOT of times.. so I would make a halt system
end
end
end
end
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 05:37 PM
I dont think thats a Touched event.
That isnt the kind of purpose im using this for either.
Nice thinking though.
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 05:41 PM
Are there any other Pro's here to help me?
Report Abuse
GeneralXtreme is not online. GeneralXtreme
Joined: 05 Oct 2009
Total Posts: 137
25 Oct 2011 05:43 PM
.Touched doesn't work on a moving block. If you use magnitude and un anchore it in the position then call the function it will work.
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 05:46 PM
But im not using the block for killing players or even detecting them.
and whats the point of Touched if it doesnt work while moving?
Btw, i tried it the other way round, still didnt work.

script.Parent.Touched:connect(function(hit)
if hit.Name == "Fall" then
print("Sinksinksinksinksinksink")
hit.BrickColor = BrickColor.new("Dark Orange")
wait(.3)
hit.BrickColor = BrickColor.new("Bright Orange")
wait(.3)
hit.BrickColor = BrickColor.new("Bright Red")
wait(.3)
hit.BrickColor = BrickColor.new("Really Red")
wait(.3)
for fall=0,40 do
hit.CFrame = hit.CFrame - Vector3.new(0,1.2,0)
wait(.1)
end
end
end)
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 05:54 PM
Bump of TryingToFixForDaysSrsly
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 06:05 PM
Bump of Frustration
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 06:15 PM
If .Touched doesnt work while the brick is moving,
Then how does a rocket work?

Oh yeah, Bump of Quarter-Past Midnight.
Report Abuse
crazyblox is not online. crazyblox
Joined: 16 Mar 2008
Total Posts: 6139
25 Oct 2011 06:21 PM
:/
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
25 Oct 2011 06:24 PM
.Touched will work on a moving brick, but not when it's moved by CFrame. :l

Your best bet would probably be to try to find a way to unanchor it and still accomplish your task instead.

"I WILL GIVE YOU BACON." - Deadmau5
~Scarfacial
Report Abuse
GeneralXtreme is not online. GeneralXtreme
Joined: 05 Oct 2009
Total Posts: 137
25 Oct 2011 11:20 PM
Good point. Bodyposition would work nice
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