Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

1 comment

0

Thank you so much!

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

This discussion is preserved as it was. New answers, comments, and votes are closed.