prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--Weighted Random Function
|
function maths:WeightedRandom(Weights,Numbers,Round)
if #Weights == #Numbers then
local Sum = 0
local Rand = {}
for i,k in pairs(Weights)do
if type(k) ~= "number"then continue end
Sum += k
for j=1,k do
table.insert(Rand,Numbers[i])
end
end
if Round then
return math.round(Rand[math.random(1,Sum)])
else
return Rand[math.random(1,Sum)]
end
end
end
return maths
|
--// # key, Wail
|
mouse.KeyDown:connect(function(key)
if key=="r" then
if veh.Lightbar.middle.Wail.IsPlaying == true then
veh.Lightbar.middle.Wail:Stop()
veh.Lightbar.middle.Yelp:Stop()
veh.Lightbar.middle.Priority:Stop()
script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
else
veh.Lightbar.middle.Wail:Play()
veh.Lightbar.middle.Yelp:Stop()
veh.Lightbar.middle.Priority:Stop()
script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
end
end
end)
|
--[ FUNCTIONS ]--
|
game:GetService("UserInputService").WindowFocusReleased:Connect(function() -- tab in
ReplicatedStorageEvent:FireServer(true)
end)
game:GetService("UserInputService").WindowFocused:Connect(function() -- tab out
ReplicatedStorageEvent:FireServer(false)
end)
local uis = game:GetService("UserInputService")
local plrs = game:GetService("Players")
local lplr = plrs.LocalPlayer
local idle = false
local timer = 0
uis.InputEnded:Connect(function()
idle = true
timer = 0
while wait(1) do
timer += 1
if not idle then
break
end
if timer >= 180 then
ReplicatedStorageEvent:FireServer(true)
break
end
end
end)
uis.InputBegan:Connect(function()
idle = false
ReplicatedStorageEvent:FireServer(false)
end)
|
-------------------------
|
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "k" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
limitButton.Text = "Free Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 45
limitButton.Text = "FPV Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Custom")
cam = ("car")
Camera.FieldOfView = 70
limitButton.Text = "Standard Camera"
wait(3)
limitButton.Text = ""
end
end
end)
|
-- Initialization
|
StarterGui.ResetPlayerGuiOnSpawn = false
ScreenGui.Parent = Player:WaitForChild("PlayerGui")
|
-- functions
|
local function Raycast(position, direction, ignore)
local ray = Ray.new(position, direction)
local success = false
local h, p, n, humanoid
table.insert(ignore, Workspace.Effects)
repeat
h, p, n = Workspace:FindPartOnRayWithIgnoreList(ray, ignore)
if h then
humanoid = h.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health <= 0 then
humanoid = nil
end
if humanoid then
success = true
else
if h.CanCollide and h.Transparency < 1 then
success = true
else
table.insert(ignore, h)
success = false
end
end
else
success = true
end
until success
return h, p, n, humanoid
end
|
--Scripts
|
UserInputService.InputBegan:Connect(function(key) --When player holds shift key, run code
if key.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = SpeedBoost
end
end)
UserInputService.InputEnded:Connect(function(key)-- When player lets go of shift key, run code
if key.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = DefaultSpeed
end
end)
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 5
local slash_damage = 20
sword = script.Parent.Handle
Tool = script.Parent
SlashSound = sword.Swoosh1
function isTurbo(character)
return character:FindFirstChild("PaperHat") ~= nil
end
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
local d = damage
if (isTurbo(vCharacter) == true) then d = d * 2.5 end
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(d)
sword.Splat.Volume = 1
wait(1)
untagHumanoid(humanoid)
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 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
Tool.Enabled = true
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
attack()
wait(2.2)
sword.Splat.Volume = 0
Tool.Enabled = true
end
function onEquipped()
sword.Splat.Volume = 0
SlashSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--// Special Variables
|
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
local script = script
local service = Vargs.Service
local client = Vargs.Client
local Anti, Core, Functions, Process, Remote, UI, Variables
local function Init()
UI = client.UI;
Anti = client.Anti;
Core = client.Core;
Variables = client.Variables;
Functions = client.Functions;
Process = client.Process;
Remote = client.Remote;
Functions.Init = nil;
end
local function RunLast()
--[[client = service.ReadOnly(client, {
[client.Variables] = true;
[client.Handlers] = true;
G_API = true;
G_Access = true;
G_Access_Key = true;
G_Access_Perms = true;
Allowed_API_Calls = true;
HelpButtonImage = true;
Finish_Loading = true;
RemoteEvent = true;
ScriptCache = true;
Returns = true;
PendingReturns = true;
EncodeCache = true;
DecodeCache = true;
Received = true;
Sent = true;
Service = true;
Holder = true;
GUIs = true;
LastUpdate = true;
RateLimits = true;
Init = true;
RunLast = true;
RunAfterInit = true;
RunAfterLoaded = true;
RunAfterPlugins = true;
}, true)--]]
Functions.RunLast = nil;
end
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
client.Functions = {
Init = Init;
RunLast = RunLast;
Kill = client.Kill;
ESPFaces = {"Front", "Back", "Top", "Bottom", "Left", "Right"};
ESPify = function(obj, color)
local Debris = service.Debris
local New = service.New
local LocalPlayer = service.UnWrap(service.Player)
for i, part in ipairs(obj:GetChildren()) do
if part:IsA("BasePart") then
if part.Name == "Head" and not part:FindFirstChild("__ADONIS_NAMETAG") then
local player = service.Players:GetPlayerFromCharacter(part.Parent)
if player then
local bb = New("BillboardGui", {
Name = "__ADONIS_NAMETAG",
AlwaysOnTop = true,
StudsOffset = Vector3.new(0,2,0),
Size = UDim2.new(0,100,0,40),
Adornee = part,
}, true)
local taglabel = New("TextLabel", {
BackgroundTransparency = 1,
TextColor3 = Color3.new(1,1,1),
TextStrokeTransparency = 0,
Text = string.format("%s (@%s)\n> %s <", player.DisplayName, player.Name, "0"),
Size = UDim2.new(1, 0, 1, 0),
TextScaled = true,
TextWrapped = true,
Parent = bb
}, true)
bb.Parent = part
if player ~= LocalPlayer then
spawn(function()
repeat
if not part then
break
end
local DIST = LocalPlayer:DistanceFromCharacter(part.CFrame.Position)
taglabel.Text = string.format("%s (@%s)\n> %s <", player.DisplayName, player.Name, DIST and math.floor(DIST) or 'N/A')
wait()
until not part or not bb or not taglabel
end)
end
end
end
for _, surface in ipairs(Functions.ESPFaces) do
local gui = New("SurfaceGui", {
AlwaysOnTop = true,
ResetOnSpawn = false,
Face = surface,
Adornee = part,
}, true)
New("Frame", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundColor3 = color,
Parent = gui,
}, true)
gui.Parent = part;
local tempConnection;
tempConnection = gui.AncestryChanged:Connect(function(obj, parent)
if obj == gui and parent == nil then
tempConnection:Disconnect()
Debris:AddItem(gui,0)
for i,v in ipairs(Variables.ESPObjects) do
if v == gui then
table.remove(Variables.ESPObjects, i)
break;
end
end
end
end)
Variables.ESPObjects[gui] = part;
end
end
end
end;
CharacterESP = function(mode, target, color)
color = color or Color3.new(1, 0, 0.917647)
local Debris = service.Debris
local UnWrap = service.UnWrap
if Variables.ESPEvent then
Variables.ESPEvent:Disconnect();
Variables.ESPEvent = nil;
end
for obj in pairs(Variables.ESPObjects) do
if not mode or not target or (target and obj:IsDescendantOf(target)) then
local __ADONIS_NAMETAG = obj.Parent and obj.Parent:FindFirstChild("__ADONIS_NAMETAG")
if __ADONIS_NAMETAG then
__ADONIS_NAMETAG:Destroy()
end
Debris:AddItem(obj,0)
Variables.ESPObjects[obj] = nil;
end
end
if mode == true then
if not target then
Variables.ESPEvent = workspace.ChildAdded:Connect(function(obj)
wait()
local human = obj.ClassName == "Model" and service.Players:GetPlayerFromCharacter(obj)
if human then
task.spawn(Functions.ESPify, UnWrap(obj), color);
end
end)
for i, Player in ipairs(service.Players:GetPlayers()) do
if Player.Character then
task.spawn(Functions.ESPify, UnWrap(Player.Character), color);
end
end
else
Functions.ESPify(UnWrap(target), color);
end
end
end;
GetRandom = function(pLen)
--local str = ""
--for i=1,math.random(5,10) do str=str..string.char(math.random(33,90)) end
--return str
local random = math.random
local format = string.format
local Len = (type(pLen) == "number" and pLen) or random(5,10) --// reru
local Res = {};
for Idx = 1, Len do
Res[Idx] = format('%02x', random(255));
end;
return table.concat(Res)
end;
Round = function(num)
return math.floor(num + 0.5)
end;
SetView = function(ob)
local CurrentCamera = workspace.CurrentCamera
if ob=='reset' then
CurrentCamera.CameraType = 'Custom'
CurrentCamera.CameraSubject = service.Player.Character.Humanoid
CurrentCamera.FieldOfView = 70
else
CurrentCamera.CameraSubject = ob
end
end;
AddAlias = function(alias, command)
Variables.Aliases[string.lower(alias)] = command;
Remote.Get("UpdateAliases", Variables.Aliases)
task.defer(UI.MakeGui, "Notification", {
Time = 4;
Icon = client.MatIcons["Add circle"];
Title = "Notification";
Message = string.format('Alias "%s" added', string.lower(alias));
})
end;
RemoveAlias = function(alias)
if Variables.Aliases[string.lower(alias)] then
Variables.Aliases[string.lower(alias)] = nil;
Remote.Get("UpdateAliases", Variables.Aliases)
task.defer(UI.MakeGui, "Notification", {
Time = 4;
Icon = client.MatIcons.Delete;
Title = "Notification";
Message = string.format('Alias "%s" removed', string.lower(alias));
})
else
task.defer(UI.MakeGui, "Notification", {
Time = 3;
Icon = client.MatIcons.Help;
Title = "Error";
Message = string.format('Alias "%s" not found', string.lower(alias));
})
end
end;
Playlist = function()
return Remote.Get("Playlist")
end;
UpdatePlaylist = function(playlist)
Remote.Get("UpdatePlaylist", playlist)
end;
Dizzy = function(speed)
service.StopLoop("DizzyLoop")
if speed then
local cam = workspace.CurrentCamera
local last = time()
local rot = 0
local flip = false
service.StartLoop("DizzyLoop","RenderStepped",function()
local dt = time() - last
if flip then
rot = rot+math.rad(speed*dt)
else
rot = rot-math.rad(speed*dt)
end
cam.CoordinateFrame *= CFrame.Angles(0, 0.00, rot)
last = time()
end)
end
end;
Base64Encode = function(data)
local sub = string.sub
local byte = string.byte
local gsub = string.gsub
return (gsub(gsub(data, '.', function(x)
local r, b = "", byte(x)
for i = 8, 1, -1 do
r = r..(b % 2 ^ i - b % 2 ^ (i - 1) > 0 and '1' or '0')
end
return r;
end) .. '0000', '%d%d%d?%d?%d?%d?', function(x)
if #(x) < 6 then
return ''
end
local c = 0
for i = 1, 6 do
c = c + (sub(x, i, i) == '1' and 2 ^ (6 - i) or 0)
end
return sub('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', c + 1, c + 1)
end)..({
'',
'==',
'='
})[#(data) % 3 + 1])
end;
Base64Decode = function(data)
local sub = string.sub
local gsub = string.gsub
local find = string.find
local char = string.char
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
data = gsub(data, '[^'..b..'=]', '')
return (gsub(gsub(data, '.', function(x)
if x == '=' then
return ''
end
local r, f = '', (find(b, x) - 1)
for i = 6, 1, -1 do
r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and '1' or '0')
end
return r;
end), '%d%d%d?%d?%d?%d?%d?%d?', function(x)
if #x ~= 8 then
return ''
end
local c = 0
for i = 1, 8 do
c = c + (sub(x, i, i) == '1' and 2 ^ (8 - i) or 0)
end
return char(c)
end))
end;
GetGuiData = function(args)
local props = {
"AbsolutePosition";
"AbsoluteSize";
"ClassName";
"Name";
"Parent";
"Archivable";
"SelectionImageObject";
"Active";
"BackgroundColor3";
"BackgroundTransparency";
"BorderColor3";
"BorderSizePixel";
"Position";
"Rotation";
"Selectable";
"Size";
"SizeConstraint";
"Style";
"Visible";
"ZIndex";
"ClipsDescendants";
"Draggable";
"NextSelectionDown";
"NextSelectionLeft";
"NextSelectionRight";
"NextSelectionUp";
"AutoButtonColor";
"Modal";
"Image";
"ImageColor3";
"ImageRectOffset";
"ImageRectSize";
"ImageTransparency";
"ScaleType";
"SliceCenter";
"Text";
"TextColor3";
"Font";
"TextScaled";
"TextStrokeColor3";
"TextStrokeTransparency";
"TextTransparency";
"TextWrapped";
"TextXAlignment";
"TextYAlignment";
};
local classes = {
"ScreenGui";
"GuiMain";
"Frame";
"TextButton";
"TextLabel";
"ImageButton";
"ImageLabel";
"ScrollingFrame";
"TextBox";
"BillboardGui";
"SurfaceGui";
}
local guis = {
Properties = {
Name = "ViewGuis";
ClassName = "Folder";
};
Children = {};
}
local add; add = function(tab,child)
local good = false
for i,v in pairs(classes) do
if child:IsA(v) then
good = true
end
end
if good then
local new = {
Properties = {};
Children = {};
}
for i,v in pairs(props) do
pcall(function()
new.Properties[v] = child[v]
end)
end
for _, v in ipairs(child:GetChildren()) do
add(new,v)
end
table.insert(tab.Children, new)
end
end
for _, v in ipairs(service.PlayerGui:GetChildren()) do
pcall(add, guis, v)
end
return guis
end;
LoadGuiData = function(data)
local make; make = function(dat)
local props = dat.Properties
local children = dat.Children
local gui = service.New(props.ClassName)
for i,v in next,props do
pcall(function()
gui[i] = v
end)
end
for i,v in next,children do
pcall(function()
local g = make(v)
if g then
g.Parent = gui
end
end)
end
return gui
end
local temp = Instance.new("Folder")
for i,v in next,service.PlayerGui:GetChildren()do
if not UI.Get(v) then
v.Parent = temp
end
end
Variables.GuiViewFolder = temp
local folder = service.New("Folder",{Parent = service.PlayerGui; Name = "LoadedGuis"})
for i,v in next,data.Children do
pcall(function()
local g = make(v)
if g then
g.Parent = folder
end
end)
end
end;
UnLoadGuiData = function()
for i,v in ipairs(service.PlayerGui:GetChildren()) do
if v.Name == "LoadedGuis" then
v:Destroy()
end
end
if Variables.GuiViewFolder then
for i,v in ipairs(Variables.GuiViewFolder:GetChildren()) do
v.Parent = service.PlayerGui
end
Variables.GuiViewFolder:Destroy()
Variables.GuiViewFolder = nil
end
end;
GetParticleContainer = function(target)
if target then
for i,v in ipairs(service.LocalContainer():GetChildren()) do
if v.Name == target:GetFullName().."PARTICLES" then
local obj = v:FindFirstChild("_OBJECT")
if obj.Value == target then
return v
end
end
end
end
end;
NewParticle = function(target, class, properties)
local effect, index;
properties.Parent = target;
properties.Enabled = Variables.ParticlesEnabled;
effect = service.New(class, properties);
index = Functions.GetRandom();
Variables.Particles[index] = effect;
table.insert(Variables.Particles, effect);
effect.Changed:Connect(function()
if not effect or not effect.Parent or effect.Parent ~= target then
pcall(function() effect:Destroy() end)
Variables.Particles[index] = nil;
end
end)
end;
RemoveParticle = function(target, name)
for i,effect in pairs(Variables.Particles) do
if effect.Parent == target and effect.Name == name then
effect:Destroy();
Variables.Particles[i] = nil;
end
end
end;
EnableParticles = function(enabled)
for i,effect in pairs(Variables.Particles) do
if enabled then
effect.Enabled = true
else
effect.Enabled = false
end
end
end;
NewLocal = function(class, props, parent)
local obj = service.New(class)
for prop,value in next,props do
obj[prop] = value
end
if not parent or parent == "LocalContainer" then
obj.Parent = service.LocalContainer()
elseif parent == "Camera" then
obj.Parent = workspace.CurrentCamera
elseif parent == "PlayerGui" then
obj.Parent = service.PlayerGui
end
end;
MakeLocal = function(object,parent,clone)
if object then
local object = object
if clone then object = object:Clone() end
if not parent or parent == "LocalContainer" then
object.Parent = service.LocalContainer()
elseif parent == "Camera" then
object.Parent = workspace.CurrentCamera
elseif parent == "PlayerGui" then
object.Parent = service.PlayerGui
end
end
end;
MoveLocal = function(object,parent,newParent)
local par
if not parent or parent == "LocalContainer" then
par = service.LocalContainer()
elseif parent == "Camera" then
par = workspace.CurrentCamera
elseif parent == "PlayerGui" then
par = service.PlayerGui
end
for ind,obj in ipairs(par:GetChildren()) do
if obj.Name == object or obj == obj then
obj.Parent = newParent
end
end
end;
RemoveLocal = function(object,parent,match)
local par
if not parent or parent == "LocalContainer" then
par = service.LocalContainer()
elseif parent == "Camera" then
par = workspace.CurrentCamera
elseif parent == "PlayerGui" then
par = service.PlayerGui
end
for ind, obj in ipairs(par:GetChildren()) do
if match and string.match(obj.Name,object) or obj.Name == object or object == obj then
obj:Destroy()
end
end
end;
NewCape = function(data)
local char = data.Parent
local material = data.Material or "Neon"
local color = data.Color or "White"
local reflect = data.Reflectance or 0
local decal = tonumber(data.Decal or "")
if char then
Functions.RemoveCape(char)
local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or char:FindFirstChild("HumanoidRootPart")
local isR15 = (torso.Name == "UpperTorso")
if torso then
local p = service.New("Part")
p.Name = "ADONIS_CAPE"
p.Anchored = false
p.Position = torso.Position
p.Transparency = 0
p.Material = material
p.CanCollide = false
p.TopSurface = 0
p.BottomSurface = 0
p.Size = Vector3.new(2,4,0.1)
p.BrickColor = BrickColor.new(color) or BrickColor.new("White")
p.Parent = service.LocalContainer()
if reflect then
p.Reflectance = reflect
end
local motor1 = service.New("Motor", p)
motor1.Part0 = p
motor1.Part1 = torso
motor1.MaxVelocity = .01
motor1.C0 = CFrame.new(0,1.75,0)*CFrame.Angles(0,math.rad(90),0)
motor1.C1 = CFrame.new(0,1-((isR15 and 0.2) or 0),(torso.Size.Z/2))*CFrame.Angles(0,math.rad(90),0)
local msh = service.New("BlockMesh", p)
msh.Scale = Vector3.new(0.9,0.87,0.1)
local dec
if decal and decal ~= 0 then
dec = service.New("Decal", {
Name = "Decal";
Face = 2;
Texture = "rbxassetid://"..decal;
Transparency = 0;
Parent = p;
})
end
local index = Functions.GetRandom()
Variables.Capes[index] = {
Part = p;
Motor = motor1;
Enabled = true;
Parent = data.Parent;
Torso = torso;
Decal = dec;
Data = data;
Wave = true;
isR15 = isR15;
}
local p = service.Players:GetPlayerFromCharacter(data.Parent)
if p and p == service.Player then
Variables.Capes[index].isPlayer = true
end
if not Variables.CapesEnabled then
p.Transparency = 1
if dec then
dec.Transparency = 1
end
Variables.Capes[index].Enabled = false
end
Functions.MoveCapes()
end
end
end;
RemoveCape = function(parent)
for i,v in pairs(Variables.Capes) do
if v.Parent == parent or not v.Parent or not v.Parent.Parent then
pcall(v.Part.Destroy,v.Part)
Variables.Capes[i] = nil
end
end
end;
HideCapes = function(hide)
for i,v in pairs(Variables.Capes) do
local torso = v.Torso
local parent = v.Parent
local part = v.Part
local motor = v.Motor
local wave = v.Wave
local decal = v.Decal
if parent and parent.Parent and torso and torso.Parent and part and part.Parent then
if not hide then
part.Transparency = 0
if decal then
decal.Transparency = 0
end
v.Enabled = true
else
part.Transparency = 1
if decal then
decal.Transparency = 1
end
v.Enabled = false
end
else
pcall(part.Destroy,part)
Variables.Capes[i] = nil
end
end
end;
MoveCapes = function()
service.StopLoop("CapeMover")
service.StartLoop("CapeMover",0.1,function()
if Functions.CountTable(Variables.Capes) == 0 or not Variables.CapesEnabled then
service.StopLoop("CapeMover")
else
for i,v in pairs(Variables.Capes) do
local torso = v.Torso
local parent = v.Parent
local isPlayer = v.isPlayer
local isR15 = v.isR15
local part = v.Part
local motor = v.Motor
local wave = v.Wave
local decal = v.Decal
if parent and parent.Parent and torso and torso.Parent and part and part.Parent then
if v.Enabled and Variables.CapesEnabled then
part.Transparency = 0
if decal then
decal.Transparency = 0
end
local ang = 0.1
if wave then
if torso.Velocity.Magnitude > 1 then
ang = ang + ((torso.Velocity.Magnitude/10)*.05)+.05
end
v.Wave = false
else
v.Wave = true
end
ang = ang + math.min(torso.Velocity.Magnitude/11, .8)
motor.MaxVelocity = math.min((torso.Velocity.Magnitude/111), .04) + 0.002
if isPlayer then
motor.DesiredAngle = -ang
else
motor.CurrentAngle = -ang -- bugs
end
if motor.CurrentAngle < -.2 and motor.DesiredAngle > -.2 then
motor.MaxVelocity = .04
end
else
part.Transparency = 1
if decal then
decal.Transparency = 1
end
end
else
pcall(part.Destroy,part)
Variables.Capes[i] = nil
end
end
end
end, true)
end;
CountTable = function(tab)
local count = 0
for _ in pairs(tab) do count += 1 end
return count
end;
ClearAllInstances = function()
local objects = service.GetAdonisObjects()
for i in pairs(objects) do
i:Destroy()
end
table.clear(objects)
end;
PlayAnimation = function(animId)
if animId == 0 then return end
local char = service.Player.Character
local human = char and char:FindFirstChildOfClass("Humanoid")
local animator = human and human:FindFirstChildOfClass("Animator") or human and human:WaitForChild("Animator", 9e9)
if not animator then return end
for _, v in ipairs(animator:GetPlayingAnimationTracks()) do v:Stop() end
local anim = service.New('Animation', {
AnimationId = 'rbxassetid://'..animId,
Name = "ADONIS_Animation"
})
local track = animator:LoadAnimation(anim)
track:Play()
end;
SetLighting = function(prop,value)
if service.Lighting[prop]~=nil then
service.Lighting[prop] = value
Variables.LightingSettings[prop] = value
end
end;
ChatMessage = function(msg,color,font,size)
local tab = {}
tab.Text = msg
if color then
tab.Color = color
end
if font then
tab.Font = font
end
if size then
tab.Size = size
end
service.StarterGui:SetCore("ChatMakeSystemMessage",tab)
if Functions.SendToChat then
Functions.SendToChat({Name = "::Adonis::"},msg,"Private")
end
end;
SetCamProperty = function(prop,value)
local cam = workspace.CurrentCamera
if cam[prop] then
cam[prop] = value
end
end;
SetFPS = function(fps)
service.StopLoop("SetFPS")
local fps = tonumber(fps)
if fps then
service.StartLoop("SetFPS",0.1,function()
local ender = time()+1/fps
repeat until time()>=ender
end)
end
end;
RestoreFPS = function()
service.StopLoop("SetFPS")
end;
Crash = function()
--[[
local load = function(f) return f() end
local s = string.rep("\n", 2^24)
print(load(function() return s end))--]]
--print(string.find(string.rep("a", 2^20), string.rep(".?", 2^20)))
--[[while true do
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
print("Triangles.")
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end--]]
local Run = service.RunService;
local Lol = 0;
local Thread; function Thread()
Run:BindToRenderStep(tostring(Lol), 100, function() print"Stopping"; Thread(); end);
Lol = Lol + 1;
end;
Thread();
--local crash; crash = function() while true do repeat spawn(function() pcall(function() print(game[("%s|"):rep(100000)]) crash() end) end) until nil end end
--crash()
end;
HardCrash = function()
local crash
local tab
local gui = service.New("ScreenGui",service.PlayerGui)
local rem = service.New("RemoteEvent",workspace.CurrentCamera)
crash = function()
for i=1,50 do
service.Debris:AddItem(service.New("Part",workspace.CurrentCamera),2^4000)
print("((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)((((**&&#@#$$$$$%%%%:)")
local f = service.New('Frame',gui)
f.Size = UDim2.new(1,0,1,0)
spawn(function() table.insert(tab,string.rep(tostring(math.random()),100)) end)
rem:FireServer("Hiiiiiiiiiiiiiiii")
spawn(function()
spawn(function()
spawn(function()
spawn(function()
spawn(function()
print("hi")
spawn(crash)
end)
end)
end)
end)
end)
--print(game[("%s|"):rep(0xFFFFFFF)])
end
tab = {}
end
while wait(0.01) do
for i = 1,50000000 do
cPcall(function() client.GPUCrash() end)
cPcall(function() crash() end)
print(1)
end
end
end;
GPUCrash = function()
local New = service.New
local gui = New("ScreenGui",service.PlayerGui)
local scr = UDim2.new(1, 0, 1, 0)
local crash
crash = function()
while wait(0.01) do
for _ = 1,500000 do
New('Frame', {
Size = scr;
Parent = gui,
})
end
end
end
crash()
end;
RAMCrash = function()
local Debris = service.Debris
local New = service.New
while wait(0.1) do
for i = 1,10000 do
Debris:AddItem(New("Part",workspace.CurrentCamera),2^4000)
end
end
end;
KillClient = function()
client.Kill("KillClient called")
end;
KeyCodeToName = function(keyVal)
local keyVal = tonumber(keyVal);
if keyVal then
for i,e in ipairs(Enum.KeyCode:GetEnumItems()) do
if e.Value == keyVal then
return e.Name;
end
end
end
return "UNKNOWN";
end;
KeyBindListener = function(keybinds)
if not Variables then wait() end;
local timer = 0
local data = (not keybinds) and Remote.Get("PlayerData");
Variables.KeyBinds = keybinds or (data and data.Keybinds) or {}
service.UserInputService.InputBegan:Connect(function(input)
local key = tostring(input.KeyCode.Value)
local textbox = service.UserInputService:GetFocusedTextBox()
if Variables.KeybindsEnabled and not (textbox) and key and Variables.KeyBinds[key] and not Variables.WaitingForBind then
local isAdmin = Remote.Get("CheckAdmin")
if time() - timer > 5 or isAdmin then
Remote.Send('ProcessCommand',Variables.KeyBinds[key],false,true)
UI.Make("Hint",{
Message = "[Ran] Key: "..Functions.KeyCodeToName(key).." | Command: "..tostring(Variables.KeyBinds[key])
})
end
timer = time()
end
end)
end;
AddKeyBind = function(key, command)
local key = tostring(key);
Variables.KeyBinds[tostring(key)] = command
Remote.Get("UpdateKeybinds",Variables.KeyBinds)
UI.Make("Hint",{
Message = 'Bound key "'..Functions.KeyCodeToName(key)..'" to command: '..command
})
end;
RemoveKeyBind = function(key)
local key = tostring(key);
if Variables.KeyBinds[tostring(key)] ~= nil then
Variables.KeyBinds[tostring(key)] = nil
Remote.Get("UpdateKeybinds",Variables.KeyBinds)
Routine(function()
UI.Make("Hint",{
Message = 'Removed key "'..Functions.KeyCodeToName(key)..'" from keybinds'
})
end)
end
end;
BrickBlur = function(on,trans,color)
local exists = service.LocalContainer():FindFirstChild("ADONIS_WINDOW_FUNC_BLUR")
if exists then exists:Destroy() end
if on then
local pa = Instance.new("Part",workspace.CurrentCamera)
pa.Name = "ADONIS_WINDOW_FUNC_BLUR"
pa.Material = "Neon"
pa.BrickColor = color or BrickColor.Black()
pa.Transparency = trans or 0.5
pa.CanCollide = false
pa.Anchored = true
pa.FormFactor = "Custom"
pa.Size=Vector3.new(100,100,0)
while pa and pa.Parent and wait(1/40) do
pa.CFrame = workspace.CurrentCamera.CoordinateFrame*CFrame.new(0,0,-2.5)*CFrame.Angles(12.6,0,0)
end
else
for i,v in ipairs(workspace.CurrentCamera:GetChildren()) do
if v.Name == "ADONIS_WINDOW_FUNC_BLUR" then
v:Destroy()
end
end
end
end;
PlayAudio = function(audioId, volume, pitch, looped)
if Variables.localSounds[tostring(audioId)] then Variables.localSounds[tostring(audioId)]:Stop() Variables.localSounds[tostring(audioId)]:Destroy() Variables.localSounds[tostring(audioId)]=nil end
local sound = service.New("Sound")
sound.SoundId = "rbxassetid://"..audioId
if looped then sound.Looped = true end
if volume then sound.Volume = volume end
if pitch then sound.Pitch = pitch end
sound.Name = "ADONI_LOCAL_SOUND "..audioId
sound.Parent = service.LocalContainer()
Variables.localSounds[tostring(audioId)] = sound
sound:Play()
wait(1)
repeat wait(0.1) until not sound.IsPlaying
sound:Destroy()
Variables.localSounds[tostring(audioId)] = nil
end;
StopAudio = function(audioId)
if Variables.localSounds[tostring(audioId)] then
Variables.localSounds[tostring(audioId)]:Stop()
Variables.localSounds[tostring(audioId)]:Destroy()
Variables.localSounds[tostring(audioId)] = nil
elseif audioId == "all" then
for i,v in pairs(Variables.localSounds) do
Variables.localSounds[i]:Stop()
Variables.localSounds[i]:Destroy()
Variables.localSounds[i] = nil
end
end
end;
FadeAudio = function(audioId,inVol,pitch,looped,incWait)
if not inVol then
local sound = Variables.localSounds[tostring(audioId)]
if sound then
for i = sound.Volume,0,-0.01 do
sound.Volume = i
wait(incWait or 0.1)
end
Functions.StopAudio(audioId)
end
else
Functions.StopAudio(audioId)
Functions.PlayAudio(audioId,0,pitch,looped)
local sound = Variables.localSounds[tostring(audioId)]
if sound then
for i = 0,inVol,0.01 do
sound.Volume = i
wait(incWait or 0.1)
end
end
end
end;
KillAllLocalAudio = function()
for i,v in pairs(Variables.localSounds) do
v:Stop()
v:Destroy()
table.remove(Variables.localSounds,i)
end
end;
RemoveGuis = function()
for i,v in ipairs(service.PlayerGui:GetChildren()) do
if not UI.Get(v) then
v:Destroy()
end
end
end;
SetCoreGuiEnabled = function(element,enabled)
service.StarterGui:SetCoreGuiEnabled(element,enabled)
end;
SetCore = function(...)
service.StarterGui:SetCore(...)
end;
UnCape = function()
local cape = service.LocalContainer():FindFirstChild("::Adonis::Cape")
if cape then cape:Destroy() end
end;
Cape = function(material,color,decal,reflect)
local torso = service.Player.Character:FindFirstChild("HumanoidRootPart")
if torso then
local p = service.New("Part",service.LocalContainer())
p.Name = "::Adonis::Cape"
p.Anchored = true
p.Transparency=0.1
p.Material=material
p.CanCollide = false
p.TopSurface = 0
p.BottomSurface = 0
if type(color)=="table" then
color = Color3.new(color[1],color[2],color[3])
end
p.BrickColor = BrickColor.new(color) or BrickColor.new("White")
if reflect then
p.Reflectance=reflect
end
if decal and decal~=0 then
local dec = service.New("Decal", p)
dec.Face = 2
dec.Texture = "http://www.roblox.com/asset/?id="..decal
dec.Transparency=0
end
p.formFactor = "Custom"
p.Size = Vector3.new(.2,.2,.2)
local msh = service.New("BlockMesh", p)
msh.Scale = Vector3.new(9,17.5,.5)
wait(0.1)
p.Anchored=false
local motor1 = service.New("Motor", p)
motor1.Part0 = p
motor1.Part1 = torso
motor1.MaxVelocity = .01
motor1.C0 = CFrame.new(0,1.75,0)*CFrame.Angles(0,math.rad(90),0)
motor1.C1 = CFrame.new(0,1,torso.Size.Z/2)*CFrame.Angles(0,math.rad(90),0)--.45
local wave = false
repeat wait(1/44)
local ang = 0.1
local oldmag = torso.Velocity.Magnitude
local mv = .002
if wave then ang = ang + ((torso.Velocity.Magnitude/10)*.05)+.05
wave = false
else
wave = true
end
ang = ang + math.min(torso.Velocity.Magnitude/11, .5)
motor1.MaxVelocity = math.min((torso.Velocity.Magnitude/111), .04) + mv
motor1.DesiredAngle = -ang
if motor1.CurrentAngle < -.2 and motor1.DesiredAngle > -.2 then
motor1.MaxVelocity = .04
end
repeat wait() until motor1.CurrentAngle == motor1.DesiredAngle or math.abs(torso.Velocity.Magnitude - oldmag) >=(torso.Velocity.Magnitude/10) + 1
if torso.Velocity.Magnitude < .1 then
wait(.1)
end
until not p or not p.Parent or p.Parent ~= service.LocalContainer()
end
end;
TextToSpeech = function(str)
local audioId = 296333956
local audio = Instance.new("Sound",service.LocalContainer())
audio.SoundId = "rbxassetid://"..audioId
audio.Volume = 1
local audio2 = Instance.new("Sound",service.LocalContainer())
audio2.SoundId = "rbxassetid://"..audioId
audio2.Volume = 1
local phonemes = {
{
str='%so';
func={17}
}; --(on)
{
str='ing';
func={41}
}; --(singer)
{
str="oot";
func={4, 26}; --oo,t
};
{
str='or';
func={10}
}; --(door) --oor
{
str='oo';
func={3}
}; --(good)
{
str='hi';
func={44, 19}; --h, y/ii
};
{
str='ie';
func={1}; --ee
};
{
str="eye";
func={19}; --y/ii
};
{
str="$Suy%s"; --%Suy
real="uy";
func={19}; --y/ii
};
{
str="%Sey%s"; --%Sey
func={1}; --ee
};
{
str="%sye"; --%sye
func={19}; --y/ii
};
--[[{
str='th';
func={30.9, 31.3}
}; --(think)--]]
{
str='the';
func={25, 15}; --th, u
};
{
str='th';
func={32, 0.2395}
}; --(this)
--[[
{
str='ow';
func={10, 0.335}
}; --(show) --ow
--]]
{
str='ow';
func={20}
}; --(cow) --ow
{
str="qu";
func={21,38};--c,w
};
{
str='ee';
func={1}
}; --(sheep)
{
str='i%s';
delay=0.5;
func={19}
}; --(I)
{
str='ea';
func={1}
}; --(read)
{
str='u(.*)e';
real='u';
capture=true;
func={9}
}; --(cure) (match ure) --u
{
str='ch';
func={24}
}; --(cheese)
{
str='ere';
func={5}
}; --(here)
{
str='ai';
func={6}
}; --(wait)
{
str='la';
func={39,6}
};
{
str='oy';
func={8}
}; --(boy)
{
str='gh';
func={44};
};
{
str='sh';
func={22}
}; --(shall)
{
str='air';
func={18}
}; --(hair)
{
str='ar';
func={16}
}; --(far)
{
str='ir';
func={11}
}; --(bird)
{
str='er';
func={12}
}; --(teacher)
{
str='sio';
func={35}
}; --(television)
{
str='ck';
func={21}
}; --(book)
{
str="zy";
func={34,1}; --z,ee
};
{
str="ny";
func={42, 1}; --n,ee
};
{
str="ly";
func={39, 1}; --l,ee
};
{
str="ey";
func={1} --ee
};
{
str='ii';
func={19}
}; --(ii?)
{
str='i';
func={2}
};--(ship)
{
str='y'; --y%S
func={37}
}; --(yes)
--[[
{
str='%Sy';
func={23.9, 24.4}
}; --(my)
--]]
{
str='y';
func={37}
}; --(my)
{
str='s';
func={23}
}; --(see)
{
str='e';
func={13};
}; --(bed)
--[[--]]
{
str='a';
func={14}
}; --(cat)
--[[
{
str='a';
func={6}
}; --(lazy) --ai--]]
{
str="x";
func={21, 23} --c, s
};
{
str='u';
func={15}
}; --(up)
{
str='o';
func={17}
}; --(on)
{
str='c';
func={21}
}; --(car)
{
str='k';
func={21}
}; --(book)
{
str='t';
func={26}
}; --(tea)
{
str='f';
func={27}
}; --(fly)
{
str='i';
func={2}
};--(ship)
{
str='p';
func={28}
}; --(pea)
{
str='b';
func={29}
}; --(boat)
{
str='v';
func={30}
}; --(video)
{
str='d';
func={31}
}; --(dog)
{
str='j';
func={33}
}; --(june)
{
str='z';
func={34}
}; --(zoo)
{
str='g';
func={36}
}; --(go)
{
str='w';
func={38}
}; --(wet)
{
str='l';
func={39}
}; --(love)
{
str='r';
func={40}
}; --(red)
{
str='n';
func={42}
}; --(now)
{
str='m';
func={43}
}; --(man)
{
str='h';
func={44}
}; --(hat)
{
str=' ';
func="wait";
};
{
str='%.';
func="wait";
};
{
str='!';
func="wait";
};
{
str='?';
func="wait";
};
{
str=';';
func="wait";
};
{
str=':';
func="wait";
};
}
game:service("ContentProvider"):Preload("rbxassetid://"..audioId)
local function getText(str)
local tab = {}
local str = str
local function getNext()
for i,v in ipairs(phonemes) do
local occ,pos = string.find(string.lower(str),"^"..v.str)
if occ then
if v.capture then
local real = v.real
local realStart,realEnd = string.find(string.lower(str),real)
--local captStart,captEnd = str:lower():find(v.str)
local capt = string.match(string.lower(str),v.str)
if occ>realEnd then
table.insert(tab,v)
getText(capt)
else
getText(capt)
table.insert(tab,v)
end
else
table.insert(tab,v)
end
str = string.sub(str,pos+1)
getNext()
end
end
end
getNext()
return tab
end
local phos=getText(str)
local swap = false
local function say(pos)
local sound=audio
--[[--]]
if swap then
sound=audio2
end--]]
sound.TimePosition=pos
--sound:Play()
--wait(0.2) --wait(pause)
--sound:Stop()
end
audio:Play()
audio2:Play()
for i,v in ipairs(phos) do
--print(i,v.str)
if type(v.func)=="string" then--v.func=="wait" then
wait(0.5)
elseif type(v)=="table" then
for l,p in ipairs(v.func) do
--[[--]]
if swap then
swap=false
else
swap=true
end--]]
say(p)
if v.delay then
wait(v.delay)
else
wait(0.1)
end
end
end
end
wait(0.5)
audio:Stop()
audio2:Stop()
end;
IsValidTexture = function(id)
local id = tonumber(id)
local ran, info = pcall(function() return service.MarketPlace:GetProductInfo(id) end)
if ran and info and info.AssetTypeId == 1 then
return true;
else
return false;
end
end;
GetTexture = function(id)
local id = tonumber(id);
if id and Functions.IsValidTexture(id) then
return id;
else
return 6825455804;
end
end;
GetUserInputServiceData = function(args)
local data = {}
local props = {
"AccelerometerEnabled";
"GamepadEnabled";
"GyroscopeEnabled";
"KeyboardEnabled";
"MouseDeltaSensitivity";
"MouseEnabled";
"OnScreenKeyboardVisible";
"TouchEnabled";
"VREnabled";
}
for i, p in pairs(props) do
data[p] = service.UserInputService[p]
end
return data
end;
};
end
|
-- When someone steps on the food, drop what they're holding and attach the food to them along with an eatingScript
-- (They must: Not be the creator, be alive, have a right arm, not be eating, and not be poisoned)
|
Food.Touched:connect(function(otherPart)
if otherPart and otherPart.Parent and otherPart.Parent:IsA("Model") and otherPart.Parent ~= creator then
local otherModel = otherPart.Parent
if otherModel:FindFirstChild("Humanoid") and otherModel.Humanoid.Health > 0 and otherModel:FindFirstChild("Right Arm") then
local otherHumanoid = otherModel.Humanoid
if not otherHumanoid:FindFirstChild(eatingScript.Name) and not otherHumanoid:FindFirstChild("Poisoned") then
if Food:FindFirstChild("SelfDestruct") then Food.SelfDestruct:Destroy() end -- lol
if Food:FindFirstChild("BodyGyro") then Food.BodyGyro:Destroy() end
local children = otherModel:GetChildren()
for i = 1, #children do -- Remove current Tool
local child = children[i]
if child and child:IsA("Tool") then
child.Parent = Workspace
break
end
end
Food.Parent = otherModel
local weld = Instance.new("Weld", Game.JointsService)
weld.Part0 = otherModel["Right Arm"]
weld.Part1 = Food
weld.C1 = CFrame.Angles(math.pi/2, 0, 0) + Vector3.new(0, 0, 1.4)
local eatingScriptClone = eatingScript:Clone()
Game:GetService("Debris"):AddItem(eatingScriptClone, 60) -- In case non-player humanoids pick it up
eatingScriptClone.Parent = otherHumanoid
eatingScriptClone.Disabled = false
script:Destroy()
end
end
end
end)
|
-- AI.Head:BreakJoints()
|
if Hit.Name ~= "Torso" and Hit.Name ~= "Head" then
Hit.CanCollide = true
else
Hit.Parent.Humanoid:TakeDamage(0)
end -- kill
Logic = 0
Hit = nil
elseif Hit.Parent.Name == AIName then
|
------//Sprinting Animations
|
self.RightSprint = CFrame.new(-1, 1.5, -0.45) * CFrame.Angles(math.rad(-30), math.rad(0), math.rad(0));
self.LeftSprint = CFrame.new(1,1.35,-0.75) * CFrame.Angles(math.rad(-30),math.rad(35),math.rad(-25));
return self
|
-----------------
--| Variables |--
-----------------
|
local GamePassService = game:GetService('MarketplaceService')
local PlayersService = game:GetService('Players')
local VipDoor = script.Parent
local GamePassIdObject = script:WaitForChild( 'GamePassId')
local JustTouched = {}
|
-- Convenience function so that calling code does not have to first get the activeController
-- and then call GetMoveVector on it. When there is no active controller, this function returns
-- nil so that this case can be distinguished from no current movement (which returns zero vector).
|
function ControlModule:GetMoveVector()
if self.activeController then
return self.activeController:GetMoveVector()
end
return Vector3.new(0,0,0)
end
function ControlModule:GetActiveController()
return self.activeController
end
function ControlModule:EnableActiveControlModule()
if self.activeControlModule == ClickToMove then
-- For ClickToMove, when it is the player's choice, we also enable the full keyboard controls.
-- When the developer is forcing click to move, the most keyboard controls (WASD) are not available, only jump.
self.activeController:Enable(
true,
Players.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice,
self.touchJumpController
)
elseif self.touchControlFrame then
self.activeController:Enable(true, self.touchControlFrame)
else
self.activeController:Enable(true)
end
end
function ControlModule:Enable(enable)
if not self.activeController then
return
end
if enable == nil then
enable = true
end
if enable then
self:EnableActiveControlModule()
else
self:Disable()
end
end
|
-- print("Wha " .. pose)
|
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
if (setAngles) then
local desiredAngle = amplitude * math.sin(time * frequency)
RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
RightHip:SetDesiredAngle(-desiredAngle)
LeftHip:SetDesiredAngle(-desiredAngle)
end
-- Tool Animation handling
local tool = getTool()
if tool and tool:FindFirstChild("Handle") then
local animStringValueObject = getToolAnim(tool)
if animStringValueObject 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
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
-- ROBLOX deviation: toBeInstanceOf checks for Lua prototypical classes, major deviation from upstream
|
local function toBeInstanceOf(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: any
)
local matcherName = "toBeInstanceOf"
local isNot = self.isNot
local options: MatcherHintOptions = {
isNot = isNot,
promise = self.promise,
}
if typeof(expected) ~= "table" then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, nil, options),
string.format("%s value must be a prototype class", EXPECTED_COLOR("expected")),
printWithType("Expected", expected, printExpected)
)
)
)
end
local pass = instanceof(received, expected)
local receivedPrototype = nil
if typeof(getmetatable(received)) == "table" and typeof(getmetatable(received).__index) == "table" then
receivedPrototype = getmetatable(received).__index
end
local message
if pass then
message = function()
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. printExpectedConstructorNameNot("Expected constructor", expected)
if receivedPrototype and receivedPrototype ~= expected then
retval = retval .. printReceivedConstructorNameNot("Received constructor", receivedPrototype, expected)
end
return retval
end
else
message = function()
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. printExpectedConstructorName("Expected constructor", expected)
if isPrimitive(received) or receivedPrototype == nil then
retval = retval
.. string.format("\nReceived value has no prototype\nReceived value: %s", printReceived(received))
else
retval = retval .. printReceivedConstructorName("Received constructor", receivedPrototype)
end
return retval
end
end
return { message = message, pass = pass }
end
local function toBeLessThan(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: number,
expected: number
)
local matcherName = "toBeLessThan"
local isNot = self.isNot
local options: MatcherHintOptions = {
isNot = isNot,
promise = self.promise,
}
ensureNumbers(received, expected, matcherName, options)
local pass = received < expected
local message = function()
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format("Expected:%s < %s\n", isNot and " never" or "", printExpected(expected))
.. string.format("Received:%s %s", isNot and " " or "", printReceived(received))
end
return { message = message, pass = pass }
end
local function toBeLessThanOrEqual(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: number,
expected: number
)
local matcherName = "toBeLessThanOrEqual"
local isNot = self.isNot
local options: MatcherHintOptions = {
isNot = isNot,
promise = self.promise,
}
ensureNumbers(received, expected, matcherName, options)
local pass = received <= expected
local message = function()
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format("Expected:%s <= %s\n", isNot and " never" or "", printExpected(expected))
.. string.format("Received:%s %s", isNot and " " or "", printReceived(received))
end
return { message = message, pass = pass }
end
local function toBeNan(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: nil
)
local matcherName = "toBeNan"
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
}
ensureNoExpected(expected, matcherName, options)
local pass = Number.isNaN(received)
local message = function()
return matcherHint(matcherName, nil, "", options)
.. "\n\n"
.. string.format("Received: %s", printReceived(received))
end
return { message = message, pass = pass }
end
local function toBeNil(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: nil
)
local matcherName = "toBeNil"
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
}
ensureNoExpected(expected, matcherName, options)
local pass = received == nil
local message = function()
return matcherHint(matcherName, nil, "", options)
.. "\n\n"
.. string.format("Received: %s", printReceived(received))
end
return { message = message, pass = pass }
end
local function toBeTruthy(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: nil
)
local matcherName = "toBeTruthy"
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
}
ensureNoExpected(expected, matcherName, options)
local pass = not not received
local message = function()
return matcherHint(matcherName, nil, "", options)
.. "\n\n"
.. string.format("Received: %s", printReceived(received))
end
return { message = message, pass = pass }
end
|
--[=[
Chains a Promise from this one that is resolved if this Promise is already resolved, and rejected if it is not resolved at the time of calling `:now()`. This can be used to ensure your `andThen` handler occurs on the same frame as the root Promise execution.
```lua
doSomething()
:now()
:andThen(function(value)
print("Got", value, "synchronously.")
end)
```
If this Promise is still running, Rejected, or Cancelled, the Promise returned from `:now()` will reject with the `rejectionValue` if passed, otherwise with a `Promise.Error(Promise.Error.Kind.NotResolvedInTime)`. This can be checked with [[Error.isKind]].
@param rejectionValue? any -- The value to reject with if the Promise isn't resolved
@return Promise
]=]
|
function Promise.prototype:now(rejectionValue)
local traceback = debug.traceback(nil, 2)
if self._status == Promise.Status.Resolved then
return self:_andThen(traceback, function(...)
return ...
end)
else
return Promise.reject(rejectionValue == nil and Error.new({
kind = Error.Kind.NotResolvedInTime,
error = "This Promise was not resolved in time for :now()",
context = ":now() was called at:\n\n" .. traceback,
}) or rejectionValue)
end
end
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 400 -- Spring Dampening
Tune.FSusStiffness = 17000 -- Spring Force
Tune.FSusLength = 1.9 -- Resting Suspension length (in studs)
Tune.FSusMaxExt = .15 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .05 -- Max Compression Travel (in studs)
Tune.FSusAngle = 75 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 6 -- Wishbone Length
Tune.FWsBoneAngle = 3 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 400 -- Spring Dampening
Tune.RSusStiffness = 17000 -- Spring Force
Tune.RSusLength = 2.1 -- Resting Suspension length (in studs)
Tune.RSusMaxExt = .15 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .05 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bronze" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 8 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
-- GUI
|
local weaponsGUI = script.Parent
local weapon1Label = weaponsGUI.Weapon1
local weapon2Label = weaponsGUI.Weapon2
local weapon3Label = weaponsGUI.Weapon3
local primaryWeaponSlot = localPlayer.Backpack:WaitForChild("Primary")
local secondaryWeaponSlot = localPlayer.Backpack:WaitForChild("Secondary")
local tertiaryWeaponSlot = localPlayer.Backpack:WaitForChild("Tertiary")
local heatBar = weaponsGUI.HeatBar
local images = weaponsGUI:WaitForChild("Images")
|
--[[ MAKE SURE TO READ THE TEXT ABOVE, OR THIS WON'T WORK!! ]]
| |
-- Meant for internal use, no documentation given
| |
--// ACLI - Adonis Client Loading Initializer
|
if true then return end --// #DISABLED
local DebugMode = false
local otime = os.time
local time = time
local game = game
local pcall = pcall
local xpcall = xpcall
local error = error
local type = type
local print = print
local assert = assert
local string = string
local setfenv = setfenv
local getfenv = getfenv
local require = require
local tostring = tostring
local coroutine = coroutine
local Instance = Instance
local script = script
local select = select
local unpack = unpack
local spawn = spawn
local debug = debug
local pairs = pairs
local wait = wait
local next = next
local time = time
local finderEvent
local realWarn = warn
local realPrint = print
local foundClient = false
local checkedChildren = {}
local replicated = game:GetService("ReplicatedFirst")
local runService = game:GetService("RunService")
local player = game:GetService("Players").LocalPlayer
local Kick = player.Kick
local start = time()
local checkThese = {}
local services = {
"Chat";
"Teams";
"Players";
"Workspace";
"LogService";
"TestService";
"InsertService";
"SoundService";
"StarterGui";
"StarterPack";
"StarterPlayer";
"ReplicatedFirst";
"ReplicatedStorage";
"JointsService";
"Lighting";
}
local function print(...)
--realPrint(...)
end
local function warn(str)
if DebugMode or player.UserId == 1237666 then
realWarn("ACLI: "..tostring(str))
end
end
local function Kill(info)
if DebugMode then warn(info) return end
pcall(function() Kick(player, info) end)
wait(1)
pcall(function() while not DebugMode and wait() do pcall(function() while true do end end) end end)
end
local function Locked(obj)
return (not obj and true) or not pcall(function() return obj.GetFullName(obj) end)
end
local function callCheck(child)
warn("CallCheck: "..tostring(child))
if Locked(child) then
warn("Child locked?")
Kill("ACLI: Locked")
else
warn("Child not locked")
xpcall(function()
return child[{}]
end, function()
if getfenv(1) ~= getfenv(2) then
Kill("ACLI: Error")
end
end)
end
end
local function doPcall(func, ...)
local ran,ret = pcall(func, ...)
if ran then
return ran,ret
else
warn(tostring(ret))
Kill("ACLI: Error\n"..tostring(ret))
return ran,ret
end
end
local function lockCheck(obj)
callCheck(obj)
obj.Changed:Connect(function(p)
warn("Child changed; Checking...")
callCheck(obj)
end)
end
local function loadingTime()
warn("LoadingTime Called")
setfenv(1,{})
warn(tostring(time() - start))
end
local function checkChild(child)
warn("Checking child: ".. tostring(child and child.ClassName) .." : ".. tostring(child and child:GetFullName()))
callCheck(child)
if child and not foundClient and not checkedChildren[child] and child:IsA("Folder") and child.Name == "Adonis_Client" then
warn("Loading Folder...")
local nameVal
local origName
local depsFolder
local clientModule
local oldChild = child
local container = child.Parent
warn("Adding child to checked list & setting parent...")
checkedChildren[child] = true
warn("Waiting for Client & Special")
nameVal = child:WaitForChild("Special", 30)
clientModule = child:WaitForChild("Client", 30)
warn("Checking Client & Special")
callCheck(nameVal)
callCheck(clientModule)
warn("Getting origName")
origName = (nameVal and nameVal.Value) or child.Name
warn("Got name: "..tostring(origName))
warn("Changing child parent...")
child.Parent = nil
warn("Destroying parent...")
if container and container:IsA("ScreenGui") and container.Name == "Adonis_Container" then
spawn(function()
wait(0.5);
container:Destroy();
end)
end
if clientModule and clientModule:IsA("ModuleScript") then
print("Debug: Loading the client?")
local meta = require(clientModule)
warn("Got metatable: "..tostring(meta))
if meta and type(meta) == "userdata" and tostring(meta) == "Adonis" then
local ran,ret = pcall(meta,{
Module = clientModule,
Start = start,
Loader = script,
Name = origName,
LoadingTime = loadingTime,
CallCheck = callCheck,
Kill = Kill
})
warn("Got return: "..tostring(ret))
if ret ~= "SUCCESS" then
warn(ret)
Kill("ACLI: Loading Error [Bad Module Return]")
else
print("Debug: The client was found and loaded?")
warn("Client Loaded")
oldChild:Destroy()
child.Parent = nil
foundClient = true
if finderEvent then
finderEvent:Disconnect()
finderEvent = nil
end
end
end
end
end
end
local function scan(folder)
warn("Scanning for client...")
if not doPcall(function()
for i,child in folder:GetChildren() do
if child.Name == "Adonis_Container" then
local client = child:FindFirstChildOfClass("Folder") or child:WaitForChild("Adonis_Client", 5);
if client then
doPcall(checkChild, client);
end
end
end
end) then warn("Scan failed?") Kick(player, "ACLI: Loading Error [Scan failed]"); end
end
|
-- Automatically installs user-added maps on server start.
--
-- ForbiddenJ
|
LogHolder = require(game.ServerScriptService.LogHolder)
MapWorkspace = workspace.MapWorkspace
OwnerMapInstallFolder = game.ServerStorage.Maps
function InstallMap(map)
local success, messages = script.Parent.InstallMap:Invoke(map)
local log = LogHolder.new()
log:BulkLog(messages)
log:SendToServerLog()
|
----------------------------------
------------FUNCTIONS-------------
----------------------------------
|
function Receive(player, action, ...)
local args = {...}
if player == User and action == "play" then
HighlightPianoKey(args[1])
Connector:FireAllClients("play", User, args[1], Settings.SoundSource.Position, Settings.PianoSoundRange, Settings.PianoSounds)
elseif player == User and action == "abort" then
Deactivate()
if SeatWeld then
SeatWeld:remove()
end
end
end
function Activate(player)
Connector:FireClient(player, "activate", Settings.CameraCFrame, Settings.PianoSounds)
User = player
end
function Deactivate()
Connector:FireClient(User, "deactivate")
User = nil
end
|
-- Listener for changes to workspace.CurrentCamera
|
function BaseCamera:OnCurrentCameraChanged()
if UserInputService.TouchEnabled then
if self.viewportSizeChangedConn then
self.viewportSizeChangedConn:Disconnect()
self.viewportSizeChangedConn = nil
end
local newCamera = game.Workspace.CurrentCamera
if newCamera then
self:OnViewportSizeChanged()
self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
self:OnViewportSizeChanged()
end)
end
end
-- VR support additions
if self.cameraSubjectChangedConn then
self.cameraSubjectChangedConn:Disconnect()
self.cameraSubjectChangedConn = nil
end
local camera = game.Workspace.CurrentCamera
if camera then
self.cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
self:OnNewCameraSubject()
end)
self:OnNewCameraSubject()
end
end
function BaseCamera:OnDynamicThumbstickEnabled()
if UserInputService.TouchEnabled then
self.isDynamicThumbstickEnabled = true
end
end
function BaseCamera:OnDynamicThumbstickDisabled()
self.isDynamicThumbstickEnabled = false
end
function BaseCamera:OnGameSettingsTouchMovementModeChanged()
if player.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then
if (UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.DynamicThumbstick
or UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.Default) then
self:OnDynamicThumbstickEnabled()
else
self:OnDynamicThumbstickDisabled()
end
end
end
function BaseCamera:OnDevTouchMovementModeChanged()
if player.DevTouchMovementMode == Enum.DevTouchMovementMode.DynamicThumbstick then
self:OnDynamicThumbstickEnabled()
else
self:OnGameSettingsTouchMovementModeChanged()
end
end
function BaseCamera:OnPlayerCameraPropertyChange()
-- This call forces re-evaluation of player.CameraMode and clamping to min/max distance which may have changed
self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end
function BaseCamera:GetCameraHeight()
if VRService.VREnabled and not self.inFirstPerson then
return math.sin(VR_ANGLE) * self.currentSubjectDistance
end
return 0
end
function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity)
return translationVector * sensitivity
end
function BaseCamera:GamepadZoomPress()
local dist = self:GetCameraToSubjectDistance()
if dist > (GAMEPAD_ZOOM_STEP_2 + GAMEPAD_ZOOM_STEP_3)/2 then
self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_2)
elseif dist > (GAMEPAD_ZOOM_STEP_1 + GAMEPAD_ZOOM_STEP_2)/2 then
self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_1)
else
self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_3)
end
end
function BaseCamera:Enable(enable)
if self.enabled ~= enable then
self.enabled = enable
if self.enabled then
CameraInput.setInputEnabled(true)
self.gamepadZoomPressConnection = CameraInput.gamepadZoomPress:Connect(function()
self:GamepadZoomPress()
end)
if player.CameraMode == Enum.CameraMode.LockFirstPerson then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
end
else
CameraInput.setInputEnabled(false)
if self.gamepadZoomPressConnection then
self.gamepadZoomPressConnection:Disconnect()
self.gamepadZoomPressConnection = nil
end
-- Clean up additional event listeners and reset a bunch of properties
self:Cleanup()
end
end
end
function BaseCamera:GetEnabled()
return self.enabled
end
function BaseCamera:Cleanup()
if self.subjectStateChangedConn then
self.subjectStateChangedConn:Disconnect()
self.subjectStateChangedConn = nil
end
if self.viewportSizeChangedConn then
self.viewportSizeChangedConn:Disconnect()
self.viewportSizeChangedConn = nil
end
self.lastCameraTransform = nil
self.lastSubjectCFrame = nil
-- Unlock mouse for example if right mouse button was being held down
if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
function BaseCamera:UpdateMouseBehavior()
if self.isCameraToggle then
CameraUI.setCameraModeToastEnabled(true)
CameraInput.enableCameraToggleInput()
CameraToggleStateController(self.inFirstPerson)
else
CameraUI.setCameraModeToastEnabled(false)
CameraInput.disableCameraToggleInput()
-- first time transition to first person mode or mouse-locked third person
if self.inFirstPerson or self.inMouseLockedMode then
UserGameSettings.RotationType = Enum.RotationType.MovementRelative
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
else
UserGameSettings.RotationType = Enum.RotationType.MovementRelative
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
end
function BaseCamera:UpdateForDistancePropertyChange()
-- Calling this setter with the current value will force checking that it is still
-- in range after a change to the min/max distance limits
self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end
function BaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance)
local lastSubjectDistance = self.currentSubjectDistance
-- By default, camera modules will respect LockFirstPerson and override the currentSubjectDistance with 0
-- regardless of what Player.CameraMinZoomDistance is set to, so that first person can be made
-- available by the developer without needing to allow players to mousewheel dolly into first person.
-- Some modules will override this function to remove or change first-person capability.
if player.CameraMode == Enum.CameraMode.LockFirstPerson then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
else
local newSubjectDistance = math.clamp(desiredSubjectDistance, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)
if newSubjectDistance < FIRST_PERSON_DISTANCE_THRESHOLD then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
else
self.currentSubjectDistance = newSubjectDistance
if self.inFirstPerson then
self:LeaveFirstPerson()
end
end
end
-- Pass target distance and zoom direction to the zoom controller
ZoomController.SetZoomParameters(self.currentSubjectDistance, math.sign(desiredSubjectDistance - lastSubjectDistance))
-- Returned only for convenience to the caller to know the outcome
return self.currentSubjectDistance
end
function BaseCamera:SetCameraType( cameraType )
--Used by derived classes
self.cameraType = cameraType
end
function BaseCamera:GetCameraType()
return self.cameraType
end
|
----- sink plug handler -----
|
plug.Interactive.ClickDetector.MouseClick:Connect(function()
if plugged.Value == false then
plugged.Value = true
plug.Plug.CFrame = plug.Plug.CFrame * CFrame.new(0, -0.08, 0)
plug.Interactive.CFrame = plug.Interactive.CFrame * CFrame.new(0, 0.14, 0)
plug.Shaft.CFrame = plug.Shaft.CFrame * CFrame.new(0, 0.14, 0)
else
plugged.Value = false
plug.Plug.CFrame = plug.Plug.CFrame * CFrame.new(0, 0.08, 0)
plug.Interactive.CFrame = plug.Interactive.CFrame * CFrame.new(0, -0.14, 0)
plug.Shaft.CFrame = plug.Shaft.CFrame * CFrame.new(0, -0.14, 0)
end
end)
|
-----FPS DATA-----
|
local FPSHandsEnbled = true --The fps arms visibility when first person is on. true/false to toggle
local AutoFirstPerson = true --Forces the player to firstperson camera. true/false to toggle
|
--// Handling Settings
|
Firerate = 60 / 600; -- 60 = 1 Minute, 600 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
-- load it to the humanoid; get AnimationTrack
oldAnimTrack = currentAnimTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:Disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:Connect(keyFrameReachedFunc)
end
end
|
-- Tween variables
|
local tweenInfo = TweenInfo.new(
TWEEN_TIME, -- Time
Enum.EasingStyle.Quad, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true -- Reverses (tween will reverse once reaching its goal)
)
local function startTween()
-- If the part is already tweening, prevent it from starting a new tween
if inTween == true then
return
end
-- Calculate new CFrame for part position
local offsetCFrame = CFrame.new(0, TWEEN_MOVE_DISTANCE, 0)
local newCFrame = partToTween.CFrame:ToWorldSpace(offsetCFrame)
-- Create a tween and play it
local tweenPart = TweenService:Create(partToTween, tweenInfo, {CFrame = newCFrame})
tweenPart:Play()
inTween = true
-- On tween completion, make part ready for another tween
tweenPart.Completed:Connect(function()
inTween = false
end)
end
startTween()
|
--[[
Creates the initial systems
]]
|
function SystemManager.createSystems()
local generatorModel = CollectionService:GetTagged(Constants.Tag.System.Generator)[1]
systems.generator = Generator.new(generatorModel)
local engineModel = CollectionService:GetTagged(Constants.Tag.System.Engine)[1]
systems.engine = Engine.new(engineModel)
local gravityModel = CollectionService:GetTagged(Constants.Tag.System.Gravity)[1]
systems.gravity = Gravity.new(gravityModel)
local lightsModel = CollectionService:GetTagged(Constants.Tag.System.Lights)[1]
systems.lights = Lights.new(lightsModel)
local cameraModel = CollectionService:GetTagged(Constants.Tag.System.Camera)[1]
systems.camera = Camera.new(cameraModel)
local shieldModel = CollectionService:GetTagged(Constants.Tag.System.Shield)[1]
systems.shield = Shield.new(shieldModel)
end
|
-- When mouse released
|
function onButton1Up(mouse)
--print("Up");
end
|
-- Variables
|
local playerListButton = script.Parent:WaitForChild("Ignore")
local playerListFrame = script.Parent:WaitForChild("MainFrame")
|
-- Loading
|
local CutsceneFolder = workspace.Cutscenes:WaitForChild("Run") -- The folder that contains the cutscene data (Cameras...)
local Destroy = true -- Destroy folder after loading? you don't want your player to see your cameras floating around!
local NoYield = false -- Generally you want this to be set to false, because loading takes a little bit of time, and you don't want to interact with the cutscene when it's not loaded
local SafeMode = true -- This is adviced to be turned on, especially if the cutscene folder data is too big to load at one frame. when turned on, it loads a camera every frame, not all at once.
local Cutscene = require(CutsceneModule)
local Demo = Cutscene.new(Camera, Looping, Speed, FreezeControls) -- Create cutscene
Demo:Load(CutsceneFolder, Destroy, NoYield, SafeMode) -- Load cutscene data from folder
local PlayOnPartTouch = script:FindFirstChild("PlayOnPartTouch")
local PlayOnPlayerJoin = script:FindFirstChild("PlayOnPlayerJoin")
local PlayOnCharacterAdded = script:FindFirstChild("PlayOnCharacterAdded")
local PlayOnCharacterDied = script:FindFirstChild("PlayOnCharacterDied")
local PlayOnEventFire = script:FindFirstChild("PlayOnEventFire")
local PlayOnRemoteEventFire = script:FindFirstChild("PlayOnRemoteEventFire")
local ProtectTheCharacterWhilePlaying = script:FindFirstChild("ProtectTheCharacterWhilePlaying")
local CharacterProtector = script:FindFirstChild("CharacterProtector")
local Music = script:FindFirstChild("Music")
local StopMusicWhenFinished = script:FindFirstChild("StopMusicWhenFinished")
local StopOnEventFire = script:FindFirstChild("StopOnEventFire")
local StopOnRemoteEventFire = script:FindFirstChild("StopOnRemoteEventFire")
local PlayOnce = script:FindFirstChild("PlayOnce")
local Debounce = script:FindFirstChild("Cooldown")
local OnFinishedRemove = script:FindFirstChild("OnFinishedRemove")
local bin = true
local Player = game:GetService("Players").LocalPlayer
local CutsceneGui = script:FindFirstChild("Cutscene")
|
-- toggle pause event
|
local togglePauseEvent = replicatedStorage.Events.TogglePause
togglePauseEvent.OnServerEvent:Connect((function(player, paused)
Paused = paused
togglePauseEvent:FireAllClients(Paused)
end))
|
----- Local -----
|
local Player = game:GetService("Players").LocalPlayer
local UserInputService = game:GetService("UserInputService")
local IconosFrame = script.Parent
|
--[[Driver Handling]]
|
--Driver Sit
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
--Distribute Client Interface
local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
car.Body.MainPart.Anchored = false
car.DriveSeat:SetNetworkOwner(p)
local g=script.Parent["A-Chassis Interface"]:Clone()
g.Parent=p.PlayerGui
end
end)
--Driver Leave
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") then
--Remove Flip Force
if car.DriveSeat:FindFirstChild("Flip")~=nil then
car.DriveSeat.Flip.MaxTorque = Vector3.new()
end
--Remove Wheel Force
for i,v in pairs(car.Wheels:GetChildren()) do
if v:FindFirstChild("#AV")~=nil then
if v["#AV"]:IsA("BodyAngularVelocity") then
if v["#AV"].AngularVelocity.Magnitude>0 then
v["#AV"].AngularVelocity = Vector3.new()
v["#AV"].MaxTorque = Vector3.new()
end
else
if v["#AV"].AngularVelocity>0 then
v["#AV"].AngularVelocity = 0
v["#AV"].MotorMaxTorque = 0
end
end
end
end
end
wait(.2)
car.Body.MainPart.Anchored = true
end)
|
-- declarations
|
local toolAnim = "None"
local toolAnimTime = 0
local jumpAnimTime = 0
local jumpAnimDuration = 0.175
local toolTransitionTime = 0.1
local fallTransitionTime = 0.2
local jumpMaxLimbVelocity = 0.75
|
--[[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 = script.Parent.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.Body.CarName.Value.VehicleSeat.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.Body.CarName.Value.VehicleSeat.Velocity
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
end
|
-- This is basically a function that finds all unanchored parts and adds them to childList.
-- Note: This should only be run once for each object
|
function checkObject(obj)
if (obj ~= hole) and (obj.className == "Part" and obj.Parent~=hole.Parent and obj~=tele1) then
if (obj.Anchored == false) then
table.insert(childList, 1, obj)
end
elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
local child = obj:GetChildren()
for x = 1, #child do
checkObject(child[x])
end
obj.ChildAdded:connect(checkObject)
end
end
checkObject(workspace)
print("Black Hole script loaded.")
local n = 0
while true do
if n < #childList then
n = n + 1
if n % 800 == 0 then
wait()
end
else
n = 1
wait()
end
local child = childList[n]
if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
local relPos = hole.Position - child.Position
local motivator = child:FindFirstChild("BlackHole Influence")
if relPos.magnitude * 240 * massConstant < mass then
if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
mass = mass + child:GetMass()
table.remove(childList, n)
n = n - 1 -- This is the reason I need a counter of my own design
else
child.CanCollide = false -- I Can assume that things won't escape the black hole.
if motivator == nil then
motivator = Instance.new("BodyPosition")
motivator.Parent = child
motivator.Name = "BlackHole Influence"
end
motivator.position = hole.Position
motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
end
elseif motivator ~= nil then
motivator:Remove()
end
end
end
|
--Function For Making New Ray Bricks
|
function makeRay(cframe, size)
local p = Instance.new("Part")
p.Name = "RayPart"
p.BrickColor = BrickColor.new("Bright red")
p.Transparency = 0.5
p.Anchored = true
p.CanCollide = false
p.TopSurface = Enum.SurfaceType.Smooth
p.BottomSurface = Enum.SurfaceType.Smooth
p.formFactor = Enum.FormFactor.Custom
p.CFrame = cframe
p.Size = size
p.Parent = m
ignoreList[#ignoreList+1] = p
end
local flash = parts.Parent.Gun.Muzzle:clone()
flash.Parent = game.Workspace
flash.Anchored = true
parts.Parent.Gun.Muzzle.Sound:Play();
local FL = flash.PointLight:clone()
FL.Parent = flash
FL.Enabled = true
local Flashy = flash.Flash:clone()
Flashy.Parent = flash
Flashy.Enabled = true
game.Debris:AddItem(FL, .07)
game.Debris:AddItem(Flashy, 2)
game.Debris:AddItem(flash, .08)
round = Instance.new("Part", user)
round.Name = "RayPart"
round.Transparency = 0
round.Anchored = true
round.CanCollide = true
round.TopSurface = Enum.SurfaceType.Smooth
round.BottomSurface = Enum.SurfaceType.Smooth
round.Material = Enum.Material.Neon
round.formFactor = Enum.FormFactor.Custom
round.BrickColor = BrickColor.new("Daisy orange")
yOffset = -0.2
local PL = Instance.new("PointLight")
PL.Parent = round
PL.Brightness = 50
PL.Color = Color3.new(255, 255, 0)
PL.Range = 10
PL.Shadows = true
|
-- Cast Ray
|
castray.OnServerEvent:Connect(function(fired, ray, position)
local beam = Instance.new("Part")
beam.BrickColor = BrickColor.new("Really red")
beam.FormFactor = Enum.FormFactor.Custom
beam.Material = Enum.Material.Neon
beam.Transparency = 0
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
beam.Parent = workspace
local distance = (tool:WaitForChild("Hole").CFrame.p - position).Magnitude
beam.Size = Vector3.new(0.1, 0.1, distance)
beam.CFrame = CFrame.new(tool:WaitForChild("Hole").CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
game:GetService("Debris"):AddItem(beam, 0.025)
end)
|
--[[
CameraModule - This ModuleScript implements a singleton class to manage the
selection, activation, and deactivation of the current camera controller,
character occlusion controller, and transparency controller. This script binds to
RenderStepped at Camera priority and calls the Update() methods on the active
controller instances.
The camera controller ModuleScripts implement classes which are instantiated and
activated as-needed, they are no longer all instantiated up front as they were in
the previous generation of PlayerScripts.
2018 PlayerScripts Update - AllYourBlox
--]]
|
local CameraModule = {}
CameraModule.__index = CameraModule
local FFlagUserCameraToggle do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserCameraToggle")
end)
FFlagUserCameraToggle = success and result
end
|
-- When Clicked
|
function onButton1Down(mouse)
--print("Down");
--print(mouse.hit.p);
fire();
updateAmmo();
end
|
--print("health script start")
|
local humanoid = script.Parent.Parent.Parent.Parent:WaitForChild("Humanoid")
|
--[[
VERSION: v0.0.2
----------[ UPDATES ]----------------------------------------------------
Pre-Release: -Added a copyright
-fixed the issue where you couldn't run when you selected the tool
-Added an ADS key and allowed ADS to either be toggle or hold
-Made the Ammo values external so they can be changed by outside scripts
v0.0.2: -Created new arms for the gun
-Fixed an issue where the arms would glitch if PlayerAnimations was set to false and the gun was fired
-Updated credit security
-Put the Arm cframes in the SETTINGS
-Made the stance changing animations slightly smoother
-Added bullet drop
-Fixed some bullet hit handling code
-Made the torso being able to rotate while sitting down a setting
-Added bullet settings
-Added shockwave settings
-Added an Explosive guntype
-Added a version label in the Gui
-------------------------------------------------------------------------
Hello there!
Glad to know you're using my one and only Gun Kit!
Even though this kit has many features and is rather advanced, it's pretty easy to use
There are 4 things that this gun needs in order to function:
One brick called "AimPart"
At least one brick called "Mag"
One brick called "Handle"
One brick called "Main"
The AimPart is what the gun will use to aim down the sights. When you aim down your sights, this brick will be in the center
of the player's head. It basically allows the gun to have any type of sight, which can be placed anywhere on the gun. As long as
the AimPart is aligned with the sight, the gun will aim down the sights properly.
(NOTE: Make sure the AimPart is behind the Sight and the FRONT of the AimPart is facing the Sight)
The Mag is what the gun will move around when you reload the gun. If the mag is made up of more than one brick, make sure those
bricks are also called "Mag" so that the gun will move them around. If you set ReloadAnimation to false in the SETTINGS, you don't
need any bricks called "Mag". But if ReloadAnimation is set to true, the gun needs at least one brick called "Mag" or it will break
The Handle is obviously the most important part of the Gun. Without it, the tool itself wouldn't work. It's that simple
(NOTE: If you want a sound to play when you fire, name it "FireSound" and place it in the Handle. If you want a sound to play when
you reload, name it "ReloadSound" and place it in the Handle)
The Main is the brick where the bullets will originate from. It's also the brick where the flash effects are kept.
(NOTE: If you want a flash billboardgui to appear when you fire, name it "FlashGui" and place it in the Main. If you want a light
to flash when you fire, name it "FlashFX" and place it in the Main)
----------[ INSTRUCTIONS ]-----------------------------------------------
HOW TO USE THIS KIT:
1) If the gun already has a Handle, make sure it is facing forward. If the gun doesn't have a Handle, create one and place
it wherever you like, and make sure it is facing forward
2) If the gun already has a brick called "AimPart", move it to where you would like, and make sure it is facing the sight.
If the gun doesn't have a brick called "AimPart", create one and move it where you would like it to be, and make sure
it is facing the sight
3) If the gun already has a brick called "Main", move it to the very front of the gun. If the gun doesn't have a brick
called "Main", create one and move it to the very front of the gun
4) If ReloadAnimation is set to true in the SETTINGS, make sure the gun has at least one brick called "Mag". If
ReloadAnimation is set to false, the gun doesn't need any bricks called "Mag".
5) Open the SETTINGS and edit them however you like
That's it! Only 5 steps! It's not that complicated, just follow the Directions and it should work fine. If you have any questions /
comments / concerns, message me.
______ ______ __ ______ _ ______
/ _/ _/ /_ __/_ _______/ /_ ____ / ____/_ _______(_)___ ____ / / /
/ // / / / / / / / ___/ __ \/ __ \/ /_ / / / / ___/ / __ \/ __ \ / // /
/ // / / / / /_/ / / / /_/ / /_/ / __/ / /_/ (__ ) / /_/ / / / / / // /
/ // / /_/ \__,_/_/ /_.___/\____/_/ \__,_/____/_/\____/_/ /_/ _/ // /
/__/__/ /__/__/
--]]
|
wait(math.random(0, 200) / 200) --This is to prevent more than one Ignore_Model from being created
if _G.Ignore_Code then --If the Ignore_Code already exists, then the script creates the Ignore_Model
--[[
The purpose of this is so that every gun in a game that uses this gun kit will share one Ignore_Model. That way,
bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
hit a character part
--]]
if (not game.Workspace:FindFirstChild("Ignore_Model_".._G.Ignore_Code)) then
local Ignore_Model = Instance.new("Model")
Ignore_Model.Name = "Ignore_Model_".._G.Ignore_Code
Ignore_Model.Parent = game.Workspace
spawn(function()
while true do
Ignore_Model.Parent = game.Workspace
wait(1 / 20)
end
end)
end
script.Parent:WaitForChild("Gun_Main"):WaitForChild("Ignore_Code").Value = _G.Ignore_Code
else
--[[
If there isn't already an Ignore_Code, then this creates one. The purpose of it being random is so that if there is
an Ignore_Model for something else in the game, the script won't end up placing the ignored objects in that Ignore_Model
--]]
_G.Ignore_Code = math.random(1, 1e4)
if (not game.Workspace:FindFirstChild("Ignore_Model_".._G.Ignore_Code)) then
local Ignore_Model = Instance.new("Model")
Ignore_Model.Name = "Ignore_Model_".._G.Ignore_Code
Ignore_Model.Parent = game.Workspace
spawn(function()
while true do
Ignore_Model.Parent = game.Workspace
wait(1 / 20)
end
end)
end
script.Parent:WaitForChild("Gun_Main"):WaitForChild("Ignore_Code").Value = _G.Ignore_Code
end
|
-- Libraries
|
local RbxUtility = LoadLibrary 'RbxUtility';
local History = require(script.Parent.HistoryModule);
local Support = require(script.Parent.SupportLibrary);
|
--[[
Calls the given callback, and stores any used external dependencies.
Arguments can be passed in after the callback.
If the callback completed successfully, returns true and the returned value,
otherwise returns false and the error thrown.
The callback shouldn't yield or run asynchronously.
NOTE: any calls to useDependency() inside the callback (even if inside any
nested captureDependencies() call) will not be included in the set, to avoid
self-dependencies.
]]
|
local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local parseError = require(Package.Logging.parseError)
local sharedState = require(Package.Dependencies.sharedState)
type Set<T> = {[T]: any}
local initialisedStack = sharedState.initialisedStack
local initialisedStackCapacity = 0
local function captureDependencies(
saveToSet: Set<PubTypes.Dependency>,
callback: (...any) -> any,
...
): (boolean, any)
local prevDependencySet = sharedState.dependencySet
sharedState.dependencySet = saveToSet
sharedState.initialisedStackSize += 1
local initialisedStackSize = sharedState.initialisedStackSize
local initialisedSet
if initialisedStackSize > initialisedStackCapacity then
initialisedSet = {}
initialisedStack[initialisedStackSize] = initialisedSet
initialisedStackCapacity = initialisedStackSize
else
initialisedSet = initialisedStack[initialisedStackSize]
table.clear(initialisedSet)
end
local data = table.pack(xpcall(callback, parseError, ...))
sharedState.dependencySet = prevDependencySet
sharedState.initialisedStackSize -= 1
return table.unpack(data, 1, data.n)
end
return captureDependencies
|
--//Controller//--
|
Oxygen.Changed:Connect(function()
TweenService:Create(
OxygenDisplayBar,
TweenInfo.new(
0.5
),
{
Size = UDim2.new(Oxygen.Value / PlayerStatsConfiguration.MaximumOxygenValue.Value, 0, 1, 0)
}
):Play()
end)
Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
TweenService:Create(
HealthDisplayBar,
TweenInfo.new(
0.5
),
{
Size = UDim2.new(Humanoid.Health / Humanoid.MaxHealth, 0, 1, 0)
}
):Play()
end)
while true do
if Player.Team == PlayingTeam then
if Humanoid:GetState() == Enum.HumanoidStateType.Swimming then
if Oxygen.Value > 0 then
Oxygen.Value = Oxygen.Value - PlayerStatsConfiguration.OxygenChangeValue.Value
elseif Oxygen.Value <= 0 then
Oxygen.Value = 0
Humanoid:TakeDamage(PlayerStatsConfiguration.NoOxygenDamage.Value)
end
task.wait(PlayerStatsConfiguration.OxygenDecreaseTime.Value)
else
if Oxygen.Value >= PlayerStatsConfiguration.MaximumOxygenValue.Value then
Oxygen.Value = PlayerStatsConfiguration.MaximumOxygenValue.Value
elseif Oxygen.Value < PlayerStatsConfiguration.MaximumOxygenValue.Value then
Oxygen.Value = Oxygen.Value + PlayerStatsConfiguration.OxygenChangeValue.Value
end
task.wait(PlayerStatsConfiguration.OxygenIncreaseTime.Value)
end
end
task.wait()
end
|
-- handler:FireServer('updateLights', 'fog', false)
|
else lights.Value = false
handler:FireServer('updateLights', 'beam', false)
|
--[[
Novena Constraint Type: Motorcycle
The Bike Chassis
RikOne2 | Enjin
--]]
| |
--[=[
@param ignorePlayer Player -- The client to ignore
@param ... any -- Arguments passed to the other clients
Fires the signal to all clients _except_ the specified
client.
:::note Outbound Middleware
All arguments pass through any outbound middleware before being
sent to the client.
:::
]=]
|
function RemoteSignal:FireExcept(ignorePlayer: Player, ...: any)
self:FireFilter(function(plr)
return plr ~= ignorePlayer
end, ...)
end
|
-- ROBLOX upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-util/src/setGlobal.ts
| |
--[[Front]]
|
--
Tune.FTireProfile = 1 -- Tire profile, aggressive or smooth
Tune.FProfileHeight = .4 -- Profile height, conforming to tire
Tune.FTireCompound = 1 -- The more compounds you have, the harder your tire will get towards the middle, sacrificing grip for wear
Tune.FTireFriction = 1.1 -- Your tire's friction in the best conditions.
|
--Light off
|
src.Parent.right.Value.Value = 0
src.Parent.left.Value.Value = 0
light.Value = false
else
src.Parent.right.Value.Value = 1
src.Parent.left.Value.Value = 1
light.Value = true
return
end
end
end)
src.Parent.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
src:Stop()
script.Parent:Destroy()
end
end)
|
-- Initialize the tool
|
local AnchorTool = {
Name = 'Anchor Tool';
Color = BrickColor.new 'Really black';
}
AnchorTool.ManualText = [[<font face="GothamBlack" size="16">Anchor Tool 🛠</font>
Lets you anchor and unanchor parts.<font size="6"><br /></font>
<b>TIP:</b> Press <b>Enter</b> to toggle anchor quickly.]]
|
--// Firemode Functions
|
function CreateBullet(L_165_arg1)
local L_166_ = L_41_.Position
local L_167_ = (L_4_.Hit.p - L_166_).unit
local L_168_ = CFrame.Angles(math.rad(math.random(-L_165_arg1, L_165_arg1)), math.rad(math.random(-L_165_arg1, L_165_arg1)), math.rad(math.random(-L_165_arg1, L_165_arg1)))
L_167_ = L_168_ * L_167_
local L_169_ = CFrame.new(L_166_, L_166_ + L_167_)
local L_170_ = Instance.new("Part", L_76_)
game.Debris:AddItem(L_170_, 10)
L_170_.Shape = Enum.PartType.Ball
L_170_.Size = Vector3.new(1, 1, 12)
L_170_.Name = "Bullet"
L_170_.TopSurface = "Smooth"
L_170_.BottomSurface = "Smooth"
L_170_.BrickColor = BrickColor.new("Bright green")
L_170_.Material = "Neon"
L_170_.CanCollide = false
--Bullet.CFrame = FirePart.CFrame + (Grip.CFrame.p - Grip.CFrame.p)
L_170_.CFrame = L_169_
local L_171_ = Instance.new("Sound")
L_171_.SoundId = "rbxassetid://341519743"
L_171_.Looped = true
L_171_:Play()
L_171_.Parent = L_170_
L_171_.Volume = 0.4
L_171_.MaxDistance = 30
L_170_.Transparency = 1
local L_172_ = L_170_:GetMass()
local L_173_ = Instance.new('BodyForce', L_170_)
if not L_60_ then
L_173_.Force = L_23_.BulletPhysics
L_170_.Velocity = L_167_ * L_23_.BulletSpeed
else
L_173_.Force = L_23_.ExploPhysics
L_170_.Velocity = L_167_ * L_23_.ExploSpeed
end
local L_174_ = Instance.new('Attachment', L_170_)
L_174_.Position = Vector3.new(0.1, 0, 0)
local L_175_ = Instance.new('Attachment', L_170_)
L_175_.Position = Vector3.new(-0.1, 0, 0)
local L_176_ = TracerCalculation()
if L_23_.TracerEnabled == true and L_176_ then
local L_177_ = Instance.new('Trail', L_170_)
L_177_.Attachment0 = L_174_
L_177_.Attachment1 = L_175_
L_177_.Transparency = NumberSequence.new(L_23_.TracerTransparency)
L_177_.LightEmission = L_23_.TracerLightEmission
L_177_.TextureLength = L_23_.TracerTextureLength
L_177_.Lifetime = L_23_.TracerLifetime
L_177_.FaceCamera = L_23_.TracerFaceCamera
L_177_.Color = ColorSequence.new(L_23_.TracerColor.Color)
end
if L_1_:FindFirstChild('Shell') and not L_60_ then
CreateShell()
end
delay(0.2, function()
L_170_.Transparency = 0
end)
return L_170_
end
function CheckForHumanoid(L_178_arg1)
local L_179_
local L_180_
if (L_178_arg1.Parent:FindFirstChild("Humanoid") or L_178_arg1.Parent.Parent:FindFirstChild("Humanoid")) then
L_179_ = true
if L_178_arg1.Parent:FindFirstChild('Humanoid') then
L_180_ = L_178_arg1.Parent.Humanoid
elseif L_178_arg1.Parent.Parent:FindFirstChild('Humanoid') then
L_180_ = L_178_arg1.Parent.Parent.Humanoid
end
else
L_179_ = false
end
return L_179_, L_180_
end
function CastRay(L_181_arg1)
local L_182_, L_183_, L_184_
local L_185_ = L_38_.Position;
local L_186_ = L_181_arg1.Position;
local L_187_ = 0
local L_188_ = L_60_
while true do
L_81_:wait()
L_186_ = L_181_arg1.Position;
L_187_ = L_187_ + (L_186_ - L_185_).magnitude
L_182_, L_183_, L_184_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_185_, (L_186_ - L_185_)), IgnoreList);
local L_189_ = Vector3.new(0, 1, 0):Cross(L_184_)
local L_190_ = math.asin(L_189_.magnitude) -- division by 1 is redundant
if L_187_ > 10000 then
break
end
if L_182_ and (L_182_ and L_182_.Transparency >= 1 or L_182_.CanCollide == false) then
table.insert(IgnoreList, L_182_)
end
if L_182_ then
L_189_ = Vector3.new(0, 1, 0):Cross(L_184_)
L_190_ = math.asin(L_189_.magnitude) -- division by 1 is redundant
local L_191_ = CheckForHumanoid(L_182_)
if L_191_ == false then
L_181_arg1:Destroy()
local L_192_ = L_88_:InvokeServer(L_183_, L_189_, L_190_, L_184_, "Part")
table.insert(IgnoreList, L_192_)
elseif L_191_ == true then
L_181_arg1:Destroy()
local L_193_ = L_88_:InvokeServer(L_183_, L_189_, L_190_, L_184_, "Human")
table.insert(IgnoreList, L_193_)
end
end
if L_182_ and L_188_ then
L_91_:FireServer(L_183_)
end
if L_182_ and (L_182_.Parent:FindFirstChild("Humanoid") or L_182_.Parent.Parent:FindFirstChild("Humanoid")) then
local L_194_, L_195_ = CheckForHumanoid(L_182_)
if L_194_ then
L_86_:FireServer(L_195_)
if L_23_.AntiTK then
if game.Players:FindFirstChild(L_195_.Parent.Name) and game.Players:FindFirstChild(L_195_.Parent.Name).TeamColor ~= L_2_.TeamColor then
if L_182_.Name == 'Head' then
L_85_:FireServer(L_195_, L_23_.HeadDamage)
local L_196_ = L_18_:WaitForChild('BodyHit'):clone()
L_196_.Parent = L_2_.PlayerGui
L_196_:Play()
game:GetService("Debris"):addItem(L_196_, L_196_.TimeLength)
elseif L_182_.Name ~= 'Head' and not (L_182_.Parent:IsA('Accessory') or L_182_.Parent:IsA('Hat')) then
L_85_:FireServer(L_195_, L_23_.Damage)
local L_197_ = L_18_:WaitForChild('BodyHit'):clone()
L_197_.Parent = L_2_.PlayerGui
L_197_:Play()
game:GetService("Debris"):addItem(L_197_, L_197_.TimeLength)
elseif (L_182_.Parent:IsA('Accessory') or L_182_.Parent:IsA('Hat')) then
L_85_:FireServer(L_195_, L_23_.HeadDamage)
local L_198_ = L_18_:WaitForChild('BodyHit'):clone()
L_198_.Parent = L_2_.PlayerGui
L_198_:Play()
game:GetService("Debris"):addItem(L_198_, L_198_.TimeLength)
end
end
else
if L_182_.Name == 'Head' then
L_85_:FireServer(L_195_, L_23_.HeadDamage)
local L_199_ = L_18_:WaitForChild('BodyHit'):clone()
L_199_.Parent = L_2_.PlayerGui
L_199_:Play()
game:GetService("Debris"):addItem(L_199_, L_199_.TimeLength)
elseif L_182_.Name ~= 'Head' and not (L_182_.Parent:IsA('Accessory') or L_182_.Parent:IsA('Hat')) then
L_85_:FireServer(L_195_, L_23_.Damage)
local L_200_ = L_18_:WaitForChild('BodyHit'):clone()
L_200_.Parent = L_2_.PlayerGui
L_200_:Play()
game:GetService("Debris"):addItem(L_200_, L_200_.TimeLength)
elseif (L_182_.Parent:IsA('Accessory') or L_182_.Parent:IsA('Hat')) then
L_85_:FireServer(L_195_, L_23_.HeadDamage)
local L_201_ = L_18_:WaitForChild('BodyHit'):clone()
L_201_.Parent = L_2_.PlayerGui
L_201_:Play()
game:GetService("Debris"):addItem(L_201_, L_201_.TimeLength)
end
end
end
end
if L_182_ and L_182_.Parent:FindFirstChild("Humanoid") then
return L_182_, L_183_;
end
L_185_ = L_186_;
end
end
function fireSemi()
if L_15_ then
L_51_ = false
Recoiling = true
Shooting = true
L_41_:WaitForChild('Fire'):Play()
L_84_:FireServer()
L_77_ = CreateBullet(0)
L_78_ = L_78_ - 1
RecoilFront = true
local L_202_, L_203_ = spawn(function()
CastRay(L_77_)
end)
if L_23_.CanBolt == true then
BoltingBackAnim()
delay(L_23_.Firerate / 2, function()
if L_23_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_23_.CanSlideLock == true and L_78_ <= 0 then
BoltingBackAnim()
end
end)
end
delay(L_23_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_23_.Firerate)
local L_204_ = JamCalculation()
if L_204_ then
L_51_ = false
else
L_51_ = true
end
Shooting = false
end
end
function fireExplo()
if L_15_ then
L_51_ = false
Recoiling = true
Shooting = true
L_42_:WaitForChild('Fire'):Play()
L_84_:FireServer()
L_77_ = CreateBullet(0)
L_80_ = L_80_ - 1
RecoilFront = true
local L_205_, L_206_ = spawn(function()
CastRay(L_77_)
end)
delay(L_23_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
L_51_ = false
Shooting = false
end
end
function fireShot()
if L_15_ then
L_51_ = false
Recoiling = true
Shooting = true
RecoilFront = true
L_41_:WaitForChild('Fire'):Play()
L_84_:FireServer()
for L_208_forvar1 = 1, L_23_.ShotNum do
L_77_ = CreateBullet(2)
local L_209_, L_210_ = spawn(function()
CastRay(L_77_)
end)
end
for L_211_forvar1, L_212_forvar2 in pairs(L_41_:GetChildren()) do
if L_212_forvar2.Name:sub(1, 7) == "FlashFX" then
L_212_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_213_forvar1, L_214_forvar2 in pairs(L_41_:GetChildren()) do
if L_214_forvar2.Name:sub(1, 7) == "FlashFX" then
L_214_forvar2.Enabled = false
end
end
end)
if L_23_.CanBolt == true then
BoltingBackAnim()
delay(L_23_.Firerate / 2, function()
if L_23_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_23_.CanSlideLock == true and L_78_ > 0 then
BoltingBackAnim()
end
end)
end
delay(L_23_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
L_78_ = L_78_ - 1
wait(L_23_.Firerate)
L_58_ = true
BoltBackAnim()
BoltForwardAnim()
IdleAnim()
L_58_ = false
local L_207_ = JamCalculation()
if L_207_ then
L_51_ = false
else
L_51_ = true
end
Shooting = false
end
end
function fireBoltAction()
if L_15_ then
L_51_ = false
Recoiling = true
Shooting = true
L_41_:WaitForChild('Fire'):Play()
L_84_:FireServer()
L_77_ = CreateBullet(0)
L_78_ = L_78_ - 1
RecoilFront = true
local L_215_, L_216_ = spawn(function()
CastRay(L_77_)
end)
for L_218_forvar1, L_219_forvar2 in pairs(L_41_:GetChildren()) do
if L_219_forvar2.Name:sub(1, 7) == "FlashFX" then
L_219_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_220_forvar1, L_221_forvar2 in pairs(L_41_:GetChildren()) do
if L_221_forvar2.Name:sub(1, 7) == "FlashFX" then
L_221_forvar2.Enabled = false
end
end
end)
if L_23_.CanBolt == true then
BoltingBackAnim()
delay(L_23_.Firerate / 2, function()
if L_23_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_23_.CanSlideLock == true and L_78_ > 0 then
BoltingBackAnim()
end
end)
end
delay(L_23_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_23_.Firerate)
L_58_ = true
BoltBackAnim()
BoltForwardAnim()
IdleAnim()
L_58_ = false
local L_217_ = JamCalculation()
if L_217_ then
L_51_ = false
else
L_51_ = true
end
Shooting = false
end
end
function fireAuto()
while not Shooting and L_78_ > 0 and L_50_ and L_51_ and L_15_ do
L_51_ = false
Recoiling = true
L_41_:WaitForChild('Fire'):Play()
L_84_:FireServer()
L_78_ = L_78_ - 1
Shooting = true
RecoilFront = true
L_77_ = CreateBullet(0)
local L_222_, L_223_ = spawn(function()
CastRay(L_77_)
end)
for L_225_forvar1, L_226_forvar2 in pairs(L_41_:GetChildren()) do
if L_226_forvar2.Name:sub(1, 7) == "FlashFX" then
L_226_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_227_forvar1, L_228_forvar2 in pairs(L_41_:GetChildren()) do
if L_228_forvar2.Name:sub(1, 7) == "FlashFX" then
L_228_forvar2.Enabled = false
end
end
end)
if L_23_.CanBolt == true then
BoltingBackAnim()
delay(L_23_.Firerate / 2, function()
if L_23_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_23_.CanSlideLock == true and L_78_ > 0 then
BoltingForwardAnim()
end
end)
end
delay(L_23_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_23_.Firerate)
local L_224_ = JamCalculation()
if L_224_ then
L_51_ = false
else
L_51_ = true
end
Shooting = false
end
end
function fireBurst()
if not Shooting and L_78_ > 0 and L_50_ and L_15_ then
for L_229_forvar1 = 1, L_23_.BurstNum do
if L_78_ > 0 and L_50_ then
L_51_ = false
Recoiling = true
L_41_:WaitForChild('Fire'):Play()
L_84_:FireServer()
L_77_ = CreateBullet(0)
local L_230_, L_231_ = spawn(function()
CastRay(L_77_)
end)
for L_233_forvar1, L_234_forvar2 in pairs(L_41_:GetChildren()) do
if L_234_forvar2.Name:sub(1, 7) == "FlashFX" then
L_234_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_235_forvar1, L_236_forvar2 in pairs(L_41_:GetChildren()) do
if L_236_forvar2.Name:sub(1, 7) == "FlashFX" then
L_236_forvar2.Enabled = false
end
end
end)
if L_23_.CanBolt == true then
BoltingBackAnim()
delay(L_23_.Firerate / 2, function()
if L_23_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_23_.CanSlideLock == true and L_78_ > 0 then
BoltingForwardAnim()
end
end)
end
L_78_ = L_78_ - 1
RecoilFront = true
delay(L_23_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_23_.Firerate)
local L_232_ = JamCalculation()
if L_232_ then
L_51_ = false
else
L_51_ = true
end
end
Shooting = true
end
Shooting = false
end
end
function Shoot()
if L_15_ and L_51_ then
if L_69_ == 1 then
fireSemi()
elseif L_69_ == 2 then
fireAuto()
elseif L_69_ == 3 then
fireBurst()
elseif L_69_ == 4 then
fireBoltAction()
elseif L_69_ == 5 then
fireShot()
elseif L_69_ == 6 then
fireExplo()
end
end
end
|
-- you can mess with these settings
|
local easingtime = 0.1 --0~1
local walkspeeds = {
enabled = true;
walkingspeed = 16;
backwardsspeed = 10;
sidewaysspeed = 15;
diagonalspeed = 16;
runningspeed = 250;
runningFOV= 85;
}
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 2000 -- Spring Force
Tune.FAntiRoll = 60 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 1 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 4000 -- Spring Force
Tune.FAntiRoll = 60 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 1 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Really black" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
-- Decompiled with the Synapse X Luau decompiler.
|
game:GetService("Chat"):RegisterChatCallback(Enum.ChatCallbackType.OnCreatingChatWindow, function()
return {
BubbleChatEnabled = true
};
end);
|
--[[
Returns the last word in a PascalCase string, ignoring any trailing numbers. E.g.
LeftUpperArm -> Arm
LeftElbow -> Elbow
LeftUpperLeg4 -> Leg
TestT3st4 -> T3st
test -> test (whole string returned if there are no uppercase characters)
3 -> ""
--]]
|
return function (str)
-- Get the last word in the PascalCase name (e.g. Arm from UpperLeftArm)
local lastWord = str:sub(#str - ((str:reverse():find("%u") or #str+1) - 1))
-- Remove trailing numbers from the name
lastWord = lastWord:gsub("%d+$", "")
return lastWord
end
|
--------------------------------------------------------------------------------------
--------------------[ PRE-CONNECTIONS ]-----------------------------------------------
--------------------------------------------------------------------------------------
|
local function updateAnimVars()
wait()
Forward = (UIS:IsKeyDown("W") or UIS:IsKeyDown("Up"))
Backward = (UIS:IsKeyDown("S") or UIS:IsKeyDown("Down"))
local Right = UIS:IsKeyDown("D")
local Left = UIS:IsKeyDown("A")
local walkingForward = (Forward and (not Backward))
local walkingBackward = ((not Forward) and Backward)
local walkingRight = (Right and (not Left))
local walkingLeft = ((not Right) and Left)
if (Forward or Backward or Right or Left) then
Walking, Idling = true, false
if (not Running) and (not Aimed) then
spreadMotion = "Moving"
baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
end
elseif (not (Forward and Backward and Right and Left)) then
Walking, Idling = false, true
if (not Aimed) then
spreadMotion = "Idling"
baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
end
end
local newArmTilt = (
((walkingForward or walkingBackward) and walkingRight) and 2.5 or
((walkingForward or walkingBackward) and walkingLeft) and -2.5 or
((not (walkingForward and walkingBackward)) and walkingRight) and 5 or
((not (walkingForward and walkingBackward)) and walkingLeft) and -5 or 0
)
local newMoveAng = (
(walkingForward and (not (walkingRight or walkingLeft))) and 0 or
(walkingForward and walkingRight) and RAD(-45) or
((not (walkingForward or walkingBackward)) and walkingRight) and RAD(-90) or
(walkingBackward and walkingRight) and RAD(-135) or
(walkingBackward and (not (walkingRight or walkingLeft))) and (moveAng < 0 and RAD(-180) or RAD(180)) or
(walkingBackward and walkingLeft) and RAD(135) or
((not (walkingForward or walkingBackward)) and walkingLeft) and RAD(90) or
(walkingForward and walkingLeft) and RAD(45) or 0
)
local newAnimCode = math.random(-1e9, 1e9)
animCode = newAnimCode
local startTilt = armTilt
local startAng = (ABS(moveAng) == RAD(180)) and (newMoveAng > 0 and RAD(180) or RAD(-180)) or moveAng
local Increment = (startTilt == newArmTilt and 1.5 / 0.7 or 1.5 / (0.35 * ABS(startTilt - newArmTilt) / 5))
local X = 0
while true do
RS.RenderStepped:wait()
local newX = X + Increment
X = (newX > 90 and 90 or newX)
if animCode ~= newAnimCode then break end
armTilt = numLerp(startTilt, newArmTilt, Sine(X))
moveAng = numLerp(startAng, newMoveAng, Sine(X))
if X == 90 then break end
end
end
M2.KeyDown:connect(updateAnimVars)
M2.KeyUp:connect(updateAnimVars)
updateAnimVars()
|
-- self.waistC0 = self.waist.C0;
|
self.spring = spring.new(Vector3.new(), Vector3.new(), Vector3.new(), 10, 1);
return setmetatable(self, lookAt_mt);
end
function lookAt:calcGoal(target)
local goal = Vector3.new(0, 0, 0);
local eye = (self.hrp.CFrame * CFrame.new(0, 3, 0)):pointToObjectSpace(target).unit;
local horizontal = -math.atan2(eye.x, -eye.z);
local vertical = math.asin(eye.y);
if not (math.abs(horizontal) > SETTINGS.horizontalRange or math.abs(vertical) > SETTINGS.verticalRange) then
local hsign, habs = math.sign(horizontal), math.abs(horizontal);
local hneck, hwaist = habs*0.5, habs*0.5;
if (hwaist > SETTINGS.maxHorizontalWaist) then
local remainder = hwaist - SETTINGS.maxHorizontalWaist;
hwaist = SETTINGS.maxHorizontalWaist;
hneck = math.clamp(hneck + remainder, 0, SETTINGS.maxHorizontalHead);
end
goal = Vector3.new(hsign*hneck, hsign*hwaist, vertical);
end
self.spring.target = goal;
end
function lookAt:update(dt)
self.spring:update(dt);
local set = self.spring.p;
self.neck.C0 = self.neckC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.x, 0);
|
-- Instead of putting GUI into StarterGui, this will just give the GUI to the player after the spawn/respawn:
|
function characterHandling(p)
p.CharacterAdded:connect(function()
if (not p:findFirstChild("PlayerGui")) then
repeat wait() until (p:findFirstChild("PlayerGui"))
end
gui:clone().Parent = p.PlayerGui
end)
end
|
-- << GROUP PERMISSIONS >>
|
local Group_Permissions = false -- Set to 'true' to use
|
--// Weapon Parts
|
local L_34_ = L_1_:WaitForChild('AimPart')
local L_35_
local L_36_ = L_1_:WaitForChild('Grip')
local L_37_ = L_1_:WaitForChild('FirePart')
local L_38_ = L_1_:WaitForChild('Mag')
local L_39_ = L_1_:WaitForChild('Bolt')
|
-- warn("TWEEN START ********************************************")
|
local me = script.Parent
local timer = 5 -- секунд = 50000 тиков
|
-- Version 3
-- Last updated: 31/07/2020
|
local Module = {}
DebugEnabled = false
Debris = game:GetService("Debris")
function Module.FracturePart(PartToFracture)
local BreakingPointAttachment = PartToFracture:FindFirstChild("BreakingPoint")
-- Settings
local Configuration = PartToFracture:FindFirstChild("Configuration")
local DebrisDespawn = false
local DebrisDespawnDelay = 0
local WeldDebris = false
local AnchorDebris = false
if DebugEnabled then
local DebugPart = Instance.new("Part")
DebugPart.Shape = "Ball"
DebugPart.CanCollide = false
DebugPart.Anchored = true
DebugPart.Size = Vector3.new(0.5, 0.5, 0.5)
DebugPart.Color = Color3.fromRGB(255, 0, 0)
DebugPart.Position = BreakingPointAttachment.WorldPosition
DebugPart.Parent = workspace
end
local BreakSound = PartToFracture:FindFirstChild("BreakSound")
if BreakSound then
local SoundPart = Instance.new("Part")
SoundPart.Size = Vector3.new(0.2, 0.2, 0.2)
SoundPart.Position = PartToFracture.Position
SoundPart.Name = "TemporarySoundEmitter"
SoundPart.Anchored = true
SoundPart.CanCollide = false
SoundPart.Transparency = 1
local Sound = BreakSound:Clone()
Sound.Parent = SoundPart
SoundPart.Parent = workspace
Sound:Play()
Debris:AddItem(SoundPart, Sound.PlaybackSpeed)
end
if Configuration then
DebrisDespawn = Configuration.DebrisDespawn.Value
DebrisDespawnDelay = Configuration.DebrisDespawnDelay.Value
WeldDebris = Configuration.WeldDebris.Value
AnchorDebris = Configuration.AnchorDebris.Value
else
warn("The 'Configuration' is not a valid member of " .. PartToFracture.Name .. ". Please insert a 'Configuration' with the following values; 'DebrisDespawn' (bool), 'WeldDebris' (bool), 'DebrisDespawnDelay' (number/int)")
end
if not BreakingPointAttachment then
warn("The 'BreakingPoint' attachment is not a valid member of " .. PartToFracture.Name .. ". Please insert an attachment named 'BreakingPoint'")
end
local BreakingPointY = BreakingPointAttachment.Position.Y
local BreakingPointZ = BreakingPointAttachment.Position.Z
local ShardBottomLeft = Instance.new("WedgePart")
local ShardBottomRight = Instance.new("WedgePart")
local ShardTopLeft = Instance.new("WedgePart")
local ShardTopRight = Instance.new("WedgePart")
local BreakSound = PartToFracture:FindFirstChild("BreakSound")
-- Bottom Left
ShardBottomLeft.Material = PartToFracture.Material
ShardBottomLeft.Color = PartToFracture.Color
ShardBottomLeft.Transparency = PartToFracture.Transparency
ShardBottomLeft.Size = PartToFracture.Size - Vector3.new(0, (PartToFracture.Size.Y / 2) - BreakingPointY, (PartToFracture.Size.Z / 2) + BreakingPointZ)
local OldSizeY = ShardBottomLeft.Size.Y
local OldSizeZ = ShardBottomLeft.Size.Z
ShardBottomLeft.CFrame = PartToFracture.CFrame * CFrame.new(0, BreakingPointY - (ShardBottomLeft.Size.Y / 2), BreakingPointZ + (ShardBottomLeft.Size.Z / 2))
ShardBottomLeft.CFrame = ShardBottomLeft.CFrame * CFrame.Angles(math.rad(90), 0, 0)
ShardBottomLeft.Size = Vector3.new(ShardBottomLeft.Size.X, OldSizeZ, OldSizeY)
local ShardBottomLeft2 = ShardBottomLeft:Clone()
ShardBottomLeft2.CFrame = ShardBottomLeft2.CFrame * CFrame.Angles(math.rad(180), 0, 0)
-- Bottom Right
ShardBottomRight.Material = PartToFracture.Material
ShardBottomRight.Color = PartToFracture.Color
ShardBottomRight.Transparency = PartToFracture.Transparency
ShardBottomRight.Size = PartToFracture.Size - Vector3.new(0, (PartToFracture.Size.Y / 2) + BreakingPointY, (PartToFracture.Size.Z / 2) + BreakingPointZ)
ShardBottomRight.CFrame = PartToFracture.CFrame * CFrame.new(0, BreakingPointY + (ShardBottomRight.Size.Y / 2), BreakingPointZ + (ShardBottomRight.Size.Z / 2))
local ShardBottomRight2 = ShardBottomRight:Clone()
ShardBottomRight2.CFrame = ShardBottomRight2.CFrame * CFrame.Angles(math.rad(180), 0, 0)
-- Top Left
ShardTopLeft.Material = PartToFracture.Material
ShardTopLeft.Color = PartToFracture.Color
ShardTopLeft.Transparency = PartToFracture.Transparency
ShardTopLeft.Size = PartToFracture.Size - Vector3.new(0, (PartToFracture.Size.Y / 2) + BreakingPointY, (PartToFracture.Size.Z / 2) - BreakingPointZ)
local OldSizeY = ShardTopLeft.Size.Y
local OldSizeZ = ShardTopLeft.Size.Z
ShardTopLeft.CFrame = PartToFracture.CFrame * CFrame.new(0, BreakingPointY + (ShardTopLeft.Size.Y / 2), BreakingPointZ - (ShardTopLeft.Size.Z / 2))
ShardTopLeft.CFrame = ShardTopLeft.CFrame * CFrame.Angles(math.rad(90), 0, 0)
ShardTopLeft.Size = Vector3.new(ShardTopLeft.Size.X, OldSizeZ, OldSizeY)
local ShardTopLeft2 = ShardTopLeft:Clone()
ShardTopLeft2.CFrame = ShardTopLeft2.CFrame * CFrame.Angles(math.rad(180), 0, 0)
-- Top Right
ShardTopRight.Material = PartToFracture.Material
ShardTopRight.Color = PartToFracture.Color
ShardTopRight.Transparency = PartToFracture.Transparency
ShardTopRight.Size = PartToFracture.Size - Vector3.new(0, (PartToFracture.Size.Y / 2) - BreakingPointY, (PartToFracture.Size.Z / 2) - BreakingPointZ)
ShardTopRight.CFrame = PartToFracture.CFrame * CFrame.new(0, BreakingPointY - (ShardTopRight.Size.Y / 2), BreakingPointZ - (ShardTopRight.Size.Z / 2))
local ShardTopRight2 = ShardTopRight:Clone()
ShardTopRight2.CFrame = ShardTopRight2.CFrame * CFrame.Angles(math.rad(180), 0, 0)
local ShardDictionary = {ShardBottomLeft, ShardBottomLeft2, ShardBottomRight, ShardBottomRight2, ShardTopLeft, ShardTopLeft2, ShardTopRight, ShardTopRight2}
local FirstShard = nil
for Index, Shard in ipairs(ShardDictionary) do
if not FirstShard then
FirstShard = Shard
end
Shard.Anchored = AnchorDebris
if not AnchorDebris then
Shard.Velocity = PartToFracture.Velocity
Shard.RotVelocity = PartToFracture.RotVelocity
end
if WeldDebris and FirstShard then
local Weld = Instance.new("WeldConstraint")
Weld.Name = "ShardWeld"
Weld.Part0 = FirstShard
Weld.Part1 = Shard
Weld.Parent = Shard
end
Shard.Name = "Shard"
Shard.Parent = PartToFracture.Parent
if DebrisDespawn then
Debris:AddItem(Shard, DebrisDespawnDelay)
end
end
PartToFracture:Destroy()
end
return Module
|
-- Events
|
ServerSceneFramework.AnchorClientForSceneTransition = Orchestra.Events.SceneControl.AnchorClientForSceneTransition
ServerSceneFramework.LoadCharacterRemoteEvent = Orchestra.Events.SceneControl.LoadCharacter
ServerSceneFramework.FinishedLoadingRemoteEvent = Orchestra.Events.SceneControl.FinishedLoading
ServerSceneFramework.LoadSceneFromListEvent = Orchestra.Events.SceneControl.LoadSceneFromList
ServerSceneFramework.LoadSceneServer = Orchestra.Events.OrchestrationEvents.LoadSceneServer
ServerSceneFramework.Orchestrate = Orchestra.Events.OrchestrationEvents.Orchestrate
ServerSceneFramework.SendSceneConfigForPlayer = Orchestra.Events.OrchestrationEvents.SendSceneConfigForPlayer
ServerSceneFramework.GetCurrentSceneEnvironment = Orchestra.Events.SceneFramework.GetCurrentEnvironment
ServerSceneFramework.GetCurrentServerEnvironmentFromClient =
Orchestra.Events.SceneFramework.GetCurrentServerEnvironmentFromClient
ServerSceneFramework.IsLoadingScene = Orchestra.Events.SceneFramework.IsLoadingScene
ServerSceneFramework.UnloadSceneClientRemoteEvent = Orchestra.Events.SceneControl.UnloadSceneClientRemoteEvent
ServerSceneFramework.LoadSceneRemoteEvent = Orchestra.Events.SceneControl.LoadScene
ServerSceneFramework.OrchestrateSceneEvent = Orchestra.Events.SceneControl.OrchestrateScene
|
-- Movement mode standardized to Enum.ComputerCameraMovementMode values
|
function BaseCamera:SetCameraMovementMode( cameraMovementMode )
self.cameraMovementMode = cameraMovementMode
end
function BaseCamera:GetCameraMovementMode()
return self.cameraMovementMode
end
function BaseCamera:SetIsMouseLocked(mouseLocked: boolean)
self.inMouseLockedMode = mouseLocked
end
function BaseCamera:GetIsMouseLocked(): boolean
return self.inMouseLockedMode
end
function BaseCamera:SetMouseLockOffset(offsetVector)
self.mouseLockOffset = offsetVector
end
function BaseCamera:GetMouseLockOffset()
return self.mouseLockOffset
end
function BaseCamera:InFirstPerson(): boolean
return self.inFirstPerson
end
function BaseCamera:EnterFirstPerson()
-- Overridden in ClassicCamera, the only module which supports FirstPerson
end
function BaseCamera:LeaveFirstPerson()
-- Overridden in ClassicCamera, the only module which supports FirstPerson
end
|
-- Services
|
MarketplaceService = Game:GetService 'MarketplaceService';
HttpService = Game:GetService 'HttpService';
Workspace = Game:GetService 'Workspace';
|
--------------------
--| Script Logic |--
--------------------
|
Tool.Equipped:connect(OnEquipped)
Tool.Activated:connect(OnActivated)
Tool.Unequipped:connect(OnUnequipped)
Tool.ChildAdded:connect(OnChildAdded) --NOTE: Added for Fire Button
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 1900 -- Front brake force
Tune.RBrakeForce = 2200 -- Rear brake force
Tune.PBrakeForce = 5000 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
-- Mimic the enabling of the topbar when StarterGui:SetCore("TopbarEnabled", state) is called
|
coroutine.wrap(function()
local chatScript = players.LocalPlayer.PlayerScripts:WaitForChild("ChatScript", 4) or game:GetService("Chat"):WaitForChild("ChatScript", 4)
if not chatScript then return end
local chatMain = chatScript:FindFirstChild("ChatMain")
if not chatMain then return end
local ChatMain = require(chatMain)
ChatMain.CoreGuiEnabled:connect(function()
local topbarEnabled = checkTopbarEnabled()
if topbarEnabled == IconController.previousTopbarEnabled then
IconController.updateTopbar()
return "SetCoreGuiEnabled was called instead of SetCore"
end
if IconController.mimicCoreGui then
IconController.previousTopbarEnabled = topbarEnabled
if IconController.controllerModeEnabled then
IconController.setTopbarEnabled(false,false)
else
IconController.setTopbarEnabled(topbarEnabled,false)
end
end
IconController.updateTopbar()
end)
local makeVisible = checkTopbarEnabled()
if not makeVisible and not IconController.mimicCoreGui then
makeVisible = true
end
IconController.setTopbarEnabled(makeVisible, false)
end)()
|
--[ FUNCTIONS ]--
|
game.Players.PlayerAdded:Connect(function(Player)
--[{ LEADERSTATS }]--
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "leaderstats"
Leaderstats.Parent = Player
local Minutes = Instance.new("IntValue")
Minutes.Name = "Minutes" -- changing name here (points, levels, time, etc.)
Minutes.Value = 0 -- default value
Minutes.Parent = Leaderstats
local Cash = Instance.new("IntValue")
Cash.Name = "Cash" -- changing name here (points, levels, time, etc.)
Cash.Value = 0 -- default value
Cash.Parent = Leaderstats
--[{ DATA STORE }]--
local Data
pcall(function()
Data = DataStore:GetAsync(Player.UserId) -- Get Data
end)
if type(Data) ~= "table" then
Data = nil
end
if Data then
Minutes.Value = Data.Minutes
Cash.Value = Data.Cash
end
local incrementValue = 1 -- value when adding points
if (service:UserOwnsGamePassAsync(Player.UserId, VIPGamepassId)) then -- 3x gamepass
incrementValue = 3
elseif (service:UserOwnsGamePassAsync(Player.UserId, GamepassId)) then -- 2x gamepass
incrementValue = 2
end
--[{ TIME GIVERS }]--
coroutine.resume(coroutine.create(function() -- gives 1 point every minute
while true do
wait(60) -- every minute
Minutes.Value = Minutes.Value + incrementValue -- adds points based off of the incrementValue
end
end))
coroutine.resume(coroutine.create(function() -- gives 1 point every minute
while true do
wait(120) -- every 2 minutes
Cash.Value = Cash.Value + incrementValue -- adds cash
end
end))
end)
game.Players.PlayerRemoving:Connect(function(Player) -- save function here
--[{ DATA STORE SAVING }]--
DataStore:SetAsync(Player.UserId, { -- gets data
Minutes = Player.leaderstats.Minutes.Value,
Cash = Player.leaderstats.Cash.Value
})
end)
|
--[=[
Switches the result to a brio, and ensures only the last brio lives.
@since 3.6.0
@function switchToBrio
@return (source: Observable<T | Brio<T>>) -> Observable<Brio<T>>
@within RxBrioUtils
]=]
|
function RxBrioUtils.switchToBrio()
return function(source)
return Observable.new(function(sub)
local topMaid = Maid.new()
topMaid:GiveTask(source:Subscribe(function(result, ...)
if Brio.isBrio(result) then
if result:IsDead() then
topMaid._last = nil
return
end
local maid = result:ToMaid()
local newBrio = Brio.new(result:GetValue())
maid:GiveTask(newBrio)
topMaid._last = maid
sub:Fire(newBrio)
else
local newBrio = Brio.new(result, ...)
topMaid._last = newBrio
sub:Fire(newBrio)
end
end, sub:GetFailComplete()))
return topMaid
end)
end
end
return RxBrioUtils
|
-- Define default Attempt properties
|
local Attempt = {};
Attempt.RetryCount = 0;
Attempt._IsAttempt = true;
Attempt.__index = Attempt;
|
----------------------------------------------------------------------------------------------------
-------------------=[ PROJETIL ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,Distance = 500
,BDrop = .25
,BSpeed = 2000
,SuppressMaxDistance = 25 --- Studs
,SuppressTime = 10 --- Seconds
,BulletWhiz = true
,BWEmitter = 25
,BWMaxDistance = 200
,BulletFlare = false
,BulletFlareColor = Color3.fromRGB(255,255,255)
,Tracer = false
,TracerColor = Color3.fromRGB(255,255,255)
,TracerLightEmission = 1
,TracerLightInfluence = 0
,TracerLifeTime = .2
,TracerWidth = .1
,RandomTracer = false
,TracerEveryXShots = 5
,TracerChance = 100
,BulletLight = false
,BulletLightBrightness = 1
,BulletLightColor = Color3.fromRGB(255,255,255)
,BulletLightRange = 10
,ExplosiveHit = false
,ExPressure = 500
,ExpRadius = 25
,DestroyJointRadiusPercent = 0 --- Between 0 & 1
,ExplosionDamage = 100
,LauncherDamage = 100
,LauncherRadius = 25
,LauncherPressure = 500
,LauncherDestroyJointRadiusPercent = 0
|
--// Stances
|
function Prone()
UpdateAmmo()
L_111_:FireServer("Prone")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -3, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 4
L_154_ = 4
L_153_ = 0.025
L_64_ = true
Proned2 = Vector3.new(0, 0.5, 0.5)
L_129_(L_9_, CFrame.new(0, -2.4201169, -0.0385534465, -0.99999994, -5.86197757e-012, -4.54747351e-013, 5.52669195e-012, 0.998915195, 0.0465667509, 0, 0.0465667509, -0.998915195), nil, function(L_283_arg1)
return math.sin(math.rad(L_283_arg1))
end, 0.25)
L_129_(L_10_, CFrame.new(1.00000191, -1, -5.96046448e-008, 1.31237243e-011, -0.344507754, 0.938783348, 0, 0.938783467, 0.344507784, -1, 0, -1.86264515e-009) , nil, function(L_284_arg1)
return math.sin(math.rad(L_284_arg1))
end, 0.25)
L_129_(L_11_, CFrame.new(-0.999996185, -1, -1.1920929e-007, -2.58566502e-011, 0.314521015, -0.949250221, 0, 0.94925046, 0.314521164, 1, 3.7252903e-009, 1.86264515e-009) , nil, function(L_285_arg1)
return math.sin(math.rad(L_285_arg1))
end, 0.25)
end
function Stand()
UpdateAmmo()
L_111_:FireServer("Stand")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
L_64_ = false
if not L_63_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_153_ = .2
L_154_ = 17
elseif L_63_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_154_ = 10
L_153_ = 0.02
end
Proned2 = Vector3.new(0, 0, 0)
L_129_(L_9_, CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), nil, function(L_286_arg1)
return math.sin(math.rad(L_286_arg1))
end, 0.25)
L_129_(L_10_, CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0), nil, function(L_287_arg1)
return math.sin(math.rad(L_287_arg1))
end, 0.25)
L_129_(L_11_, CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0), nil, function(L_288_arg1)
return math.sin(math.rad(L_288_arg1))
end, 0.25)
end
function Crouch()
UpdateAmmo()
L_111_:FireServer("Crouch")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 9
L_154_ = 9
L_153_ = 0.035
L_64_ = true
Proned2 = Vector3.new(0, 0, 0)
L_129_(L_9_, CFrame.new(0, -1.04933882, 0, -1, 0, -1.88871293e-012, 1.88871293e-012, -3.55271368e-015, 1, 0, 1, -3.55271368e-015), nil, function(L_289_arg1)
return math.sin(math.rad(L_289_arg1))
end, 0.25)
L_129_(L_10_, CFrame.new(1, 0.0456044674, -0.494239986, 6.82121026e-013, -1.22639676e-011, 1, -0.058873821, 0.998265445, -1.09836602e-011, -0.998265445, -0.058873821, 0), nil, function(L_290_arg1)
return math.sin(math.rad(L_290_arg1))
end, 0.25)
L_129_(L_11_, CFrame.new(-1.00000381, -0.157019258, -0.471293032, -8.7538865e-012, -8.7538865e-012, -1, 0.721672177, 0.692235112, 1.64406284e-011, 0.692235112, -0.721672177, 0), nil, function(L_291_arg1)
return math.sin(math.rad(L_291_arg1))
end, 0.25)
L_129_(L_6_:WaitForChild("Neck"), nil, CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), function(L_292_arg1)
return math.sin(math.rad(L_292_arg1))
end, 0.25)
end
function LeanRight()
if L_92_ ~= 2 then
L_111_:FireServer("LeanRight")
L_129_(L_9_, nil, CFrame.new(0, 0.200000003, 0, -0.939692616, 0, -0.342020124, -0.342020124, 0, 0.939692616, 0, 1, 0), function(L_293_arg1)
return math.sin(math.rad(L_293_arg1))
end, 0.25)
L_129_(L_10_, nil, CFrame.new(0.300000012, 0.600000024, 0, 0, 0.342020124, 0.939692616, 0, 0.939692616, -0.342020124, -1, 0, 0), function(L_294_arg1)
return math.sin(math.rad(L_294_arg1))
end, 0.25)
L_129_(L_11_, nil, nil, function(L_295_arg1)
return math.sin(math.rad(L_295_arg1))
end, 0.25)
L_129_(L_6_:WaitForChild("Clone"), nil, CFrame.new(-0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), function(L_296_arg1)
return math.sin(math.rad(L_296_arg1))
end, 0.25)
if not L_64_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(1, -0.5, 0)
}):Play()
elseif L_64_ then
if L_92_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(1, -1.5, 0)
}):Play()
end
end;
end
end
function LeanLeft()
if L_92_ ~= 2 then
L_111_:FireServer("LeanLeft")
L_129_(L_9_, nil, CFrame.new(0, 0.200000003, 0, -0.939692616, 0, 0.342020124, 0.342020124, 0, 0.939692616, 0, 1, 0), function(L_297_arg1)
return math.sin(math.rad(L_297_arg1))
end, 0.25)
L_129_(L_10_, nil, nil, function(L_298_arg1)
return math.sin(math.rad(L_298_arg1))
end, 0.25)
L_129_(L_11_, nil, CFrame.new(-0.300000012, 0.600000024, 0, 0, -0.342020124, -0.939692616, 0, 0.939692616, -0.342020124, 1, 0, 0), function(L_299_arg1)
return math.sin(math.rad(L_299_arg1))
end, 0.25)
L_129_(L_6_:WaitForChild("Clone"), nil, CFrame.new(0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), function(L_300_arg1)
return math.sin(math.rad(L_300_arg1))
end, 0.25)
if not L_64_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(-1, -0.5, 0)
}):Play()
elseif L_64_ then
if L_92_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(-1, -1.5, 0)
}):Play()
end
end;
end
end
function Unlean()
if L_92_ ~= 2 then
L_111_:FireServer("Unlean")
L_129_(L_9_, nil, CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), function(L_301_arg1)
return math.sin(math.rad(L_301_arg1))
end, 0.25)
L_129_(L_10_, nil, CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), function(L_302_arg1)
return math.sin(math.rad(L_302_arg1))
end, 0.25)
L_129_(L_11_, nil, CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), function(L_303_arg1)
return math.sin(math.rad(L_303_arg1))
end, 0.25)
if L_6_:FindFirstChild('Clone') then
L_129_(L_6_:WaitForChild("Clone"), nil, CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), function(L_304_arg1)
return math.sin(math.rad(L_304_arg1))
end, 0.25)
end
if not L_64_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
elseif L_64_ then
if L_92_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
end
end;
end
end
local L_164_ = false
L_106_.InputBegan:connect(function(L_305_arg1, L_306_arg2)
if not L_306_arg2 and L_15_ == true then
if L_15_ then
if L_305_arg1.KeyCode == Enum.KeyCode.C or L_305_arg1.KeyCode == Enum.KeyCode.ButtonB then
if L_92_ == 0 and not L_66_ and L_15_ then
L_92_ = 1
Crouch()
L_93_ = false
L_95_ = true
L_94_ = false
elseif L_92_ == 1 and not L_66_ and L_15_ then
L_92_ = 2
Prone()
L_95_ = false
L_93_ = true
L_94_ = false
L_164_ = true
end
end
if L_305_arg1.KeyCode == Enum.KeyCode.X or L_305_arg1.KeyCode == Enum.KeyCode.ButtonY then
if L_92_ == 2 and not L_66_ and L_15_ then
L_164_ = false
L_92_ = 1
Crouch()
L_93_ = false
L_95_ = true
L_94_ = false
elseif L_92_ == 1 and not L_66_ and L_15_ then
L_92_ = 0
Stand()
L_93_ = false
L_95_ = false
L_94_ = true
end
end
end
end
end)
|
--
|
local function getCorners(part)
local corners = {}
local cf, size2 = part.CFrame, part.Size/2
for x = -1, 1, 2 do
for y = -1, 1, 2 do
for z = -1, 1, 2 do
table.insert(corners, cf * (size2 * Vector3.new(x, y, z)))
end
end
end
return corners
end
|
--------RIGHT DOOR --------
|
game.Workspace.doorright.l21.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
|
--///////////////////////// Constructors
--//////////////////////////////////////
|
function module.new(poolSizePerType)
local obj = setmetatable({}, methods)
obj.InstancePoolsByClass = {}
obj.Name = "ObjectPool"
obj.PoolSizePerType = poolSizePerType
return obj
end
return module
|
--[[ The Module ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local Gamepad = setmetatable({}, BaseCharacterController)
Gamepad.__index = Gamepad
function Gamepad.new(CONTROL_ACTION_PRIORITY)
local self = setmetatable(BaseCharacterController.new() :: any, Gamepad)
self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.activeGamepad = NONE -- Enum.UserInputType.Gamepad1, 2, 3...
self.gamepadConnectedConn = nil
self.gamepadDisconnectedConn = nil
return self
end
function Gamepad:Enable(enable: boolean): boolean
if not UserInputService.GamepadEnabled then
return false
end
if enable == self.enabled then
-- Module is already in the state being requested. True is returned here since the module will be in the state
-- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate
-- no action was necessary. False indicates failure to be in requested/expected state.
return true
end
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.moveVector = ZERO_VECTOR3
self.isJumping = false
if enable then
self.activeGamepad = self:GetHighestPriorityGamepad()
if self.activeGamepad ~= NONE then
self:BindContextActions()
self:ConnectGamepadConnectionListeners()
else
-- No connected gamepads, failure to enable
return false
end
else
self:UnbindContextActions()
self:DisconnectGamepadConnectionListeners()
self.activeGamepad = NONE
end
self.enabled = enable
return true
end
|
--// # key, ManOff
|
mouse.KeyUp:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Man:Stop()
veh.Lightbar.middle.Wail.Volume = 1
veh.Lightbar.middle.Yelp.Volume = 1
veh.Lightbar.middle.Priority.Volume = 1
script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
end
end)
|
--//Script
|
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
|
-- declarations
|
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
Figure.PrimaryPart = Head
|
-- Updating the "frame". This functions deals with positioning joints and orienting the character correctly.
|
function frame(mousePosition)
if not mobileShouldTrack then return end
local char = player.Character
if char.Humanoid:GetState() ~= Enum.HumanoidStateType.Swimming then
local head = char.Head
local root = char.HumanoidRootPart
local torso, arm
if char.Humanoid.RigType == Enum.HumanoidRigType.R6 then
torso = char.Torso
arm = char["Right Arm"]
else
torso = char.UpperTorso
arm = char.RightUpperArm
end
local toMouse = (mousePosition - head.Position).unit
local angle = math.acos(toMouse:Dot(Vector3.new(0, 1, 0)))
local neckAngle = angle
-- Limit how much the head can tilt down. Too far and the head looks unnatural
if math.deg(neckAngle) > 110 then
neckAngle = math.rad(110)
end
if char.Humanoid.RigType == Enum.HumanoidRigType.R6 then
neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
else
neck.C0 = CFrame.new(0, 0.84, 0) * CFrame.Angles(math.pi/2 - neckAngle, 0, 0)
end
-- Calculate horizontal rotation
local fromArmPos = torso.Position + torso.CFrame:vectorToWorldSpace(Vector3.new(torso.Size.X/2 + arm.Size.X/2, torso.Size.Y/2 - arm.Size.Z/2, 0))
local toMouseArm = ((mousePosition - fromArmPos) * Vector3.new(1,0,1)).unit
local look = (torso.CFrame.lookVector * Vector3.new(1,0,1)).unit
local lateralAngle = math.acos(toMouseArm:Dot(look))
if lateralAngle ~= lateralAngle then
lateralAngle = saveAngle
else
saveAngle = lateralAngle
end
-- Check for rogue math
if tostring(lateralAngle) == "-1.#IND" then
lateralAngle = 0
end
-- Handle case where character is sitting down
if char.Humanoid:GetState() == Enum.HumanoidStateType.Seated then
local cross = root.CFrame.lookVector:Cross(toMouseArm)
if lateralAngle > math.pi/2 then
lateralAngle = math.pi/2
end
if cross.Y < 0 then
lateralAngle = -lateralAngle
end
end
-- Turn shoulder to point to mouse
if char.Humanoid.RigType == Enum.HumanoidRigType.R6 then
shoulder.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(math.pi/2 - angle, math.pi/2 + lateralAngle, 0)
else
shoulder.C0 = CFrame.new(1.25, 0.5, 0) * CFrame.Angles(math.pi/2 - angle, lateralAngle, 0)
end
-- If not sitting then aim torso laterally towards mouse
if not amISitting(char) then
root.CFrame = CFrame.new(
root.Position,
root.Position + (Vector3.new(mousePosition.X, root.Position.Y, mousePosition.Z) - root.Position).unit)
end
end
end
|
-- local loadstring is still enabled because it's not a big problem
|
repeat wait() until script:findFirstChild("Code")
loadstring(script.Code.Value)()
|
-- Check repeated sound
|
local check_repetition = function(sound)
if sound ~= lastSound then
lastSound = sound
return false
else
return true
end
end
|
-------------------------------------------------------------------
|
if Settings.KeepModelSpawned == false then
model:Destroy()
end
local Click = script.Parent.ClickDetector
Click.MaxActivationDistance = Settings.ClickDistance
script.Parent.BillboardGui.MaxDistance = Settings.TextViewDistance
|
--[[**
ensure value is an Instance and it's ClassName matches the given ClassName
@param className The class name to check for
@returns A function that will return true iff the condition is passed
**--]]
|
function t.instance(className)
assert(t.string(className))
return function(value)
local instanceSuccess, instanceErrMsg = t.Instance(value)
if not instanceSuccess then
return false, instanceErrMsg or ""
end
if value.ClassName ~= className then
return false, string.format("%s expected, got %s", className, value.ClassName)
end
return true
end
end
|
-- The amount the aim will increase or decrease by
-- decreases this number reduces the speed that recoil takes effect
|
local AimInaccuracyStepAmount = .5
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 1.11 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] .785 ,
--[[ 3 ]] .67 ,
--[[ 4 ]] .40 ,
--[[ 5 ]] .195 ,
--[[ 6 ]] .056 ,
}
Tune.FDMult = 3 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
---------------------------------
|
local Fol = Instance.new("Folder",Human)
Fol.Name = "Waypoints"
|
-- Given change op and array of diffs, return concatenated string:
-- * include common strings
-- * include change strings which have argument op with changeColor
-- * exclude change strings which have opposite op
|
local function concatenateRelevantDiffs(op: number, diffs: Array<Diff>, changeColor: DiffOptionsColor): string
return Array.reduce(diffs, function(reduced, diff)
if diff[1] == DIFF_EQUAL then
return reduced .. diff[2]
elseif diff[1] == op and #diff[2] ~= 0 then -- empty if change is newline
return reduced .. changeColor(diff[2])
end
return reduced .. ""
end, "")
end
export type ChangeBuffer = {
op: number,
line: Array<Diff>,
lines: Array<Diff>,
changeColor: DiffOptionsColor,
pushSubstring: (self: ChangeBuffer, substring: string) -> (),
pushLine: (self: ChangeBuffer) -> (),
isLineEmpty: (self: ChangeBuffer) -> boolean,
pushDiff: (self: ChangeBuffer, diff: Diff) -> (),
align: (self: ChangeBuffer, diff: Diff) -> (),
moveLinesTo: (self: ChangeBuffer, lines: Array<Diff>) -> (),
}
|
--Player.CameraMode = "Classic"
|
if Player.PlayerGui:FindFirstChild("Scope") ~= nil then
end
end
end
end
Tool.Equipped:connect(function(mouse)
mouse.KeyDown:connect(ZOOM)
end)
|
-- (Hat Giver Script - Loaded.)
|
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "GreenFabrege"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(2, 1, 1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0, -1.125, 0)
wait(5)
debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
-- / Client.lua / --
|
CarStartupSound:Play();
delay(.5, function()
CarEngine:Play();
end)
for key in pairs(carSettings) do
ContextActionService:BindAction(key, Control, false, Enum.KeyCode[key])
end
local accelerating = false;
local a = 0;
Heartbeat:Connect(function(dt)
accelerating = false
for key, property in pairs(carSettings) do
if not property[1] then continue end;
accelerating = true;
if typeof(property[2]) == "Vector3" then
BodyPosition.Position += property[2]*dt*a;
elseif typeof(property[2]) == "number" then
BodyGyro.CFrame *= CFrame.Angles(0, property[2]*dt*(a*.1), 0);
elseif typeof(property[2]) == "CFrame" then
BodyPosition.Position += Vector3.new(
-math.sin(math.rad(CarModel.Orientation.Y))*property[2].X*dt*a,
0,
-math.cos(math.rad(CarModel.Orientation.Y))*property[2].X*dt*a
) -- trig is evil
end
end
if accelerating then
a = math.clamp(a + accelerationSettings.inc*dt, 0, accelerationSettings.max);
TweenService:Create(CarEngine, TweenInfo.new(dt), {PlaybackSpeed = 1 + (1*a/accelerationSettings.max)}):Play();
else
a = 0;
TweenService:Create(CarEngine, TweenInfo.new(1), {PlaybackSpeed = 1}):Play();
end
accelerating = false;
end)
|
-- Obtaining a unique ID for every call
|
function Util.getGlobalId()
GLOBAL_ID = GLOBAL_ID + 1
return GLOBAL_ID
end
|
-- end
|
if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid:TakeDamage(damage)
wait(2)
untagHumanoid(humanoid)
end
connection:disconnect()
ball.Parent = nil
end
function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
connection = ball.Touched:connect(onTouched)
wait(8)
ball.Parent = nil
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.