Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make it so when something will teleport, it will be near your torso?

Asked by 10 years ago

Sorry for the long title. I am working on something that when you click a GUI, it will teleport a kart near your torso, no matter where you are. I got all the code down, but theres just one thing that will not work that I do not understand. After I click it, I go to the output, and one thing says Unable to cast CoordinateFrame to Vector3. Here is the code to. If anyone could help me that would be great!

Kart = game.Debris.Kart1 Button = script.Parent.Parent plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function() if Button.Visible == true then Button.Visible = false wait(0.1) Kart:clone().Parent = game.Lighting wait(1) Kart2 = game.Lighting.Kart1 Kart2.Name = "Kart" wait(1) Kart2.Parent = game.Workspace Kart2:makeJoints() Kart2:MoveTo(plr.Character.Torso.CFrame + Vector3.new(0,0,10)) --This is the problem.

end end)

2 answers

Log in to vote
0
Answered by 10 years ago

try this

Kart = game.Debris.Kart1 Button = script.Parent.Parent plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function() if Button.Visible == true then Button.Visible = false wait(0.1) Kart:clone().Parent = game.Lighting wait(1) Kart2 = game.Lighting.Kart1 Kart2.Name = "Kart" wait(1) Kart2.Parent = game.Workspace Kart2:makeJoints() Kart2:MoveTo(plr.Character.Torso.Position * Vector3.new(0,0,10)) --This is the problem.

end end)
0
Thank you so much! johnjohncar 10 — 10y
Ad
Log in to vote
0
Answered by 10 years ago
Kart = game.Debris.Kart1 Button = script.Parent.Parent plr

Answer this question