Navigation Menu

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
@Elmuti
Elmuti / monster_ai.lua
Created August 28, 2015 01:46
monster_ai.lua
local char = script.Parent
local head = char:WaitForChild("Head")
local torso = char:WaitForChild("Torso")
local hum = char:WaitForChild("Humanoid")
local destReachRange = 3
local losRange = 128
local hearRange = 48
local ai_max_range = math.huge
local attackRange = 2 --65
local runSpeed = 16
@Elmuti
Elmuti / monster_ai.lua
Created August 28, 2015 12:26
monster_ai.lua
local char = script.Parent
local head = char:WaitForChild("Head")
local torso = char:WaitForChild("Torso")
local hum = char:WaitForChild("Humanoid")
local destReachRange = 3
local losRange = 128
local hearRange = 48
local ai_max_range = math.huge
local attackRange = 2 --65
local runSpeed = 16
@Elmuti
Elmuti / monster_ai.lua
Created August 28, 2015 18:34
monster_ai v3
local char = script.Parent
local head = char:WaitForChild("Head")
local torso = char:WaitForChild("Torso")
local hum = char:WaitForChild("Humanoid")
local destReachRange = 2
local losRange = 128
local hearRange = 48
local ai_max_range = math.huge
local attackRange = 2 --65
local runSpeed = 16
@Elmuti
Elmuti / asd.lua
Created August 28, 2015 23:27
asdads
--Some vars
local char = script.Parent
local head = char:WaitForChild("Head")
local torso = char:WaitForChild("Torso")
local hum = char:WaitForChild("Humanoid")
local map = workspace.Map
local sndEvent = workspace.Game.PlaySoundClient
local timeouts = 0
--Some constants
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)