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: Can anyone fix this?

Previous Thread :: Next Thread 
KINGofstephanos is not online. KINGofstephanos
Joined: 21 Aug 2012
Total Posts: 282
09 Jul 2016 12:43 AM
the player is supposed to click this button in a elevator and its supposed to then teleport them but for some reason its not, here's the script

script.Parent.ClickDetector.MouseClick:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Torso.CFrame = CFrame.new(356.6, 4.707, -62.8)
end
end)
I have a click detector in
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
09 Jul 2016 12:54 AM
MouseClick doesn't work the same way as the touched event. Its parameter is the Player who clicked it, whereas the touched event's parameter is the part that hit it.

if you do player.Parent (game.Players) you're not gonna find a humanoid.

script.Parent.ClickDetector.MouseClick:connect(function(player)
player.Character:WaitForChild("Torso").CFrame = CFrame.new(356.6, 4.707, -62.8)
end)


Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
09 Jul 2016 12:59 AM
cframing a part in the character to teleport someone is futile, there's a function called MoveTo, although it's required to use vector3 as far as im concerned


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
09 Jul 2016 01:00 AM
yes


Report Abuse
KINGofstephanos is not online. KINGofstephanos
Joined: 21 Aug 2012
Total Posts: 282
09 Jul 2016 01:02 AM
ohh thanks dude
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
09 Jul 2016 01:06 AM
np


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