Function Helper | Coding made easier

Function Helper


FunctionHelperIcon

Link:
Function Helper


Description

Function Helper gives useful tools to help so it becomes a bit more easy to code in some aspects of Roblox Studio. Roblox has a variety of syntaxes, which can sometimes be tough to implement. Function Helper plans to make it easy to code in Roblox so that tough things to implement can be made in a matter of seconds.


Why this?

Function Helper gives efficient tools to make some things easier, you can also share, what can be added, and there is a 100% chance I’ll add it.


Commands

Pcalls

FunctionHelper:createSafePcall(functionToExecute, tries <- Optional)              

Random

FunctionHelper.getRandomIndexByProbability(probList) --Numbers have to add up to 100

Raycasting

FunctionHelper:Raycast(rayOrigin, rayDirection, filters)                           
FunctionHelper:shoot(rayOrigin, rayDirection, projectile, deletionTime, filters) -- Better to cast a raycasted line, returns results
FunctionHelper:changeRayDistance(rayDirection, distance) -- Chance distance of ray

Tables

FunctionHelper:sortTable(tableToSort, lowestToHighest <- Boolean)  -- Sort a table

Examples

local FunctionHelper = require(game:GetService("ServerScriptService"):WaitForChild("FunctionHelper"))

local distance = 1000 -- Distance for ray to travel
local directionOfRay = Vector3.new(90,0,0) -- Direction for ray to travel

local direction = FunctionHelper:changeRayDistance(directionOfRay, distance)

while true do
	local origin = workspace:WaitForChild("Test").Position
	
	FunctionHelper:createSafePcall(function()
		local result = FunctionHelper:shoot(origin, direction, game.ServerStorage.Bullet, 0.5, {FilterDescendantsInstances = {workspace.Part}, FilterType = Enum.RaycastFilterType.Blacklist})
		
		if result then
			local explosion = Instance.new("Explosion", workspace)
			explosion.Position = result.Position
		end
	end, nil, false)
	task.wait(1)
end
local tableToSort = {2,1,5,4}
local sortedTable = FunctionHelper:sortTable(tableToSort, true)

Any suggestions on what I can add or improve on will be appreciated!

10 Likes

Update 0.1

This update includes 4 new functions!


Raycasting

FunctionHelper:Raycast(rayOrigin, rayDirection, filters) -- Returns result
FunctionHelper:shoot(rayOrigin, rayDirection, projectile, deletionTime, filters) -- Better to cast a raycasted line, returns results
FunctionHelper:changeRayDistance(rayDirection, distance) -- Chance distance of ray

Tables

FunctionHelper:sortTable(tableToSort, lowestToHighest <- Boolean)  -- Sort a table

Examples

local FunctionHelper = require(game:GetService("ServerScriptService"):WaitForChild("FunctionHelper"))

local distance = 1000 -- Distance for ray to travel
local directionOfRay = Vector3.new(90,0,0) -- Direction for ray to travel

local direction = FunctionHelper:changeRayDistance(directionOfRay, distance)

while true do
	local origin = workspace:WaitForChild("Test").Position
	
	FunctionHelper:createSafePcall(function()
		local result = FunctionHelper:shoot(origin, direction, game.ServerStorage.Bullet, 0.5, {FilterDescendantsInstances = {workspace.Part}, FilterType = Enum.RaycastFilterType.Blacklist})
		
		if result then
			local explosion = Instance.new("Explosion", workspace)
			explosion.Position = result.Position
		end
	end, nil, false)
	task.wait(1)
end

local tableToSort = {2,1,5,4}
local sortedTable = FunctionHelper:sortTable(tableToSort, true)

More updates coming soon!


2 Likes

I think this is a great resource that is definitely undervalued. It’s way easier to call FunctionHelper:sortTable() vs this:

local table = {1, 5302, 84938, 38, 948, 12}

table.sort(table, function(a, b)
    return a < b
end)

Though the name could be worked on, and perhaps a documentation could be even more helpful (showing its true potential), I think this was, and still could be an amazing resource!

1 Like

Wow! Thanks for motivating me for updating Function Helper again!

Also can you tell me what name I can put to replace Function Helper?

I honestly do not know… Something kind of techy would sound good, though!

1 Like

Update 0.2

This is a very small update, with no new commands, but I deprecated some functions, and I am going to change their names. If you are using any of the deprecated functions you should probably change to the latest version of the function, however nothing will glitch if you are using the deprecated functions.

Deprecated Functions:

FunctionHelper:Raycast(rayOrigin, rayDirection, filters)                           
FunctionHelper:shoot(rayOrigin, rayDirection, projectile, deletionTime, filters) -- Better to cast a raycasted line, returns results
FunctionHelper:changeRayDistance(rayDirection, distance) -- Chance distance of ray

I am also going to add these commands, next update!

FunctionHelper:BanPlayer(player, timeForBan)
FunctionHelper:MoreRandom(startingNumber, endNumber)

are you going to create documentation for this? it would be really helpful!
I also noticed some of the function casing is a bit inconsistent, try to have some naming conventions
great tool! good luck with the future of it

1 Like

Thanks! I am learning how to create a documentation for this, and I’ll create it soon! I am also deprecating the functions that don’t have a good naming convention. I will switch these functions for new ones!

I am thinking about moving FunctionHelper:BanPlayer to Update 0.4, since it is a bit tough to make

Hey nice idea! It looks very useful, I’ll have to try it. Maybe you could call it Function Finder?

1 Like

Function Finder gives the wrong impression, so maybe something like simpli-function, I’m not too sure lol.

1 Like

How about something similar to what @DistinctDeveloper said: EasyFunc?

1 Like

For now I stopped working on this module, as I am planning to make my integer bypasser module public soon.

1 Like