Can someone help me with my gui? [closed]
Ok, so this is my dilemma. I am making a tracking gui for a moving hand, and to track where the player is in between the start, and finish of a map. This is the code. Can someone show me how I can get the speed of the moving hand, and check if it is in between the start, and finish?
01 | local Player = game.Players.LocalPlayer |
04 | local playerspeed = Player.Character.Humanoid.WalkSpeed |
05 | local torso = Player.Character.Torso.Position |
06 | local initX = script.Parent.Size.X.Offset |
09 | pos 1 = game.Workspace.TheHand.Hand.Position |
10 | pos 2 = game.Workspace:FindFirstChild(Player.Name).Torso.Position |
11 | point = game.Workspace.TheHand.Finish.Position |
12 | local handdistance = (pos 1 - point).magnitude |
13 | local fromplayer = (pos 1 - point).magnitude |
14 | local pointdistance = (pos 2 - point).magnitude |
16 | local handtime = fromplayer/ 25 |
17 | local arrivaltime = pointdistance/playerspeed |
20 | local Pie = (pointdistance / 16 ) |
21 | script.Parent.LPlayername:TweenPosition(UDim 2. new( 1 , - 115 , 0 , 1000 /initX*Pie), "Out" , "Sine" , 0.25 ) |
22 | script.Parent.Hand:TweenPosition(UDim 2. new(- 1.5 , 0 , 0 , 1000 /initX*handtime), "Out" , "Sine" , 0.25 ) |