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
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
| |
|
blocabox
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
| |
|
blocabox
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
|
| 09 Dec 2012 07:08 AM |
| Bump, why aren't I getting answers?! |
|
|
| Report Abuse |
|
|
blocabox
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
|
| 09 Dec 2012 08:23 AM |
| Bump, scripting helpers is useless. |
|
|
| Report Abuse |
|
|
cygorx
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 668 |
|
|
| 09 Dec 2012 08:26 AM |
| You didn't call your function. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 09 Dec 2012 08:41 AM |
@Monkey 'Cause he wants to :D
I think.
Tactical Rainboom Inbound |
|
|
| Report Abuse |
|
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
| |
|
blocabox
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
| |
|
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
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
| |
|
blocabox
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
|
| 09 Dec 2012 10:20 AM |
| Nothing in output either. :/ |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 865 |
|
| |
|