Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me with my gui? [closed]

Asked by 8 years ago

This question already has an answer here:

I need help with this gui?

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
0
Edit your post to use Lua code formatting. A row of ~~~~ should be before and after the code on its own line. BlueTaslem 18071 — 8y
0
Done JuanShedletsky 0 — 8y
0
@JuanShedletsky Highlight all the code you have and hit the blue 'Lua' button. DigitalVeer 1473 — 8y

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?

1 answer

Log in to vote
1
Answered by 8 years ago

If you want people to help, you gotta put it in Lua format bud.

0
I tried?? JuanShedletsky 0 — 8y
Ad