|
This is the script
wait(1)
player = game.Players.LocalPlayer
telespot = game.Workspace.TeleBrick1
teleporter = game.Workspace.TeleToTown
function Tele()
torso = player.Character.Torso
torso.CFrame = telespot.CFrame
end
teleporter.Touched:connect(Tele)
So, whats wrong with it? Please tell me, I am working on a game called "Hunted" |
|
|
blox6137Join Date: 2008-11-23 Post Count: 1109 |
You have to use the "MoveTo()" or whatever function that was; I forget. |
|
|
|
|
FunseJoin Date: 2012-06-11 Post Count: 7887 |
wait(1)
player = game.Players.LocalPlayer
telespot = game.Workspace.TeleBrick1
teleporter = game.Workspace.TeleToTown
CD = instance.new("ClickDetector",teleporter)
CD.Name = "CD"
function Tele()
torso = player.Character.Humanoid
torso:MoveTo(Vector3.new(telespot.Position,telespot))
end
CD.Touched:connect(Tele) |
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
You can't do that, you need a server script for .Touched
Then move the player from there |
|
FunseJoin Date: 2012-06-11 Post Count: 7887 |
That was what I was thinking,
wait(1)
telespot = game.Workspace.TeleBrick1
teleporter = game.Workspace.TeleToTown
function Tele(hit)
torso = hit.Parent.Humanoid
torso:MoveTo(Vector3.new(telespot.Position,telespot))
end
CD.Touched:connect(Tele)
In a server script |
|
|
put this in a script not local:
wait(1)
--no need to define the player
telespot = Workspace.TeleBrick1
teleporter = Workspace.TeleToTown
funtion Tele(touch)
--looks for the player who touched
local player = game.Players[touch.Parent.Name]
if player then
--teleports player
player.Character.Torso.CFrame = TeleBrick1.CFrame
end
end
Teleporter.Touched:connect(Tele) |
|
|
Thanks, I'll try those scripts. |
|
|
None of those worked, please help, and why would there be a click detector in it? |
|
|
|
BlupoV2Join Date: 2012-11-12 Post Count: 543 |
player = game.Players.LocalPlayer
character = player.Character:wait()
torso = character.Torso
telespot = game.Workspace.TeleBrick1
teleporter = game.Workspace.TeleToTown
function Tele()
torso.CFrame = telespot.CFrame + Vector3.new(1,1,1)
end
teleporter.Touched:connect(Tele)
-- Try this |
|
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
no, ur just doing it wrong |
|
|
I copied and pasted it, I cant be doing it wrong. |
|
|
UncleTazJoin Date: 2009-08-19 Post Count: 12795 |
target = game.Workspace.TeleBrick1.CFrame
script.Parent.Touched:connect(function(hit)
humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.Character.Torso.CFrame = target + Vector3.new(0, 1, 0)
wait(2)
end
end)
-- Insert this script inside a Part, name it "Teleport", make sure in Workspace, you have part name "TeleBrick1" |
|
|