prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--This module is for any client FX related to the first door on the left.
|
local DoorFX = {}
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
function DoorFX.OPEN(door)
if not door then return end
tweenService:Create(door.Door.Main, tweenInfo, {CFrame = door.Door.Goal.CFrame}):Play()
door.Door.Main.DoorOpenFADEOUT:Play()
end
function DoorFX.CLOSE(door)
if not door then return end
door.Door.Main.CFrame = door.Door.Home.CFrame
end
return DoorFX
|
----------//KeyBinds\\----------
|
CAS:BindAction("Run", handleAction, false, Enum.KeyCode.LeftShift)
CAS:BindAction("Stand", handleAction, false, Enum.KeyCode.X)
CAS:BindAction("Crouch", handleAction, false, Enum.KeyCode.C)
CAS:BindAction("NVG", handleAction, false, Enum.KeyCode.N)
CAS:BindAction("ToggleWalk", handleAction, false, Enum.KeyCode.Z)
CAS:BindAction("LeanLeft", handleAction, false, Enum.KeyCode.Q)
CAS:BindAction("LeanRight", handleAction, false, Enum.KeyCode.E)
|
--Max/min degrees for panning: 359/0
|
TurnJump=1.0 --Number of degrees each movement makes. 1 = 1 degree every time; 0.5 = half a degree every time; ect.
TurnSpeed=0.0001 --Wait time between jumps
SpeedVariation=1
Beam=script.Parent.Tilt.H1
CPan=0
CTilt=0
local Pan = Instance.new("Weld")
Pan.Part0 = script.Parent.Base
Pan.Part1 = script.Parent.Pan.Handle
Pan.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0,1,0)
Pan.Parent = script.Parent
local Tilt = Instance.new("Weld")
Tilt.Part0 = script.Parent.Pan.Center
Tilt.Part1 = script.Parent.Tilt.Handle
Tilt.C1 = CFrame.fromEulerAnglesXYZ(math.pi/-2, math.pi/2, 0) * CFrame.new(0,0,0)
Tilt.Parent = script.Parent
OneDegree=math.pi/180
function Degrees(Des)
return(Des*OneDegree)
end
Colors={"Hot pink", "Really blue"}
function RandColor()
return Colors[math.random(1, #Colors)]
end
function On(Color)
Beam.BrickColor=BrickColor.new(Color)
Beam.Transparency=0.3
end
function Off()
Beam.Transparency=1
end
function Reach(PanDegree,TiltDegree,Speed)
ReachedPan=false
ReachedTilt=false
Moving=true
--Send out the directional degree spiders! They will go out and seek the shortest path around.
Current=CPan
Pos=0
while Current~=PanDegree do
Current=Current+TurnJump
Pos=Pos+1
if Current>359 then
Current=Current-360
end
end
Current=CPan
Neg=0
while Current~=PanDegree do
Current=Current-TurnJump
Neg=Neg+1
if Current<0 then
Current=Current+360
end
end
Rand=math.random(1,2)
while ReachedPan==false or ReachedTilt==false and Moving==true do
if CPan-0.5<PanDegree and CPan+0.5>PanDegree then
ReachedPan=true
end
if CTilt-0.5<TiltDegree and CTilt+0.5>TiltDegree then
ReachedTilt=true
end
if ReachedPan==false then
PN=0 --] Deternine Direction of movement
if Pos<Neg then --]
PN=1 --]
elseif Neg<Pos then --]
PN=-1 --]
elseif Neg==Pos then --]
if Rand==1 then --]
PN=-1 --]
else --]
PN=1 --]
end --]
end --]
CPan=CPan+TurnJump*PN
if CPan>359 then
CPan=CPan-360
end
if CPan<0 then
CPan=360+CPan
end
Pan.C1=Pan.C1*CFrame.fromEulerAnglesXYZ(0,Degrees(1)*PN*TurnJump,0)
end
if ReachedTilt==false then
PN=0 --] Deternine Direction of movement
if TiltDegree-CTilt<0 then --]
PN=-1 --]
elseif TiltDegree-CTilt>=0 then --]
PN=1 --]
end --]
CTilt=CTilt+PN*TurnJump
Tilt.C1=Tilt.C1*CFrame.fromEulerAnglesXYZ(0,Degrees(1)*PN*TurnJump,0)
end
wait(Speed)
end
end
function Move()
Moving=false
wait(script.Parent.Move.Value.Z*2)
Reach(script.Parent.Move.Value.X,script.Parent.Move.Value.Y,script.Parent.Move.Value.Z)
end
script.Parent.Move.Changed:connect(Move)
while true do
On(RandColor())
Reach(math.random(0,159),math.random(-115,115),TurnSpeed+math.random(TurnSpeed*-SpeedVariation*1000000,TurnSpeed*SpeedVariation*1000000)/1000000)
end
|
-- Libraries
|
local Libraries = Tool:WaitForChild 'Libraries'
local Support = require(Libraries:WaitForChild 'SupportLibrary')
local PaintHistoryRecord = {}
PaintHistoryRecord.__index = PaintHistoryRecord
function PaintHistoryRecord.new()
local self = setmetatable({}, PaintHistoryRecord)
-- Include selection
self.Selection = Support.CloneTable(Core.Selection.Items)
self.Parts = Support.CloneTable(Core.Selection.Parts)
-- Initialize color data
self.InitialColor = Support.GetMemberMap(self.Parts, 'Color')
self.TargetColor = nil
-- Initialize union data
self.InitialUnionColoring = {}
for _, Part in pairs(self.Parts) do
if Part:IsA 'UnionOperation' then
self.InitialUnionColoring[Part] = Part.UsePartColor
end
end
-- Return new record
return self
end
function PaintHistoryRecord:Unapply()
local Changes = {}
-- Assemble change list
for _, Part in ipairs(self.Parts) do
table.insert(Changes, {
Part = Part,
Color = self.InitialColor[Part],
UnionColoring = self.InitialUnionColoring[Part]
})
end
-- Push changes
Core.SyncAPI:Invoke('SyncColor', Changes)
-- Restore selection
Core.Selection.Replace(self.Selection)
end
function PaintHistoryRecord:Apply(KeepSelection)
local Changes = {}
-- Assemble change list
for _, Part in ipairs(self.Parts) do
table.insert(Changes, {
Part = Part,
Color = self.TargetColor,
UnionColoring = true
})
end
-- Push changes
Core.SyncAPI:Invoke('SyncColor', Changes)
-- Restore selection
if not KeepSelection then
Core.Selection.Replace(self.Selection)
end
end
return PaintHistoryRecord
|
--Objects
|
local Chassis = require(script.Parent.ChassisModule)
Chassis.InitializeSeats()
local driverScript = script.Parent:WaitForChild("Driver")
local root = script.Parent.Parent
local driverSeat = Chassis.GetDriverSeat()
local AdditionalSeats = Chassis.GetPassengerSeats()
local LocalSeatingScript = script:WaitForChild("LocalVehicleSeatingScript")
|
-- Basic settings
|
local FOOTSTEP_PLACEMENT_RATE = 0.4
local GROUND_DETECTION_DISTANCE = 3.1
local plr = game.Players.LocalPlayer
game.ReplicatedStorage.Interactions.Client.Perks.ShowFootsteps.OnClientEvent:connect(function(plrs)
-- Make sure character is alive
if plr.Character ~= nil then
-- Set up detection part for each player
local ignore = plr.PlayerScripts.Functions.GetRayIgnoreList:Invoke()
for _, i in pairs(plrs) do
local thisChr = i.Character
if thisChr:FindFirstChild("HumanoidRootPart") and i ~= plr then
local left = false
local waitTime = FOOTSTEP_PLACEMENT_RATE
local color = Color3.fromHSV(math.random(), 1, 1)
spawn(function()
while wait(waitTime) do
-- Check if detection part is gone or owner is gone
if thisChr.Parent == nil or thisChr:FindFirstChild("HumanoidRootPart") == nil then
break
end
-- Check if should place a foot step
local ray = Ray.new(thisChr.HumanoidRootPart.Position, Vector3.new(0, -GROUND_DETECTION_DISTANCE, 0))
local hit, hitPos = workspace:FindPartOnRayWithIgnoreList(ray, ignore, false, true)
if hit ~= nil and thisChr.HumanoidRootPart.Velocity.Magnitude > 1 then
-- Tell the owner to place a footstep
local cfr
if left then
cfr = thisChr.HumanoidRootPart.CFrame * CFrame.new(-0.5, -2.95, 0)
left = false
else
cfr = thisChr.HumanoidRootPart.CFrame * CFrame.new(0.5, -2.95, 0)
left = true
end
plr.PlayerScripts.Functions.PlaceFootstep:Fire(cfr, color, thisChr.Humanoid)
-- Set wait time to be the placement rate
waitTime = FOOTSTEP_PLACEMENT_RATE
else
-- Set wait time to be quick
waitTime = 0.033
end
end
end)
end
end
end
end)
|
--[[
Grabs gamepass info - cleaner alternative to GetProductInfo. Caches and may potentially yield.
Functions.GetGamepassInfo(
id, <-- |REQ| ID of gamepass. (w/o link)
)
--]]
|
return function(id)
--- Check cache
if not cachedGamepassInfo[id] then
--- Get product info
local productInfo = _L.Services.MarketplaceService:GetProductInfo(id, Enum.InfoType.GamePass)
--- Update cache
if productInfo then
cachedGamepassInfo[id] = productInfo
end
--
return productInfo
else
--- Return cache
return cachedGamepassInfo[id]
end
end
|
--// This module is only used to generate and update a list of non-custom commands for the webpanel and will not operate under normal circumstances
|
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server;
local service = Vargs.Service;
local Settings = server.Settings
local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps
--if true then return end --// fully disabled
service.TrackTask("Thread: WEBPANEL_JSON_UPDATE", function()
task.wait(1)
local enabled = rawget(_G,"ADONISWEB_CMD_JSON_DOUPDATE");
local secret = rawget(_G,"ADONISWEB_CMD_JSON_SECRET");
local endpoint = rawget(_G,"ADONISWEB_CMD_JSON_ENDPOINT");
if not enabled or not secret or not endpoint then return end
print("WEB ENABLED DO UPDATE");
if Core.DebugMode and enabled then
print("DEBUG DO LAUNCH ENABLED");
task.wait(5)
local list = {};
local HTTP = service.HttpService;
local Encode = Functions.Base64Encode
local Decode = Functions.Base64Decode
for i,cmd in Commands do
table.insert(list, {
Index = i;
Prefix = cmd.Prefix;
Commands = cmd.Commands;
Arguments = cmd.Args;
AdminLevel = cmd.AdminLevel;
Hidden = cmd.Hidden or false;
NoFilter = cmd.NoFilter or false;
})
end
--warn("COMMANDS LIST JSON: ");
--print(`\n\n{HTTP:JSONEncode(list)}\n\n`);
--print("ENCODED")
--// LAUNCH IT
print("LAUNCHING")
local success, res = pcall(HTTP.RequestAsync, HTTP, {
Url = endpoint;
Method = "POST";
Headers = {
["Content-Type"] = "application/json",
["Secret"] = secret
};
Body = HTTP:JSONEncode({
["data"] = Encode(HTTP:JSONEncode(list))
})
});
print("LAUNCHED TO WEBPANEL")
print("RESPONSE BELOW")
print(`SUCCESS: {success}\nRESPONSE:\n{(res and HTTP.JSONEncode(res)) or res}`)
end
end)
end
|
--[[**
ensures value is a number where min <= value
@param min The minimum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberMin(min)
return function(value)
local success = t.number(value)
if not success then
return false
end
if value >= min then
return true
else
return false
end
end
end
|
--[[
Races a set of Promises and returns the first one that resolves,
cancelling the others.
]]
|
function Promise.race(promises)
assert(type(promises) == "table", string.format(ERROR_NON_LIST, "Promise.race"))
for i, promise in pairs(promises) do
assert(Promise.is(promise), string.format(ERROR_NON_PROMISE_IN_LIST, "Promise.race", tostring(i)))
end
return Promise._new(debug.traceback(nil, 2), function(resolve, reject, onCancel)
local newPromises = {}
local finished = false
local function cancel()
for _, promise in ipairs(newPromises) do
promise:cancel()
end
end
local function finalize(callback)
return function (...)
cancel()
finished = true
return callback(...)
end
end
if onCancel(finalize(reject)) then
return
end
for i, promise in ipairs(promises) do
newPromises[i] = promise:andThen(finalize(resolve), finalize(reject))
end
if finished then
cancel()
end
end)
end
Promise.Race = Promise.race
|
-- Test selectors (when unsupported)
|
return {
supportsTestSelectors = false,
findFiberRoot = shim,
getBoundingRect = shim,
getTextContent = shim,
isHiddenSubtree = shim,
matchAccessibilityRole = shim,
setFocusIfFocusable = shim,
setupIntersectionObserver = shim,
}
|
---------END LEFT DOOR
|
game.Workspace.DoorValues.Moving.Value = true
game.Workspace.DoorClosed.Value = true
wait(0.1)
until game.Workspace.DoorValues.Close.Value==69
end
game.Workspace.DoorValues.Moving.Value = false
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
service = nil;
return function(p1)
local v1 = p1.Color or Color3.new(1, 1, 1);
local v2 = {
Name = "ColorPicker",
Title = p1.Title and "Color Picker",
Size = { 250, 230 },
MinSize = { 150, 230 },
MaxSize = { math.huge, 230 },
SizeLocked = true
};
local u1 = nil;
local u2 = v1;
function v2.OnClose()
if not u1 then
u1 = u2;
end;
end;
local v3 = client.UI.Make("Window", v2);
local v4 = {
Text = "Accept",
Size = UDim2.new(1, -10, 0, 20),
Position = UDim2.new(0, 5, 0, 175)
};
local v5 = {};
function v5.MouseButton1Down()
u1 = u2;
v3:Close();
end;
v4.Events = v5;
local v6 = v3:Add("TextButton", v4);
local u3 = v1.r;
local u4 = v1.g;
local u5 = v1.b;
local u6 = v3:Add("Frame", {
Size = UDim2.new(1, -10, 0, 20),
Position = UDim2.new(0, 5, 0, 150),
BackgroundColor3 = u2
});
local u7 = nil;
local u8 = nil;
local u9 = nil;
local u10 = nil;
local u11 = nil;
local u12 = nil;
local v7 = {
Text = "Red: ",
BoxText = u3 * 255,
BackgroundTransparency = 1,
TextSize = 20,
Size = UDim2.new(1, -20, 0, 20),
Position = UDim2.new(0, 10, 0, 0)
};
local function u13()
u2 = Color3.new(u3, u4, u5);
u6.BackgroundColor3 = u2;
u7:SetValue(math.floor(u3 * 255));
u8.SliderBar.ImageColor3 = Color3.new(0, 0, 0):lerp(Color3.new(1, 0, 0), u3);
u8:SetValue(u3);
u9:SetValue(math.floor(u4 * 255));
u10.SliderBar.ImageColor3 = Color3.new(0, 0, 0):lerp(Color3.new(0, 1, 0), u4);
u10:SetValue(u4);
u11:SetValue(math.floor(u5 * 255));
u12.SliderBar.ImageColor3 = Color3.new(0, 0, 0):lerp(Color3.new(0, 0, 1), u5);
u12:SetValue(u5);
end;
function v7.TextChanged(p2, p3, p4)
if tonumber(p2) then
local v8 = nil;
p2 = math.floor(tonumber(p2));
if p2 < 0 then
v8 = true;
p2 = 0;
elseif p2 > 255 then
v8 = true;
p2 = 255;
end;
u3 = p2 / 255;
u13();
if v8 then
return p2;
end;
elseif p3 then
return u3 * 255;
end;
end;
u7 = v3:Add("StringEntry", v7);
u9 = v3:Add("StringEntry", {
Text = "Green: ",
BoxText = u4 * 255,
BackgroundTransparency = 1,
TextSize = 20,
Size = UDim2.new(1, -20, 0, 20),
Position = UDim2.new(0, 10, 0, 50),
TextChanged = function(p5, p6, p7)
if tonumber(p5) then
local v9 = false;
p5 = math.floor(tonumber(p5));
if p5 < 0 then
v9 = true;
p5 = 0;
elseif p5 > 255 then
v9 = true;
p5 = 255;
end;
u4 = p5 / 255;
u13();
if v9 then
return p5;
end;
elseif p6 then
return u4 * 255;
end;
end
});
u11 = v3:Add("StringEntry", {
Text = "Blue: ",
BoxText = u5 * 255,
BackgroundTransparency = 1,
TextSize = 20,
Size = UDim2.new(1, -20, 0, 20),
Position = UDim2.new(0, 10, 0, 100),
TextChanged = function(p8, p9, p10)
if tonumber(p8) then
local v10 = false;
p8 = math.floor(tonumber(p8));
if p8 < 0 then
v10 = true;
p8 = 0;
elseif p8 > 255 then
v10 = true;
p8 = 255;
end;
u5 = p8 / 255;
u13();
if v10 then
return p8;
end;
elseif p9 then
return u5 * 255;
end;
end
});
u8 = v3:Add("Slider", {
Percent = u2.r,
Size = UDim2.new(1, -20, 0, 20),
Position = UDim2.new(0, 10, 0, 25),
OnSlide = function(p11)
u3 = p11;
u13();
end
});
u10 = v3:Add("Slider", {
Percent = u2.r,
Size = UDim2.new(1, -20, 0, 20),
Position = UDim2.new(0, 10, 0, 75),
OnSlide = function(p12)
u4 = p12;
u13();
end
});
u12 = v3:Add("Slider", {
Percent = u2.r,
Size = UDim2.new(1, -20, 0, 20),
Position = UDim2.new(0, 10, 0, 125),
OnSlide = function(p13)
u5 = p13;
u13();
end
});
u13();
local l__gTable__11 = v3.gTable;
v3:ResizeCanvas();
v3:Ready();
while true do
wait();
if u1 then
break;
end;
if not l__gTable__11.Active then
break;
end;
end;
return nil;
end;
|
-- mod:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,-2,0))) -- опускаем чутка -- TranslateBy MoveTo
-- превращаем в ландшафт
|
game.Workspace.Terrain:FillBlock(mod.Base.CFrame, mod.Base.Size, Enum.Material.Cobblestone)
|
-- Set the portal effects based on the initial Status value
|
onAdStatusChange()
|
-- Update the previous floor material, current floor material and sound data
|
humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
getFloorMaterial()
getSoundProperties()
update()
if humanoid.MoveDirection.Magnitude > 0 then
currentSound.Playing = true
end
end)
|
--local r2 = cr.Misc.FR.Door.Ind
|
local b1 = lt.LEFT
local b2 = lt.RIGHT
local b3 = lt.TB
local lw = lt.B
local lww = lt.L
local lwww = lt.L2
local hi = lt.HB
local rb = lt.RB
local rv = lt.Reverse
local left = false
local right = false
local hazards = false
local reverse = false
local headlt = false
local highlt = false
local relay = false
local brake = false
function DealWithInput(input,processed)
if (processed) then return end
if input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.Down then --Brake
if input.UserInputState == Enum.UserInputState.Begin then
brake=true
b3.BrickColor = BrickColor.new("Really red")
b3.Material = Enum.Material.Neon
if not left then
b1.BrickColor = BrickColor.new("Really Red")
b1.Material = Enum.Material.Neon
end
if not right then
b2.BrickColor = BrickColor.new("Really Red")
b2.Material = Enum.Material.Neon
end
elseif input.UserInputState == Enum.UserInputState.End then
brake=false
b3.BrickColor = BrickColor.new("Crimson")
b3.Material = Enum.Material.SmoothPlastic
if ((not left) and (not hazards) and (not brake)) then
b1.BrickColor = BrickColor.new("Pearl")
b1.Material = Enum.Material.SmoothPlastic
else
|
--local l2 = cr.Misc.FL.Door.Ind
|
local r1 = lt.RightIn
|
--//Functions
|
function CarColor ()
for i,v in pairs(Car.Body.Color:GetChildren()) do
v.Color = Stats.Color.Value
end
for i,vv in pairs(Car.Misc.Arka_Kapaklar:GetChildren()) do
if vv:IsA("BasePart") then
vv.Color = Stats.Color.Value
end
end
end
function CheckFuel ()
if oldpos == nil then
oldpos = MainP.Position
else
newpos = MainP.Position
|
-- Updates the GUI whenever the player starts to give them the most up to date status.
|
updateText()
status.Changed:Connect(updateText)
|
-- Public Methods
|
function GJK:IsColliding()
local direction = (self.CentroidA - self.CentroidB).Unit
local simplex = {self.SupportA(self.SetA, direction) - self.SupportB(self.SetB, -direction)}
direction = -direction
for i = 1, MAX_TRIES do
table.insert(simplex, self.SupportA(self.SetA, direction) - self.SupportB(self.SetB, -direction))
if (simplex[#simplex]:Dot(direction) <= 0) then
return false
else
local passed, newDirection = containsOrigin(self, simplex, direction)
if (passed) then
return true
end
direction = newDirection
end
end
return false
end
|
--> Services
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 730 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7500 -- Use sliders to manipulate values
Tune.Redline = 9000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-- ANIMATION
|
function Joint(Name, Part0, Part1, C0, C1, MaxVelocity)
local Motor = Instance.new("Motor")
Motor.C0 = C0
Motor.C1 = C1
Motor.MaxVelocity = MaxVelocity
Motor.Name = Name
Motor.Parent = Part0
Motor.Part0 = Part0
Motor.Part1 = Part1
end
|
-- The hand is actually part of the arm/etc, so remap their limb types
|
local LIMB_TYPE_ALIASES = {
Hand = "Arm",
Foot = "Leg",
}
|
---//Abrir y cerrar por un button//-----
--[[
button.MouseButton1Click:Connect(function()
if frame.Visible == false then
frame.Visible = true
else
frame.Visible = false
end
end)
]]
|
--
|
-- Classes --
|
if (itemType == 'Class') then
Classes[item.Name] = item
item.Properties = {}
item.Functions = {}
item.YieldFunctions = {}
item.Events = {}
item.Callbacks = {}
|
-- Bind tool events
|
Tool.Equipped:connect(equip)
Tool.Unequipped:connect(unequip)
|
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop(transitionTime)
runAnimTrack:Destroy()
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
-- check to see if we need to blend a walk/run animation
if animName == "walk" then
local runAnimName = "run"
local runIdx = rollAnimation(runAnimName)
runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
runAnimTrack:Play(transitionTime)
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
|
--// Recoil Settings
|
gunrecoil = -0.5; -- How much the gun recoils backwards when not aiming
camrecoil = 0.43; -- How much the camera flicks when not aiming
AimGunRecoil = -0.4; -- How much the gun recoils backwards when aiming
AimCamRecoil = 0.31; -- How much the camera flicks when aiming
CamShake = 10; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
AimCamShake = 8; -- THIS IS ALSO NEW!!!!
Kickback = 3.4; -- Upward gun rotation when not aiming
AimKickback = 2.2; -- Upward gun rotation when aiming
|
--------------------[ ARM CREATION FUNCTION ]-----------------------------------------
|
function createArms()
local Arms = {}
for i = 0, 1 do
local armModel = Instance.new("Model")
armModel.Name = "armModel"
local Arm = Instance.new("Part")
Arm.BrickColor = (S.fakeArmSettings.realBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.fakeArmSettings.Color)
Arm.Transparency = S.fakeArmSettings.Transparency
Arm.Name = "Arm"
Arm.CanCollide = false
Arm.Size = V3(0.598, 2, 0.598)
Arm.Parent = armModel
local armMesh = Instance.new("SpecialMesh")
armMesh.MeshId = "rbxasset://fonts//leftarm.mesh"
armMesh.MeshType = Enum.MeshType.FileMesh
armMesh.Scale = V3(0.598, 1, 0.598)
armMesh.Parent = Arm
local Glove1 = Instance.new("Part")
Glove1.BrickColor = BrickColor.new("Black")
Glove1.Name = "Glove1"
Glove1.CanCollide = false
Glove1.Size = V3(0.598, 2, 0.598)
Glove1.Parent = armModel
local glove1Mesh = Instance.new("SpecialMesh")
glove1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
glove1Mesh.Offset = V3(0, -0.5, 0)
glove1Mesh.Scale = V3(0.658, 0.205, 0.658)
glove1Mesh.Parent = Glove1
local glove1Weld = Instance.new("Weld")
glove1Weld.Part0 = Arm
glove1Weld.Part1 = Glove1
glove1Weld.Parent = Arm
local Glove2 = Instance.new("Part")
Glove2.BrickColor = BrickColor.new("Black")
Glove2.Name = "Glove2"
Glove2.CanCollide = false
Glove2.Size = V3(0.598, 2, 0.598)
Glove2.Parent = armModel
local glove2Mesh = Instance.new("SpecialMesh")
glove2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
glove2Mesh.Offset = V3(0, -0.435, 0)
glove2Mesh.Scale = V3(0.69, 0.105, 0.69)
glove2Mesh.Parent = Glove2
local glove2Weld = Instance.new("Weld")
glove2Weld.Part0 = Arm
glove2Weld.Part1 = Glove2
glove2Weld.Parent = Arm
local Glove3 = Instance.new("Part")
Glove3.BrickColor = BrickColor.new("Black")
Glove3.Name = "Glove3"
Glove3.CanCollide = false
Glove3.Size = V3(0.598, 2, 0.598)
Glove3.Parent = armModel
local glove3Mesh = Instance.new("SpecialMesh")
glove3Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
glove3Mesh.Offset = V3(0.18 * ((i * 2) - 1), -0.7, 0)
glove3Mesh.Scale = V3(0.299, 0.305, 0.657)
glove3Mesh.Parent = Glove3
local glove3Weld = Instance.new("Weld")
glove3Weld.Part0 = Arm
glove3Weld.Part1 = Glove3
glove3Weld.Parent = Arm
local Sleeve1 = Instance.new("Part")
Sleeve1.BrickColor = BrickColor.new("Sand green")
Sleeve1.Name = "Sleeve1"
Sleeve1.CanCollide = false
Sleeve1.Size = V3(0.598, 2, 0.598)
Sleeve1.Parent = armModel
local sleeve1Mesh = Instance.new("SpecialMesh")
sleeve1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
sleeve1Mesh.Offset = V3(0, 0.75, 0)
sleeve1Mesh.Scale = V3(0.656, 0.3, 0.656)
sleeve1Mesh.Parent = Sleeve1
local sleeve1Weld = Instance.new("Weld")
sleeve1Weld.Part0 = Arm
sleeve1Weld.Part1 = Sleeve1
sleeve1Weld.Parent = Arm
local Sleeve2 = Instance.new("Part")
Sleeve2.BrickColor = BrickColor.new("Sand green")
Sleeve2.Name = "Sleeve2"
Sleeve2.CanCollide = false
Sleeve2.Size = V3(0.598, 2, 0.598)
Sleeve2.Parent = armModel
local sleeve2Mesh = Instance.new("SpecialMesh")
sleeve2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
sleeve2Mesh.Offset = V3(0, 0.55, 0)
sleeve2Mesh.Scale = V3(0.75, 0.1, 0.75)
sleeve2Mesh.Parent = Sleeve2
local sleeve2Weld = Instance.new("Weld")
sleeve2Weld.Part0 = Arm
sleeve2Weld.Part1 = Sleeve2
sleeve2Weld.Parent = Arm
table.insert(Arms, {Model = armModel, armPart = Arm})
end
return Arms
end
|
-- Ugly hack because sometimes PlayerAdded doesn't fire in play solo
|
for _,player in pairs(Players:GetPlayers()) do
playerAdded(player)
end
|
--- Skill
|
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://4835590095"
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.X and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = false
Tool.Active.Value = "SunaTornadoBig"
wait(0.1)
Track1 = Player.Character.Humanoid:LoadAnimation(Animation)
Track1:Play()
wait(0.15)
script.Fire:FireServer(plr)
local hum = Player.Character.Humanoid
for i = 1,30 do
wait()
hum.CameraOffset = Vector3.new(
math.random(-1,1),
math.random(-1,1),
math.random(-1,1)
)
end
hum.CameraOffset = Vector3.new(0,0,0)
wait(0.15)
Tool.Active.Value = "None"
wait(2)
Debounce = true
end
end)
|
--------------------------------------------------------------------------------------------------------------------------------------
|
function PressH(key)
if (key== "h") then
if (Activate==false) then
for _,v in ipairs(game.Players.LocalPlayer.Character.Helmet:GetChildren()) do
if v.ClassName == "Part" or v.ClassName=="UnionOperation" or v.ClassName=="WedgePart" then
game.Players.LocalPlayer.Character.Helmet.LS.Light.Enabled=false
game.Players.LocalPlayer.Character.Helmet.Flashlight.Material = "SmoothPlastic"
v.Transparency=1
end
end
for _,v in ipairs(game.Players.LocalPlayer.Character:GetChildren()) do
if v.ClassName == "Hat" then
v.Handle.Transparency=0
end
end
game.Players.LocalPlayer.Character.Head.Transparency = 0
Activate = true
elseif (Activate==true) then
for _,v in ipairs(game.Players.LocalPlayer.Character:GetChildren()) do
if v.ClassName == "Hat" then
v.Handle.Transparency=1
end
end
for _,v in ipairs(game.Players.LocalPlayer.Character.Helmet:GetChildren()) do
if v.ClassName == "Part" or v.ClassName=="UnionOperation" or v.ClassName=="WedgePart" then
v.Transparency=0
end
end
game.Players.LocalPlayer.Character.Helmet.Middle.Transparency=1
game.Players.LocalPlayer.Character.Head.Transparency = 1
Activate=false
end
end
end
Mouse.KeyDown:connect(PressH)
|
--print("anti-sleep activate")
--[===[
while script.Parent do
local waitTime = wait()
if waitTime > 0.0000001 and IsCoupled.Value then --insurance
LastPositions[NumberPositions]=nil
table.insert(LastPositions,1,coupler.Position)
local AveragePosition = Vector3.new()
for i = 1, #LastPositions do
AveragePosition = AveragePosition + LastPositions[i]/#LastPositions
end
local RateOfChangeOfAveragePosition = (AveragePosition-LastAveragePosition).magnitude/waitTime
if LastRateOfChangeOfAveragePosition < WakeupThreshold and RateOfChangeOfAveragePosition >= WakeupThreshold then
if not PGS and RateOfChangeOfAveragePosition > WakeupThreshold then
for _,k in pairs (coupler.Parent.Parent:GetChildren()) do --this assumes the draft gear itself is welded to the train
if k:IsA("BasePart") then
if k:CanAwaken() then
k:Awake()
end
break
end
end
end
end
LastRateOfChangeOfAveragePosition = RateOfChangeOfAveragePosition
LastAveragePosition = AveragePosition
end
end
]===]
| |
--4: And, as said before, this code must be in a NORMAL SCRIPT. not a LocalScript, just a Script.
| |
--[[Weight and CG]]
|
Tune.Weight = 3400 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- move back UI --
|
Events.BringTitle.Event:Connect(function()
moveTitle = tweenService:Create(Title, movementTitle, titleEnd)
moveSolo = tweenService:Create(PlaySolo, movementSolo, soloEnd)
moveCustomize = tweenService:Create(Customize, movementCustomize, customizeEnd)
moveAchievements = tweenService:Create(Achievements, movementAchievements, achievementsEnd)
moveSettings = tweenService:Create(Settings, movementSettings, settingsEnd)
moveBack = tweenService:Create(Back, movementBack, backEnd)
moveTitle:Play()
moveSolo:Play()
moveCustomize:Play()
moveAchievements:Play()
moveSettings:Play()
moveBack:Play()
achievementEnabled.Value = true
customizeEnabled.Value = true
soloEnabled.Value = true
settingsEnabled.Value = true
backEnabled.Value = false
end)
Events.RemoveTitle.Event:Connect(function()
moveTitle = tweenService:Create(Title, movementTitle, titleStart)
moveSolo = tweenService:Create(PlaySolo, movementSolo, soloStart)
moveCustomize = tweenService:Create(Customize, movementCustomize, customizeStart)
moveAchievements = tweenService:Create(Achievements, movementAchievements, achievementsStart)
moveSettings = tweenService:Create(Settings, movementSettings, settingsStart)
moveBack = tweenService:Create(Back, movementBack, backStart)
moveTitle:Play()
moveSolo:Play()
moveCustomize:Play()
moveAchievements:Play()
moveSettings:Play()
moveBack:Play()
achievementEnabled.Value = false
customizeEnabled.Value = false
soloEnabled.Value = false
settingsEnabled.Value = false
backEnabled.Value = true
end)
|
-- not used, but needs to be required
|
local VehicleController = require(script.MasterControl:WaitForChild('VehicleController'))
|
-------- CONFIG
-- ENABLERS (do not touch yet)
|
local Popups_Enabled = false -- Enables popups. (refer to "Instructions" for installation)
local Sequential_Indicators = false -- Enables sequential indicators. (refer to "Instructions" for installation)
local Sequential_Segments = 3 -- How many segments your indicators use. (don't use if Sequential_Indicators is false)
local Trunk_Lights = false -- Enables rear, brake, and reverse lights on trunk. (they will still work inside of the main model)
local Plate_Lights = false -- Enables license plate lights.
local Interior_Lights = false -- Enables interior lights. (Not Working Yet)
local Mirror_Indicators = false --Enables indicators on mirrors. (Not Working yet)
local Dashboard_Indicators = false -- Enables dashboard indicators. (refer to "Instrucitons" for setup) (Not Working Yet)
|
--[[
Builds a map that allows us to find Attachment0/Attachment1 when we have the other,
and keep track of the joint that connects them. Format is
{
["WaistRigAttachment"] = {
Joint = UpperTorso.Waist<Motor6D>,
Attachment0 = LowerTorso.WaistRigAttachment<Attachment>,
Attachment1 = UpperToros.WaistRigAttachment<Attachment>,
},
...
}
--]]
|
function buildAttachmentMap(character)
local attachmentMap = {}
-- NOTE: GetConnectedParts doesn't work until parts have been parented to Workspace, so
-- we can't use it (unless we want to have that silly restriction for creating ragdolls)
for _,part in pairs(character:GetChildren()) do
if part:IsA("BasePart") then
for _,attachment in pairs(part:GetChildren()) do
if attachment:IsA("Attachment") then
local jointName = attachment.Name:match("^(.+)RigAttachment$")
local joint = jointName and attachment.Parent:FindFirstChild(jointName) or nil
if joint then
attachmentMap[attachment.Name] = {
Joint = joint,
Attachment0=joint.Part0[attachment.Name];
Attachment1=joint.Part1[attachment.Name];
}
end
end
end
end
end
return attachmentMap
end
return function(humanoid)
local character = humanoid.Parent
-- Trying to recover from broken joints is not fun. It's impossible to reattach things like
-- armor and tools in a generic way that works across all games, so we just prevent that
-- from happening in the first place.
humanoid.BreakJointsOnDeath = false
-- Roblox decided to make the ghost HumanoidRootPart CanCollide=true for some reason, so
-- we correct this and disable collisions. This prevents the invisible part from colliding
-- with the world and ruining the physics simulation (e.g preventing a roundish torso from
-- rolling)
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart then
rootPart.CanCollide = false
end
local player = game.Players:GetPlayerFromCharacter(character)
local attachmentMap = buildAttachmentMap(character)
local ragdollConstraints = buildConstraints(attachmentMap)
local collisionFilters = buildCollisionFilters(attachmentMap, character.PrimaryPart)
collisionFilters.Parent = ragdollConstraints
ragdollConstraints.Parent = character
game:GetService("CollectionService"):AddTag(humanoid, "Ragdoll")
end
|
-- Don't edit below unless you know what you're doing.
|
local O = 1
function onClicked()
if O == 1 then
O = 2
One()
elseif O == 2 then
O = 3
Two()
elseif O == 3 then
O = 1
Three()
end
end
script.Parent.MouseButton1Down:connect(onClicked)
|
--This works great for scary places, adding scream sounds when a humanoi passes trough a zone--
| |
--// Functions \\--
|
function PartSetup (center,Name)
center.Parent = workspace.CurrentCamera
center.Size = Vector3.new(7, 5, 0.05)
center.Anchored = false
center.CanCollide = false
center.Name = Name.."Menu"
center.CustomPhysicalProperties= PhysicalProperties.new(0, 0, 0)
center.Transparency = .8
center.BrickColor = BrickColor.White()
center.Material = Enum.Material.Neon
end
function WeldSetup (centerWeld,center,C0info)
centerWeld.Part0 = workspace:WaitForChild(Player.Name).HumanoidRootPart
centerWeld.Part1 = center
centerWeld.C0 = CFrame.new(0,1.5,-5)
centerWeld.Parent = workspace:WaitForChild(Player.Name).HumanoidRootPart
end
|
--[[
Returns first value (success), and packs all following values.
]]
|
local function packResult(success, ...)
return success, select("#", ...), { ... }
end
local function makeErrorHandler(traceback)
assert(traceback ~= nil)
return function(err)
-- If the error object is already a table, forward it directly.
-- Should we extend the error here and add our own trace?
if type(err) == "table" then
return err
end
return Error.new({
error = err,
kind = Error.Kind.ExecutionError,
trace = debug.traceback(tostring(err), 2),
context = "Promise created at:\n\n" .. traceback,
})
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Pets__1 = game.Players.LocalPlayer:WaitForChild("Pets");
local l__Background__2 = script.Parent.Background;
l__Background__2.MouseButton1Click:Connect(function()
local l__Value__3 = script.Parent.Parent.Parent.DefaultButtonColor.Value;
local l__SideFrame__4 = script.Parent.Parent.Parent.Parent.SideFrame;
if l__SideFrame__4.MassDelete.Value ~= false then
if script.Parent.MassDeleteIndicator.Visible == false then
script.Parent.MassDeleteIndicator.Visible = true;
script.Parent.Background.BackgroundColor3 = script.Parent.Parent.Parent.MassDeleteButtonColor.Value;
return;
else
script.Parent.MassDeleteIndicator.Visible = false;
script.Parent.Background.BackgroundColor3 = l__Value__3;
return;
end;
end;
for v5, v6 in pairs(script.Parent.Parent:GetChildren()) do
if v6:IsA("Frame") then
v6.Background.BackgroundColor3 = l__Value__3;
end;
end;
l__Background__2.BackgroundColor3 = script.Parent.Parent.Parent.SelectButtonColor.Value;
l__SideFrame__4.PetID.Value = script.Parent.PetID.Value;
end);
|
-- RayPlaneIntersection (shortened)
-- http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm
|
function moduleApiTable:RayPlaneIntersection(ray, planeNormal, pointOnPlane)
planeNormal = planeNormal.unit
ray = ray.Unit
local Vd = planeNormal:Dot(ray.Direction)
if Vd == 0 then -- parallel, no intersection
return nil
end
local V0 = planeNormal:Dot(pointOnPlane - ray.Origin)
local t = V0 / Vd
if t < 0 then --plane is behind ray origin, and thus there is no intersection
return nil
end
return ray.Origin + ray.Direction * t
end
function moduleApiTable:GetEaseLinear()
return Linear
end
function moduleApiTable:GetEaseOutQuad()
return EaseOutQuad
end
function moduleApiTable:GetEaseInOutQuad()
return EaseInOutQuad
end
function moduleApiTable:CreateNewSlider(numOfSteps, startStep, minStep)
return CreateNewSlider(numOfSteps, startStep, minStep)
end
function moduleApiTable:CreateNewSelector(selectionStringTable, startPosition)
return CreateSelector(selectionStringTable, startPosition)
end
function moduleApiTable:CreateNewDropDown(dropDownStringTable, startPosition)
return CreateDropDown(dropDownStringTable, startPosition, nil)
end
function moduleApiTable:AddNewRow(pageToAddTo, rowDisplayName, selectionType, rowValues, rowDefault, extraSpacing)
return AddNewRow(pageToAddTo, rowDisplayName, selectionType, rowValues, rowDefault, extraSpacing)
end
function moduleApiTable:AddNewRowObject(pageToAddTo, rowDisplayName, rowObject, extraSpacing)
return AddNewRowObject(pageToAddTo, rowDisplayName, rowObject, extraSpacing)
end
function moduleApiTable:ShowAlert(alertMessage, okButtonText, settingsHub, okPressedFunc, hasBackground)
ShowAlert(alertMessage, okButtonText, settingsHub, okPressedFunc, hasBackground)
end
function moduleApiTable:IsSmallTouchScreen()
return isSmallTouchScreen()
end
function moduleApiTable:IsPortrait()
return isPortrait()
end
function moduleApiTable:MakeStyledButton(name, text, size, clickFunc, pageRef, hubRef)
return MakeButton(name, text, size, clickFunc, pageRef, hubRef)
end
function moduleApiTable:MakeStyledImageButton(name, image, size, imageSize, clickFunc, pageRef, hubRef)
return MakeImageButton(name, image, size, imageSize, clickFunc, pageRef, hubRef)
end
function moduleApiTable:AddButtonRow(pageToAddTo, name, text, size, clickFunc, hubRef)
return AddButtonRow(pageToAddTo, name, text, size, clickFunc, hubRef)
end
function moduleApiTable:CreateSignal()
return CreateSignal()
end
function moduleApiTable:UsesSelectedObject()
return usesSelectedObject()
end
function moduleApiTable:TweenProperty(instance, prop, start, final, duration, easingFunc, cbFunc)
return PropertyTweener(instance, prop, start, final, duration, easingFunc, cbFunc)
end
function moduleApiTable:OnResized(key, callback)
return addOnResizedCallback(key, callback)
end
function moduleApiTable:FireOnResized()
local newSize = getViewportSize()
local portrait = moduleApiTable:IsPortrait()
for key, callback in pairs(onResizedCallbacks) do
callback(newSize, portrait)
end
end
|
--Create suggestion labels
|
local function createSuggestionLabels(props)
for i = 1,props.maxSuggestions do
local label = props.rframe.LabelTemplate:Clone()
label.Name = "Label"..i
label.Visible = false
label.Parent = props.rframe
label.MouseEnter:Connect(function()
props.suggestionPos = i
end)
label.MouseButton1Up:Connect(function()
props.suggestionPos = i
selectSuggestion(props)
end)
end
end
|
-- Connects the given collision function to the object's "Touched" event, but only if that object is a Part
-- Otherwise, it tries this function on all of the object's children
|
local function attachCollisionFunction(item, collisionFunction)
if item:IsA("BasePart") then
item.Touched:Connect(collisionFunction)
else
for _, child in ipairs(item:GetChildren()) do
attachCollisionFunction(child, collisionFunction)
end
end
end
|
-- init chat bubble tables
|
local function initChatBubbleType(chatBubbleType, fileName, imposterFileName, isInset, sliceRect)
this.ChatBubble[chatBubbleType] = createChatBubbleMain(fileName, sliceRect)
this.ChatBubbleWithTail[chatBubbleType] = createChatBubbleWithTail(fileName, UDim2.new(0.5, -CHAT_BUBBLE_TAIL_HEIGHT, 1, isInset and -1 or 0), UDim2.new(0, 30, 0, CHAT_BUBBLE_TAIL_HEIGHT), sliceRect)
this.ScalingChatBubbleWithTail[chatBubbleType] = createScaledChatBubbleWithTail(fileName, 0.5, UDim2.new(-0.5, 0, 0, isInset and -1 or 0), sliceRect)
end
initChatBubbleType(BubbleColor.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5,5,15,15))
initChatBubbleType(BubbleColor.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7,7,33,33))
initChatBubbleType(BubbleColor.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7,7,33,33))
initChatBubbleType(BubbleColor.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7,7,33,33))
function this:SanitizeChatLine(msg)
if string.len(msg) > MaxChatMessageLengthExclusive then
return string.sub(msg, 1, MaxChatMessageLengthExclusive + string.len(ELIPSES))
else
return msg
end
end
local function createBillboardInstance(adornee)
local billboardGui = Instance.new("BillboardGui")
billboardGui.Adornee = adornee
billboardGui.Size = UDim2.new(0,BILLBOARD_MAX_WIDTH,0,BILLBOARD_MAX_HEIGHT)
billboardGui.StudsOffset = Vector3.new(0, 1.5, 2)
billboardGui.Parent = BubbleChatScreenGui
local billboardFrame = Instance.new("Frame")
billboardFrame.Name = "BillboardFrame"
billboardFrame.Size = UDim2.new(1,0,1,0)
billboardFrame.Position = UDim2.new(0,0,-0.5,0)
billboardFrame.BackgroundTransparency = 1
billboardFrame.Parent = billboardGui
local billboardChildRemovedCon = nil
billboardChildRemovedCon = billboardFrame.ChildRemoved:connect(function()
if #billboardFrame:GetChildren() <= 1 then
billboardChildRemovedCon:disconnect()
billboardGui:Destroy()
end
end)
this:CreateSmallTalkBubble(BubbleColor.WHITE).Parent = billboardFrame
return billboardGui
end
function this:CreateBillboardGuiHelper(instance, onlyCharacter)
if instance and not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then
if not onlyCharacter then
if instance:IsA("BasePart") then
-- Create a new billboardGui object attached to this player
local billboardGui = createBillboardInstance(instance)
this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui
return
end
end
if instance:IsA("Model") then
local head = instance:FindFirstChild("Head")
if head and head:IsA("BasePart") then
-- Create a new billboardGui object attached to this player
local billboardGui = createBillboardInstance(head)
this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui
end
end
end
end
local function distanceToBubbleOrigin(origin)
if not origin then return 100000 end
return (origin.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
end
local function isPartOfLocalPlayer(adornee)
if adornee and PlayersService.LocalPlayer.Character then
return adornee:IsDescendantOf(PlayersService.LocalPlayer.Character)
end
end
function this:SetBillboardLODNear(billboardGui)
local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee)
billboardGui.Size = UDim2.new(0, BILLBOARD_MAX_WIDTH, 0, BILLBOARD_MAX_HEIGHT)
billboardGui.StudsOffset = Vector3.new(0, isLocalPlayer and 1.5 or 2.5, isLocalPlayer and 2 or 0)
billboardGui.Enabled = true
local billChildren = billboardGui.BillboardFrame:GetChildren()
for i = 1, #billChildren do
billChildren[i].Visible = true
end
billboardGui.BillboardFrame.SmallTalkBubble.Visible = false
end
function this:SetBillboardLODDistant(billboardGui)
local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee)
billboardGui.Size = UDim2.new(4,0,3,0)
billboardGui.StudsOffset = Vector3.new(0, 3, isLocalPlayer and 2 or 0)
billboardGui.Enabled = true
local billChildren = billboardGui.BillboardFrame:GetChildren()
for i = 1, #billChildren do
billChildren[i].Visible = false
end
billboardGui.BillboardFrame.SmallTalkBubble.Visible = true
end
function this:SetBillboardLODVeryFar(billboardGui)
billboardGui.Enabled = false
end
function this:SetBillboardGuiLOD(billboardGui, origin)
if not origin then return end
if origin:IsA("Model") then
local head = origin:FindFirstChild("Head")
if not head then origin = origin.PrimaryPart
else origin = head end
end
local bubbleDistance = distanceToBubbleOrigin(origin)
if bubbleDistance < NEAR_BUBBLE_DISTANCE then
this:SetBillboardLODNear(billboardGui)
elseif bubbleDistance >= NEAR_BUBBLE_DISTANCE and bubbleDistance < MAX_BUBBLE_DISTANCE then
this:SetBillboardLODDistant(billboardGui)
else
this:SetBillboardLODVeryFar(billboardGui)
end
end
function this:CameraCFrameChanged()
for index, value in pairs(this.CharacterSortedMsg:GetData()) do
local playerBillboardGui = value["BillboardGui"]
if playerBillboardGui then this:SetBillboardGuiLOD(playerBillboardGui, index) end
end
end
function this:CreateBubbleText(message)
local bubbleText = Instance.new("TextLabel")
bubbleText.Name = "BubbleText"
bubbleText.BackgroundTransparency = 1
bubbleText.Position = UDim2.new(0,CHAT_BUBBLE_WIDTH_PADDING/2,0,0)
bubbleText.Size = UDim2.new(1,-CHAT_BUBBLE_WIDTH_PADDING,1,0)
bubbleText.Font = CHAT_BUBBLE_FONT
bubbleText.TextWrapped = true
bubbleText.FontSize = CHAT_BUBBLE_FONT_SIZE
bubbleText.Text = message
bubbleText.Visible = false
return bubbleText
end
function this:CreateSmallTalkBubble(chatBubbleType)
local smallTalkBubble = this.ScalingChatBubbleWithTail[chatBubbleType]:Clone()
smallTalkBubble.Name = "SmallTalkBubble"
smallTalkBubble.Position = UDim2.new(0,0,1,-40)
smallTalkBubble.Visible = false
local text = this:CreateBubbleText("...")
text.TextScaled = true
text.TextWrapped = false
text.Visible = true
text.Parent = smallTalkBubble
return smallTalkBubble
end
function this:UpdateChatLinesForOrigin(origin, currentBubbleYPos)
local bubbleQueue = this.CharacterSortedMsg:Get(origin).Fifo
local bubbleQueueSize = bubbleQueue:Size()
local bubbleQueueData = bubbleQueue:GetData()
if #bubbleQueueData <= 1 then return end
for index = (#bubbleQueueData - 1), 1, -1 do
local value = bubbleQueueData[index]
local bubble = value.RenderBubble
if not bubble then return end
local bubblePos = bubbleQueueSize - index + 1
if bubblePos > 1 then
local tail = bubble:FindFirstChild("ChatBubbleTail")
if tail then tail:Destroy() end
local bubbleText = bubble:FindFirstChild("BubbleText")
if bubbleText then bubbleText.TextTransparency = 0.5 end
end
local udimValue = UDim2.new( bubble.Position.X.Scale, bubble.Position.X.Offset,
1, currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT )
bubble:TweenPosition(udimValue, Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true)
currentBubbleYPos = currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT
end
end
function this:DestroyBubble(bubbleQueue, bubbleToDestroy)
if not bubbleQueue then return end
if bubbleQueue:Empty() then return end
local bubble = bubbleQueue:Front().RenderBubble
if not bubble then
bubbleQueue:PopFront()
return
end
spawn(function()
while bubbleQueue:Front().RenderBubble ~= bubbleToDestroy do
wait()
end
bubble = bubbleQueue:Front().RenderBubble
local timeBetween = 0
local bubbleText = bubble:FindFirstChild("BubbleText")
local bubbleTail = bubble:FindFirstChild("ChatBubbleTail")
while bubble and bubble.ImageTransparency < 1 do
timeBetween = wait()
if bubble then
local fadeAmount = timeBetween * CHAT_BUBBLE_FADE_SPEED
bubble.ImageTransparency = bubble.ImageTransparency + fadeAmount
if bubbleText then bubbleText.TextTransparency = bubbleText.TextTransparency + fadeAmount end
if bubbleTail then bubbleTail.ImageTransparency = bubbleTail.ImageTransparency + fadeAmount end
end
end
if bubble then
bubble:Destroy()
bubbleQueue:PopFront()
end
end)
end
function this:CreateChatLineRender(instance, line, onlyCharacter, fifo)
if not instance then return end
if not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then
this:CreateBillboardGuiHelper(instance, onlyCharacter)
end
local billboardGui = this.CharacterSortedMsg:Get(instance)["BillboardGui"]
if billboardGui then
local chatBubbleRender = this.ChatBubbleWithTail[line.BubbleColor]:Clone()
chatBubbleRender.Visible = false
local bubbleText = this:CreateBubbleText(line.Message)
bubbleText.Parent = chatBubbleRender
chatBubbleRender.Parent = billboardGui.BillboardFrame
line.RenderBubble = chatBubbleRender
local currentTextBounds = TextService:GetTextSize(
bubbleText.Text, CHAT_BUBBLE_FONT_SIZE_INT, CHAT_BUBBLE_FONT,
Vector2.new(BILLBOARD_MAX_WIDTH, BILLBOARD_MAX_HEIGHT))
local bubbleWidthScale = math.max((currentTextBounds.X + CHAT_BUBBLE_WIDTH_PADDING)/BILLBOARD_MAX_WIDTH, 0.1)
local numOflines = (currentTextBounds.Y/CHAT_BUBBLE_FONT_SIZE_INT)
-- prep chat bubble for tween
chatBubbleRender.Size = UDim2.new(0,0,0,0)
chatBubbleRender.Position = UDim2.new(0.5,0,1,0)
local newChatBubbleOffsetSizeY = numOflines * CHAT_BUBBLE_LINE_HEIGHT
chatBubbleRender:TweenSizeAndPosition(UDim2.new(bubbleWidthScale, 0, 0, newChatBubbleOffsetSizeY),
UDim2.new( (1-bubbleWidthScale)/2, 0, 1, -newChatBubbleOffsetSizeY),
Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true,
function() bubbleText.Visible = true end)
-- todo: remove when over max bubbles
this:SetBillboardGuiLOD(billboardGui, line.Origin)
this:UpdateChatLinesForOrigin(line.Origin, -newChatBubbleOffsetSizeY)
delay(line.BubbleDieDelay, function()
this:DestroyBubble(fifo, chatBubbleRender)
end)
end
end
function this:OnPlayerChatMessage(sourcePlayer, message, targetPlayer)
if not this:BubbleChatEnabled() then return end
local localPlayer = PlayersService.LocalPlayer
local fromOthers = localPlayer ~= nil and sourcePlayer ~= localPlayer
local safeMessage = this:SanitizeChatLine(message)
local line = createPlayerChatLine(sourcePlayer, safeMessage, not fromOthers)
if sourcePlayer and line.Origin then
local fifo = this.CharacterSortedMsg:Get(line.Origin).Fifo
fifo:PushBack(line)
--Game chat (badges) won't show up here
this:CreateChatLineRender(sourcePlayer.Character, line, true, fifo)
end
end
function this:OnGameChatMessage(origin, message, color)
local localPlayer = PlayersService.LocalPlayer
local fromOthers = localPlayer ~= nil and (localPlayer.Character ~= origin)
local bubbleColor = BubbleColor.WHITE
if color == Enum.ChatColor.Blue then bubbleColor = BubbleColor.BLUE
elseif color == Enum.ChatColor.Green then bubbleColor = BubbleColor.GREEN
elseif color == Enum.ChatColor.Red then bubbleColor = BubbleColor.RED end
local safeMessage = this:SanitizeChatLine(message)
local line = createGameChatLine(origin, safeMessage, not fromOthers, bubbleColor)
this.CharacterSortedMsg:Get(line.Origin).Fifo:PushBack(line)
this:CreateChatLineRender(origin, line, false, this.CharacterSortedMsg:Get(line.Origin).Fifo)
end
function this:BubbleChatEnabled()
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
local chatSettings = require(chatSettings)
if chatSettings.BubbleChatEnabled ~= nil then
return chatSettings.BubbleChatEnabled
end
end
end
return PlayersService.BubbleChat
end
function this:ShowOwnFilteredMessage()
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
chatSettings = require(chatSettings)
return chatSettings.ShowUserOwnFilteredMessage
end
end
return false
end
function findPlayer(playerName)
for i,v in pairs(PlayersService:GetPlayers()) do
if v.Name == playerName then
return v
end
end
end
ChatService.Chatted:connect(function(origin, message, color) this:OnGameChatMessage(origin, message, color) end)
local cameraChangedCon = nil
if game.Workspace.CurrentCamera then
cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(prop) this:CameraCFrameChanged() end)
end
game.Workspace.Changed:connect(function(prop)
if prop == "CurrentCamera" then
if cameraChangedCon then cameraChangedCon:disconnect() end
if game.Workspace.CurrentCamera then
cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(prop) this:CameraCFrameChanged() end)
end
end
end)
local AllowedMessageTypes = nil
function getAllowedMessageTypes()
if AllowedMessageTypes then
return AllowedMessageTypes
end
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
chatSettings = require(chatSettings)
if chatSettings.BubbleChatMessageTypes then
AllowedMessageTypes = chatSettings.BubbleChatMessageTypes
return AllowedMessageTypes
end
end
local chatConstants = clientChatModules:FindFirstChild("ChatConstants")
if chatConstants then
chatConstants = require(chatConstants)
AllowedMessageTypes = {chatConstants.MessageTypeDefault, chatConstants.MessageTypeWhisper}
end
return AllowedMessageTypes
end
return {"Message", "Whisper"}
end
function checkAllowedMessageType(messageData)
local allowedMessageTypes = getAllowedMessageTypes()
for i = 1, #allowedMessageTypes do
if allowedMessageTypes[i] == messageData.MessageType then
return true
end
end
return false
end
local ChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local OnMessageDoneFiltering = ChatEvents:WaitForChild("OnMessageDoneFiltering")
local OnNewMessage = ChatEvents:WaitForChild("OnNewMessage")
OnNewMessage.OnClientEvent:connect(function(messageData, channelName)
if not checkAllowedMessageType(messageData) then
return
end
local sender = findPlayer(messageData.FromSpeaker)
if not sender then
return
end
if not messageData.IsFiltered or messageData.FromSpeaker == LocalPlayer.Name then
if messageData.FromSpeaker ~= LocalPlayer.Name or this:ShowOwnFilteredMessage() then
return
end
end
this:OnPlayerChatMessage(sender, messageData.Message, nil)
end)
OnMessageDoneFiltering.OnClientEvent:connect(function(messageData, channelName)
if not checkAllowedMessageType(messageData) then
return
end
local sender = findPlayer(messageData.FromSpeaker)
if not sender then
return
end
if messageData.FromSpeaker == LocalPlayer.Name and not this:ShowOwnFilteredMessage() then
return
end
this:OnPlayerChatMessage(sender, messageData.Message, nil)
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__HDAdminMain__1 = _G.HDAdminMain;
local l__settings__2 = l__HDAdminMain__1.settings;
local v3 = {};
local v4 = {};
function v4.Function(p1, p2)
local v5 = l__HDAdminMain__1.signals.GetPing:InvokeServer(math.random(1, 1000));
l__HDAdminMain__1:GetModule("Notices"):Notice("Notice", l__HDAdminMain__1.hdAdminCoreName, "Your ping is " .. math.floor((tick() - tick()) / 2 * 1000 * 1000 + 0.5) / 1000 .. "!");
end;
v3.ping = v4;
v3.blur = {
Function = function(p3, p4)
l__HDAdminMain__1.blur.Size = p4[2] ~= 0 and p4[2] or 20;
end,
UnFunction = function(p5, p6)
l__HDAdminMain__1.blur.Size = 0;
end
};
local v6 = {};
local u1 = {};
function v6.Function(p7, p8)
for v7, v8 in pairs(u1) do
v7.Enabled = true;
end;
u1 = {};
end;
v3.showGuis = v6;
v3.hideGuis = {
Function = function(p9, p10)
for v9, v10 in pairs(l__HDAdminMain__1.playerGui:GetChildren()) do
if v10:IsA("ScreenGui") and v10.Name ~= "Chat" and v10.Name ~= "HDAdminGUIs" then
if v10.Enabled == true then
u1[v10] = true;
end;
v10.Enabled = false;
end;
end;
end
};
v3.view = {
Function = function(p11, p12)
local v11 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid(p12[1]);
if v11 then
l__HDAdminMain__1:GetModule("cf"):SetCameraSubject(v11);
end;
end,
UnFunction = function(p13, p14)
local v12 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid(p13);
if v12 then
l__HDAdminMain__1.signals.SetCameraSubject:FireClient(p13, v12);
end;
end
};
v3.nightVision = {
Function = function(p15, p16)
for v13, v14 in pairs(l__HDAdminMain__1.players:GetChildren()) do
local v15 = l__HDAdminMain__1:GetModule("cf"):GetHead(v14);
if v14.Name ~= l__HDAdminMain__1.player.Name and v15 then
for v16, v17 in pairs(v14.Character:GetChildren()) do
if v17:IsA("BasePart") and v17:FindFirstChild("HDNightVision") == nil then
for v18 = 1, 6 do
local v19 = l__HDAdminMain__1.client.Assets.NightVision:Clone();
v19.Parent = v17;
v19.Face = v18 - 1;
v19.Name = "HDAdminNightVision";
end;
end;
end;
local v20 = l__HDAdminMain__1.client.Assets.Nickname:Clone();
v20.TextLabel.Text = v14.Name;
v20.Parent = v15;
v20.Name = "HDAdminNightVision";
end;
end;
end,
UnFunction = function(p17, p18)
for v21, v22 in pairs(l__HDAdminMain__1.players:GetChildren()) do
if v22.Character then
for v23, v24 in pairs(v22.Character:GetDescendants()) do
if v24.Name == "HDAdminNightVision" then
v24:Destroy();
end;
end;
end;
end;
end
};
v3.cmdbar = {
Function = function(p19, p20)
l__HDAdminMain__1:GetModule("CmdBar"):OpenCmdBar();
end
};
v3.cmdbar2 = {
Function = function(p21, p22)
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu("cmdbar2", {}, 2);
end
};
v3.rainbowFart = {
Function = function(p23, p24)
local v25 = p24[1];
local v26 = 20;
local v27 = { 174658105, 148635119 };
local function u2(p25, p26)
local v28 = Instance.new("Sound", p26);
v28.SoundId = "rbxassetid://" .. p25;
v28.Volume = 0.5;
v28:Play();
if not v28.IsPlaying then
local v29 = v28.Played:Wait();
end;
wait();
end;
local function v30(p27, p28, p29, p30, p31)
local v31 = l__HDAdminMain__1.client.Assets.Poop:Clone();
u2(p29, v31);
v31.CanCollide = false;
v31.Color = Color3.fromHSV((p30 - 1) * 0.05, 0.7, 0.7);
v31.CFrame = p28.Seat.CFrame * CFrame.new(0, p30 * 1 - 0.5, 0);
p27:SetPrimaryPartCFrame(v31.CFrame * CFrame.new(0, 3, 0));
v31.Parent = p31;
end;
local v32 = l__HDAdminMain__1:GetModule("cf"):GetHead(v25);
if not v32 then
return;
end;
v25.Character.Parent = nil;
local v33, v34 = l__HDAdminMain__1:GetModule("cf"):CreateClone(v25.Character);
if v34.sit.Length <= 0 then
while true do
wait();
if v34.sit.Length > 0 then
break;
end;
end;
end;
v33.Head.CFrame = v32.CFrame;
if v25 == l__HDAdminMain__1.player then
l__HDAdminMain__1:GetModule("cf"):Movement(false);
l__HDAdminMain__1:GetModule("cf"):SetCameraSubject(v33.Humanoid);
end;
local v35 = Instance.new("Model", workspace);
local v36 = l__HDAdminMain__1.client.Assets.Toilet:Clone();
v35.Name = v25.Name .. "'s poop";
v36.PrimaryPart = v36.Seat;
v36:SetPrimaryPartCFrame(v33.HumanoidRootPart.CFrame * CFrame.new(0, -1, 0));
v36.Parent = workspace;
v36.Seat:Sit(v33.Humanoid);
v34.sit:Play(0);
v33.Head.face.Texture = "rbxassetid://304907108";
wait();
v33.PrimaryPart = v33.Head;
v33:SetPrimaryPartCFrame(v36.PrimaryPart.CFrame * CFrame.new(0, 3, 0));
for v37, v38 in pairs(v33:GetChildren()) do
if v38:IsA("BasePart") and v38.Name ~= "HumanoidRootPart" then
v38.Anchored = true;
end;
end;
wait(1);
u2(174658105, v33.HumanoidRootPart);
wait(2);
local v39 = 0 + 1;
v30(v33, v36, 148635119, v39, v35, v35);
v33.Head.face.Texture = "rbxassetid://338312149";
wait(1.5);
v33.Head.face.Texture = "rbxassetid://316545711";
for v40 = 1, 20 do
if v40 == 18 then
for v41, v42 in pairs(v33:GetChildren()) do
if v42:IsA("BasePart") and v42.Name ~= "HumanoidRootPart" then
v42.Anchored = false;
end;
end;
local v43 = Instance.new("Explosion");
v43.Position = v33.Head.Position;
v43.Parent = v33;
v43.DestroyJointRadiusPercent = 0;
v33:BreakJoints();
elseif v40 > 19 then
for v44, v45 in pairs(v35:GetChildren()) do
v45.Anchored = false;
v45.CanCollide = true;
end;
end;
if v26 <= v40 then
wait(1.5);
else
v30(v33, v36, v27[math.random(1, #v27)], v39 + 1, v35);
wait();
end;
end;
wait(3);
v35:Destroy();
v36:Destroy();
v33:Destroy();
if v25 == l__HDAdminMain__1.player then
local v46 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid(v25);
if v46 then
l__HDAdminMain__1:GetModule("cf"):Movement(true);
l__HDAdminMain__1:GetModule("cf"):SetCameraSubject(v46);
end;
end;
v25.Character.Parent = workspace;
end
};
v3.icecream = {
Function = function(p32, p33)
local v47 = p33[1];
v47.Character.Parent = nil;
local v48, v49 = l__HDAdminMain__1:GetModule("cf"):CreateClone(v47.Character);
local l__HumanoidRootPart__50 = v48:FindFirstChild("HumanoidRootPart");
if l__HumanoidRootPart__50 == nil then
v48:Destroy();
return;
end;
l__HumanoidRootPart__50.Anchored = true;
local v51 = l__HDAdminMain__1.client.Assets.IcecreamVan:Clone();
v51.PrimaryPart = v51.VanDoor.Part1;
v51:SetPrimaryPartCFrame(l__HumanoidRootPart__50.CFrame * CFrame.new(-210, 3, -4) * CFrame.Angles(0, math.rad(90), 0));
v51.Parent = workspace;
if v47 == l__HDAdminMain__1.player then
l__HDAdminMain__1:GetModule("cf"):Movement(false);
l__HDAdminMain__1:GetModule("cf"):SetCameraSubject(v48.Humanoid);
for v52, v53 in pairs(v51:GetDescendants()) do
if v53:IsA("BasePart") then
v53.CanCollide = true;
end;
end;
end;
local v54 = l__HDAdminMain__1:GetModule("cf"):CreateSound({
SoundId = 260910474,
Volume = 0.5,
Parent = v51.PrimaryPart
});
local v55 = l__HDAdminMain__1:GetModule("cf"):CreateSound({
SoundId = 861942173,
Volume = 4,
Parent = v51.PrimaryPart
});
local v56 = l__HDAdminMain__1:GetModule("cf"):CreateSound({
SoundId = 2628538600,
Volume = 0.15,
Parent = v51.PrimaryPart
});
local v57 = l__HDAdminMain__1:GetModule("cf"):CreateSound({
SoundId = 147758746,
Volume = 0.8,
Parent = v51.PrimaryPart
});
v54:Play();
l__HDAdminMain__1:GetModule("cf"):TweenModel(v51, v51.PrimaryPart.CFrame * CFrame.new(0, 0, 210), TweenInfo.new(8));
wait(8.1);
local v58 = l__HDAdminMain__1.tweenService:Create(v54, TweenInfo.new(0.5), {
Volume = 0
});
v58:Play();
v58.Completed:Wait();
v54:Stop();
v54:Destroy();
wait(1);
v51.VanDoor.Part1.Transparency = 1;
v51.VanDoor.Part2.Transparency = 1;
wait(1);
v48.PrimaryPart = v48.Head;
v48:SetPrimaryPartCFrame(v51.Clown.Head.CFrame * CFrame.new(0, 0, -2.5) * CFrame.Angles(0, math.rad(180), 0));
if v47 == l__HDAdminMain__1.player then
v47.CameraMaxZoomDistance = 0.5;
spawn(function()
v47.CameraMaxZoomDistance = 1;
end);
end;
local l__face__59 = v48.Head:FindFirstChild("face");
if l__face__59 then
l__face__59.Texture = "rbxassetid://338312149";
end;
v55:Play();
wait(1);
v51.VanDoor.Part1.Transparency = 0;
v51.VanDoor.Part2.Transparency = 0;
v48.Parent = v51;
for v60, v61 in pairs(v48:GetChildren()) do
if v61:IsA("Accessory") then
v61:remove();
end;
end;
v54:Play();
l__HDAdminMain__1:GetModule("cf"):TweenModel(v51, v51.PrimaryPart.CFrame * CFrame.new(0, 0, 400), TweenInfo.new(14, Enum.EasingStyle.Quad, Enum.EasingDirection.In));
wait(4);
local v62 = v51.Clown["Right Arm"];
v62.CFrame = v62.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0);
for v63, v64 in pairs(v51.Doll:GetChildren()) do
v64.Transparency = 0;
end;
v51.Doll.Head.face.Transparency = 0;
wait(0.1);
v56:Play();
wait(1.5);
v57:Play();
if l__face__59 then
l__face__59.Texture = "rbxassetid://288918236";
end;
wait(2.5);
if v47 == l__HDAdminMain__1.player then
local v65 = Instance.new("Explosion");
v65.Position = v48.Head.Position;
v65.Parent = v48;
v48:BreakJoints();
l__HDAdminMain__1.audio.Oof:Play();
end;
wait(5);
if v47 == l__HDAdminMain__1.player then
local v66 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid(v47);
if v66 then
l__HDAdminMain__1:GetModule("cf"):Movement(true);
l__HDAdminMain__1:GetModule("cf"):SetCameraSubject(v66);
end;
v47.CameraMaxZoomDistance = 20;
wait();
v47.CameraMinZoomDistance = 20;
wait();
v47.CameraMinZoomDistance = v47.CameraMinZoomDistance;
v47.CameraMaxZoomDistance = v47.CameraMaxZoomDistance;
end;
if v47.Character then
v47.Character.Parent = workspace;
end;
v51:Destroy();
end
};
local v67 = {
DisplayLaser = function(p34, p35, p36)
local l__LeftBeam__68 = p35:FindFirstChild("LeftBeam");
if l__LeftBeam__68 then
l__LeftBeam__68.Enabled = p36;
p35.RightBeam.Enabled = p36;
p35.MidAttachment.GlowHit.Enabled = p36;
end;
end,
Activate = function(p37)
local l__Name__69 = p37.Name;
local v70 = l__HDAdminMain__1:GetModule("cf"):GetHead();
local v71 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid();
local v72 = l__HDAdminMain__1:GetModule("cf"):GetHRP();
if v70 and v71 and l__HDAdminMain__1.mouseDown then
local l__HDAdminLaserHead__73 = v70:FindFirstChild("HDAdminLaserHead");
local v74 = l__HDAdminMain__1:GetModule("cf"):GetNeck();
local v75 = false;
if v71.RigType == Enum.HumanoidRigType.R6 then
v75 = true;
end;
v70.Parent.PrimaryPart = v72;
if l__HDAdminLaserHead__73 and v74 then
local v76 = tick() - 1;
local v77 = v71.HipHeight / 2.5;
local l__LaserTarget__78 = l__HDAdminLaserHead__73.LaserTarget;
local l__Fire__79 = l__LaserTarget__78.MidAttachment2.Fire;
local l__Sparks__80 = l__LaserTarget__78.MidAttachment.Sparks;
local l__Sizzle__81 = l__HDAdminMain__1.audio.Sizzle;
local l__Sizzle2__82 = l__HDAdminMain__1.audio.Sizzle2;
l__Sizzle__81:Play();
p37.DisplayLaser(l__HDAdminLaserHead__73, l__LaserTarget__78, true);
while true do
local v83 = nil;
local v84, v85 = l__HDAdminMain__1:GetModule("cf"):GetMousePoint(l__HDAdminMain__1.lastHitPosition);
local v86 = CFrame.new(v85, v70.Position);
local v87 = l__HDAdminMain__1.player:DistanceFromCharacter(v86.p);
local v88 = false;
if v87 > 30 then
v86 = v86 * CFrame.new(0, 0, 30 - v87);
v88 = true;
end;
l__LaserTarget__78.CFrame = v86;
local l__Position__89 = l__LaserTarget__78.Position;
if v70.Parent.PrimaryPart == nil then
v70.Parent.PrimaryPart = v70.parent.HumanoidRootPart;
end;
v83 = CFrame.new(Vector3.new(), v70.Parent.PrimaryPart.CFrame:VectorToObjectSpace((Vector3.new(l__Position__89.X, v70.Position.Y, l__Position__89.Z) - v70.Position).Unit));
if v75 then
local v90 = v83 * CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(180), 0);
else
v90 = v83 * CFrame.new(0, v77, 0);
end;
v74.C0 = v90;
if v76 < tick() - 0.6 then
v76 = tick();
l__HDAdminMain__1:GetModule("cf"):ReplicateEffect(p37.Name, { v86, v90 });
end;
if v84 and not v88 and (v84.Parent:FindFirstChild("Humanoid") or v84.Name == "Handle") then
l__Fire__79.Enabled = true;
l__Sparks__80.Enabled = true;
if not l__Sizzle2__82.Playing then
l__Sizzle2__82:Play();
end;
else
l__Fire__79.Enabled = false;
l__Sparks__80.Enabled = false;
if l__Sizzle2__82.Playing then
l__Sizzle2__82:Stop();
end;
end;
wait();
if not l__HDAdminMain__1.mouseDown then
break;
end;
if not l__HDAdminMain__1.commandsActive[l__Name__69] then
break;
end;
if not v70 then
break;
end;
if not v70.Parent then
break;
end;
if not v74 then
break;
end;
end;
v74.C0 = v74.C0;
p37.DisplayLaser(l__HDAdminLaserHead__73, l__LaserTarget__78, false);
l__Fire__79.Enabled = false;
l__Sparks__80.Enabled = false;
l__Sizzle__81:Stop();
l__Sizzle2__82:Stop();
end;
end;
l__HDAdminMain__1.commandsActive[l__Name__69] = nil;
end
};
local u3 = {};
local u4 = {};
local u5 = TweenInfo.new(0.7);
function v67.ReplicationEffect(p38, p39, p40)
local v91 = p39[1];
local v92 = p39[2];
local v93 = l__HDAdminMain__1:GetModule("cf"):GetHead(p38);
if v93 then
local l__HDAdminLaserHead__94 = v93:FindFirstChild("HDAdminLaserHead");
local v95 = l__HDAdminMain__1:GetModule("cf"):GetNeck(p38);
if l__HDAdminLaserHead__94 and v95 then
local l__LaserTarget__96 = l__HDAdminLaserHead__94.LaserTarget;
if u3[p38] then
u3[p38] = u3[p38] + 1;
else
u3[p38] = 1;
u4[p38] = v95.C0;
l__LaserTarget__96.CFrame = v91 * CFrame.new(0, 0, math.random(10, 40) - 15);
v95.C0 = v92;
l__LaserTarget__96.MidAttachment.GlowHit.Rate = 50;
p40.DisplayLaser(l__HDAdminLaserHead__94, l__LaserTarget__96, true);
end;
l__HDAdminMain__1.tweenService:Create(l__LaserTarget__96, u5, {
CFrame = v91
}):Play();
l__HDAdminMain__1.tweenService:Create(v95, u5, {
C0 = v92
}):Play();
wait(0.7);
u3[p38] = u3[p38] - 1;
if u3[p38] <= 0 then
p40.DisplayLaser(l__HDAdminLaserHead__94, l__LaserTarget__96, false);
v95.C0 = u4[p38];
u4[p38] = nil;
u3[p38] = nil;
end;
end;
end;
end;
v3.laserEyes = v67;
v3.warp = {
Function = function(p41, p42)
local v97 = 0.005;
local v98 = 0.995;
local v99 = -0.005;
while true do
l__HDAdminMain__1.runService.RenderStepped:Wait();
if v98 < v97 then
v98 = 0.005;
v99 = 0.005;
elseif v98 > 1 then
v98 = 1;
v99 = -0.005;
end;
l__HDAdminMain__1.camera.CFrame = l__HDAdminMain__1.camera.CFrame * CFrame.new(0, 0, 0, v98, 0, 0, 0, v98, 0, 0, 0, 1);
v98 = v98 + v99;
if v98 > 1 then
break;
end;
end;
end
};
v3.fly = {
Activate = function(p43)
l__HDAdminMain__1:GetModule("FlyCommand"):Fly(p43.Name);
end
};
v3.fly2 = {
Activate = function(p44)
l__HDAdminMain__1:GetModule("FlyCommand"):Fly(p44.Name);
end
};
v3.noclip = {
Activate = function(p45)
local l__Name__100 = p45.Name;
local v101 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid();
local v102 = l__HDAdminMain__1:GetModule("cf"):GetHRP();
if v101 and v102 then
local v103 = tick();
v102.Anchored = true;
v101.PlatformStand = true;
while true do
wait();
local l__Position__104 = v102.Position;
v102.CFrame = CFrame.new(l__Position__104, l__Position__104 + (l__HDAdminMain__1.camera.Focus.p - l__HDAdminMain__1.camera.CFrame.p).unit) * l__HDAdminMain__1:GetModule("cf"):GetNextMovement(tick() - v103, l__HDAdminMain__1.commandSpeeds[l__Name__100]);
v103 = tick();
if not l__HDAdminMain__1.commandsActive[l__Name__100] then
break;
end;
end;
if v102 and v101 then
v102.Anchored = false;
v102.Velocity = Vector3.new();
v101.PlatformStand = false;
end;
end;
end
};
v3.noclip2 = {
Activate = function(p46)
l__HDAdminMain__1:GetModule("FlyCommand"):Fly(p46.Name, true);
end
};
v3.clip = {
Function = function(p47, p48, p49)
l__HDAdminMain__1:GetModule("cf"):DeactivateCommand("noclip");
end
};
v3.boing = {
ExpandTime = 4,
ExpandAmount = 3,
EndBoing = {},
Function = function(p50, p51, p52)
local v105 = p51[1];
local v106 = l__HDAdminMain__1:GetModule("cf"):GetHead(v105);
local v107 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid(v105);
if v106 and v107 and not p52.UnFunction(p50, p51, p52) then
local l__Mesh__108 = v106:FindFirstChild("Mesh");
if l__Mesh__108 then
local v109 = {};
local l__Character__110 = v105.Character;
for v111, v112 in pairs(l__Character__110:GetChildren()) do
if v112:IsA("Accessory") then
table.insert(v109, v112);
v112.Parent = nil;
end;
end;
local l__Scale__113 = l__Mesh__108.Scale;
l__HDAdminMain__1.tweenService:Create(l__Mesh__108, TweenInfo.new(p52.ExpandTime, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out), {
Scale = Vector3.new(l__Scale__113.X, l__Scale__113.Y * p52.ExpandAmount, l__Scale__113.Z)
}):Play();
local v114 = Instance.new("BindableEvent");
p52.EndBoing[v105] = v114;
l__HDAdminMain__1:GetModule("cf"):WaitForEvent(v114, v107.Died, v105.CharacterAdded);
p52.EndBoing[v105] = nil;
v114:Destroy();
if l__Mesh__108 then
local v115 = l__HDAdminMain__1.tweenService:Create(l__Mesh__108, TweenInfo.new(2, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out), {
Scale = l__Scale__113
});
v115:Play();
v115.Completed:Wait();
end;
local v116, v117, v118 = pairs(v109);
while true do
local v119 = nil;
local v120 = nil;
v120, v119 = v116(v117, v118);
if not v120 then
break;
end;
v118 = v120;
if l__Character__110 then
v119.Parent = l__Character__110;
else
v119:Destroy();
end;
end;
end;
end;
end,
UnFunction = function(p53, p54, p55)
local v121 = p55.EndBoing[p54[1]];
if not v121 then
return;
end;
v121:Fire();
return true;
end
};
for v122, v123 in pairs(v3) do
v123.Name = v122;
end;
return v3;
|
-- ====================
-- BASIC
-- A basic settings for the gun
-- ====================
|
Auto = false;
MuzzleOffset = Vector3.new(0, 0.625, 1.25);
BaseDamage = 60;
FireRate = 0.3; --In second
ReloadTime = 2.5; --In second
AmmoPerClip = 6; --Put "math.huge" to make this gun has infinite ammo and never reload
Spread = 1.25; --In degree
HeadshotEnabled = true; --Enable the gun to do extra damage on headshot
HeadshotDamageMultiplier = 3;
MouseIconID = "316279304";
HitSoundIDs = {186809061,186809249,186809250,186809252};
IdleAnimationID = 94331086; --Set to "nil" if you don't want to animate
IdleAnimationSpeed = 1;
FireAnimationID = 94332152; --Set to "nil" if you don't want to animate
FireAnimationSpeed = 6;
ReloadAnimationID = nil; --Set to "nil" if you don't want to animate
ReloadAnimationSpeed = 1;
|
--[[Installation Directories]]
|
--
install(dir:WaitForChild("Config"), c:WaitForChild("Music Gui"))
install(c:WaitForChild("Music Gui"), game:GetService("StarterGui"))
|
-- CONSTANTS
|
local GuiLib = script.Parent.Parent
local Lazy = require(GuiLib:WaitForChild("LazyLoader"))
local Defaults = GuiLib:WaitForChild("Defaults")
local INCREMENT_BUTTON = Defaults:WaitForChild("IncrementButton")
local DECREMENT_BUTTON = Defaults:WaitForChild("DecrementButton")
local WARN_MSG = "%s is not a valid mask. Defaulting to 'String' mask."
local MASKS = {}
for _, module in pairs(script:GetChildren()) do
MASKS[module.Name] = require(module)
end
|
-- Wait for game to load:
|
if (not game:IsLoaded()) then
game.Loaded:Wait()
end
local guis = game:GetService("ReplicatedStorage"):FindFirstChild(REP_STORAGE_FOLDER_NAME)
local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
if (not guis) then
warn("UI loader failed to find " .. REP_STORAGE_FOLDER_NAME .. " folder in ReplicatedStorage")
return
end
|
-- Updated 10/14/2014 - Updated to 1.0.3
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
|
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
local function CallOnChildren(Instance, FunctionToCall)
-- Calls a function on each of the children of a certain object, using recursion.
FunctionToCall(Instance)
for _, Child in next, Instance:GetChildren() do
CallOnChildren(Child, FunctionToCall)
end
end
local function GetNearestParent(Instance, ClassName)
-- Returns the nearest parent of a certain class, or returns nil
local Ancestor = Instance
repeat
Ancestor = Ancestor.Parent
if Ancestor == nil then
return nil
end
until Ancestor:IsA(ClassName)
return Ancestor
end
local function GetBricks(StartInstance)
local List = {}
-- if StartInstance:IsA("BasePart") then
-- List[#List+1] = StartInstance
-- end
CallOnChildren(StartInstance, function(Item)
if Item:IsA("BasePart") and
Item.Parent.Name ~= ("S") and
Item.Parent.Name ~= ("TailRotor")and
Item.Parent.Name ~= ("TopRotor") then
List[#List+1] = Item;
end
end)
return List
end
local function Modify(Instance, Values)
-- Modifies an Instance by using a table.
assert(type(Values) == "table", "Values is not a table");
for Index, Value in next, Values do
if type(Index) == "number" then
Value.Parent = Instance
else
Instance[Index] = Value
end
end
return Instance
end
local function Make(ClassType, Properties)
-- Using a syntax hack to create a nice way to Make new items.
return Modify(Instance.new(ClassType), Properties)
end
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
local function HasWheelJoint(Part)
for _, SurfaceName in pairs(Surfaces) do
for _, HingSurfaceName in pairs(HingSurfaces) do
if Part[SurfaceName].Name == HingSurfaceName then
return true
end
end
end
return false
end
local function ShouldBreakJoints(Part)
--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
-- definitely some edge cases.
if NEVER_BREAK_JOINTS then
return false
end
if HasWheelJoint(Part) then
return false
end
local Connected = Part:GetConnectedParts()
if #Connected == 1 then
return false
end
for _, Item in pairs(Connected) do
if HasWheelJoint(Item) then
return false
elseif not Item:IsDescendantOf(script.Parent) then
return false
end
end
return true
end
local function WeldTogether(Part0, Part1, JointType, WeldParent)
--- Weld's 2 parts together
-- @param Part0 The first part
-- @param Part1 The second part (Dependent part most of the time).
-- @param [JointType] The type of joint. Defaults to weld.
-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
-- @return The weld created.
JointType = JointType or "Weld"
local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
Modify(NewWeld, {
Name = "qCFrameWeldThingy";
Part0 = Part0;
Part1 = Part1;
C0 = CFrame.new();--Part0.CFrame:inverse();
C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
Parent = Part1;
})
if not RelativeValue then
RelativeValue = Make("CFrameValue", {
Parent = Part1;
Name = "qRelativeCFrameWeldValue";
Archivable = true;
Value = NewWeld.C1;
})
end
return NewWeld
end
local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
-- @param MainPart The part to weld the model to (can be in the model).
-- @param [JointType] The type of joint. Defaults to weld.
-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
for _, Part in pairs(Parts) do
if Part ~= MainPart then
WeldTogether(MainPart, Part, JointType, MainPart)
end
end
if not DoNotUnanchor then
for _, Part in pairs(Parts) do
Part.Anchored = false
end
MainPart.Anchored = false
end
end
local function PerfectionWeld()
local Tool = GetNearestParent(script, "Tool")
local Parts = GetBricks(script.Parent)
local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
if PrimaryPart then
WeldParts(Parts, PrimaryPart, "Weld", false)
else
warn("qWeld - Unable to weld part")
end
return Tool
end
local Tool = PerfectionWeld()
if Tool and script.ClassName == "Script" then
--- Don't bother with local scripts
script.Parent.AncestryChanged:connect(function()
PerfectionWeld()
end)
end
|
-- Libraries
|
local Roact = require(Vendor:WaitForChild('Roact'))
local new = Roact.createElement
local function ExportDialog(props)
return new('ScreenGui', {}, {
Dialog = new('Frame', {
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(31, 31, 31);
BackgroundTransparency = 0.6;
BorderSizePixel = 0;
Position = UDim2.new(0.5, 0, 0.5, 0);
Size = UDim2.new(0, 200, 0, 0);
}, {
Corners = new('UICorner', {
CornerRadius = UDim.new(0, 4);
});
CloseButton = new('TextButton', {
AnchorPoint = Vector2.new(0, 1);
BackgroundColor3 = Color3.fromRGB(0, 0, 0);
BackgroundTransparency = 0.5;
Modal = true;
Position = UDim2.new(0, 0, 1, 0);
Size = UDim2.new(1, 0, 0, 23);
Text = 'Close';
Font = Enum.Font.GothamSemibold;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 11;
[Roact.Event.Activated] = function (rbx)
props.OnDismiss()
end;
}, {
Corners = new('UICorner', {
CornerRadius = UDim.new(0, 4);
});
});
Text = new('TextLabel', {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 1, -23);
Font = Enum.Font.GothamSemibold;
RichText = true;
Text = props.Text;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 11;
TextWrapped = true;
[Roact.Change.TextBounds] = function (rbx)
rbx.Parent.Size = UDim2.new(0, 200, 0, rbx.TextBounds.Y + 23 + 26)
end;
}, {
Padding = new('UIPadding', {
PaddingLeft = UDim.new(0, 10);
PaddingRight = UDim.new(0, 10);
});
});
});
})
end
return ExportDialog
|
-- Called when any relevant values of GameSettings or LocalPlayer change, forcing re-evalulation of
-- current control scheme
|
function ControlModule:OnComputerMovementModeChange()
local controlModule, success = self:SelectComputerMovementModule()
if success then
self:SwitchToController(controlModule)
end
end
function ControlModule:OnTouchMovementModeChange()
local touchModule, success = self:SelectTouchModule()
if success then
while not self.touchControlFrame do
wait()
end
self:SwitchToController(touchModule)
end
end
function ControlModule:CreateTouchGuiContainer()
if self.touchGui then self.touchGui:Destroy() end
-- Container for all touch device guis
self.touchGui = Instance.new('ScreenGui')
self.touchGui.Name = "TouchGui"
self.touchGui.ResetOnSpawn = false
self.touchControlFrame = Instance.new("Frame")
self.touchControlFrame.Name = "TouchControlFrame"
self.touchControlFrame.Size = UDim2.new(1, 0, 1, 0)
self.touchControlFrame.BackgroundTransparency = 1
self.touchControlFrame.Parent = self.touchGui
self.touchGui.Parent = self.playerGui
end
return ControlModule.new()
|
--health.Changed:connect(function()
--root.Hurt.Pitch = root.Hurt.OriginalPitch.Value+(math.random(-100,100)/100)
--root.Hurt:Play()
--end)
| |
--[[ Psst! If you want to use a space in the name of a function, here's an example of how you could do that:
attacks["Cool Enemy"] = function()
-- cool code here
end
]]
|
return attacks
|
-- The variable below is the ID of the script you've created, you won't need
-- to enter any information other than this.
| |
-- << Functions >> --
|
function lerp(a, b, c)
return a + (b - a) * c
end
bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
if script.Parent.Humanoid.MoveDirection.Magnitude > 0 then
deltaTime = deltaTime * (script.Parent.Humanoid.WalkSpeed * 3.75)
else
deltaTime = deltaTime * 60
end
print(deltaTime)
if Humanoid.Health <= 0 then
bobbing:Disconnect()
return
end
local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0
local calcRootMagnitude = math.min(rootMagnitude, 50)
if deltaTime > 3 then
func1 = 0
func2 = 0
else
func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime)
func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime)
end
Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10)))
val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2)
func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime)
func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)
if rootMagnitude > 1 then
val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
else
val = lerp(val, 0, 0.05 * deltaTime)
end
if rootMagnitude > 12 then
int = 20
int2 = 18
elseif rootMagnitude > 0.1 then
int = 12
int2 = 14
else
int2 = 0
end
vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime)
end)
|
-- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable
|
function ControlModule:SelectComputerMovementModule(): ({}?, boolean)
if not (UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled) then
return nil, false
end
local computerModule
local DevMovementMode = Players.LocalPlayer.DevComputerMovementMode
if DevMovementMode == Enum.DevComputerMovementMode.UserChoice then
computerModule = computerInputTypeToModuleMap[lastInputType]
if UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove and computerModule == Keyboard then
-- User has ClickToMove set in Settings, prefer ClickToMove controller for keyboard and mouse lastInputTypes
computerModule = ClickToMove
end
else
-- Developer has selected a mode that must be used.
computerModule = movementEnumToModuleMap[DevMovementMode]
-- computerModule is expected to be nil here only when developer has selected Scriptable
if (not computerModule) and DevMovementMode ~= Enum.DevComputerMovementMode.Scriptable then
warn("No character control module is associated with DevComputerMovementMode ", DevMovementMode)
end
end
if computerModule then
return computerModule, true
elseif DevMovementMode == Enum.DevComputerMovementMode.Scriptable then
-- Special case where nil is returned and we actually want to set self.activeController to nil for Scriptable
return nil, true
else
-- This case is for when computerModule is nil because of an error and no suitable control module could
-- be found.
return nil, false
end
end
|
--Set target angular velocity for all 4 wheels.
|
function Chassis.SetMotorVelocity(vel)
for _, motor in pairs(Motors) do
motor.AngularVelocity = vel
end
end
|
--Format: [GroupId] = { [RankNumber] = "PermissionName" OR PermissionNumber };
|
local Groups ={
[3204047] = { [255]="HeadAdmin", [1]="VIP" };
[1202458] = { [2]="VIP", [6]=3 };
}
|
--[=[
Manages the cleaning of events and other things. Useful for
encapsulating state and make deconstructors easy.
See the [Five Powerful Code Patterns talk](https://developer.roblox.com/en-us/videos/5-powerful-code-patterns-behind-top-roblox-games)
for a more in-depth look at Maids in top games.
```lua
local maid = Maid.new()
maid:GiveTask(function()
print("Cleaning up")
end)
maid:GiveTask(workspace.ChildAdded:Connect(print))
-- Disconnects all events, and executes all functions
maid:DoCleaning()
```
@class Maid
]=]
-- luacheck: pop
|
local Maid = {}
Maid.ClassName = "Maid"
|
--Killpart.Touched:Connect(function(hit)
-- local Character = hit.parent
| |
--[[Dependencies]]
|
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
|
--
|
script.Parent.Handle3.Hinge1.Transparency = 1
script.Parent.Handle3.Interactive1.Transparency = 1
script.Parent.Handle3.Part1.Transparency = 1
wait(0.06)
script.Parent.Handle1.Hinge1.Transparency = 1
script.Parent.Handle1.Interactive1.Transparency = 1
script.Parent.Handle1.Part1.Transparency = 1
|
-- ScreenSpace -> WorldSpace. Raw function taking a screen position and a depth and
-- converting it into a world position.
|
function ScreenSpace.ScreenToWorld(x, y, depth)
local aspectRatio = ScreenSpace.AspectRatio()
local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
--
local xf, yf = x/ScreenSpace.ViewSizeX()*2 - 1, y/ScreenSpace.ViewSizeY()*2 - 1
local xpos = xf * -wfactor * depth
local ypos = yf * hfactor * depth
--
return Vector3.new(xpos, ypos, depth)
end
|
-- Reset broken glass
|
function ResetGlass()
for i, gData in pairs(dParts.Glass) do
gData[1].Parent = gData[2]
for _, shard in pairs(gData[3]) do
if shard then shard:Destroy() end
end
dParts.Glass[i] = nil
end
end
|
-- Set this to true if you want to instead use the triggers for the throttle
|
local useTriggersForThrottle = true
|
-- Volume Functions --
|
function VolumeUp()
volumeValue.Value = volumeValue.Value + 0.1
end
TV.VButtonUp.ClickDetector.MouseClick:Connect(VolumeUp)
function VolumeDown()
volumeValue.Value = volumeValue.Value - 0.1
end
TV.VButtonDown.ClickDetector.MouseClick:Connect(VolumeDown)
function VolumeChanged()
if volumeValue.Value < 0 then
volumeValue.Value = 0
elseif volumeValue.Value > 1.2 then
volumeValue.Value = 1.2 -- I don't recommend any value higher than 1, it's annoying.
else
music.Volume = volumeValue.Value
end
end
volumeValue.Changed:Connect(VolumeChanged)
|
--// KeyBindings
|
FireSelectKey = Enum.KeyCode.V;
CycleSightKey = Enum.KeyCode.T;
LaserKey = Enum.KeyCode.G;
LightKey = Enum.KeyCode.B;
InteractKey = Enum.KeyCode.E;
|
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config
|
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end)
ChatLocalization = ChatLocalization or {}
if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then
function ChatLocalization:FormatMessageToSend(key,default) return default end
end
local function allSpaces(inputString)
local testString = string.gsub(inputString, " ", "")
return string.len(testString) == 0
end
|
--[[Transmission]]
|
Tune.TransModes ={"Auto"} --[[
[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 = "RPM" --[[
[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 = 3.20 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.42 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.75 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.38 ,
--[[ 3 ]] 1.72 ,
--[[ 4 ]] 1.34 ,
--[[ 5 ]] 1.11 ,
--[[ 6 ]] .78 ,
}
Tune.FDMult = 1 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--// Handling Settings
|
Firerate = 60 / 200; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 5; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--[=[
@private
@param onFulfilled function?
@param onRejected function?
@param promise2 Promise<T>? -- May be nil. If it is, then we have the option to return self
@return Promise
]=]
|
function Promise:_executeThen(onFulfilled, onRejected, promise2)
if self._fulfilled then
if type(onFulfilled) == "function" then
-- If either onFulfilled or onRejected returns a value x, run
-- the Promise Resolution Procedure [[Resolve]](promise2, x).
if promise2 then
promise2:Resolve(onFulfilled(unpack(self._fulfilled, 1, self._valuesLength)))
return promise2
else
local results = table.pack(onFulfilled(unpack(self._fulfilled, 1, self._valuesLength)))
if results.n == 0 then
return _emptyFulfilledPromise
elseif results.n == 1 and Promise.isPromise(results[1]) then
return results[1]
else
local promise = Promise.new()
-- Technically undefined behavior from A+, but we'll resolve to nil like ES6 promises
promise:Resolve(table.unpack(results, 1, results.n))
return promise
end
end
else
-- If onFulfilled is not a function, it must be ignored.
-- If onFulfilled is not a function and promise1 is fulfilled,
-- promise2 must be fulfilled with the same value as promise1.
if promise2 then
promise2:_fulfill(self._fulfilled, self._valuesLength)
return promise2
else
return self
end
end
elseif self._rejected then
if type(onRejected) == "function" then
-- If either onFulfilled or onRejected returns a value x, run
-- the Promise Resolution Procedure [[Resolve]](promise2, x).
if promise2 then
promise2:Resolve(onRejected(unpack(self._rejected, 1, self._valuesLength)))
return promise2
else
local results = table.pack(onRejected(unpack(self._rejected, 1, self._valuesLength)))
if results.n == 0 then
return _emptyFulfilledPromise
elseif results.n == 1 and Promise.isPromise(results[1]) then
return results[1]
else
local promise = Promise.new()
-- Technically undefined behavior from A+, but we'll resolve to nil like ES6 promises
promise:Resolve(table.unpack(results, 1, results.n))
return promise
end
end
else
-- If onRejected is not a function, it must be ignored.
-- If onRejected is not a function and promise1 is rejected, promise2 must be
-- rejected with the same reason as promise1.
if promise2 then
promise2:_reject(self._rejected, self._valuesLength)
return promise2
else
return self
end
end
else
error("Internal error: still pending")
end
end
|
--[[**
ensures Roblox NumberSequenceKeypoint type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.NumberSequenceKeypoint = primitive("NumberSequenceKeypoint")
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,VRecoil = {0.5,0.7} --- Vertical Recoil
,HRecoil = {0.5,0.7} --- Horizontal Recoil
,AimRecover = .95 ---- Between 0 & 1
,RecoilPunch = .1
,VPunchBase = 1 --- Vertical Punch
,HPunchBase = 1 --- Horizontal Punch
,DPunchBase = 1 --- Tilt Punch | useless
,AimRecoilReduction = 1 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0.03
,MinRecoilPower = 1
,MaxRecoilPower = 2
,RecoilPowerStepAmount = .15
,MinSpread = 4 --- Min bullet spread value | Studs
,MaxSpread = 40 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 2.5
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.01 --- Weapon Base Sway | Studs
,MaxSway = 1 --- Max sway value based on player stamina | Studs
|
-- Create component
|
local Component = Cheer.CreateComponent('BTNotificationsManager', View);
function Component.Start(Core)
-- Display update notification if tool is outdated
if Core.IsVersionOutdated() then
if Core.Mode == 'Plugin' then
Cheer(View.PluginUpdateNotification).Start(Component.AdjustLayout);
elseif Core.Mode == 'Tool' then
Cheer(View.ToolUpdateNotification).Start(Component.AdjustLayout);
end;
end;
-- Display HttpEnabled warning if HttpService is disabled
if not Core.SyncAPI:Invoke('IsHttpServiceEnabled') then
Cheer(View.HttpDisabledWarning).Start(Component.AdjustLayout);
end;
-- Adjust layout
View.UIListLayout:ApplyLayout();
-- Animate opening
View.Position = UDim2.new(0.5, 0, 1.5, 0);
View.Visible = true;
View:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), nil, nil, 0.2);
-- Destroy notifications container on tool unequip
spawn(function ()
Core.Disabling:Wait();
View:Destroy();
end);
-- Return component for chaining
return Component;
end;
function Component.AdjustLayout()
View.UIListLayout:ApplyLayout();
end;
return Component;
|
--bp.Position = shelly.PrimaryPart.Position
|
if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
bp.Parent = nil
wait(math.random(3,8))
end
local soundBank = game.ServerStorage.Sounds.NPC.Shelly:GetChildren()
shelly.Health.Changed:connect(function()
if shellyGood then
bp.Parent,bg.Parent= nil,nil
shelly.PrimaryPart.Transparency =1
shelly.PrimaryPart.CanCollide = false
shelly.Shell.Transparency = 1
shelly.HitShell.Transparency = 0
shelly.HitShell.CanCollide = true
shellyGood = false
ostrich = tick()
shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()
repeat wait() until tick()-ostrich > 10
shelly.PrimaryPart.Transparency = 0
shelly.PrimaryPart.CanCollide = true
shelly.Shell.Transparency = 0
shelly.HitShell.Transparency = 1
shelly.HitShell.CanCollide = false
bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
shellyGood = true
end
end)
while true do
if shellyGood then
MoveShelly()
else
wait(1)
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = script:FindFirstAncestor("MainUI");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v3 = require(script.Parent);
local v4 = require(l__LocalPlayer__2:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v5 = game["Run Service"];
local l__UserInputService__6 = game:GetService("UserInputService");
local l__TweenService__7 = game:GetService("TweenService");
local l__Parent__8 = script.Parent.Parent.Parent;
local v9 = v3.hideplayers;
task.delay(2, function()
for v10 = 1, 7 do
for v11, v12 in pairs(game.Players:GetChildren()) do
pcall(function()
local l__Humanoid__13 = v12.Character:FindFirstChild("Humanoid");
if l__Humanoid__13 and (l__Humanoid__13:GetAttribute("LoadedAppearance") or l__Humanoid__13:GetAttribute("AppearanceFinal")) then
return;
end;
l__Humanoid__13:SetAttribute("LoadedAppearance", true);
wait();
l__Humanoid__13.AutomaticScalingEnabled = true;
wait();
l__Humanoid__13.AutomaticScalingEnabled = false;
wait();
l__Humanoid__13.AutomaticScalingEnabled = true;
end);
end;
wait(5);
end;
end);
while true do
wait(0.5);
if v3.hideplayers ~= v9 then
v3.update();
v9 = v3.hideplayers;
local v14 = math.clamp(v3.hideplayers, 0, 1);
for v15, v16 in pairs(game.Players:GetPlayers()) do
pcall(function()
if v16 ~= l__LocalPlayer__2 then
for v17, v18 in pairs(v16.Character:GetDescendants()) do
if v18:IsA("BasePart") or v18:IsA("Decal") then
l__TweenService__7:Create(v18, TweenInfo.new(0.1), {
LocalTransparencyModifier = v14
}):Play();
if v18:IsA("BasePart") then
v18.CollisionGroupId = 1;
end;
end;
end;
end;
end);
end;
wait(0.5);
end;
end;
|
-- Services
|
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
----- Private Variables -----
|
local ActiveProfileStores = ProfileService._active_profile_stores
local AutoSaveList = ProfileService._auto_save_list
local IssueQueue = ProfileService._issue_queue
local DataStoreService = game:GetService("DataStoreService")
local RunService = game:GetService("RunService")
local PlaceId = game.PlaceId
local JobId = game.JobId
local AutoSaveIndex = 1 -- Next profile to auto save
local LastAutoSave = os.clock()
local LoadIndex = 0
local ActiveProfileLoadJobs = 0 -- Number of active threads that are loading in profiles
local ActiveProfileSaveJobs = 0 -- Number of active threads that are saving profiles
local CriticalStateStart = 0 -- os.clock()
local IsStudio = RunService:IsStudio()
local IsLiveCheckActive = false
local UseMockDataStore = false
local MockDataStore = ProfileService._mock_data_store -- Mock data store used when API access is disabled
local UserMockDataStore = ProfileService._user_mock_data_store -- Separate mock data store accessed via ProfileStore.Mock
local UseMockTag = {}
|
--CasingMesh.Scale = Vector3.new(.75,.75,.75)
|
CasingMesh.Parent = CasingBase
function OnFire()
if IsShooting then return end
if MyHumanoid and MyHumanoid.Health > 0 then
if RecoilTrack and AmmoInClip > 0 then
end
IsShooting = true
if AmmoInClip > 0 and not Reloading then
--if RecoilTrack then RecoilTrack:Play() end
if Handle:FindFirstChild('FireSound') then
Handle.FireSound:Play()
end
CreateFlash()
if MyMouse then
MyMouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
local targetPoint = MyMouse.Hit.p
for i = 1, BulletCount do
local shootDirection = (targetPoint - Handle.Position).unit
-- Adjust the shoot direction randomly off by a little bit to account for recoil
-- moves random*spread in a random angle from center shot point (center bias)
shootDirection = ((CFrame.new(Vector3.new(0,0,0),shootDirection) * CFrame.Angles(0,0,math.random()*2*math.pi))*CFrame.Angles(math.random()*Spread,0,0)).lookVector
local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
local bullet
-- Create a bullet here
if hitObject then
bullet = CreateBullet(bulletPos)
end
if hitObject and hitObject.Parent then
local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
if hitHumanoid then
local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
if MyPlayer.Neutral or (hitPlayer and hitPlayer.TeamColor ~= MyPlayer.TeamColor) then
TagHumanoid(hitHumanoid, MyPlayer)
hitHumanoid:TakeDamage(Damage)
if bullet then
bullet:Destroy()
bullet = nil
--bullet.Transparency = 1
end
end
end
end
end
local casing = CasingBase:Clone()
casing.Position = Tool.Handle.Position + Vector3.new(0,1,0)
casing.Velocity = (Vector3.new((math.random()-.5),(.5+math.random()),(math.random()-.5)) - 1.5*(Tool.Handle.CFrame * CFrame.Angles(0,math.pi/4,0)).lookVector)*20
DebrisService:AddItem(casing, 2.5)
casing.Parent = game.Workspace
AmmoInClip = AmmoInClip - 1
UpdateAmmo(AmmoInClip)
end
wait(FireRate-.2)
if AmmoInClip > 0 then
if PumpTrack then
PumpTrack:Play()
end
if Handle:FindFirstChild('PumpSound') then
Handle.PumpSound:Play()
end
wait(.2)
end
MyMouse.Icon = "rbxasset://textures\\GunCursor.png"
end
IsShooting = false
if AmmoInClip == 0 then
Reload()
end
if RecoilTrack then
RecoilTrack:Stop()
end
end
end
function UpdateAmmo(value)
if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
end
--if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
-- WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
--end
end
function OnMouseDown()
LeftButtonDown = true
OnFire()
end
function OnMouseUp()
LeftButtonDown = false
end
function OnKeyDown(key)
if string.lower(key) == 'r' then
Reload()
end
end
function OnEquipped(mouse)
EquipAnim = WaitForChild(Tool, 'Equip')
PumpAnim = WaitForChild(Tool, 'Reload')
FireSound = WaitForChild(Handle, 'FireSound')
MyCharacter = Tool.Parent
MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
MyTorso = MyCharacter:FindFirstChild('Torso')
MyMouse = mouse
WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
if WeaponGui and MyPlayer then
WeaponGui.Parent = MyPlayer.PlayerGui
UpdateAmmo(AmmoInClip)
end
if EquipAnim then
Tool.Grip = CFrame.new(0.132808685, 0.00749024749, 0.526850462, 0.925221086, 0.000443253666, 0.379427731, 0.00859767944, 0.999718785, -0.0221330915, -0.379331142, 0.0237402022, 0.924956799)
EquipTrack = MyHumanoid:LoadAnimation(EquipAnim)
EquipTrack:Play()
end
if PumpAnim then
PumpTrack = MyHumanoid:LoadAnimation(PumpAnim)
end
if MyMouse then
MyMouse.Icon = "rbxasset://textures\\GunCursor.png"
-- Disable mouse icon
--MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
MyMouse.Button1Down:connect(OnMouseDown)
MyMouse.Button1Up:connect(OnMouseUp)
MyMouse.KeyDown:connect(OnKeyDown)
end
end
|
--[[
Returns the current value of this Spring object.
The object will be registered as a dependency unless `asDependency` is false.
]]
|
function class:get(asDependency: boolean?): any
if asDependency ~= false then
useDependency(self)
end
return self._currentValue
end
|
-- Also activate when the Fire Button is down
|
local function OnChildAdded(child)
if child.Name == 'FireButtonDown' then
child.Changed:connect(function(newValue)
if newValue == true then
OnActivated(true)
end
end)
end
end
|
--[[Engine]]
|
-- [TORQUE CURVE VISUAL]
-- https://www.desmos.com/calculator/nap6stpjqf
-- Use sliders to manipulate values
-- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
Tune.Horsepower = 141
Tune.IdleRPM = 700
Tune.PeakRPM = 3300
Tune.Redline = 4600
Tune.EqPoint = 4100
Tune.PeakSharpness = 2
Tune.CurveMult = 0
Tune.InclineComp = 5 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Turbo Settings
Tune.Aspiration = "Natural" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger
"Super" : Supercharger ]]
Tune.Boost = 5 --Max PSI (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 80 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 9 --The compression ratio (look it up)
Tune.Sensitivity = 0.05 --How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1)
--Misc
Tune.RevAccel = 300 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 250 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
|
-- Initialize surface tool
|
local SurfaceTool = require(CoreTools:WaitForChild 'Surface')
Core.AssignHotkey('B', Core.Support.Call(Core.EquipTool, SurfaceTool));
Core.Dock.AddToolButton(Core.Assets.SurfaceIcon, 'B', SurfaceTool, 'SurfaceInfo');
|
-- Decompiled with the Synapse X Luau decompiler.
|
wait(1);
local v1 = require(script.Parent.FormatNumber);
local l__LocalPlayer__2 = game.Players.LocalPlayer;
script.Parent.Logo.Silver.Text = v1.FormatLong(l__LocalPlayer__2.Data.Silver.Value);
script.Parent.Logo.Shadow.Text = v1.FormatLong(l__LocalPlayer__2.Data.Silver.Value);
l__LocalPlayer__2.Data.Silver.Changed:Connect(function()
script.Parent.Logo.Silver.Text = v1.FormatLong(l__LocalPlayer__2.Data.Silver.Value);
script.Parent.Logo.Shadow.Text = v1.FormatLong(l__LocalPlayer__2.Data.Silver.Value);
script.Parent.Sound:Play();
end);
|
--/Welds
|
function WeldParts(part0,part1)
local newWeld = Instance.new("Weld")
newWeld.Part0 = part0
newWeld.Part1 = part1
newWeld.C0 = CFrame.new()
newWeld.C1 = part1.CFrame:toObjectSpace(part0.CFrame)
newWeld.Parent = part0
end
|
--
|
function Triangle:SetParent(parent)
self.WedgeA.Parent = parent
self.WedgeB.Parent = parent
self.Parent = parent
end
function Triangle:SetWedgeProperties(properties)
for prop, value in next, properties do
self.WedgeA[prop] = value
self.WedgeB[prop] = value
end
end
function Triangle:Draw(a, b, c)
a = a or self.a
b = b or self.b
c = c or self.c
self.a = a
self.b = b
self.c = c
local wedgeA = self.WedgeA
local wedgeB = self.WedgeB
local ab, ac, bc = b - a, c - a, c - b
local abd, acd, bcd = ab:Dot(ab), ac:Dot(ac), bc:Dot(bc)
if (abd > acd and abd > bcd) then
c, a = a, c
elseif (acd > bcd and acd > abd) then
a, b = b, a
end
ab, ac, bc = b - a, c - a, c - b
local right = ac:Cross(ab).Unit
local up = bc:Cross(right).Unit
local back = bc.Unit
local height = math.abs(ab:Dot(up))
local width1 = math.abs(ab:Dot(back))
local width2 = math.abs(ac:Dot(back))
wedgeA.Size = Vector3.new(0.05, height, width1)
wedgeA.CFrame = CFrame.fromMatrix((a + b)/2, right, up, back)
wedgeA.Parent = self.Parent
wedgeB.Size = Vector3.new(0.05, height, width2)
wedgeB.CFrame = CFrame.fromMatrix((a + c)/2, -right, up, -back)
wedgeB.Parent = self.Parent
end
|
--[[
RemoveWeaponsOnDeath
Description: This script removes weapons on players when they die.
]]
| |
--------END RIGHT DOOR --------
|
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
------------------------------------------------------------------------
|
local Spring = {} do
Spring.__index = Spring
function Spring.new(freq, pos)
local self = setmetatable({}, Spring)
self.f = freq
self.p = pos
self.v = pos*0
return self
end
function Spring:Update(dt, goal)
local f = self.f*2*pi
local p0 = self.p
local v0 = self.v
local offset = goal - p0
local decay = exp(-f*dt)
local p1 = goal + (v0*dt - offset*(f*dt + 1))*decay
local v1 = (f*dt*(offset*f - v0) + v0)*decay
self.p = p1
self.v = v1
return p1
end
function Spring:Reset(pos)
self.p = pos
self.v = pos*0
end
end
|
--[[Steering]]
|
Tune.SteerInner = 70 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 65 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .2 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .2 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
|
--Current joints
|
ra = tors:findFirstChild("Right Shoulder")
la = tors:findFirstChild("Left Shoulder")
rl = tors:findFirstChild("Right Hip")
ll = tors:findFirstChild("Left Hip")
hd = tors:findFirstChild("Neck")
|
--geraçao de zumbis
|
local part = game:GetService("ServerStorage").Zombie
while (true) do
wait(5)
local novaparte = part:Clone()
partal = math.random(1,4)
if portal == 1 then
novaparte.Humanoid.RootPart.Position = workspace.Portal1.Position
elseif portal == 2 then
novaparte.Humanoid.RootPart.Position = workspace.Portal3.Position
elseif portal == 3 then
else
novaparte.Parent = workspace
end
end
|
--------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
|
function tweenJoint(Joint, newC0, newC1, Alpha, Duration)
spawn(function()
local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
local tweenIndicator = nil
if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
tweenIndicator = Instance.new("IntValue")
tweenIndicator.Name = "tweenCode"
tweenIndicator.Value = newCode
tweenIndicator.Parent = Joint
else
tweenIndicator = Joint.tweenCode
tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
end
--local tweenIndicator = createTweenIndicator:InvokeServer(Joint, newCode)
if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
if newC0 then Joint.C0 = newC0 end
if newC1 then Joint.C1 = newC1 end
else
local startC0 = Joint.C0
local startC1 = Joint.C1
local t0 = tick()
while true do
RS.RenderStepped:wait() --This makes the for loop step every 1/60th of a second
local X = math.min((tick() - t0) / Duration, 1) * 90
if tweenIndicator.Value ~= newCode then break end --This makes sure that another tween wasn't called on the same joint
if (not Selected) then break end --This stops the tween if the tool is deselected
if newC0 then Joint.C0 = startC0:lerp(newC0, Alpha(X)) end
if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
--if newC0 then lerpCF:InvokeServer(Joint, "C0", startC0, newC0, Alpha(X)) end
--if newC1 then lerpCF:InvokeServer(Joint, "C1", startC1, newC1, Alpha(X)) end
if X == 90 then break end
end
end
if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
tweenIndicator:Destroy()
end
--deleteTweenIndicator:InvokeServer(tweenIndicator, newCode)
end)
end
function tweenCam(Key, newRot, Alpha, Duration)
spawn(function()
local newCode = math.random(-1e9, 1e9)
camOffsets[Key].Code = newCode
local Increment = 1.5 / Duration
local prevRot = camOffsets[Key].Rot
local X = 0
while true do
RS.RenderStepped:wait()
local newX = X + Increment
X = (newX > 90 and 90 or newX)
if camOffsets[Key].Code ~= newCode then break end
if (not Selected) then break end
camOffsets[Key].Rot = prevRot:lerp(newRot, Alpha(X))
if X == 90 then break end
end
if camOffsets[Key].Code == newCode then
camOffsets[Key].Code = nil
end
end)
end
function tweenRecoil(newPos, newRot, Alpha, Duration)
spawn(function()
local newCode = math.random(-1e9, 1e9)
recoilAnim.Code = newCode
local Increment = 1.5 / Duration
local prevPos = recoilAnim.Pos
local prevRot = recoilAnim.Rot
local X = 0
while true do
RS.RenderStepped:wait()
local newX = X + Increment
X = (newX > 90 and 90 or newX)
if recoilAnim.Code ~= newCode then break end
if (not Selected) then break end
recoilAnim.Pos = prevPos:lerp(newPos, Alpha(X))
recoilAnim.Rot = prevRot:lerp(newRot, Alpha(X))
if X == 90 then break end
end
if recoilAnim.Code == newCode then
recoilAnim.Code = nil
end
end)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.