Skip to content

Instantly share code, notes, and snippets.

@spotco
spotco / GrassGen.lua
Last active March 20, 2017 06:39
GrassGen.lua
local GRASS_COUNT = 20
local function getCorners(basePart)
local rotate = math.rad(90)
return ({
bottom = {
back = {
left = ((basePart.Position + ((basePart.CFrame * CFrame.Angles(0, rotate, 0)).lookVector * (basePart.Size.X / 2))) - ((basePart.CFrame * CFrame.Angles(rotate, 0, 0)).lookVector * (basePart.Size.Y / 2))) - (basePart.CFrame.lookVector * (basePart.Size.Z / 2));
right = ((basePart.Position + ((basePart.CFrame * CFrame.Angles(0, -rotate, 0)).lookVector * (basePart.Size.X / 2))) - ((basePart.CFrame * CFrame.Angles(rotate, 0, 0)).lookVector * (basePart.Size.Y / 2))) - (basePart.CFrame.lookVector * (basePart.Size.Z / 2));
};
@spotco
spotco / BushGen.lua
Last active March 20, 2017 06:38
BushGen.lua
local BUSH_COUNT = 5
local function getCorners(basePart)
local rotate = math.rad(90)
return ({
bottom = {
back = {
left = ((basePart.Position + ((basePart.CFrame * CFrame.Angles(0, rotate, 0)).lookVector * (basePart.Size.X / 2))) - ((basePart.CFrame * CFrame.Angles(rotate, 0, 0)).lookVector * (basePart.Size.Y / 2))) - (basePart.CFrame.lookVector * (basePart.Size.Z / 2));
right = ((basePart.Position + ((basePart.CFrame * CFrame.Angles(0, -rotate, 0)).lookVector * (basePart.Size.X / 2))) - ((basePart.CFrame * CFrame.Angles(rotate, 0, 0)).lookVector * (basePart.Size.Y / 2))) - (basePart.CFrame.lookVector * (basePart.Size.Z / 2));
};
@spotco
spotco / Weld.lua
Created March 15, 2017 23:16
Weld.lua
local weldName = string.format(
"Weld(%s)_(%s)",
script.Parent.Name,
script.Parent.WeldTarget.Value.Name
)
if script.Parent:FindFirstChild(weldName) ~= nil then
script.Parent:FindFirstChild(weldName):Destroy()
end
local weld = nil
local function make_weld()
@spotco
spotco / decal_to_surfacegui.lua
Created March 23, 2017 05:13
decal_to_surfacegui.lua
local selection_part = game.Selection:Get()[1]
local decals = {}
for _,child in pairs(selection_part:GetChildren()) do
if child.ClassName == "Decal" then
table.insert(decals, child)
end
end
@spotco
spotco / json_unicode_convert.py
Created April 4, 2017 23:18
json_unicode_convert.py
import sys
import re
import json
import io
jsarr = None
try:
jsarr = json.loads(open(sys.argv[1],'r').read())
except Exception as e:
print "ERR file(%s)"%(e)
@spotco
spotco / MinimalTopbarLocalscript.lua
Last active March 29, 2019 03:26
Minimal topbar (Used in 2017 Egghunt and ROBEATS)
wait()
game.Players.LocalPlayer:WaitForChild("PlayerGui")
local screengui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
screengui.ResetOnSpawn = false
local frame = Instance.new("Frame",screengui)
frame.Name = "ChatTopbar"
frame.BackgroundColor3 = Color3.new(0,0,0)
frame.BackgroundTransparency = 0.6
frame.Size = UDim2.new(0,120,0,37)
frame.Position = UDim2.new(0,0,0,-36)
@spotco
spotco / surfacegui_to_decal.lua
Created May 4, 2017 05:59
surfacegui_to_decal.lua
local selection_part = game.Selection:Get()[1]
local decals = {}
for _,child in pairs(selection_part:GetChildren()) do
if child.ClassName == "SurfaceGui" then
table.insert(decals, child)
end
end
@spotco
spotco / motor6dcreator.lua
Created May 4, 2017 07:16
motor6d and weld creator
-- Motor6D creator
local target_part = game.Workspace.StarMachineHumanoid.NeckCenter
local selection_part = game.Selection:Get()[1]
local motor6d = Instance.new("Motor6D")
motor6d.Part0 = target_part
motor6d.Part1 = selection_part
motor6d.C1 = CFrame.new(0,0,0)
motor6d.C0 = motor6d.Part0.CFrame:inverse() * motor6d.Part1.CFrame
@spotco
spotco / RemoveUIOffset.lua
Created May 15, 2017 02:11
RemoveUIOffset.lua
local selection_part = game.Selection:Get()[1]
function r_itr(cur)
pcall(function()
local position = cur.Position
local size = cur.Size
if typeof(size) ~= "UDim2" or typeof(position) ~= "UDim2" then
return
import sys
import json
import io
def use_i_token(i_token, i_token_to_key):
key = i_token_to_key[i_token]
return key == "en-US" or key == "fr" or key == "de" or key == "it" or key == "ja" or key == "pt-BR" or key == "ru" or key == "es"
i_line = 0
i_token_to_key = {}