Skip to content

Instantly share code, notes, and snippets.

View Elmuti's full-sized avatar
🏠
Working from home

real name Elmuti

🏠
Working from home
  • Finland
View GitHub Profile
function getRayEntranceAndExit(pos, dir, distance)
local ignore = deepcopy(_G.ignorelist)
local Ray1 = Ray.new(pos, dir.unit*distance)
local obj, enter, enterface = workspace:FindPartOnRayWithIgnoreList(Ray1, _G.ignorelist)
if obj ~= nil then
table.insert(ignore, obj)
end
local Ray2 = Ray.new(enter, dir.unit*distance)
local _, hpos2 = workspace:FindPartOnRayWithIgnoreList(Ray2, ignore)
local Ray3 = Ray.new(hpos2, CFrame.new(hpos2, enter).lookVector.unit*distance)
debug = true
player = {
x = 64;
y = 500;
Speed = 250;
Texture = nil;
}
isAlive = true
score = 0
highscore = 0
debug = true
player = {
x = 64;
y = 500;
Speed = 250;
Texture = nil;
}
isAlive = true
score = 0
highscore = 0
debug = true
player = {
x = 64;
y = 500;
Speed = 250;
Texture = nil;
}
isAlive = true
score = 0
local chars = "abcdefghijklmnopqrstuvwxyz0123456789"
function flipCoin()
local bools = {true, false}
return bools[math.random(1, #bools)]
end
function randChar()
local n = math.random(1, 36)
local chars = "abcdefghijklmnopqrstuvwxyz0123456789"
function flipCoin()
local bools = {true, false}
return bools[math.random(1, #bools)]
end
function randChar()
local n = math.random(1, 36)
local mx, my
function love.load()
end
function love.update(dt)
mx, my = love.mouse.getPosition()
end
-- A slightly edited version of https://github.com/Vorlias/ROBLOX-ModuleScripts/blob/master/Lua-OOP/ModObject.rbxs
ModObject = {
Version = 1.4;
EnableStructConstructor = true;
};
CustomObjects = {
};
local Signal = {}
local mobj = require("ModObject")
function Signal.New()
local sig = Signal:Init()
sig.connection = nil
return sig
end
function Signal:Connect(f)
local Inventory = {}
local mobj = require("System/Libraries/ModObject")
local Signal = require("System/Classes/Signal")
Inventory.ItemAdded = Signal.New()
Inventory.ItemRemoved = Signal.New()
function Inventory.Create(itemsTable)
local inv = Inventory:Init()