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
local RunService = game:GetService("RunService")
local Signal = require(game.ReplicatedStorage.Core.NevermoreSignal)
local UnitMixin = require(game.ReplicatedStorage.Mixins.UnitMixin)
local class = require(game.ReplicatedStorage.Middleclass)
local SpellHandlers = require(game.ServerScriptService.SpellHandlers)
local CastResult = require(game.ReplicatedStorage.Game.SpellCastResult)
local Combat = require(game.ServerScriptService.Combat)
local AuraDatabase = require(game.ReplicatedStorage.AuraDatabase)
local ItemDatabase = require(game.ReplicatedStorage.Databases.ItemDatabase)
local Aura = require(game.ServerScriptService.Aura)
local Players = game:GetService("Players")
local ObjectManager = require(game.ReplicatedStorage.ObjectManager)
local DamageInfo = require(game.ReplicatedStorage.Game.DamageInfo)
local HealInfo = require(game.ReplicatedStorage.Game.HealInfo)
local Aura_C = require(game.ReplicatedStorage.Entities.Aura_C)
local Party_C = require(game.ReplicatedStorage.Entities.Party_C)
local CombatText = require(game.ReplicatedStorage.Interface.CombatText)
local ProjectileService = require(game.ReplicatedStorage.Services.ProjectileService_C)
local SpellResult = require(game.ReplicatedStorage.Enums.SpellResult)
local ConsoleService = require(game.ReplicatedStorage.Services.ConsoleService)
local function raycast(orig, dir)
return workspace:FindPartOnRayWithIgnoreList(Ray.new(orig, dir), {char, workspace.Ignore, workspace.PlayerSpawns, workspace.ItemPickups, workspace.ItemSpawns, workspace.Nodes})
end
-- Radius of player's hitbox:
local playerRadius = 2.95
-- STEP 1: cast forward into movement direction to find initial collision with wall:
-- (i.e. so you dont teleport the player into wall to begin with)
local SpellResistType = {
SpellResult.Miss,
SpellResult.Resist,
SpellResult.Resist75,
SpellResult.Resist50,
SpellResult.Resist25,
SpellResult.ResistNone,
}
local SPELL_RESISTANCE = {
local mathLib = {}
function mathLib.Lerp(start, goal, alpha)
return start * (1 - alpha) + goal * alpha
end
function mathLib.Round(num, numDecimalPlaces)
local mult = 10^(numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end
function newStack ()
return {""} -- starts with an empty string
--nigger
local PLAYER_EVENT_ON_DUEL_END = 11
local PLAYER_EVENT_ON_COMMAND = 42
local POWER_MANA = 0
local function OnDuelEnd(event, winner, loser, type)
winner:SetHealth(winner:GetMaxHealth())
if winner:GetPowerType() == POWER_MANA then
winner:SetPower(POWER_MANA, winner:GetMaxPower(POWER_MANA))
local Orakel = require(game.ReplicatedStorage.Orakel.Main)
local mathLib = Orakel.LoadModule("MathLib")
local Die = require(game.ReplicatedStorage.Die)
local Combat = {}
local UnitCombatDieSides = require(game.ReplicatedStorage.Enums.UnitCombatDieSides)
local DamageSchool = require(game.ReplicatedStorage.Enums.DamageSchool)
local EquipmentSlot = require(game.ReplicatedStorage.Enums.EquipmentSlot)
local UNARMED_DAMAGE = NumberRange.new(1, 3)
local char = script.Parent
local Root = char:WaitForChild("HumanoidRootPart")
local map = workspace.CurrentMap
local Abyss = require(game.ReplicatedStorage.Abyss.Main)
local npcLib = Abyss.LoadModule("NpcLib")
local pathLib = Abyss.LoadModule("PathLib")
local assetLib = Abyss.LoadModule("AssetLib")
local physLib = Abyss.LoadModule("PhysLib")
function Pathfind(target, startPos, goalPos)
curStatus = "Pathfinding"
local abortPathfind = false
--GetNearestNode(position, returnBrick, dir, masterTable)
--GetNearestNodeVis(subject, position, visRange, returnBrick, dir, masterTable, ignore)
local startID = pathLib.GetNearestNodeVis(Root, startPos, losRange, false, map.Nodes, masterTable, {char, workspace.NPCs})
local goalID = NEW_GOAL_NODE or pathLib.GetNearestNodeVis(target, goalPos, losRange, false, map.Nodes, masterTable, {char, workspace.NPCs})
local path = pathLib.AStar(masterTable, startID, goalID)
local Vector2 = {}
local sqrt = math.sqrt
local acos = math.acos
local abs = math.abs
function Vector2.new(x, y)
assert(tonumber(x) or (x == nil), "Vector2 coordinates can only be numbers")
assert(tonumber(x) or (x == nil), "Vector2 coordinates can only be numbers")
local vec2 = {}
setmetatable(vec2, Vector2)