Giter Club home page Giter Club logo

conikkutills's Introduction

ConikkUtills

My own personal LUAU utility module I use in almost all of my games, It's very bare bones atm and I plan to add on to it overtime.

Roblox

Version

⚠️NOTICE⚠️

This module uses some open source modules on roblox from other creators of the community which will NOT have their code included on this github page, they will be in the module on the roblox site

Installation

You can get the Module here

Requirement Example

local ConikkUtills = require(game:GetService("ReplicatedStorage").ConikkUtills)

Documentation

GetPlayerThumbnail(Player, Enum.ThumbnailType, Enum.ThumbnailSize) | Get a Player's Thumbnail

local Player = game:GetService("Players").LocalPlayer
local Decal = workspace.Part.Decal

Decal.Texture = ConikkUtills:GetPlayerThumbnail(Player, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)

TurnPositive(n : number) | Returns a negative number as positive

print(ConikkUtills:TurnPositive(-8)) --> 8
print(ConikkUtills:TurnPositive(27)) --> 27

NumbersMagnitude(N1 : number, N2 : number) | Returns the magnitude length of two numbers

print(ConikkUtills:NumbersMagnitude(1, 80)) --> 79
print(ConikkUtills:NumbersMagnitude(34, 130)) --> 96
print(ConikkUtills:NumbersMagnitude(-17, 421)) --> 438

Round:ToNearestInteger(n : number) | Round a decimal to the nearest integer

print(ConikkUtills.Round:ToNearestInteger(0.365)) --> 0
print(ConikkUtills.Round:ToNearestInteger(0.683)) --> 1
print(ConikkUtills.Round:ToNearestInteger(0.975)) --> 1

Round:ToFarthestInteger(n : number) | Round a decimal to the farthest integer

print(ConikkUtills.Round:ToFarthestInteger(0.365)) --> -0
print(ConikkUtills.Round:ToFarthestInteger(0.683)) --> 1
print(ConikkUtills.Round:ToFarthestInteger(0.975)) --> 1

StudioOnly:Print(string : string) | Prints in Studio only

local Num = math.random(1, 2)

if num == 1 then
    print("I print in both RobloxPlayer and Roblox Studio :)")
else
   ConikkUtills.StudioOnly:Print("I only print in Studio >:)")
end

StudioOnly:Warn(string : string) | Warns in Studio only

local Num = math.random(1, 2)

if num == 1 then
    warn("I warn in both RobloxPlayer and Roblox Studio :D")
else
    ConikkUtills.StudioOnly:Warn("I only warn in Studio >:D")
end

StudioOnly:Error(string : string, level : number?) | Errors in Studio only

local Num = math.random(1, 2)

if num == 1 then
    error("I error in both RobloxPlayer and Roblox Studio :3", 1)
else
    ConikkUtills.StudioOnly:Error("I only error in Studio >:3")
end

ScreenEffects:Fade():Start:(InSpeed : number?, OutSpeed : number?, DisplayOrder : number?)

  • If InSpeed is set to nil, the fade in will instantly make the screen black, then fade out
  • If OutSpeed is set to nil, then it will instantly get rid of the fade once it completes
  • If DisplayOrder is nil, its set to 99999 by default

If you call a fade like this:

local fade = ConikkUtills:ScreenEffects:Fade():Start(1, 1)

You can call RBXScriptSignals and/or read TweenBase read only properties from fade.In and/or fade.Out if InSpeed and/or OutSpeed are not nil

Here's a example of what you can do with this

-- Method 1:
local fade = ConikkUtills.ScreenEffects:Fade():Start(0.5, 1)

fade.In.Completed:Wait()
print("Fade In Completed")
fade.Out.Completed:Wait()
print("Fade Out Completed")
-- Method 2:
local fade = ConikkUtills.ScreenEffects:Fade()

fade:Start(0.5, 1)

fade.Fading.In.Completed:Wait()
print("Fade In Completed")
fade.Fading.Out.Completed:Wait()
print("Fade Out Completed")

Input:AnyKey()

RbxScriptConnect that can be used when any key is pressed, works on all devices and excludes non touch and keycode type inputs and keycodes resigned for roblox's escape menu, this includes:

  • Escape Key
  • Pause Key
  • Thumbstick1
  • Thumbstick2
  • Mouse Movement
  • Gyro
  • Accelermeter

Here's a script example to show what it can be used for, I usually use this for title screens

local AnyKey = ConikkUtills.Input:AnyKey

function Pressed()
    print("Pressed a key")
end

AnyKey:Wait()
print("Pressed a key for the first time")

AnyKey:Connect(Pressed)

Input:GetPlatform() -> string

Tries to get aproximate platform, sadly can't tell if player is on PlayStation or Xbox, but will say they are a console user

local Platform = ConikkUtills.Input:GetPlatform()

if Platform == "Mobile" then
    print("User is on mobile")
else
    print("User is not mobile")
end

Input:IsController() -> boolean

Checks if Gamepad is connected and enabled

local IsController = ConikkUtills.Input:IsController()

if IsController == true then
    print("Controller connected")
else
    print("No controller connected")
end

Input:IsVR() -> boolean

Checks if user is in VR

local IsVR = ConikkUtills.Input:IsVR()

if IsVR == true then
    print("User is in VR")
else
    print("User is not in VR")
end

Input:GetEnabled() -> string

Returns main UserInputType control that is Enabled, this includes:

  • KeyboardEnabled : "Keyboard"
  • GamepadEnabled : "Gamepad"
  • TouchEnabled : "Touch"

ContextActionUtility

For in depth documentation and other infomation vist this devfourm post

Functions

ConikkUtills.ContextActionUtility:BindAction(actionName : string, functionToBind : any , createTouchButton : boolean, ...)
ConikkUtills.ContextActionUtility:UnbindAction(actionName : string)
ConikkUtills.ContextActionUtility:BindActionAtPriority(actionName : string, functionToBind : any , createTouchButton : boolean, priorityLevel : any, ...)
ConikkUtills.ContextActionUtility:DisableAction(actionName : string, effectList)
ConikkUtills.ContextActionUtility:SetImage(actionName : string, image : string)
ConikkUtills.ContextActionUtility:SetTitle(actionName : string, title : string)
ConikkUtills.ContextActionUtility:GetButton(actionName : string)
ConikkUtills.ContextActionUtility:MakeButtonRound(actionName : string, amount : number)
ConikkUtills.ContextActionUtility:MakeButtonSquare(actionName : string)
ConikkUtills.ContextActionUtility:SetPressedColor(actionName : string, color : Color3)
ConikkUtills.ContextActionUtility:SetReleasedColor(actionName : string, color : Color3)

Events

local Equipped = ConikkUtills.ContextActionUtility.LocalToolEquipped()
local Unequipped = ConikkUtills.ContextActionUtility.LocalToolUnequipped()

Refrences:

Equipped:Connect()
Equipped:Wait()
Equipped:ConnectParallel()
Equipped:Once()

LightingAPIProfile

  • For in depth documentation and other infomation vist this github repository
  • This was made by my friend Hexa and I integraded it into my system, it's really good for changing lighting in game very easily

Functions

ConikkUtills.LightingProfile:ApplyProfile()
ConikkUtills.LightingProfile:CreateProfileInstanceFromCurrentLighting()

Credits

Development

Want to contribute? Send a pull request if there are any bugs!

License

MIT

conikkutills's People

Contributors

conikku avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.