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: One way doors

Previous Thread :: Next Thread 
wow75 is not online. wow75
Joined: 16 Jan 2009
Total Posts: 951
18 Feb 2013 12:42 PM
How would i make a one way door script force you downward with out rotating it?

door = script.Parent

function onTouch(hit)
if hit.Parent == nil then return end
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
hit.Parent.Torso.Velocity=door.CFrame.lookVector * 100 -- Push the Player back
end
end
door.Touched:connect(onTouch)
Report Abuse
theoverlord5303 is not online. theoverlord5303
Joined: 21 Aug 2010
Total Posts: 21
18 Feb 2013 01:39 PM
I can't test this right now, and if you haven't tried it before I do I'll get back to you, but try this:

local door = script.Parent

function onTouch(Brick)
local Player = Brick.Parent:findFirstChild("Humanoid")
if (Player ~= nil) then

Use the CFrame to put them on the side of the door you want them to be.
Report Abuse
wow75 is not online. wow75
Joined: 16 Jan 2009
Total Posts: 951
18 Feb 2013 03:01 PM
I was guessing it would go like this:



door = script.Parent

function onTouch(hit)
if hit.Parent == nil then return end
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
hit.Parent.Torso.Velocity=door.BottomSurface * 100 -- Over here is the difference...
end
end
door.Touched:connect(onTouch)
Report Abuse
wow75 is not online. wow75
Joined: 16 Jan 2009
Total Posts: 951
19 Feb 2013 04:23 PM
Bumpleump.
Report Abuse
wow75 is not online. wow75
Joined: 16 Jan 2009
Total Posts: 951
19 Feb 2013 08:28 PM
Anyone?
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
19 Feb 2013 08:42 PM
hit.Parent.Torso.Velocity=Vector3.new(0,-100,0)

I THINK this is what you want. If you're wanting to force them downwards, I would also recommend forcing the character to Sit or PlatformStand.
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