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?
local Player = game.Players.LocalPlayer local pos1 = nil local pos2 = nil local playerspeed = Player.Character.Humanoid.WalkSpeed --studs a second local torso = Player.Character.Torso.Position local initX = script.Parent.Size.X.Offset while wait() do pos1 = game.Workspace.TheHand.Hand.Position pos2 = game.Workspace:FindFirstChild(Player.Name).Torso.Position point = game.Workspace.TheHand.Finish.Position local handdistance = (pos1 - point).magnitude local fromplayer = (pos1 - point).magnitude local pointdistance = (pos2 - point).magnitude local handtime = fromplayer/25 local arrivaltime = pointdistance/playerspeed --print('The hand is '..handaway..' seconds away!') local Pie = (pointdistance / 16) script.Parent.LPlayername:TweenPosition(UDim2.new(1, -115, 0, 1000/initX*Pie),"Out","Sine",0.25) script.Parent.Hand:TweenPosition(UDim2.new(-1.5, 0, 0, 1000/initX*handtime),"Out","Sine",0.25) end
If you want people to help, you gotta put it in Lua format bud.
Marked as Duplicate by DigitalVeer, User#5978, and Discern
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?