Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is it possible to do math with a path?

I will use three buttons as an example This script is very rough but I want to know if It's possible to do math with path values of some sort.

I am trying to use paths instead of numbers.

PathA = PathA + PathB
PathA = PathA - PathB
PathA = PathA * PathB
PathA = PathA / PathB
PathA = PathA <=PathB

Note: I am not trying to fix a script I want to know if this method is possible and if it will work correctly.

I know the script does not work.

--Rough Example

local ButtonHolder = script.Parent
local pathA = ButtonHolder.ButtonAHolder.ButtonA
local pathB = ButtonHolder.ButtonBHolder.ButtonB
local PathNameA = ButtonHolder.ButtonAHolder
local PathNameB = ButtonHolder.ButtonBHolder

local Subtract = ButtonHolder.Subtract


Subtract.MouseButton1Down function()) 
pathA.Value = PathA.Value - PathB.Value  --Subtracting a path value

end)

3 comments

1

What is a "path"?

1

I'm with BlueTaslem on this one. The question uses....custom...terminology? I guess. Best term I can think of.

0

Nevermind I figured out how to do it. A.Value = (A.Value-B.Value)

1 answer

As long as it's an IntValue and the value is not nil then it should work. Your rough example seems confusing though.

I'm assuming you mean path as in game.Workspace.yadayada

This discussion is preserved as it was. New answers, comments, and votes are closed.