01 | local exampleModel_tree 1 = workspace.exampleModel_tree 1 |
02 | tool = script.Parent |
03 | local localScriptText_testing = workspace.localScriptText_testing |
04 | local SurfaceGui = localScriptText_testing.SurfaceGui |
05 | local TextLableMessageOutput = SurfaceGui.TextLabel |
06 | local player = game.Players.LocalPlayer |
07 | local mouse = player:GetMouse() |
08 | local HumanoidRootPart = workspace [ player.Name ] .HumanoidRootPart |
09 | tool.Equipped:Connect( function () |
10 | TextLableMessageOutput.Text = "tool was equipped" |
11 | tool.Activated:Connect( function () |
12 | TextLableMessageOutput.Text = "mouse was clicked" |
13 | if mouse.Target and mouse.Target.Parent then |
14 | if mouse.Target.CFrame = = exampleModel_tree 1. tree 1 Part 1 _trunk.CFrame and not HumanoidRootPart.**Position **< = exampleModel_tree 1. tree 1 Part 1 _trunk.CFrame + CFrame.new( 1 , 0 , 0 or 2 , 0 , 0 or 3 , 0 , 0 ) then |
15 | if HumanoidRootPart.**Position** < = exampleModel_tree 1. tree 1 Part 1 _trunk.CFrame + CFrame.new( 1 , 0 , 0 or 2 , 0 , 0 or 3 , 0 , 0 ) then |
It looks like you're mixing a CFrame with a position. A coordinate frame stores a position plus a rotational matrix. So you could just grab the .Position from the CFrames, and that should fix it. So (exampleModel_tree1.tree1Part1_trunk.CFrame + CFrame.new(1,0,0 or 2,0,0 or 3,0,0)).Position
instead.