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.
This module uses some open source modules on roblox from other creators of the community! Creators will be credited in the according scripts.
You can get the Module here
local ConikkUtills = require(game:GetService("ReplicatedStorage").ConikkUtills)GetPlayerThumbnail(Player, Enum.ThumbnailType, Enum.ThumbnailSize)
→ contentID: string, isUsable: boolean
local Player = game:GetService("Players").LocalPlayer
local Decal = workspace.Part.Decal
Decal.Texture = ConikkUtills:GetPlayerThumbnail(Player, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)print(ConikkUtills.Number:TurnPositive(-8)) --> 8
print(ConikkUtills.Number:TurnPositive(27)) --> 27print(ConikkUtills.Number:NumbersMagnitude(1, 80)) --> 79
print(ConikkUtills.Number:NumbersMagnitude(34, 130)) --> 96
print(ConikkUtills.Number:NumbersMagnitude(-17, 421)) --> 438IMPORTANT: Recently a
mapmethod was implemented into the math library of luau, this method achieves the same behaviour at better performance. It is recommended to usemath.mapinstead ofCarryNumberToNewRange
local oldRange = NumberRange.new(0, 10)
local newRange = {Min = 0, Max = 50} --Both can be a NumberRange and a table
local number1 = 5
local number2 = 8
local number3 = 1
print(
ConikkUtills.Number:CarryNumberToNewRange(number1, oldRange, newRange), --> 25
ConikkUtills.Number:CarryNumberToNewRange(number2, oldRange, newRange), --> 40
ConikkUtills.Number:CarryNumberToNewRange(number3, oldRange, newRange) --> 5
)print(ConikkUtills.Number:RoundToNearestInteger(0.365)) --> 0
print(ConikkUtills.Number:RoundToNearestInteger(0.683)) --> 1
print(ConikkUtills.Number:RoundToNearestInteger(0.975)) --> 1print(ConikkUtills.Number:RoundToFarthestInteger(0.365)) --> -0
print(ConikkUtills.Number:RoundToFarthestInteger(0.683)) --> 1
print(ConikkUtills.Number:RoundToFarthestInteger(0.975)) --> 1local 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 >:)")
endlocal 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")
endlocal 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")
endFadeScreen || FadeWipeTransition = {
Start : function,
Fading : {
In : Tween?,
Out : Tween?
}
}FadeScreen:Start(InSpeed : number?, OutSpeed : number?, DisplayOrder : number?, Color : Color3?)
→ {In: Tween, Out: Tween}
- If
InSpeedis set tonil, the fade in will instantly make the screen black, then fade out - If
OutSpeedis set tonil, then it will instantly get rid of the fade once it completes - If
DisplayOrderisnil, its set to 99999 by default - If
Colorisnil, its set to Color3.FromRGB(0, 0, 0) [Color Black] by default
FadeWipeTransition:Start(Speed : number?, DisplayOrder : number?, Color : Color3?)
→ {In: Tween, Out: Tween}
- If
Speedis set tonil, by default it will be (0.65 x 2) - If
DisplayOrderisnil, its set to 99999 by default - If
Colorisnil, its set to Color3.FromRGB(0, 0, 0) [Color Black] by default
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
-- 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")Returns a signal 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
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)Tries to get the approximate platform, can't tell if player is on PlayStation or Xbox, but will say they are a console user.
If the user has multiple types of controls enabled, then it will return "Compound". For example, if the user has a phone with a keyboard/gamepad plugged into it, it will return "Compound".
local Platform = ConikkUtills.Input:GetPlatformApproximate()
if Platform == "Mobile" then
print("User is on mobile")
else
print("User is not mobile")
end*Please note that if the user is either using PlayStation or Xbox controllers but has NOT yet inputted any inputs OR has not yet used the needed keys to approximate this will result in the function returning "Other" and not the appropriate platform name
↑ This has been scrapped in favor of the platform being found immediately via performing GetStringForKeyCode for ButtonA, if this causes any problems it can be disabled with setting FindConsolePlatformImmediate (found in "DeviceMaid" script, line 1) to false.
local Platform = ConikkUtills.Input:GetConsolePlatformApproximate()
if Platform == "PlayStation" then
print("Is using PlayStation controller")
elseif Platform == "Xbox" then
print("Is using Xbox controller")
endHere are the keys needed to be pressed in order to do proper platform detection, you could use these in a startup menu of sorts and ask the player to input one of these buttons to quickly declare their console platform.
NeededInputs = {
Enum.KeyCode.ButtonA,
Enum.KeyCode.ButtonB,
Enum.KeyCode.ButtonX,
Enum.KeyCode.ButtonY,
Enum.KeyCode.ButtonL1,
Enum.KeyCode.ButtonL2,
Enum.KeyCode.ButtonL3,
Enum.KeyCode.ButtonR1,
Enum.KeyCode.ButtonR2,
Enum.KeyCode.ButtonR3,
Enum.KeyCode.ButtonStart,
Enum.KeyCode.ButtonSelect,
}local IsController = ConikkUtills.Input:IsController()
if IsController == true then
print("Controller connected")
else
print("No controller connected")
endlocal IsVR = ConikkUtills.Input:IsVR()
if IsVR == true then
print("User is in VR")
else
print("User is not in VR")
endinfoTable = {
Gamepad: boolean, --if true, a gamepad is connected to the device the user is using. this goes for the rest of the elements in the table
Touch: boolean,
Keyboard: boolean
}For in depth documentation and other infomation vist this devfourm post
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)local Equipped = ConikkUtills.ContextActionUtility.LocalToolEquipped()
local Unequipped = ConikkUtills.ContextActionUtility.LocalToolUnequipped()Equipped:Connect()
Equipped:Wait()
Equipped:ConnectParallel()
Equipped:Once()- 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
ConikkUtills.LightingProfile:ApplyProfile(Configuration | LightingProfileData)ConikkUtills.LightingProfile:CreateProfileInstanceFromCurrentLighting() -> ConfigurationWant to contribute? Send a pull request if there are any bugs!
MIT
