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: This script is driving me insane because I can't fix it

Previous Thread :: Next Thread 
Dunker11 is not online. Dunker11
Joined: 16 May 2009
Total Posts: 3070
26 Jan 2014 02:12 PM
I have 2 teleporters and as soon as I step on one, it's super fast and teleports back within miliseconds. I want it to give me time to step off of it but it goes right away. What do I do to give myself time here?

TELEPORTER 1:

Ting = 0
script.Parent.Touched:connect(function(p)
if p.Parent:findFirstChild("Torso") and Ting == 0 then
Ting = 0
p.Parent.Torso.CFrame = script.Parent.Parent["2"].CFrame + Vector3.new(0,5,0)
Ting = 0
end
end)

TELEPORTER 2:

Ting = 0
script.Parent.Touched:connect(function(p)
if p.Parent:findFirstChild("Torso") and Ting == 0 then
Ting = 0
p.Parent.Torso.CFrame = script.Parent.Parent["1"].CFrame + Vector3.new(0,5,0)
Ting = 0
end
end)
Report Abuse
Korrium is not online. Korrium
Joined: 25 Aug 2009
Total Posts: 729
26 Jan 2014 02:22 PM
maybe you should add wait(2)

I didn't read the script fully so you figure out where to put it.
Report Abuse
Dunker11 is not online. Dunker11
Joined: 16 May 2009
Total Posts: 3070
26 Jan 2014 02:27 PM
I already tried it in a few places it didn't help
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
26 Jan 2014 02:40 PM
On each of them, have it when it's stepped, the other script gets disabled.

TELEPORTER 1:

Ting = 0
script.Parent.Touched:connect(function(p)
if p.Parent:findFirstChild("Torso") and Ting == 0 then
Ting = 0
script.Parent.Parent["2"].Script.Disabled = true --OVER HERE
p.Parent.Torso.CFrame = script.Parent.Parent["2"].CFrame + Vector3.new(0,5,0)
Ting = 0
end
end)

TELEPORTER 2:

Ting = 0
script.Parent.Touched:connect(function(p)
if p.Parent:findFirstChild("Torso") and Ting == 0 then
Ting = 0
script.Parent.Parent["1"].Script.Disabled = true
p.Parent.Torso.CFrame = script.Parent.Parent["1"].CFrame + Vector3.new(0,5,0)
Ting = 0
end
end)

~Hope I helped, if you need a script, PM me. ~Glory to CAT!~ ~CAT General Shawnyg~
Report Abuse
nerdkillerxl is not online. nerdkillerxl
Joined: 12 Jun 2011
Total Posts: 13
27 Feb 2014 06:47 PM
This is one of the first scripts i learned and at my place, i am using the same pair of teleporter since 2011.
One of my friend had this problem and i fixed by adding
Workspace.Touch.("Torso")
I hope it works, or pm me, i'll try to help.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Feb 2014 07:45 PM
TELEPORTER 1:

Ting = 1
script.Parent.Touched:connect(function(p)
wait(5)
Ting = 0
end)
script.Parent.Touched:connect(function(p)
if p.Parent:findFirstChild("Torso") and Ting == 0 then
Ting = 0
p.Parent.Torso.CFrame = script.Parent.Parent["2"].CFrame + Vector3.new(0,5,0)
end
Ting = 1
end)

TELEPORTER 2:

Ting = 1
script.Parent.Touched:connect(function(p)
wait(5)
Ting = 0
end)
script.Parent.Touched:connect(function(p)
if p.Parent:findFirstChild("Torso") and Ting == 0 then
Ting = 0
p.Parent.Torso.CFrame = script.Parent.Parent["2"].CFrame + Vector3.new(0,5,0)
end
Ting = 1
end)

--There problem solved... Although, I'd check for errors incase I messed up.
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
27 Feb 2014 07:47 PM
"Workspace.Touch.("Torso")"

What is that nonsense? That isn't even scripting.

~ Usering ~
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
27 Feb 2014 07:50 PM
Nice free model. Just put this script straight into the model and remove the scripts in both of the teleporters.

Your model should look like this:
Model
> Script
> 1
> 2

tp1 = script.Parent["1"]
tp2 = script.Parent["2"]
debounce = false
tp1.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and not debounce then
debounce = true
player.Character:MoveTo(tp1.Position + Vector3.new(0,5,0))
debounce = false
end
end)
tp2.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and not debounce then
debounce = true
player.Character:MoveTo(tp2.Position + Vector3.new(0,5,0))
wait(5)
debounce = false
end
end)

~ Usering ~
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Feb 2014 07:53 PM
I already answered his question dude.
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
27 Feb 2014 07:54 PM
What does that mean? There is no restriction on how many answers someone can post.

~ Usering ~
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Feb 2014 11:19 AM
True, but posting two answers could confuse him.
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
28 Feb 2014 11:23 AM
Not if they both have the same conclusion that would just teach him more
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Feb 2014 04:49 PM
I suppose, but mine does what he asked, his is a brand new script that goes in the model, I am assuming that mine is what he will most likely use, if any.
Report Abuse
Dunker11 is not online. Dunker11
Joined: 16 May 2009
Total Posts: 3070
28 Feb 2014 07:50 PM
2 things.

1: shawnyg answered it.
2: It was a brick and a script I put in it. No free models.
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