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: Why wont this work?

Previous Thread :: Next Thread 
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 03:44 PM
Part1 = Teleport
Part2 = Here

local Pos1 = game.Workspace:FindFirstChild(Teleport,true)
local Pos2 = game.Workspace:FindFirstChild(Here,true)

local db = false

Pos1.Touched:connect(function(hit)
db = true
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent.Torso.CFrame = CFrame.new(Pos2.Position+Vector3.new(0,5,0))
db = false
end end)

I have a part called Teleport and Here, but this just wont work.
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
13 Apr 2014 03:46 PM
"Part1=teleport"
"Part2 = here"

You need to say where they are

Part1= Game.workspace.teleport
Report Abuse
laffydecious is not online. laffydecious
Joined: 26 Nov 2010
Total Posts: 573
13 Apr 2014 03:48 PM
When you assign the Teleport and Here variable, you're not actually telling it that Part1 = your part called Teleport. Imagine I have a part called 'Part' and I want to assign it to the variable 'killBrick'. I'd do this:

killBrick = game.Workspace.Part

So, in your case, it might be:

Part1 = game.Workspace.Teleport
Part2 = game.Workspace.Here
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
13 Apr 2014 03:48 PM
I already said that.
Report Abuse
laffydecious is not online. laffydecious
Joined: 26 Nov 2010
Total Posts: 573
13 Apr 2014 03:49 PM
I wrote it whilst you posted that.
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 03:50 PM
Part1 = Game.workspace.teleport
Part2 = Game.workspace.here

local Pos1 = game.Workspace:FindFirstChild(Part1,true)
local Pos2 = game.Workspace:FindFirstChild(Part2,true)

local db = false

Pos1.Touched:connect(function(hit)
db = true
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent.Torso.CFrame = CFrame.new(Pos2.Position+Vector3.new(0,5,0))
db = false
end end)

Still isn't working.
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
13 Apr 2014 03:51 PM
Erm is the Teleport button capital or not capital?

Because the variable of part1 and part2 need to be exact name
case sensitive
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
13 Apr 2014 03:52 PM
Also at the end you put end twice together
Make them be on a new line
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 03:52 PM
Non-capital.
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 03:53 PM
Part1 = game.workspace.teleport
Part2 = game.workspace.here

local Pos1 = game.Workspace:FindFirstChild(Part1,true)
local Pos2 = game.Workspace:FindFirstChild(Part2,true)

local db = false

Pos1.Touched:connect(function(hit)
db = true
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent.Torso.CFrame = CFrame.new(Pos2.Position+Vector3.new(0,5,0))
db = false
end
end)

This isn't working either.
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
13 Apr 2014 03:58 PM
Isn't it debounce

Local debounce = true
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 03:58 PM
Please help, I only need this one script for my game right now.
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 04:01 PM
Part1 = game.workspace.teleport
Part2 = game.workspace.here

local Pos1 = game.Workspace:FindFirstChild(Part1,true)
local Pos2 = game.Workspace:FindFirstChild(Part2,true)

local debounce = false

Pos1.Touched:connect(function(hit)
debounce = true
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent.Torso.CFrame = CFrame.new(Pos2.Position+Vector3.new(0,5,0))
debounce = false
end
end)

Still isn't working.. waiiiiiiiiii
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
13 Apr 2014 04:04 PM
Capitalise the w in game.Workspace
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 04:08 PM
Part1 = game.Workspace.teleport
Part2 = game.Workspace.here

local Pos1 = game.Workspace:FindFirstChild(Part1,true)
local Pos2 = game.Workspace:FindFirstChild(Part2,true)

local debounce = false

Pos1.Touched:connect(function(hit)
debounce = true
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent.Torso.CFrame = CFrame.new(Pos2.Position+Vector3.new(0,5,0))
debounce = false
end
end)

Okay, lets go to basic things.

I have it in the Workspace, and I have 2 parts named teleport and here.

Why doesn't it work!?
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 04:14 PM
Have you just given up one me? D:
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Apr 2014 04:17 PM
Learn what FindFirstChild actually does...
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 04:19 PM
I didn't write this script, someone else did for me.

Can you just re-write it so it works, please?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Apr 2014 04:24 PM
local Part1 = workspace.teleport --make sure these actually exist
local Part2 = workspace.here
local Pos1 = Part1.Position
local Pos2 = Part2.Position

local db = false

Pos1.Touched:connect(function(hit)
if db then return end
if hit.Parent:FindFirstChild("Torso") then
db = true
hit.Parent.Torso.CFrame = CFrame.new(Pos2+Vector3.new(0,5,0))
wait(1)
db = false
end end)
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 04:28 PM
Still isn't working.

What I am trying to achive is step on one block and you teleport to another set block.

I have teleport and here in the workspace, as long as the script in the workspace.

The place is here -

http://web.roblox.com/Slides-Alpha-v0-1-place?id=152067264
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Apr 2014 04:31 PM
Part1.Touched, not Pos1
Report Abuse
ieyedude is not online. ieyedude
Joined: 07 Feb 2010
Total Posts: 5059
13 Apr 2014 04:39 PM
Still not working. I DONT KNOW WHY.

Is there anyway you can just make a script from scratch, that when a certain brick is touched, it is teleported to another set brick?
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