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: Need help with a simple script

Previous Thread :: Next Thread 
TradeMarket is not online. TradeMarket
Joined: 29 Aug 2012
Total Posts: 183
25 Nov 2012 09:12 PM
I want when you touch the block you get teleported to the brick named Blah, can anyone help?

Blah = game.Workspace.Blah

function onTouched(hit)
local Torso = hit.Parent:findFirstChild("Torso")
if Torso ~= nil then
Torso.CFrame = -->What goes here<--
end

script.Parent.Touched:connect(onTouched)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:13 PM


    Blah = game.Workspace.Blah
    function onTouched(hit)
    local Torso = hit.Parent:findFirstChild("Torso")
    if Torso ~= nil then
    Torso.CFrame = Blah.CFrame
    end
    script.Parent.Touched:connect(onTouched)

¤¤ †KMXD† ¤¤
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
25 Nov 2012 09:13 PM
Blah = game.Workspace.Blah

script.Parent.Touched:connect(function(hit)
local Torso = hit.Parent
if Torso ~= nil then
Torso:MoveTo(Blah.Position)
end
end)


Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:15 PM
Forgot the end

fail D:

¤¤ †KMXD† ¤¤
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:15 PM
@TheRobot

You can be teleporting any random model. . .

¤¤ †KMXD† ¤¤
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
25 Nov 2012 09:16 PM
...

Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
25 Nov 2012 09:17 PM
lrn2skript dood
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
25 Nov 2012 09:17 PM
Blah = game.Workspace.Blah

script.Parent.Touched:connect(function(hit)
local Torso = game.Players:GetPlayerFromCharacter(hit.Parent)
if Torso == nil then return end
Torso:MoveTo(Blah.Position)
end
end)

Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:19 PM
One too many ends.

¤¤ †KMXD† ¤¤
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
25 Nov 2012 09:19 PM
fail....
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
25 Nov 2012 09:20 PM
"One too many ends."

2 :

The if statement and the event.

Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
25 Nov 2012 09:22 PM
oh god

how did i not see that

Blah = game.Workspace.Blah

script.Parent.Touched:connect(function(hit)
local Torso = game.Players:GetPlayerFromCharacter(hit.Parent)
if Torso == nil then return end
Torso:MoveTo(Blah.Position)
end)

Sorry guys


Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:22 PM
script.Parent.Touched:connect(function(hit)
local Torso = game.Players:GetPlayerFromCharacter(hit.Parent)
if Torso == nil then return end --The if statement
Torso:MoveTo(Blah.Position)
end --Nothing
end) --The event

¤¤ †KMXD† ¤¤
Report Abuse
MisterScripter is not online. MisterScripter
Joined: 24 Sep 2010
Total Posts: 702
25 Nov 2012 09:47 PM
@Knightmare

That is wrong, you would be trying to move his player instead of the character model
Report Abuse
MisterScripter is not online. MisterScripter
Joined: 24 Sep 2010
Total Posts: 702
25 Nov 2012 09:49 PM
script.Parent.Touched:connect(function(hit)
local TorsoP = game.Players:GetPlayerFromCharacter(hit.Parent)
if TorsoP == nil then return end --The if statement
TorsoBrick = TorsoP.Character.Torso
TorsoBrick:MoveTo(Blah.Position)
end) --The event
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
27 Nov 2012 05:21 PM
@Mister

That's wrong too.

Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
27 Nov 2012 09:17 PM
@Mister

That wasn't my script, as I was only pointing out the extra end another person possessed. Also, as Robot stated, your script would also not work as you're trying to use the MoveTo() method on a part, which it is not a valid member of.

If it were me, I would go along the lines of:

    local Blah = Workspace.Blah
    
    script.Parent.Touched:connect(function(Hit)
      if not Game.Players:GetPlayerFromCharacter(Hit.Parent) then
        return
      end
      Hit.Parent:MoveTo(Blah.Position)
    end)

¤¤ †KMXD† ¤¤
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Nov 2012 10:07 PM
local Blah = Workspace.Blah

script.Parent.Touched:connect(function(Hit)
if not Game.Players:GetPlayerFromCharacter(Hit.Parent) then
return
end
Hit.Parent.Humanoid:MoveTo(Blah.Position)
end)


I wiin.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
28 Nov 2012 04:01 PM
Yes, let's make them walk there, if they could.

¤¤ †KMXD† ¤¤
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