Skip to content

Instantly share code, notes, and snippets.

View kezzyhko's full-sized avatar
💜
💜💜💜🤍🤍

Sergey Semushin kezzyhko

💜
💜💜💜🤍🤍
View GitHub Profile
@kezzyhko
kezzyhko / NormalizeModel.lua
Created April 18, 2024 17:24
Script for Roblox to weld uploaded model and add a root part
local model = game.Selection:Get()[1]
local root = Instance.new("Part")
root.Name = "RootPart"
root.Size = Vector3.one
root.EnableFluidForces = false
root.CanCollide = false
root.CanQuery = false
root.CanTouch = false
root.Transparency = 1
<?php
function shell_with_print($cmd_pattern, ...$argv) {
$cmd = sprintf("$cmd_pattern 2>&1", ...$argv);
echo $cmd;
echo "\n";
system($cmd, $ret);
return ($ret == 0);
}
@kezzyhko
kezzyhko / !RobloxVideoPlayer.md
Last active February 8, 2024 20:26
Video player for Roblox on EditableImage

This is a video player for Roblox on EditableImage

How to use

On http server

  • Change SERVER_ADDRESS in VideoPlayer.py to whatever you want
  • Install dependencies for VideoPlayer.py script: numpy and opencv
  • Run VideoPlayer.py on your server
  • Setup VideoId.txt files, which link to video file and contain asset id of audio uploaded to roblox

Inside Roblox

  • Put VideoDownloader.lua into ServerScriptService as server Script
  • Inside VideoDownloader, create module Config which has UrlBase set to you server address in format https://example.com/
@kezzyhko
kezzyhko / MoveToCamera.lua
Created January 13, 2024 16:12
Moves selected part/model to current camera position
game.Selection:Get()[1]:PivotTo(workspace.CurrentCamera.CFrame)
@kezzyhko
kezzyhko / SelectDescendantsOfType.lua
Last active October 27, 2023 17:29
This script selects descendants of selected instance, but only of specific type
local p = game.Selection:Get()[1]
for _, obj in pairs(p:GetDescendants()) do
if obj:IsA("Seat") then
game.Selection:Add({obj})
end
end
game.Selection:Remove({p})
@kezzyhko
kezzyhko / getRegistraionDates.lua
Last active September 4, 2023 10:32
Prints Roblox registration dates of all players on server
local players = game:GetService("Players"):GetPlayers()
for _, player in pairs(players) do
local registrationTimestamp = (os.time() - player.AccountAge * 86400)
local registrationDateString = os.date("%Y-%m-%d", registrationTimestamp)
print(player.Name, registrationDateString)
end
@kezzyhko
kezzyhko / DevToDevExample.py
Created January 30, 2023 10:49
Example of sending a custom event to devtodev
import requests
import zlib
from requests.structures import CaseInsensitiveDict
url = "https://api.devtodev.com/stat/v1/?api=KEY"
headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/json"
data = r'{"2834420485":{"ce":[{"name":"TestEvent","entries":[{"p":{"t1":{"double":{"testDouble2":2.2,"testDouble1":1.1},"string":{"testOther2":"table: 0xccd0b9dfc6fb80ea","testString1":"A","testOther1":"Part","testString2":"B","testString3":"C"},"boolean":{"testBool1":true}}},"t1":1674753603}]}]}}'
@kezzyhko
kezzyhko / RandomIntWithExcept.lua
Created November 2, 2022 14:47
A function that returns a random integer from range [min; except) ∪ (except; max]
local function RandomIntWithExcept(min: number, max: number, except: number?): number
if except then
local len = max - min + 1
return (math.random(1, len-1) + except - min) % len + min
else
return math.random(min, max)
end
end
@kezzyhko
kezzyhko / change_transparency.py
Created July 29, 2022 16:04
Change image transparency, but preserve color data
import argparse
import pathlib
from PIL import Image
def transparency_type(value, min=0, max=255):
try:
value = int(value)
if min <= value <= max: