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)
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)
Kart = game.Debris.Kart1 Button = script.Parent.Parent plr