WinLib - A Library Module

INFO

Note: I didn’t feel like making this page all beautiful and stuff, I am feeling a bit down so this is the best I can do

What is this?

A “very simple” library module I made for fun, filling up some needs in your game.
Note: This is in alpha and very unfinished, I want to add a lot of stuff, suggest your stuff in the comments

What does it have?

Well, it has webhook support, functions for calculating (like turning studs into metres) and some simple game functions. I’ve been thinking of adding more though but thought i’d release this as alpha.

It also has (since 1.1a) AI Gemini 1.5 flash support. Simplified to make your code look “pretty”
I also gave the AI memory!

Will this be another unfinished project?

Hopefully not.

Downloads

Get it from github

Small Documentation

How to use the webhook functions:

local Webhook = WinLib.CreateWebhook("yourid","yourtoken")

WinLib.WebhookPost(Webhook, "Hello World!") -- Also returns "Success" and "Response"

Calculating the “average” hours spent in a week

local HoursSpent = {
	3,
	4,
	2,
	5,
	6,
	8,
	6
}

print(WinLib.Mean(HoursSpent))

Transforming alive players into a userid

local List = WinLib.GetPlayersAlive()
local UserID2Transform = 1

for _, Player in pairs(List) do
	local Char = Player.Character
	local Hum = Char:FindFirstChildOfClass("Humanoid")
	
	WinLib.TransformWithUserID(Hum, UserID2Transform)
end

AI Generating Text (1.1a)

local AI = WinLib.CreateAI("YourAPIKey", "You are a helpful assistant")

WinLib.GenerateAI(AI, "How do gamma ray bursts work?", false, "Me") 
-- Second arg is prompt, Third is whenever or not is adding to the AI's memory

Color mixing

local Part = workspace:FindFirstChild("Part") or workspace:WaitForChild("Part")

Part.Color = WinLib.MixColors(Color3.new(1,0,0), Color3.new(0,0,1), .5) -- Becomes purple

GetRandomPosInCircle in action

local Dist = {
	50,
	50,
	150
}

local Min = Dist[1]
local Max = Dist[2]

local StartPoint = Vector3.new(0,0,0)

while true do
	local P = Instance.new("Part")
	P.Anchored = true

	P.Size = Vector3.new(1,1,1)
	P.Material = Enum.Material.Neon
	P.Color = Color3.fromRGB(255,0,0)
	P.Position = WinLib.GetRandomPosInCircle(StartPoint, Dist)

	P.Parent = workspace

	task.wait(.1)
end

Result:

1 Like