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: Touchstone Teleport?

Previous Thread :: Next Thread 
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 02:44 AM
I need help with this

Tool = script.Parent



function teleport()

local char = Tool.Parent

if (char == nil) then return end

local t = char:FindFirstChild("Torso")
if t == nil then return end

local dx = math.random(-10,10)
local dz = math.random(-10,10)

local pos = game.Workspace.TouchstoneLocus.Position

local dest = Vector3.new(pos.x + dx, pos.y - 15, pos.z + dz)
local g = Instance.new("BodyAngularVelocity")
g.maxTorque = Vector3.new(1e5,1e5,1e5)
g.angularvelocity = Vector3.new(-61.5, 54.2, 66.5)
g.Parent = t

t.CFrame = CFrame.new(dest)

t.Velocity = Vector3.new(-61.5, 54.2, 66.5)
t.RotVelocity = Vector3.new(-61.5, 54.2, 66.5)

wait(1)
g.Parent = nil


end






-61.5, 54.2, 66.5 is the position of the brick i want it to teleport to.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 03:14 AM
Bump.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 04:57 AM
Bump.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 07:08 AM
Bump, why aren't I getting answers?!
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 08:23 AM
Bump, scripting helpers is useless.
Report Abuse
cygorx is not online. cygorx
Joined: 09 Nov 2012
Total Posts: 668
09 Dec 2012 08:26 AM
You didn't call your function.
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
09 Dec 2012 08:30 AM
Why are you making it look so complicated...

Tool = script.Parent
Character = Tool.Parent

Tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if Character:findFirstChild("Torso") then
Character.Torso.CFrame = CFrame.new(-61.5, 54.2, 66.5)
end
end)
end)
Report Abuse
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
09 Dec 2012 08:41 AM
@Monkey 'Cause he wants to :D

I think.

Tactical Rainboom Inbound
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
09 Dec 2012 08:46 AM
Lol.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 10:10 AM
Didn't work.... -_-
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
09 Dec 2012 10:13 AM
Tool = script.Parent

Tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
Character = Tool.Parent
if Character:findFirstChild("Torso") then
Character.Torso.CFrame = CFrame.new(-61.5, 54.2, 66.5)
end
end)
end)

Then try that.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 10:19 AM
Didn't work.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 10:20 AM
Nothing in output either. :/
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
09 Dec 2012 10:21 AM
Then I don't know what is wrong, I'm too busy to fix it.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 10:29 AM
Dang, I waited almost a whole day for an answer and the one I got didn't work at all....
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
09 Dec 2012 10:33 AM
Try this prehaps?:

local tool = script.Parent

tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
char = Tool.Parent
if char:findFirstChild("Torso") then
charr.Torso.CFrame = CFrame.new(-61.5, 54.2, 66.5)
end
end)
end)
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 10:38 AM
Nope :|

Why doesn't it work...

Here's more details if it helps?

The item is touchstone and I want it to work just like shedletsky's/telamon's where it teleports you to a certain location when you click. But it seems that no matter what I do it doesn't work :/
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
09 Dec 2012 10:48 AM
local Tool = script.Parent

Tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
game.Players.LocalPlayer.Character.Torso.CFrame = mouse.Hit
end)
end)

put this in a localscript.

¬ SHG Scripter Tier-2 ♣ LuaLearners Elite
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 10:59 AM
Didn't work...
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
09 Dec 2012 11:04 AM
Since you said once they equip it they will instantly move to a certain location. Try this out.

tool = script.Parent
player = tool.Parent.Parent
tool.Changed:connect(function(property)
if property ~= "Parent" then return end
if property == Backpack then return end
local char = game.Workspace.FindFirstChild(player.Name)
char.Torso.CFrame = CFrame.new(0,0,0)
end)
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
09 Dec 2012 11:12 AM
Here's the right code :P It's been a while since I was gone so just change it to a more appropriated way.

tool = script.Parent
local id = Instance.new("StringValue")
id.Parent = tool
id.Value = tool.Parent.Parent.Name
tool.Changed:connect(function(property)
if property ~= "Parent" then return end
if property == Backpack then return end
game.Workspace.id.Value.Torso.CFrame = CFrame.new(0,0,0)
end)
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 11:13 AM
Didn't work :|

I'll post it as a model and see if any of you can fix it?

http://www.roblox.com/BlueFlag-Please-Fix-item?id=100105133
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
09 Dec 2012 11:15 AM
@blocabox

It works perfectly. Did you try my newest post?
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 11:16 AM
Posted right when you posted that, I'll try it.
Report Abuse
blocabox is not online. blocabox
Joined: 06 Dec 2012
Total Posts: 865
09 Dec 2012 11:18 AM
It didn't work?
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