Hello, I'm a 100% noob at scripting please ignore the .parents for days Idk how to shorten it ;-;

function onClick() 

script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(Vector3.new(-37.505, 16.575, 71.025)) 
end 

script.Parent.MouseButton1Click:connect(onClick) 

3 comments

0

You can shorten it by using LocalPlauer

0

Like incapaz said, just use a variable called player like this "local player = game:GetService("Players").LocalPlayer", this replaced user script.Parent.Parent stuff, so it's just player.Character.Torso.Cframe. Also, this script only changed the CFrame for the person clicking because its a local script, others won't see this.

0

o ty