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: Broken Teleport Script

Previous Thread :: Next Thread 
brickbuilder74 is not online. brickbuilder74
Joined: 23 Jun 2008
Total Posts: 8810
29 Oct 2011 09:46 AM
It just won't teleport the guy. Output says nothing.


script.Parent.Touched:connect(function(p)
local h = p.Parent:FindFirstChild("Huminoid")
if h ~= nil then
local plr = game.Players:FindFirstChild(p.Parent.Name)
local torso = plr.Character.Torso
local location = {script.Parent.Parent.Tele2.Position}
local i = 1
local x = location[i].x
local y = location[i].y
local z = location[i].z
x = x + math.random(-1, 1)
z = z + math.random(-1, 1)
y = y + math.random(2, 3)
local lx = 0
local ly = y
local lz = 0
torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
end
end)
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Oct 2011 09:50 AM
local h = p.Parent:FindFirstChild("Huminoid")
to
local h = p.Parent:FindFirstChild("Humanoid")

Also, I would add a debounce to prevent breaking.
Report Abuse
brickbuilder74 is not online. brickbuilder74
Joined: 23 Jun 2008
Total Posts: 8810
29 Oct 2011 09:55 AM
Aha! Thanks, I hate spelling errors. Anyway, I just now added a debounce, too.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Oct 2011 09:58 AM
Kay. :3
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