prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[=[
Honestly, I have not used this one much.
https://rxjs-dev.firebaseapp.com/api/operators/withLatestFrom
https://medium.com/js-in-action/rxjs-nosy-combinelatest-vs-selfish-withlatestfrom-a957e1af42bf
@param inputObservables {Observable<TInput>}
@return (source: Observable<T>) -> Observable<{T, ...TInput}>
]=] |
function Rx.withLatestFrom(inputObservables)
assert(inputObservables, "Bad inputObservables")
for _, observable in pairs(inputObservables) do
assert(Observable.isObservable(observable), "Bad observable")
end
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local maid = Maid.new()
local latest = {}
for key, observable in pairs(inputObservables) do
latest[key] = UNSET_VALUE
maid:GiveTask(observable:Subscribe(function(value)
latest[key] = value
end, nil, nil))
end
maid:GiveTask(source:Subscribe(function(value)
for _, item in pairs(latest) do
if item == UNSET_VALUE then
return
end
end
sub:Fire({value, unpack(latest)})
end, sub:GetFailComplete()))
return maid
end)
end
end
|
-- DOM code omitted for now but translated below:
--[[
function isDomNode(obj: any): boolean
return obj ~= nil and
typeof(obj) == "table" and
typeof(obj.nodeType) == "number" and
typeof(obj.nodeName) == "string" and
typeof(obj.isEqualNode) == "function"
end
--]] | |
--[[ API
countdownTimersModule
:AddTimer(timerPropertiesTable)
:RemoveTimer(timer)
:GetTimers()
Timer Properties
Enabled = true
UniversalEventDate = DateTime.fromUniversalTime(2022, 4, 26, 14, 30, 0, 0) -- UTC (year, month, day, hour, minute)
BubbleTimerUI = bubbleTimerUI
BoardTimerUI = boardTimerUI
AutomaticallyDisableAfter = 10 -- Seconds after the event date in which the timer will disable itself.
DisableBubbleWhenBoardVisible = true
TimerReachedFunction = clientTimerReachedFunc
ReadableBoardDistance = 120
]] | |
-- Implements Javascript's `Object.is` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is |
return function(value1: any, value2: any): boolean
if value1 == value2 then
return value1 ~= 0 or 1 / value1 == 1 / value2
else
return value1 ~= value1 and value2 ~= value2
end
end
|
--[[ Local functionality ]] | --
local function isDynamicThumbstickEnabled()
return ThumbstickFrame and ThumbstickFrame.Visible
end
local function enableAutoJump(humanoid)
if humanoid and isDynamicThumbstickEnabled() then
local shouldRevert = humanoid.AutoJumpEnabled == false
shouldRevert = shouldRevert and LocalPlayer.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice
RevertAutoJumpEnabledToFalse = shouldRevert
humanoid.AutoJumpEnabled = true
end
end
do
local function onCharacterAdded(character)
for _, child in ipairs(LocalPlayer.Character:GetChildren()) do
if child:IsA("Tool") then
IsAToolEquipped = true
end
end
character.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
IsAToolEquipped = true
elseif child:IsA("Humanoid") then
enableAutoJump(child)
end
end)
character.ChildRemoved:Connect(function(child)
if child:IsA("Tool") then
IsAToolEquipped = false
end
end)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
enableAutoJump(humanoid)
end
end
LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
if LocalPlayer.Character then
onCharacterAdded(LocalPlayer.Character)
end
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data |
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return plrData.Classes.Super.Viper.Obtained.Value == true and plrData.Classes.Super.Viper.Scourge.Value == true and plrData.Classes.Super.Viper.HiddenViper.Value == true
end
|
--> Main |
local function UpdateHeatBar()
heatBar.Visible = heldGunHeat.Value > 0.025
heatBar.Heat.Size = UDim2.new(heldGunHeat.Value,0,1,0)
end
local function SetupGUIForHeldGun(gun)
for i,image in ipairs(images:GetChildren()) do
if image.Name == gun.Name then
image.ImageTransparency = 0
else
image.ImageTransparency = 1
end
end
heldGunHeat = gun:WaitForChild("Heat")
if heatConnection then
heatConnection:Disconnect()
end
UpdateHeatBar()
heatConnection = heldGunHeat.Changed:Connect(function(property)
UpdateHeatBar()
end)
end
local function SetupGUIForHeldMelee(melee)
for i,image in ipairs(images:GetChildren()) do
if image.Name == melee.Name then
image.ImageTransparency = 0
else
image.ImageTransparency = 1
end
end
heatBar.Visible = false
if heatConnection then
heatConnection:Disconnect()
end
end
|
-- Hook up ShopRegion parts to open and close the merch booth |
local TAG_NAME = "ShopRegion"
local DEBOUNCE_TIME = 1
local lastClose = 0
function hookupRegionPart(regionPart)
regionPart.Touched:Connect(function(otherPart)
-- Debounce the shop from opening too soon after being closed
if os.clock() < lastClose + DEBOUNCE_TIME then
return
end
local character = Players.LocalPlayer.Character
if character and character:FindFirstChild("HumanoidRootPart") == otherPart then
MerchBooth.openMerchBooth()
end
end)
regionPart.TouchEnded:Connect(function(otherPart)
local character = Players.LocalPlayer.Character
if character and character:FindFirstChild("HumanoidRootPart") == otherPart then
lastClose = os.clock()
MerchBooth.closeMerchBooth()
end
end)
end
for _, regionPart in ipairs(CollectionService:GetTagged(TAG_NAME)) do
hookupRegionPart(regionPart)
end
CollectionService:GetInstanceAddedSignal(TAG_NAME):connect(hookupRegionPart)
|
--[[Transmission]] |
Tune.TransModes = {"Auto", "Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.16 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 4.40 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
------------------------- |
function onClicked()
R.Function1.Disabled = true
FX.CRUSH.BrickColor = BrickColor.new("Really red")
FX.CRUSH.loop.Disabled = true
FX.JET.BrickColor = BrickColor.new("Really red")
FX.JET.loop.Disabled = true
FX.LPF.BrickColor = BrickColor.new("Really red")
FX.LPF.loop.Disabled = true
FX.HPF.BrickColor = BrickColor.new("Really red")
FX.HPF.loop.Disabled = true
FX.ZIP.BrickColor = BrickColor.new("Really red")
FX.ZIP.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[[Run]] |
--Print Version
local ver=require(car["A-Chassis Tune"].README)
print("//INSPARE: AC6 Loaded - Build "..ver)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Update External Values
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
if Stats.Fuel.Value <= 0 then _IsOn = false end
end
|
--[=[
Retrieves the manager
@return PlayerDataStoreManager
]=] |
function PlayerDataStoreService:PromiseManager()
if self._dataStoreManagerPromise then
return self._dataStoreManagerPromise
end
self._dataStoreManagerPromise = self._started
:Then(function()
return DataStorePromises.promiseDataStore(self._dataStoreName, self._dataStoreScope)
end)
:Then(function(dataStore)
local manager = PlayerDataStoreManager.new(
dataStore,
function(player)
return tostring(player.UserId)
end)
self._maid:GiveTask(manager)
return manager
end)
return self._dataStoreManagerPromise
end
return PlayerDataStoreService
|
-- Track 1 |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local EventSequencer = require(ReplicatedStorage:WaitForChild("EventSequencer"))
local BouncePlatforms = require(ReplicatedStorage:WaitForChild("BouncePlatforms"))
local GetCurrentSceneEnvironment = EventSequencer.getCurrentSceneEnvironment
local Schema = EventSequencer.createSchema()
local performerAnimations = require(script.PerformerAnimations)
local Environment = nil
local ServerEnvironment = nil
local MainAudio = nil
local Performer = nil
local StageSpotlights = {}
local PerformerRootPart = nil
local PerformerRootPartBaseCFrame = CFrame.new(0, 0, 0)
local rng = Random.new()
function enableBouncyPads()
for _, part in pairs(CollectionService:GetTagged("Bouncy")) do
BouncePlatforms.new(part, {
debounce = 0.2,
bounceVector = Vector3.new(0, 1, 0),
bounceForce = 150,
})
end
BouncePlatforms:enable()
end
local function emitChanceFromTagged(tagName, chance, newLifetime)
for _, emitter in pairs(CollectionService:GetTagged(tagName)) do
if rng:NextNumber(0, 1) <= chance then
if newLifetime then
emitter.Lifetime = newLifetime
end
emitter:Emit(1)
end
end
end
local function setTaggedObjectsEnabled(tagName, enabled)
for _, emitter in pairs(CollectionService:GetTagged(tagName)) do
emitter.Enabled = enabled
end
end
local function schemaSetTaggedObjectsEnabled(timeStamp, tagName, enabled)
Schema:schedule({
SyncToAudio = {
Audio = MainAudio,
StartAtAudioTimes = { timeStamp },
Skippable = true,
},
OnStart = function()
setTaggedObjectsEnabled(tagName, enabled)
end,
})
end
local function setStageSpotlightEnabled(lightIndex, enabled)
local lens = StageSpotlights["i" .. lightIndex] -- Get cached object
if not lens and ServerEnvironment then
local stageSpotlights = ServerEnvironment:FindFirstChild("StageSpotlights", true)
if stageSpotlights then
local spotLight = stageSpotlights:FindFirstChild("SpotLight" .. lightIndex)
if spotLight then
lens = spotLight:FindFirstChild("lens")
StageSpotlights["i" .. lightIndex] = lens -- Cache object for quick access
end
end
end
if lens then
lens.Material = enabled and Enum.Material.Neon or Enum.Material.Plastic
lens.Color = enabled and Color3.fromRGB(175, 221, 255) or Color3.fromRGB(80, 148, 193)
local beam = lens:FindFirstChild("LightBeam")
if beam then
beam.Enabled = enabled
end
local light = lens:FindFirstChild("SpotLight")
if light then
light.Enabled = enabled
end
end
end
local function schemaSetStageSpotlightIndexesEnabled(timeStamp, lightIndexList, enabled)
Schema:schedule({
SyncToAudio = {
Audio = MainAudio,
StartAtAudioTimes = { timeStamp },
Skippable = true,
},
OnStart = function()
for _, lightIndex in pairs(lightIndexList) do
setStageSpotlightEnabled(lightIndex, enabled)
end
end,
})
end
local function schemaRotateStageLights(startTime, endTime, lightChangeRate, startLightIndex, direction)
direction = direction or -1
lightChangeRate = lightChangeRate or 0.5
startLightIndex = startLightIndex or 1
local numLightChanges = math.max(1, math.floor((endTime - startTime) / lightChangeRate))
for i = 0, numLightChanges do
local timeStamp = startTime + i * lightChangeRate
local onLightIndex = ((startLightIndex + i * direction - 1) % 8) + 1
local offLightIndex = ((startLightIndex + (i - 1) * direction - 1) % 8) + 1
schemaSetStageSpotlightIndexesEnabled(timeStamp, { onLightIndex }, true)
schemaSetStageSpotlightIndexesEnabled(timeStamp, { offLightIndex }, false)
end
end
local lightsWaveMapIndexes = { { 2 }, { 1, 3 }, { 4, 8 }, { 5, 7 }, { 6 } }
local function schemaWaveStageLights(startTime, endTime, changeRate, startMapIndex, direction)
direction = direction or 1
changeRate = changeRate or 0.333
startMapIndex = startMapIndex or 1
local numLightChanges = math.max(1, math.floor((endTime - startTime) / changeRate))
for i = 0, numLightChanges do
local timeStamp = startTime + i * changeRate
local onLightMapIndex = ((startMapIndex + i * direction - 1) % 5) + 1
local offLightMapIndex = ((startMapIndex + (i - 1) * direction - 1) % 5) + 1
schemaSetStageSpotlightIndexesEnabled(timeStamp, lightsWaveMapIndexes[onLightMapIndex], true)
schemaSetStageSpotlightIndexesEnabled(timeStamp, lightsWaveMapIndexes[offLightMapIndex], false)
end
end
Schema.OnSetup = function()
Environment = GetCurrentSceneEnvironment()
ServerEnvironment = EventSequencer.getCurrentServerEnvironmentFromClient()
Performer = Environment:WaitForChild("Nitro")
PerformerRootPart = Performer:WaitForChild("HumanoidRootPart")
PerformerRootPartBaseCFrame = PerformerRootPart.CFrame
enableBouncyPads()
StageSpotlights = {}
end
Schema.OnRun = function()
MainAudio = Schema:audio({
StartTime = 0,
SoundId = "rbxassetid://1838673350",
})
performerAnimations(Schema, MainAudio, Performer)
schemaSetStageSpotlightIndexesEnabled(0, { 1, 2, 3, 4, 5, 6, 7, 8 }, false)
schemaSetTaggedObjectsEnabled(0, "DistantFog", true)
schemaSetTaggedObjectsEnabled(0, "BurstFog", false)
schemaRotateStageLights(2, 15.5, 0.5, 8, -1)
schemaSetStageSpotlightIndexesEnabled(16, { 1, 2, 3 }, true)
schemaSetStageSpotlightIndexesEnabled(16, { 4, 5, 6, 7, 8 }, false)
schemaSetStageSpotlightIndexesEnabled(32, { 1, 2, 3 }, false)
schemaSetStageSpotlightIndexesEnabled(39, { 4, 5, 6, 7, 8 }, true)
-- Raise the performer
local raisePerformer = Schema:tween({ -- There are currently problems when seeking while tweening a cframe
StartTimes = { 39 },
Tween = {
Object = PerformerRootPart,
Info = TweenInfo.new(5.8, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),
Properties = {
CFrame = CFrame.new(0, 6, 0) * PerformerRootPartBaseCFrame,
},
},
})
schemaSetStageSpotlightIndexesEnabled(42, { 4, 5, 6, 7, 8 }, false)
schemaSetStageSpotlightIndexesEnabled(42, { 1, 2, 3 }, true)
schemaSetTaggedObjectsEnabled(42, "DistantFog", false)
-- Drop the performer
local dropPerformer = Schema:tween({ -- There are currently problems when seeking while tweening a cframe
StartTimes = { 45 },
Tween = {
Object = PerformerRootPart,
Info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
Properties = {
CFrame = PerformerRootPartBaseCFrame,
},
},
})
-- 46 First drop
schemaSetStageSpotlightIndexesEnabled(44.99, { 1, 2, 3, 4, 5, 6, 7, 8 }, false)
schemaWaveStageLights(45, 58, 0.2, 5, -1)
schemaSetTaggedObjectsEnabled(45.33, "BurstFog3", true)
schemaSetTaggedObjectsEnabled(45.66, "BurstFog2", true)
schemaSetTaggedObjectsEnabled(46, "BurstFog1", true)
local smallSpeakerSoundwaveParticles =
Schema:interval({ -- Speaker sound wave particles tied to sound intensity (Small)
SyncToAudio = {
StartAtAudioTime = 0,
EndAtAudioTime = 147,
Audio = MainAudio,
},
Frequency = 0.5,
OnInterval = function()
local intensity = MainAudio.CurrentSoundIntensityRatio
emitChanceFromTagged("SpeakerParticles3", intensity, NumberRange.new(0.1 + 1 - intensity))
end,
})
local LargeSpeakerSoundwaveParticles =
Schema:interval({ -- Speaker sound wave particles tied to sound intensity (Large)
SyncToAudio = {
StartAtAudioTime = 46,
EndAtAudioTime = 147,
Audio = MainAudio,
},
Frequency = 0.5,
OnInterval = function()
local intensity = MainAudio.CurrentSoundIntensityRatio
emitChanceFromTagged("SpeakerParticles2", intensity, NumberRange.new(0.3 + 1 - intensity))
end,
})
local mediumSpeakerSoundwaveParticles =
Schema:interval({ -- Speaker sound wave particles tied to sound intensity (Medium)
SyncToAudio = {
StartAtAudioTime = 50,
EndAtAudioTime = 147,
Audio = MainAudio,
},
Frequency = 0.5,
OnInterval = function()
local intensity = MainAudio.CurrentSoundIntensityRatio
emitChanceFromTagged("SpeakerParticles1", intensity, NumberRange.new(0.1 + 1 - intensity))
end,
})
local smokeBursts = Schema:interval({ -- Smoke burst emitters tied to sound intensity
SyncToAudio = {
StartAtAudioTime = 50,
EndAtAudioTime = 147,
Audio = MainAudio,
},
Frequency = 0.1,
OnInterval = function()
local intensity = MainAudio.CurrentSoundIntensityRatio
setTaggedObjectsEnabled("BurstFog3", intensity > 0.35)
setTaggedObjectsEnabled("BurstFog2", intensity > 0.55)
setTaggedObjectsEnabled("BurstFog1", intensity > 0.75)
end,
})
schemaRotateStageLights(58, 68, 0.2, 6, -1)
schemaSetStageSpotlightIndexesEnabled(68.1, { 1, 2, 3, 4, 5, 6, 7, 8 }, true)
-- Raise the performer
local raisePerformerQuickly = Schema:tween({ -- There are currently problems when seeking while tweening a cframe
StartTimes = { 67.75 },
Tween = {
Object = PerformerRootPart,
Info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
Properties = {
CFrame = CFrame.new(0, 6, 0) * PerformerRootPartBaseCFrame,
},
},
})
local dropPerformerQuickly = Schema:tween({
StartTimes = { 68.25 },
Tween = {
Object = PerformerRootPart,
Info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In),
Properties = {
CFrame = PerformerRootPartBaseCFrame,
},
},
})
schemaRotateStageLights(71, 88, 0.2, 8, 1)
schemaSetStageSpotlightIndexesEnabled(88.1, { 1, 2, 3, 4, 5, 6, 7, 8 }, true)
schemaWaveStageLights(90, 105, 0.2, 5, -1)
-- Pick up the pace
schemaWaveStageLights(107, 122.5, 0.1, 5, 1)
-- 123 go mellow
schemaSetStageSpotlightIndexesEnabled(123, { 1, 2, 3, 4, 5, 6, 7, 8 }, false)
end
Schema.OnEndScene = function()
StageSpotlights = {}
end
return Schema
|
--[[Wheel Alignment]] |
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -15
Tune.RCamber = -15
Tune.FToe = 0
Tune.RToe = 0
|
----------------------------------
------------FUNCTIONS-------------
---------------------------------- |
function IsBlack(note)
if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then
return true
end
end
function HighlightPianoKey(note1)
if not Settings.KeyAesthetics then return end
--print("highlight!")
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local key = Keys[octave][note2]
if IsBlack(note1) then
key.Mesh.Offset = Vector3.new(0.02, -0.15, 0)
else
key.Mesh.Offset = Vector3.new(0, -.05, 0)
end
delay(.5, function() RestorePianoKey(note1) end)
end
function RestorePianoKey(note1)
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local key = Keys[octave][note2]
if IsBlack(note1) then
key.Mesh.Offset = Vector3.new(0.02, -0.1, 0)
else
key.Mesh.Offset = Vector3.new(0, 0, 0)
end
end
|
--ColourRand --------------------------------------------- |
script.Parent.Configuration.ColorRand.Changed:connect(function()
while script.Parent.Configuration.ColorRand.Value == 1 do
wait(0.1)
r = math.random(1,255)/255
g = math.random(1,255)/255
b = math.random(1,255)/255
script.Parent.Configuration.Colour.Value = Color3.new(r,g,b)
end
end)
|
--You can change the values below to suit your needs |
local max_mode = 10 --The maximum amount of modes forwards. Set to 0 to disable forwards motion.
local min_mode = -10 --The minimum amount of modes backwards. Set to 0 to disable backwards motion.
local increment_speed = 0.4 --The amount in which the speed value increments with every mode.
|
--[[
Wait in parallel for all RemoteEvents and RemoteFunctions defined in RemoteNames to
replicate into the remoteFolder.
Used to ensure all remotes exist before the client Network module finishes initializing.
--]] |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Sift = require(ReplicatedStorage.Dependencies.Sift)
local RemoteEventName = require(ReplicatedStorage.Source.Network.RemoteName.RemoteEventName)
local RemoteFunctionName = require(ReplicatedStorage.Source.Network.RemoteName.RemoteFunctionName)
local RemoteFolderName = require(ReplicatedStorage.Source.Network.RemoteFolderName)
local function waitForAllRemotesAsync(remoteFolder: Instance, timeoutSeconds: number)
-- Using FindFirstChild to satisfy the type checker
local remoteEventsFolder = remoteFolder:FindFirstChild(RemoteFolderName.RemoteEvents) :: Folder
local remoteFunctionsFolder = remoteFolder:FindFirstChild(RemoteFolderName.RemoteFunctions) :: Folder
-- We are casting these constants tables to any for type compatibility with Sift
local remoteEvents: { string } = Sift.Dictionary.values(RemoteEventName :: any)
local remoteFunctions: { string } = Sift.Dictionary.values(RemoteFunctionName :: any)
-- Validate that the remotes defined under RemoteNames exist in remote folders
local success = true
local function search(names: { string }, folder: Folder)
for _, remoteName in ipairs(names) do
local remote = folder:WaitForChild(remoteName, timeoutSeconds)
if not remote then
success = false
break
end
end
end
search(remoteEvents, remoteEventsFolder)
search(remoteFunctions, remoteFunctionsFolder)
assert(success, "Network could not find all remotes. Did the client Network module initialize before the server?")
end
return waitForAllRemotesAsync
|
--Var |
local path = PathfindingService:CreatePath()
|
--[[
AnimateKey(note1,px,py,pz,ox,oy,oz,Time)
--note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time
local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]] |
local vars = {}
for i = 1,61 do
vars[i] = false
end
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local key = Piano.Keys.Keys:FindFirstChild(note1)
if key then
if IsBlack(note1) then
key.Color = Color3.fromRGB(229, 91, 188)
key.ParticleEmitter.Color = ColorSequence.new({ColorSequenceKeypoint.new( 0, Color3.fromRGB(229, 91, 188)),ColorSequenceKeypoint.new( 1, Color3.fromRGB(229, 91, 188))})
else
key.Color = Color3.fromRGB(229, 117, 214)
key.ParticleEmitter.Color = ColorSequence.new({ColorSequenceKeypoint.new( 0, Color3.fromRGB(229, 117, 214)),ColorSequenceKeypoint.new( 1, Color3.fromRGB(229, 117, 214))})
end
key.Transparency = 0
key.ParticleEmitter:Emit(1)
vars[note1] = true
local obj = key
local Properties = {}
Properties.Size = Vector3.new(key.Size.x + 1,key.Size.y,key.Size.z)
Properties.Position = Vector3.new(key.Position.x,key.Position.y + .5,key.Position.z)
Tween(obj,Properties,.2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
vars[note1] = false
wait(.1)
if not vars[note1] then
Properties = {}
Properties.Size = Vector3.new(.13,.39,.39)
Properties.Position = Vector3.new(key.Position.x,orgins[tostring(note1)][1].y,key.Position.z)
Tween(obj,Properties,.1,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
end
end
return
end
|
--------------------------------------------------- |
local tweenService = game:GetService("TweenService")
This = script.Parent
Lift = This.Parent.Parent.Parent
CustomLabel = require(Lift.CustomLabel)
Characters = require(script.Characters)
CustomText = CustomLabel["CUSTOMFLOORLABEL"]
for i,v in pairs(Lift.Car:WaitForChild("Welds"):GetChildren()) do
if v.Part1 == script.Parent.Back then v:Destroy() end
end
local weld = Instance.new("ManualWeld", This.Button)
weld.C0 = Lift.Car.Platform.CFrame:inverse() * This.Back.CFrame
weld.Part0 = Lift.Car.Platform
weld.Part1 = This.Back
click = false
for x,x in pairs(This.Button:GetChildren()) do
if x:IsA("SurfaceGui") and x.Name == ("Button") then
x.Button.MouseButton1Click:connect(function()
if click == false then
click = true
tweenService:Create(weld,TweenInfo.new(0.1),{
["C1"] = weld.C1*CFrame.new(0.002, 0, 0),
}):Play()
wait(0.1)
tweenService:Create(weld,TweenInfo.new(0.1),{
["C1"] = weld.C1*CFrame.new(-0.002, 0, 0),
}):Play()
wait(0.1)
click = false
end
end)
end
end
|
--- Get (or create) BindableFunction |
function GetFunc(funcName)
--- Variables
funcName = string.lower(funcName)
local func = funcs[funcName]
--- Check if function already exists
if not func then
func = Instance.new("BindableFunction")
func.Name = funcName
funcs[funcName] = func
end
return func
end
|
--//THROTTLE PATCHER//-- |
GEAR = 1
Wrpm = 3
Gear1 = 52
Idle = "dsaBETA_LIMIT"
FinalDrive = "GearTest"
RPMLimiter = 4.3
rpm = BrickColor
sconfig = math.min(42)
rwd = script.Parent
Gear2 = 4
Gear3 = "ying"
Gear4 = "yan"
Gear5 = "34"
config = 14.4
scale = 41
hp = script.Parent
size = 14
th = 54
|
--[[ TEXT CHANGER ]] | --
while true do
script.Parent.TextLabel.Text = "Teleporting."
wait(0.5)
script.Parent.TextLabel.Text = "Teleporting.."
wait(0.5)
script.Parent.TextLabel.Text = "Teleporting..."
wait(0.5)
end
|
----- MAGIC NUMBERS ABOUT THE TOOL -----
-- How much damage a bullet does |
local Damage = 25 |
-- Decompiled with the Synapse X Luau decompiler. |
local l__Parent__1 = script.Parent;
local l__Humanoid__2 = l__Parent__1:WaitForChild("Humanoid");
local v3, v4 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserNoUpdateOnLoop");
end);
local v5, v6 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserEmoteToRunThresholdChange");
end);
local v7, v8 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPlayEmoteByIdAnimTrackReturn2");
end);
local l__ScaleDampeningPercent__9 = script:FindFirstChild("ScaleDampeningPercent");
math.randomseed(tick());
function findExistingAnimationInSet(p1, p2)
if p1 ~= nil then
if p2 == nil then
return 0;
end;
else
return 0;
end;
local l__count__10 = p1.count;
local v11 = 1 - 1;
while true do
if p1[v11].anim.AnimationId == p2.AnimationId then
return v11;
end;
if 0 <= 1 then
if v11 < l__count__10 then
else
break;
end;
elseif l__count__10 < v11 then
else
break;
end;
v11 = v11 + 1;
end;
return 0;
end;
local u1 = {};
local u2 = {};
function configureAnimationSet(p3, p4)
if u1[p3] ~= nil then
local v12, v13, v14 = pairs(u1[p3].connections);
while true do
local v15, v16 = v12(v13, v14);
if v15 then
else
break;
end;
v14 = v15;
v16:disconnect();
end;
end;
u1[p3] = {};
u1[p3].count = 0;
u1[p3].totalWeight = 0;
u1[p3].connections = {};
local u3 = true;
local v17, v18 = pcall(function()
u3 = game:GetService("StarterPlayer").AllowCustomAnimations;
end);
if not v17 then
u3 = true;
end;
local v19 = script:FindFirstChild(p3);
if u3 then
if v19 ~= nil then
table.insert(u1[p3].connections, v19.ChildAdded:connect(function(p5)
configureAnimationSet(p3, p4);
end));
table.insert(u1[p3].connections, v19.ChildRemoved:connect(function(p6)
configureAnimationSet(p3, p4);
end));
local v20, v21, v22 = pairs(v19:GetChildren());
while true do
local v23, v24 = v20(v21, v22);
if v23 then
else
break;
end;
v22 = v23;
if v24:IsA("Animation") then
local v25 = 1;
local l__Weight__26 = v24:FindFirstChild("Weight");
if l__Weight__26 ~= nil then
v25 = l__Weight__26.Value;
end;
u1[p3].count = u1[p3].count + 1;
local l__count__27 = u1[p3].count;
u1[p3][l__count__27] = {};
u1[p3][l__count__27].anim = v24;
u1[p3][l__count__27].weight = v25;
u1[p3].totalWeight = u1[p3].totalWeight + u1[p3][l__count__27].weight;
table.insert(u1[p3].connections, v24.Changed:connect(function(p7)
configureAnimationSet(p3, p4);
end));
table.insert(u1[p3].connections, v24.ChildAdded:connect(function(p8)
configureAnimationSet(p3, p4);
end));
table.insert(u1[p3].connections, v24.ChildRemoved:connect(function(p9)
configureAnimationSet(p3, p4);
end));
end;
end;
end;
end;
if u1[p3].count <= 0 then
local v28, v29, v30 = pairs(p4);
while true do
local v31, v32 = v28(v29, v30);
if v31 then
else
break;
end;
v30 = v31;
u1[p3][v31] = {};
u1[p3][v31].anim = Instance.new("Animation");
u1[p3][v31].anim.Name = p3;
u1[p3][v31].anim.AnimationId = v32.id;
u1[p3][v31].weight = v32.weight;
u1[p3].count = u1[p3].count + 1;
u1[p3].totalWeight = u1[p3].totalWeight + v32.weight;
end;
end;
local v33, v34, v35 = pairs(u1);
while true do
local v36, v37 = v33(v34, v35);
if v36 then
else
break;
end;
local l__count__38 = v37.count;
local v39 = 1 - 1;
while true do
if u2[v37[v39].anim.AnimationId] == nil then
l__Humanoid__2:LoadAnimation(v37[v39].anim);
u2[v37[v39].anim.AnimationId] = true;
end;
if 0 <= 1 then
if v39 < l__count__38 then
else
break;
end;
elseif l__count__38 < v39 then
else
break;
end;
v39 = v39 + 1;
end;
end;
end;
function configureAnimationSetOld(p10, p11)
if u1[p10] ~= nil then
local v40, v41, v42 = pairs(u1[p10].connections);
while true do
local v43, v44 = v40(v41, v42);
if v43 then
else
break;
end;
v42 = v43;
v44:disconnect();
end;
end;
u1[p10] = {};
u1[p10].count = 0;
u1[p10].totalWeight = 0;
u1[p10].connections = {};
local u4 = true;
local v45, v46 = pcall(function()
u4 = game:GetService("StarterPlayer").AllowCustomAnimations;
end);
if not v45 then
u4 = true;
end;
local v47 = script:FindFirstChild(p10);
if u4 then
if v47 ~= nil then
table.insert(u1[p10].connections, v47.ChildAdded:connect(function(p12)
configureAnimationSet(p10, p11);
end));
table.insert(u1[p10].connections, v47.ChildRemoved:connect(function(p13)
configureAnimationSet(p10, p11);
end));
local v48 = 1;
local v49, v50, v51 = pairs(v47:GetChildren());
while true do
local v52, v53 = v49(v50, v51);
if v52 then
else
break;
end;
v51 = v52;
if v53:IsA("Animation") then
table.insert(u1[p10].connections, v53.Changed:connect(function(p14)
configureAnimationSet(p10, p11);
end));
u1[p10][v48] = {};
u1[p10][v48].anim = v53;
local l__Weight__54 = v53:FindFirstChild("Weight");
if l__Weight__54 == nil then
u1[p10][v48].weight = 1;
else
u1[p10][v48].weight = l__Weight__54.Value;
end;
u1[p10].count = u1[p10].count + 1;
u1[p10].totalWeight = u1[p10].totalWeight + u1[p10][v48].weight;
v48 = v48 + 1;
end;
end;
end;
end;
if u1[p10].count <= 0 then
local v55, v56, v57 = pairs(p11);
while true do
local v58, v59 = v55(v56, v57);
if v58 then
else
break;
end;
v57 = v58;
u1[p10][v58] = {};
u1[p10][v58].anim = Instance.new("Animation");
u1[p10][v58].anim.Name = p10;
u1[p10][v58].anim.AnimationId = v59.id;
u1[p10][v58].weight = v59.weight;
u1[p10].count = u1[p10].count + 1;
u1[p10].totalWeight = u1[p10].totalWeight + v59.weight;
end;
end;
local v60, v61, v62 = pairs(u1);
while true do
local v63, v64 = v60(v61, v62);
if v63 then
else
break;
end;
local l__count__65 = v64.count;
local v66 = 1 - 1;
while true do
l__Humanoid__2:LoadAnimation(v64[v66].anim);
if 0 <= 1 then
if v66 < l__count__65 then
else
break;
end;
elseif l__count__65 < v66 then
else
break;
end;
v66 = v66 + 1;
end;
end;
end;
local u5 = {
idle = { {
id = "http://www.roblox.com/asset/?id=507766666",
weight = 1
}, {
id = "http://www.roblox.com/asset/?id=507766951",
weight = 1
}, {
id = "http://www.roblox.com/asset/?id=507766388",
weight = 9
} },
walk = { {
id = "http://www.roblox.com/asset/?id=507777826",
weight = 10
} },
run = { {
id = "http://www.roblox.com/asset/?id=507767714",
weight = 10
} },
swim = { {
id = "http://www.roblox.com/asset/?id=507784897",
weight = 10
} },
swimidle = { {
id = "http://www.roblox.com/asset/?id=507785072",
weight = 10
} },
jump = { {
id = "http://www.roblox.com/asset/?id=507765000",
weight = 10
} },
fall = { {
id = "http://www.roblox.com/asset/?id=507767968",
weight = 10
} },
climb = { {
id = "http://www.roblox.com/asset/?id=507765644",
weight = 10
} },
sit = { {
id = "http://www.roblox.com/asset/?id=2506281703",
weight = 10
} },
toolnone = { {
id = "http://www.roblox.com/asset/?id=507768375",
weight = 10
} },
toolslash = { {
id = "http://www.roblox.com/asset/?id=522635514",
weight = 10
} },
toollunge = { {
id = "http://www.roblox.com/asset/?id=522638767",
weight = 10
} },
wave = { {
id = "http://www.roblox.com/asset/?id=507770239",
weight = 10
} },
point = { {
id = "http://www.roblox.com/asset/?id=507770453",
weight = 10
} },
dance = { {
id = "http://www.roblox.com/asset/?id=507771019",
weight = 10
}, {
id = "http://www.roblox.com/asset/?id=507771955",
weight = 10
}, {
id = "http://www.roblox.com/asset/?id=507772104",
weight = 10
} },
dance2 = { {
id = "http://www.roblox.com/asset/?id=507776043",
weight = 10
}, {
id = "http://www.roblox.com/asset/?id=507776720",
weight = 10
}, {
id = "http://www.roblox.com/asset/?id=507776879",
weight = 10
} },
dance3 = { {
id = "http://www.roblox.com/asset/?id=507777268",
weight = 10
}, {
id = "http://www.roblox.com/asset/?id=507777451",
weight = 10
}, {
id = "http://www.roblox.com/asset/?id=507777623",
weight = 10
} },
laugh = { {
id = "http://www.roblox.com/asset/?id=507770818",
weight = 10
} },
cheer = { {
id = "http://www.roblox.com/asset/?id=507770677",
weight = 10
} }
};
function scriptChildModified(p15)
local v67 = u5[p15.Name];
if v67 ~= nil then
configureAnimationSet(p15.Name, v67);
end;
end;
script.ChildAdded:connect(scriptChildModified);
script.ChildRemoved:connect(scriptChildModified);
for v68, v69 in pairs(u5) do
configureAnimationSet(v68, v69);
end;
local u6 = "";
local u7 = {
wave = false,
point = false,
dance = true,
dance2 = true,
dance3 = true,
laugh = false,
cheer = false
};
local u8 = false;
local u9 = nil;
local u10 = nil;
local u11 = nil;
local u12 = nil;
local u13 = nil;
function stopAllAnimations()
local v70 = u6;
if u7[v70] ~= nil then
if u7[v70] == false then
v70 = "idle";
end;
end;
if u8 then
v70 = "idle";
u8 = false;
end;
u6 = "";
u9 = nil;
if u10 ~= nil then
u10:disconnect();
end;
if u11 ~= nil then
u11:Stop();
u11:Destroy();
u11 = nil;
end;
if u12 ~= nil then
u12:disconnect();
end;
if u13 ~= nil then
u13:Stop();
u13:Destroy();
u13 = nil;
end;
return v70;
end;
local u14 = l__ScaleDampeningPercent__9;
function getHeightScale()
if l__Humanoid__2 then
else
return 1;
end;
if not l__Humanoid__2.AutomaticScalingEnabled then
return 1;
end;
local v71 = l__Humanoid__2.HipHeight / 2;
if u14 == nil then
u14 = script:FindFirstChild("ScaleDampeningPercent");
end;
if u14 ~= nil then
v71 = 1 + (l__Humanoid__2.HipHeight - 2) * u14.Value / 2;
end;
return v71;
end;
local function u15(p16)
local v72 = p16 * 1.25 / getHeightScale();
local v73 = 0.0001;
local v74 = 0.0001;
local v75 = v72 / 0.5;
local v76 = v72 / 1;
if v72 <= 0.5 then
v73 = 1;
elseif v72 < 1 then
local v77 = (v72 - 0.5) / 0.5;
v73 = 1 - v77;
v74 = v77;
v75 = 1;
v76 = 1;
else
v74 = 1;
end;
u11:AdjustWeight(v73);
u13:AdjustWeight(v74);
u11:AdjustSpeed(v75);
u13:AdjustSpeed(v76);
end;
local u16 = 1;
function setAnimationSpeed(p17)
if u6 == "walk" then
u15(p17);
return;
end;
if p17 ~= u16 then
u16 = p17;
u11:AdjustSpeed(u16);
end;
end;
local u17 = v3 or v4;
function keyFrameReachedFunc(p18)
if p18 == "End" then
if u6 == "walk" then
if u17 == true then
else
u13.TimePosition = 0;
u11.TimePosition = 0;
return;
end;
if u13.Looped ~= true then
u13.TimePosition = 0;
end;
if u11.Looped ~= true then
u11.TimePosition = 0;
return;
end;
else
local v78 = u6;
if u7[v78] ~= nil then
if u7[v78] == false then
v78 = "idle";
end;
end;
if u8 then
if u11.Looped then
return;
end;
v78 = "idle";
u8 = false;
end;
playAnimation(v78, 0.15, l__Humanoid__2);
setAnimationSpeed(u16);
end;
end;
end;
function rollAnimation(p19)
local v79 = math.random(1, u1[p19].totalWeight);
local v80 = 1;
while true do
if u1[p19][v80].weight < v79 then
else
break;
end;
v79 = v79 - u1[p19][v80].weight;
v80 = v80 + 1;
end;
return v80;
end;
local function u18(p20, p21, p22, p23)
if p20 ~= u9 then
if u11 ~= nil then
u11:Stop(p22);
u11:Destroy();
end;
if u13 ~= nil then
u13:Stop(p22);
u13:Destroy();
if u17 == true then
u13 = nil;
end;
end;
u16 = 1;
u11 = p23:LoadAnimation(p20);
u11.Priority = Enum.AnimationPriority.Core;
u11:Play(p22);
u6 = p21;
u9 = p20;
if u10 ~= nil then
u10:disconnect();
end;
u10 = u11.KeyframeReached:connect(keyFrameReachedFunc);
if p21 == "walk" then
u13 = p23:LoadAnimation(u1.run[rollAnimation("run")].anim);
u13.Priority = Enum.AnimationPriority.Core;
u13:Play(p22);
if u12 ~= nil then
u12:disconnect();
end;
u12 = u13.KeyframeReached:connect(keyFrameReachedFunc);
end;
end;
end;
function playAnimation(p24, p25, p26)
u18(u1[p24][rollAnimation(p24)].anim, p24, p25, p26);
u8 = false;
end;
function playEmote(p27, p28, p29)
u18(p27, p27.Name, p28, p29);
u8 = true;
end;
local u19 = "";
function toolKeyFrameReachedFunc(p30)
if p30 == "End" then
playToolAnimation(u19, 0, l__Humanoid__2);
end;
end;
local u20 = nil;
local u21 = nil;
local u22 = nil;
function playToolAnimation(p31, p32, p33, p34)
local l__anim__81 = u1[p31][rollAnimation(p31)].anim;
if u20 ~= l__anim__81 then
if u21 ~= nil then
u21:Stop();
u21:Destroy();
p32 = 0;
end;
u21 = p33:LoadAnimation(l__anim__81);
if p34 then
u21.Priority = p34;
end;
u21:Play(p32);
u19 = p31;
u20 = l__anim__81;
u22 = u21.KeyframeReached:connect(toolKeyFrameReachedFunc);
end;
end;
function stopToolAnimations()
if u22 ~= nil then
u22:disconnect();
end;
u19 = "";
u20 = nil;
if u21 ~= nil then
u21:Stop();
u21:Destroy();
u21 = nil;
end;
return u19;
end;
local u23 = v5 or v6;
local u24 = "Standing";
function onRunning(p35)
local v82 = u23;
if v82 then
v82 = u8 and l__Humanoid__2.MoveDirection == Vector3.new(0, 0, 0);
end;
if (v82 and l__Humanoid__2.WalkSpeed or 0.75) < p35 then
playAnimation("walk", 0.2, l__Humanoid__2);
setAnimationSpeed(p35 / 16);
u24 = "Running";
return;
end;
if u7[u6] == nil then
if not u8 then
playAnimation("idle", 0.2, l__Humanoid__2);
u24 = "Standing";
end;
end;
end;
function onDied()
u24 = "Dead";
end;
local u25 = 0;
function onJumping()
playAnimation("jump", 0.1, l__Humanoid__2);
u25 = 0.31;
u24 = "Jumping";
end;
function onClimbing(p36)
playAnimation("climb", 0.1, l__Humanoid__2);
setAnimationSpeed(p36 / 5);
u24 = "Climbing";
end;
function onGettingUp()
u24 = "GettingUp";
end;
function onFreeFall()
if u25 <= 0 then
playAnimation("fall", 0.2, l__Humanoid__2);
end;
u24 = "FreeFall";
end;
function onFallingDown()
u24 = "FallingDown";
end;
function onSeated()
u24 = "Seated";
end;
function onPlatformStanding()
u24 = "PlatformStanding";
end;
function onSwimming(p37)
if 1 < p37 then
else
playAnimation("swimidle", 0.4, l__Humanoid__2);
u24 = "Standing";
return;
end;
playAnimation("swim", 0.4, l__Humanoid__2);
setAnimationSpeed(p37 / 10);
u24 = "Swimming";
end;
local u26 = "None";
function animateTool()
if u26 == "None" then
playToolAnimation("toolnone", 0.1, l__Humanoid__2, Enum.AnimationPriority.Idle);
return;
end;
if u26 == "Slash" then
playToolAnimation("toolslash", 0, l__Humanoid__2, Enum.AnimationPriority.Action);
return;
end;
if u26 == "Lunge" then
else
return;
end;
playToolAnimation("toollunge", 0, l__Humanoid__2, Enum.AnimationPriority.Action);
end;
function getToolAnim(p38)
local v83, v84, v85 = ipairs(p38:GetChildren());
while true do
v83(v84, v85);
if v83 then
else
break;
end;
v85 = v83;
if v84.Name == "toolanim" then
if v84.className == "StringValue" then
return v84;
end;
end;
end;
return nil;
end;
local u27 = 0;
local u28 = 0;
function stepAnimate(p39)
u27 = p39;
if 0 < u25 then
u25 = u25 - (p39 - u27);
end;
if u24 == "FreeFall" then
if u25 <= 0 then
playAnimation("fall", 0.2, l__Humanoid__2);
else
if u24 == "Seated" then
playAnimation("sit", 0.5, l__Humanoid__2);
return;
end;
if u24 == "Running" then
playAnimation("walk", 0.2, l__Humanoid__2);
elseif u24 ~= "Dead" then
if u24 ~= "GettingUp" then
if u24 ~= "FallingDown" then
if u24 ~= "Seated" then
if u24 == "PlatformStanding" then
stopAllAnimations();
end;
else
stopAllAnimations();
end;
else
stopAllAnimations();
end;
else
stopAllAnimations();
end;
else
stopAllAnimations();
end;
end;
else
if u24 == "Seated" then
playAnimation("sit", 0.5, l__Humanoid__2);
return;
end;
if u24 == "Running" then
playAnimation("walk", 0.2, l__Humanoid__2);
elseif u24 ~= "Dead" then
if u24 ~= "GettingUp" then
if u24 ~= "FallingDown" then
if u24 ~= "Seated" then
if u24 == "PlatformStanding" then
stopAllAnimations();
end;
else
stopAllAnimations();
end;
else
stopAllAnimations();
end;
else
stopAllAnimations();
end;
else
stopAllAnimations();
end;
end;
local v86 = l__Parent__1:FindFirstChildOfClass("Tool");
if v86 then
if v86:FindFirstChild("Handle") then
else
stopToolAnimations();
u26 = "None";
u20 = nil;
u28 = 0;
return;
end;
else
stopToolAnimations();
u26 = "None";
u20 = nil;
u28 = 0;
return;
end;
local v87 = getToolAnim(v86);
if v87 then
u26 = v87.Value;
v87.Parent = nil;
u28 = p39 + 0.3;
end;
if u28 < p39 then
u28 = 0;
u26 = "None";
end;
animateTool();
end;
l__Humanoid__2.Died:connect(onDied);
l__Humanoid__2.Running:connect(onRunning);
l__Humanoid__2.Jumping:connect(onJumping);
l__Humanoid__2.Climbing:connect(onClimbing);
l__Humanoid__2.GettingUp:connect(onGettingUp);
l__Humanoid__2.FreeFalling:connect(onFreeFall);
l__Humanoid__2.FallingDown:connect(onFallingDown);
l__Humanoid__2.Seated:connect(onSeated);
l__Humanoid__2.PlatformStanding:connect(onPlatformStanding);
l__Humanoid__2.Swimming:connect(onSwimming);
game:GetService("Players").LocalPlayer.Chatted:connect(function(p40)
local v88 = "";
if string.sub(p40, 1, 3) == "/e " then
v88 = string.sub(p40, 4);
elseif string.sub(p40, 1, 7) == "/emote " then
v88 = string.sub(p40, 8);
end;
if u24 == "Standing" and u7[v88] ~= nil then
playAnimation(v88, 0.1, l__Humanoid__2);
end;
end);
local u29 = v7 or v8;
script:WaitForChild("PlayEmote").OnInvoke = function(p41)
if u24 ~= "Standing" then
return;
end;
if u7[p41] ~= nil then
playAnimation(p41, 0.1, l__Humanoid__2);
if u29 then
return true, u11;
else
return true;
end;
end;
if typeof(p41) ~= "Instance" or not p41:IsA("Animation") then
return false;
end;
playEmote(p41, 0.1, l__Humanoid__2);
if u29 then
return true, u11;
end;
return true;
end;
if l__Parent__1.Parent ~= nil then
playAnimation("idle", 0.1, l__Humanoid__2);
u24 = "Standing";
end;
while l__Parent__1.Parent ~= nil do
local v89, v90 = wait(0.1);
stepAnimate(v90);
end;
|
--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
--[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
--[[end;]] | --
local JeffTheKillerHumanoid;
for _,Child in pairs(JeffTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JeffTheKillerHumanoid=Child;
end;
end;
local AttackDebounce=false;
local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
local WalkDebounce=false;
local Notice=false;
local JeffLaughDebounce=false;
local MusicDebounce=false;
local NoticeDebounce=false;
local ChosenMusic;
function FindNearestBae()
local NoticeDistance=100;
local TargetMain;
for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("HumanoidRootPart")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
Spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
Wait(0.3);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(7000);
if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
end;
end;
Wait(0.1);
AttackDebounce=false;
end);
end;
end;
end;
end;
end;
return TargetMain;
end;
while Wait(0)do
local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
local Jumpable=false;
if Blockage then
Jumpable=true;
if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
local BlockageHumanoid;
for _,Child in pairs(Blockage.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
BlockageHumanoid=Child;
end;
end;
if Blockage and Blockage:IsA("Terrain")then
local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
if CellMaterial==Enum.CellMaterial.Water then
Jumpable=false;
end;
elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
Jumpable=false;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
JeffTheKillerHumanoid.Jump=true;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
Spawn(function()
WalkDebounce=true;
local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
if RayTarget then
local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
JeffTheKillerHeadFootStepClone:Play();
JeffTheKillerHeadFootStepClone:Destroy();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
Wait(0.5);
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
Wait(0.2);
end
end;
WalkDebounce=false;
end);
end;
local MainTarget=FindNearestBae();
local FoundHumanoid;
if MainTarget then
for _,Child in pairs(MainTarget.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
JeffTheKillerHumanoid.Jump=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
if not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
end;
end;
if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
local MusicChoice=math.random(1,2);
if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
end;
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
ChosenMusic.Volume=0.5;
ChosenMusic:Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
if not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
end;
end;
if not MainTarget and not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
if not MainTarget and not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
if MainTarget then
Notice=true;
if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
NoticeDebounce=true;
end
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
JeffTheKillerHumanoid.WalkSpeed=40;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=0.004;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
else
Notice=false;
NoticeDebounce=false;
local RandomWalk=math.random(1,150);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
if RandomWalk==1 then
JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="ColdBloodedKiller";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=10000;
JeffTheKillerHumanoid.JumpPower=70;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end; |
-- Public Constructors |
function RotatedRegion3.new(cframe, size)
local self = setmetatable({}, RotatedRegion3)
self.CFrame = cframe
self.Size = size
self.Shape = "Block"
self.Set = Vertices.Block(cframe, size/2)
self.Support = Supports.PointCloud
self.Centroid = cframe.p
self.AlignedRegion3 = Region3.new(worldBoundingBox(self.Set))
return self
end
RotatedRegion3.Block = RotatedRegion3.new
function RotatedRegion3.Wedge(cframe, size)
local self = setmetatable({}, RotatedRegion3)
self.CFrame = cframe
self.Size = size
self.Shape = "Wedge"
self.Set = Vertices.Wedge(cframe, size/2)
self.Support = Supports.PointCloud
self.Centroid = Vertices.GetCentroid(self.Set)
self.AlignedRegion3 = Region3.new(worldBoundingBox(self.Set))
return self
end
function RotatedRegion3.CornerWedge(cframe, size)
local self = setmetatable({}, RotatedRegion3)
self.CFrame = cframe
self.Size = size
self.Shape = "CornerWedge"
self.Set = Vertices.CornerWedge(cframe, size/2)
self.Support = Supports.PointCloud
self.Centroid = Vertices.GetCentroid(self.Set)
self.AlignedRegion3 = Region3.new(worldBoundingBox(self.Set))
return self
end
function RotatedRegion3.Cylinder(cframe, size)
local self = setmetatable({}, RotatedRegion3)
self.CFrame = cframe
self.Size = size
self.Shape = "Cylinder"
self.Set = {cframe, size/2}
self.Support = Supports.Cylinder
self.Centroid = cframe.p
self.AlignedRegion3 = Region3.new(worldBoundingBox(getCorners(unpack(self.Set))))
return self
end
function RotatedRegion3.Ball(cframe, size)
local self = setmetatable({}, RotatedRegion3)
self.CFrame = cframe
self.Size = size
self.Shape = "Ball"
self.Set = {cframe, size/2}
self.Support = Supports.Ellipsoid
self.Centroid = cframe.p
self.AlignedRegion3 = Region3.new(worldBoundingBox(getCorners(unpack(self.Set))))
return self
end
function RotatedRegion3.FromPart(part)
return RotatedRegion3[Vertices.Classify(part)](part.CFrame, part.Size)
end
|
--!strict |
local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type Object = types.Object
return function(t: Object | Array<any>): boolean
return table.isfrozen(t)
end
|
--[=[
@class Symbol
Represents a unique object.
Symbols are often used as unique keys in tables. This is useful to avoid possible collisions
with a key in a table, since the symbol will always be unique and cannot be reconstructed.
:::note All Unique
Every creation of a symbol is unique, even if the
given names are the same.
:::
```lua
local Symbol = require(packages.Symbol)
-- Create a symbol:
local symbol = Symbol("MySymbol")
-- The name is optional:
local anotherSymbol = Symbol()
-- Comparison:
print(symbol == symbol) --> true
-- All symbol constructions are unique, regardless of the name:
print(Symbol("Hello") == Symbol("Hello")) --> false
-- Commonly used as unique keys in a table:
local DATA_KEY = Symbol("Data")
local t = {
-- Can only be accessed using the DATA_KEY symbol:
[DATA_KEY] = {}
}
print(t[DATA_KEY]) --> {}
```
]=] |
local function Symbol(name: string?)
local symbol = newproxy(true)
if not name then
name = ""
end
getmetatable(symbol).__tostring = function()
return "Symbol(" .. name .. ")"
end
return symbol
end
return Symbol
|
--------| Reference |-------- |
local camera = game.Workspace.CurrentCamera
|
--This gets really messy and I'm not proud of it, however I'm keeping it in as players enjoy the classic morphs |
function module:OldMorphHandler(plr, char, morph, rigType)
local head = char.Head
if rigType == Enum.HumanoidRigType.R15 then
main:GetModule("cf"):ConvertCharacterToRig(plr, "R6")
char = plr.Character
end
for i,v in pairs(morph:GetChildren()) do
if v.ClassName == "Model" then
local body_type = "Nothing"
if v.Name == "Chest" then
body_type = "Torso"
elseif v.Name == "Arm1" then
body_type = "Left Arm"
elseif v.Name == "Arm2" then
body_type = "Right Arm"
elseif v.Name == "Leg1" then
body_type = "Left Leg"
elseif v.Name == "Leg2" then
body_type = "Right Leg"
end
local body_part = v:clone()
body_part.Parent = char
local C = body_part:GetChildren()
for i=1, #C do
if C[i].className == "Part" or C[i].className == "UnionOperation" then
local W = Instance.new("Weld")
W.Part0 = body_part.Middle
W.Part1 = C[i]
local CJ = CFrame.new(body_part.Middle.Position)
local C0 = body_part.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = body_part.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = char[body_type]
Y.Part1 = body_part.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0--]]
end
for a,b in pairs(body_part:GetChildren()) do
if b.ClassName == "Part" or b.ClassName == "UnionOperation" then
b.CanCollide = false
b.Anchored = false
end
if b.Name == "Face" then
char.Head.face.Texture = b.Decal.Texture
b:Destroy()
elseif b.Name == "Head" then
char.FakeHead.BrickColor = b.BrickColor
b:Destroy()
end
end
elseif v.Name == "FakeHead" then
if v:FindFirstChild("Decal") then
if char.Head:FindFirstChild("face") then
char.Head.face.Texture = v.Decal.Texture
end
end
head.BrickColor = v.BrickColor
head.Transparency = v.Transparency
for c,d in pairs(v:GetChildren()) do
if d.ClassName == "SpecialMesh" then
d:Clone().Parent = head
end
end
--
elseif v.ClassName == "CharacterMesh" then
v:Clone().Parent = char
v.Name = "CharacterMesh"
elseif v.ClassName == "Accessory" or v.ClassName == "Hat" then
local accessory = v:Clone()
accessory.Parent = char
if accessory:FindFirstChild("Handle") then
accessory.Handle.Anchored = false
end
end
end
if morph.Chest:FindFirstChild("Ab") then
for a,b in pairs(char:GetChildren()) do
if b.Name == "Left Arm" or b.Name == "Right Arm" or b.Name == "Left Leg" or b.Name == "Right Leg" then
b.Transparency = 0
b.BrickColor = head.BrickColor
elseif b.Name == "Torso" then
b.Transparency = 0
b.BrickColor = char.Chest.Ab.BrickColor
end
end
else
for a,b in pairs(char:GetChildren()) do
if b:IsA("BasePart") and b.Name ~= "FakeHead" and b.Name ~= "Radio" then
b.Transparency = 1
end
end
end
end
function module:AddExtraFeatures(plr, char, morph)
if morph:FindFirstChild("ExtraFeatures") then
local g = morph.ExtraFeatures:clone()
g.Name = "ExtraFeatures"
g.Parent = char
for a,b in pairs(g:GetChildren()) do
if b.className == "Part" or b.className == "UnionOperation" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = b
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = b.CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = char["Head"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
for a,b in pairs(g:GetChildren()) do
b.Anchored = false
b.CanCollide = false
end
end
end
local function setDeathEnabled(humanoid,value)
humanoid:SetStateEnabled("Dead",value)
wait()
if humanoid:FindFirstChild("SetDeathEnabled") then
local char = humanoid.Parent
local player = game.Players:GetPlayerFromCharacter(char)
if player then
pcall(function() humanoid.SetDeathEnabled:InvokeClient(player,value) end)
end
end
end
local function prepareJointVerifier(humanoid)
local verifyJoints = humanoid:FindFirstChild("VerifyJoints")
if not verifyJoints then
local disableDeath = Instance.new("RemoteFunction")
disableDeath.Name = "SetDeathEnabled"
disableDeath.Parent = humanoid
local validator = main.server.Assets.PackageValidator:Clone()
validator.Parent = humanoid
verifyJoints = Instance.new("RemoteFunction")
verifyJoints.Name = "VerifyJoints"
verifyJoints.Parent = humanoid
validator.Disabled = false
end
return verifyJoints
end
function module:Morph(plr, morph)
local humanoid = main:GetModule("cf"):GetHumanoid(plr)
if humanoid then
local char = plr.Character
local rigType = humanoid.RigType
local tag = char:FindFirstChild("CharTag")
if tag == nil or tag.Value ~= morph.Name then
module:ClearFakeBodyParts(char)
module:ClearCharacter(char)
if morph:FindFirstChild("Chest") then
module:OldMorphHandler(plr, char, morph, rigType)
char = plr.Character
else
----------------------------------------------------------------
local tag = Instance.new("StringValue")
tag.Name = "CharTag"
tag.Parent = char
--Humanoid
local model = morph:Clone()
local hum_values = {}
for a,b in pairs(model.Humanoid:GetChildren()) do
if b:IsA("NumberValue") then
hum_values[b.Name] = b.Value
end
end
for a,b in pairs(model:GetDescendants()) do
if b:IsA("BasePart") then
b.Anchored = false
end
end
model.Humanoid:Destroy()
----- << GET PACKAGE >>
local package = Instance.new("Folder")
local r15 = Instance.new("Folder")
r15.Name = "R15"
r15.Parent = package
for a,r15_part in pairs(model:GetChildren()) do
if r15_part:IsA("BasePart") and r15_part.Name ~= "Head" and r15_part.Name ~= "HumanoidRootPart" then
r15_part:Clone().Parent = r15
end
end
---- << APPLY PACKAGE >>
if rigType == Enum.HumanoidRigType.R15 then
local verifyJoints
local player = game.Players:GetPlayerFromCharacter(char)
if player then
verifyJoints = prepareJointVerifier(humanoid)
humanoid:UnequipTools()
end
local accessories = {}
for _,child in pairs(char:GetChildren()) do
if child:IsA("Accoutrement") then
child.Parent = nil
table.insert(accessories,child)
end
end
setDeathEnabled(humanoid,false)
for _,newLimb in pairs(package.R15:GetChildren()) do
local oldLimb = char:FindFirstChild(newLimb.Name)
if oldLimb then
newLimb.BrickColor = oldLimb.BrickColor
newLimb.CFrame = oldLimb.CFrame
oldLimb:Destroy()
end
newLimb.Parent = char
end
humanoid:BuildRigFromAttachments()
if player then
pcall(function ()
local attempts = 0
while attempts < 10 do
local success = verifyJoints:InvokeClient(player)
if success then
break
else
attempts = attempts + 1
end
end
if attempts == 10 then
warn("Failed to apply package to ",player)
end
end)
end
for _,accessory in pairs(accessories) do
accessory.Parent = char
end
setDeathEnabled(humanoid,true)
package:Destroy()
end
-- Clear
wait()
for a,b in pairs(char:GetChildren()) do
if b:IsA("Accessory") or b:IsA("Hat") or b:IsA("ForceField") or b:IsA("Clothing") or b.Name == "Body Colors" or b.ClassName == "ShirtGraphic" then
b:Destroy()
end
if b.Name == "Head" then
for c,d in pairs(b:GetChildren()) do
if d:IsA("SpecialMesh") then
--d:Destroy()
end
end
end
if b:FindFirstChild("BodyEffect") then
b.BodyEffect:Destroy()
end
end
-- Apply
if char:WaitForChild("Head"):FindFirstChild("face") then
char.Head.face:Destroy()
end
for a,b in pairs(hum_values) do
if char.Humanoid:FindFirstChild(a) == nil then
local val = Instance.new("NumberValue")
val.Name = a
val.Parent = char.Humanoid
end
char.Humanoid[a].Value = b
end
char.Head.Transparency = morph.Head.Transparency
tag.Value = morph.Name
if model.Head:FindFirstChild("face") then
model.Head.face.Parent = char.Head
end
--local scale = model.Head.Mesh.Scale
local plrMesh = char.Head:FindFirstChildOfClass("SpecialMesh")
if not plrMesh then
plrMesh = Instance.new("SpecialMesh")
plrMesh.Parent = char.Head
end
local headMesh = model.Head.Mesh
if headMesh then
if string.match(headMesh.MeshId, "%d") == nil then
plrMesh.MeshType = Enum.MeshType.Head
else
plrMesh.MeshId = headMesh.MeshId
end
plrMesh.TextureId = headMesh.TextureId
plrMesh.Offset = headMesh.Offset
plrMesh.Scale = headMesh.Scale
end
for a,b in pairs(model:GetChildren()) do
if b.Name == "Shirt" or b.Name == "Pants" or b.Name == "Body Colors" or b.ClassName == "ShirtGraphic" then
b.Parent = char
elseif b.Name == "face" then
b.Parent = char.Head
elseif b.ClassName == "Accessory" or b.ClassName == "Hat" then
humanoid:AddAccessory(b)
local handle = b:FindFirstChild("Handle")
if handle and handle:FindFirstChild("Mesh") == nil then
handle.Transparency = 1
end
elseif b:IsA("BasePart") then
if b:FindFirstChild("BodyEffect") then
b.BodyEffect:Clone().Parent = char.HumanoidRootPart
end
end
end
---------------------------
local modelRigType = Enum.HumanoidRigType.R15
if model:FindFirstChild("Torso") then
modelRigType = Enum.HumanoidRigType.R6
end
if rigType ~= modelRigType then
local function updateCorrespondingPart(cPart, mPart)
cPart.Transparency = mPart.Transparency
end
for r6Name, r15Table in pairs(correspondingBodyParts) do
local modelBodyPart = model:FindFirstChild(r6Name)
if modelBodyPart then
for i, correspondingPartName in pairs(r15Table) do
local correspondingPart = char:FindFirstChild(correspondingPartName)
if correspondingPart then
updateCorrespondingPart(correspondingPart, modelBodyPart)
end
end
else
local correspondingPart = char:FindFirstChild(r6Name)
if correspondingPart then
for i, modelBodyPartName in pairs(r15Table) do
local modelBodyPart = model:FindFirstChild(modelBodyPartName)
if modelBodyPart then
updateCorrespondingPart(correspondingPart, modelBodyPart)
end
end
end
end
end
end
module:UpdateHipHeight(char)
----------------------------------------------------------------
model:Destroy()
end
end
module:AddExtraFeatures(plr, char, morph)
if tag then
tag:Destroy()
end
------------------
if char.Head:FindFirstChild("face") == nil then
local decal = Instance.new("Decal")
decal.Name = "face"
decal.Texture = ""
decal.Parent = char.Head
end
if char then
if morph.Name == "Domo" or morph.Name == "Minion" or morph.Name == "MachoObliviousHD" or morph.Name == "Slender" or morph.Name == "EvilObliviousHD" or morph.Name == "BigMomma" then
char.Head.Transparency = 1
if char.Head:FindFirstChild("face") then
char.Head.face.Transparency = 1
end
else
char.Head.Transparency = 0
if char.Head:FindFirstChild("face") then
char.Head.face.Transparency = 0
end
end
if morph.Name == "Golden Bob" then
char.Head.Reflectance = 0.5
else
char.Head.Reflectance = 0
end
end
---------------
end
end |
-- Config variables |
local castLimit = 4 -- Number of times the module will recast if a non collided part is hit
local castDebug = false -- Creates red dots where raycasts hit
local dir = {}
local lastResult
local players = game:GetService("Players")
local defaultParams = RaycastParams.new()
defaultParams.FilterType = Enum.RaycastFilterType.Blacklist
defaultParams.IgnoreWater = true
dir.CastToTarget = function(origin,target,tolerance,distLimit,ignore,params)
local cParams
local hit = false
local result
local castCount = 0
local firstOrigin = origin
-- Set new arguments
if params then
cParams = params
else
cParams = defaultParams
end
if not distLimit then distLimit = 4000 end
-- Loop cast until target hit or hit nil
local direction = (target - origin).Unit
while castCount < castLimit and not hit do
castCount = castCount + 1
defaultParams.FilterDescendantsInstances = ignore
-- Too far away
if (firstOrigin - origin).Magnitude > distLimit then
break
end
result = workspace:Raycast(origin,direction * distLimit,defaultParams)
if result then lastResult = result end
if result and castDebug then
--print("Cast hit "..result.Instance.Name)
local dPart = Instance.new("Part")
dPart.Shape = Enum.PartType.Ball
dPart.Size = Vector3.new(0.4,0.4,0.4)
dPart.Anchored = true
dPart.Position = result.Position
dPart.CanCollide = false
dPart.Transparency = 0.5
dPart.Color = Color3.new(1, 0, 0)
dPart.Name = "Debug"
dPart.Parent = workspace
table.insert(ignore,dPart)
end
if not result then
-- Hit nil!
break
elseif result.Instance:IsA("Terrain") then
-- Hit terrain
hit = true
elseif result.Instance:IsA("BasePart") and not result.Instance.CanCollide then
-- Hit a part without collisions, recast
origin = result.Position
table.insert(ignore,result.Instance)
elseif (result.Instance:IsA("BasePart") and result.Instance.CanCollide) or result.Instance.Name == "Armor" then
-- Hit a part with collisions!
hit = true
end
end
if not hit then
if (origin - target).Magnitude < tolerance and lastResult then
return lastResult
else
return nil
end
else
if (result.Position - target).Magnitude < tolerance then
return result
end
end
end
return dir
|
--local Energia = PastaVar.Energia |
local Ferido = PastasStan.Ferido
local Caido = PastasStan.Caido
local Ragdoll = require(game.ReplicatedStorage.ACS_Engine.Modulos.Ragdoll)
local configuracao = require(game.ReplicatedStorage.ACS_Engine.ServerConfigs.Config)
local RS = game:GetService("RunService")
local debounce = false
|
--// Hash: 3c31d814e610c566c5bb39cdf2a4c1a58462fc9807524adfec0f0d743e6a3543423cabf7f8115130be5cd265da00a8a0
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {};
for v2, v3 in pairs(script:GetChildren()) do
v1[v3.Name] = v3;
end;
local u1 = require(script.Parent:WaitForChild("getLastWordFromPascalCase"));
function getConstraintTemplate(p1)
p1 = u1(p1);
return v1[p1] or v1.Default;
end;
function createConstraint(p2)
local l__Name__4 = p2.Joint.Name;
local v5 = getConstraintTemplate(l__Name__4):Clone();
v5.Attachment0 = p2.Attachment0;
v5.Attachment1 = p2.Attachment1;
v5.Name = l__Name__4 .. "RagdollConstraint";
local v6 = Instance.new("ObjectValue", v5);
v6.Name = "RigidJoint";
v6.Value = p2.Joint;
return v5;
end;
return function(p3)
local v7 = Instance.new("Folder");
v7.Name = "RagdollConstraints";
for v8, v9 in pairs(p3) do
if v9.Joint.Name ~= "Root" then
createConstraint(v9).Parent = v7;
end;
end;
return v7;
end;
|
-- declarations |
local Figure = script.Parent
local Head = Figure:WaitForChild("Head")
local Humanoid = Figure:WaitForChild("Humanoid")
local regening = false
|
-- Services |
local StarterGui = game:GetService("StarterGui")
|
-- make a splat |
for i=1,3 do
local s = Instance.new("Part")
s.Shape = 1 -- block
s.formFactor = 2 -- plate
s.Size = Vector3.new(1,.4,1)
s.BrickColor = col
local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
s.Velocity = 15 * v
s.CFrame = CFrame.new(ball.Position + v, v)
ball.BrickCleanup:clone().Parent = s
s.BrickCleanup.Disabled = false
s.Parent = game.Workspace
end
if humanoid then
if game.Players:FindFirstChild(humanoid.Parent.Name).TeamColor~=ball.BrickColor then
tagHumanoid(humanoid)
humanoid:TakeDamage(damage)
wait(2)
untagHumanoid(humanoid)
end
end
connection:disconnect()
ball.Parent = nil
end
function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
connection = ball.Touched:connect(onTouched)
wait(8)
ball.Parent = nil
|
-- elseif key == "u" then --Window controls
-- windows = not windows
-- rad(windows) |
elseif key == "[" then -- volume down
if st then
carSeat.CCS.Value = carSeat.CCS.Value-1
else
handler:FireServer('updateVolume', -0.5)
end
elseif key == "g" then -- volume up
handler:FireServer('sr')
elseif key == "]" then -- volume up
if st then
carSeat.CCS.Value = carSeat.CCS.Value+1
else
handler:FireServer('updateVolume', 0.5)
end
elseif key == "u" then --Mode Screen Switch
swap()
elseif key:byte() == 48 then -- CC
st = true
end
end)
mouse.KeyUp:connect(function (key)
key = string.lower(key)
if key:byte() == 48 then --Camera controls
st = false
end
end)
for i,v in pairs(HB:GetChildren()) do
if v:IsA('ImageButton') then
v.MouseButton1Click:connect(function()
if carSeat.Windows:FindFirstChild(v.Name) then
local v = carSeat.Windows:FindFirstChild(v.Name)
if v.Value == true then
handler:FireServer('updateWindows', v.Name, false)
else
handler:FireServer('updateWindows', v.Name, true)
end
end
end)
end
end
for i,v in pairs(HUB.Windows:GetChildren()) do
if v:IsA('ImageButton') then
v.MouseButton1Click:connect(function()
if carSeat.Windows:FindFirstChild(v.Name) then
local v = carSeat.Windows:FindFirstChild(v.Name)
if v.Value == true then
handler:FireServer('updateWindows', v.Name, false)
else
handler:FireServer('updateWindows', v.Name, true)
end
end
end)
end
end
HUB.Misc.CC.MouseButton1Click:connect(function()
carSeat.CC.Value = not carSeat.CC.Value
carSeat.CCS.Value = math.floor(carSeat.Velocity.Magnitude*mph)
end)
HUB.Misc.W.MouseButton1Click:connect(function()
handler:FireServer('wws',carSeat.WS.Value,st)
handler:FireServer('wwr',carSeat.WS.Value,st)
end)
HUB.Misc.SS.MouseButton1Click:connect(function()
carSeat.SST.Value = not carSeat.SST.Value
end)
|
--script.Parent.CanCollide = true |
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then
tagHumanoid(humanoid)
humanoid.Health = humanoid.Health - 10
untagHumanoid(humanoid)
connection:disconnect()
else
damage = damage / 2
if damage < 2 then
connection:disconnect()
ball.Parent = nil
end
end
if math.random(1,1) == 1 then
explosion = Instance.new("Explosion")
explosion.BlastRadius = 5
explosion.BlastPressure = 50000 -- these are really wussy units
explosion.Position = script.Parent.Position
explosion.Parent = game.Workspace
connection:disconnect()
ball.Parent = nil
end
end
function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
connection = ball.Touched:connect(onTouched)
r = game:service("RunService")
t, s = r.Stepped:wait()
d = t + 5.0 - s
while t < d do
t = r.Stepped:wait()
end
ball.Parent = nil
|
--[[
MouseLockController - Replacement for ShiftLockController, manages use of mouse-locked mode
2018 Camera Update - AllYourBlox
--]] | |
--local configs = workspace:WaitForChild("Configuration", 10)
--local hasModel = configs:FindFirstChild("hasC4Model") | |
-- MODULES --
--local fallService = require(script.Parent:WaitForChild("FallService")) |
local miscModule = require(Modules:WaitForChild("Misc"))
|
--// Event Connections |
L_118_.OnClientEvent:connect(function(L_332_arg1, L_333_arg2)
if L_332_arg1 ~= L_2_ then
local L_334_ = L_332_arg1.Character
local L_335_ = L_334_.AnimBase.AnimBaseW
local L_336_ = L_335_.C1
if L_333_arg2 then
L_133_(L_335_, nil , L_334_.Head.CFrame, function(L_337_arg1)
return math.sin(math.rad(L_337_arg1))
end, 0.25)
elseif not L_333_arg2 then
L_133_(L_335_, nil , L_336_, function(L_338_arg1)
return math.sin(math.rad(L_338_arg1))
end, 0.25)
end
end
end)
L_121_.OnClientEvent:connect(function(L_339_arg1, L_340_arg2)
if L_42_ and L_340_arg2 ~= L_2_ and L_24_.CanCallout then
if (L_3_.HumanoidRootPart.Position - L_339_arg1).magnitude <= 10 then
L_41_.Visible = true
local L_341_ = ScreamCalculation()
if L_341_ then
if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then
L_122_:FireServer(L_7_.AHH, L_100_[math.random(0, 21)])
end
end
L_14_:Create(L_41_, TweenInfo.new(0.1), {
BackgroundTransparency = 0.4
}):Play()
delay(0.1, function()
L_14_:Create(L_41_, TweenInfo.new(3), {
BackgroundTransparency = 1
}):Play()
end)
end
end
end)
|
-- @moduledescription Manage all the player, if they are ready or not |
local module = {}
local System = require(game.ReplicatedStorage.System) :: any
module.OnReady = System.Signal.new()
function module.Init()
System.Remotes.ConnectEvent("Ready", function(plr)
print(plr, "is ready!")
local Player = System.Player.Get(plr)
Player.Ready = true
System.Entity.ReplicateToNewPlayer(plr)
Player:OnDeath(true)
end)
game.Players.PlayerRemoving:Connect(function(p)
local plr = System.Player.Get(p)
if not plr then return end
print(plr:ToString(), "Left")
plr:Destroy()
end)
end
return module
|
-- Class |
local MaidClass = {}
MaidClass.__index = MaidClass
MaidClass.__type = "Maid"
function MaidClass:__tostring()
return MaidClass.__type
end
|
-- Check when player is typing in chat or typing in general (this was originally setting _L.Typing instead of _L.Variables.Typing for 2 years LMFAO oops) |
_L.Services.UserInputService.TextBoxFocused:Connect(function(textBox)
_L.Variables.Typing = true
if textBox:IsDescendantOf(_L.Player.Chat) then
_L.Variables.Chatting = true
end
end)
_L.Services.UserInputService.TextBoxFocusReleased:Connect(function(textBox)
_L.Variables.Typing = false
if textBox:IsDescendantOf(_L.Player.Chat) then
_L.Variables.Chatting = false
end
end)
|
-- NOTE: To me, this appears a bit 'hackish' so I can't
-- promise that it will always work! |
local noJump = script.NoJump:Clone()
script.NoJump:Destroy()
function CharacterSpawned(char)
local noJ = noJump:Clone()
noJ.Parent = char
delay(0.2, function()
noJ.Disabled = false
end)
end
function PlayerEntered(player)
player.CharacterAdded:connect(CharacterSpawned)
end
for _,v in pairs(game.Players:GetPlayers()) do PlayerEntered(v) end
game.Players.PlayerAdded:connect(PlayerEntered)
|
--[[
-----------[ THEMES ]-----------
- LIGHT MODE:
If you want the light theme version of the board,
replace line 1 with:
require(2925075326).Parent = script.Parent
- DARK MODE:
If you want the dark theme version of the board,
replace line 1 with:
require(5799918029).Parent = script.Parent
- RAINBOW THEME [Light Mode]:
If you want the rainbow theme version of the board,
replace line 1 with:
require(6872314867).Parent = script.Parent
- RAINBOW THEME [Dark Mode]:
If you want the rainbow theme version of the board,
replace line 1 with:
require(7509666388).Parent = script.Parent
- FALL THEME [Light Mode]:
If you want the rainbow theme version of the board,
replace line 1 with:
require(7509600424).Parent = script.Parent
- FALL THEME [Dark Mode]:
If you want the rainbow theme version of the board,
replace line 1 with:
require(7509567360).Parent = script.Parent
--]] | |
-- Every valid configuration value should be non-nil in the config table. |
function Config.new(defaultConfig)
local self = {}
self.defaultConfig = defaultConfig
self.defaultConfigKeys = {}
for key in pairs(defaultConfig) do
table.insert(self.defaultConfigKeys, key)
end
self._currentConfig = setmetatable({}, {
__index = function(_, key)
local message = (
"Invalid global configuration key %q. Valid configuration keys are: %s"
):format(
tostring(key),
table.concat(self.defaultConfigKeys, ", ")
)
error(message, 3)
end
})
-- We manually bind these methods here so that the Config's methods can be
-- used without passing in self, since they could get exposed on the
-- root object.
self.set = function(...)
return Config.set(self, ...)
end
self.get = function(...)
return Config.get(self, ...)
end
self.scoped = function(...)
return Config.scoped(self, ...)
end
self.set(defaultConfig)
return self
end
function Config:set(configValues)
-- Validate values without changing any configuration.
-- We only want to apply this configuration if it's valid!
for key, value in pairs(configValues) do
if self.defaultConfig[key] == nil then
local message = (
"Invalid global configuration key %q (type %s). Valid configuration keys are: %s"
):format(
tostring(key),
typeof(key),
table.concat(self.defaultConfigKeys, ", ")
)
error(message, 3)
end
-- Right now, all configuration values must be boolean.
if typeof(value) ~= "boolean" then
local message = (
"Invalid value %q (type %s) for global configuration key %q. Valid values are: true, false"
):format(
tostring(value),
typeof(value),
tostring(key)
)
error(message, 3)
end
self._currentConfig[key] = value
end
end
function Config:get()
return self._currentConfig
end
return Config
|
--- Skill |
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = false
Tool.Active.Value = "FireBomb"
wait(0.1)
Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
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)
|
--// Processing |
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server
local service = Vargs.Service
local Commands, Decrypt, Encrypt, UnEncrypted, AddLog, TrackTask, Pcall
local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings, Defaults
local function Init()
Functions = server.Functions;
Admin = server.Admin;
Anti = server.Anti;
Core = server.Core;
HTTP = server.HTTP;
Logs = server.Logs;
Remote = server.Remote;
Process = server.Process;
Variables = server.Variables;
Settings = server.Settings;
Defaults = server.Defaults
Commands = Remote.Commands
Decrypt = Remote.Decrypt
Encrypt = Remote.Encrypt
UnEncrypted = Remote.UnEncrypted
AddLog = Logs.AddLog
TrackTask = service.TrackTask
Pcall = server.Pcall
--// NetworkServer Events
if service.NetworkServer then
service.RbxEvent(service.NetworkServer.ChildAdded, server.Process.NetworkAdded)
service.RbxEvent(service.NetworkServer.DescendantRemoving, server.Process.NetworkRemoved)
end
Process.Init = nil
AddLog("Script", "Processing Module Initialized")
end;
local function RunAfterPlugins(data)
local existingPlayers = service.Players:GetPlayers()
--// Events
service.RbxEvent(service.Players.PlayerAdded, service.EventTask("PlayerAdded", Process.PlayerAdded))
service.RbxEvent(service.Players.PlayerRemoving, service.EventTask("PlayerRemoving", Process.PlayerRemoving))
--// Load client onto existing players
if existingPlayers then
for i, p in ipairs(existingPlayers) do
Core.LoadExistingPlayer(p)
end
end
service.TrackTask("Thread: ChatCharacterLimit", function()
local ChatModules = service.Chat:WaitForChild("ClientChatModules", 5)
if ChatModules then
local ChatSettings = ChatModules:WaitForChild("ChatSettings", 5)
if ChatSettings then
local success, ChatSettingsModule = pcall(function()
return require(ChatSettings)
end)
if success then
local NewChatLimit = ChatSettingsModule.MaximumMessageLength
if NewChatLimit and type(NewChatLimit) == "number" then
Process.MaxChatCharacterLimit = NewChatLimit
AddLog("Script", "Chat Character Limit automatically set to " .. NewChatLimit)
end
else
AddLog("Script", "Failed to automatically get ChatSettings Character Limit, ignore if you use a custom chat system")
end
end
end
end)
Process.RunAfterPlugins = nil
AddLog("Script", "Process Module RunAfterPlugins Finished")
end
local RateLimiter = {
Remote = {};
Command = {};
Chat = {};
CustomChat = {};
RateLog = {};
}
local function RateLimit(p, typ)
if p and type(p) == "userdata" and p:IsA("Player") then
local ready = (not RateLimiter[typ][p.UserId] or (RateLimiter[typ][p.UserId] and time() - RateLimiter[typ][p.UserId] >= server.Process.RateLimits[typ]));
RateLimiter[typ][p.UserId] = time()
return ready
else
return true
end
end
server.Process = {
Init = Init;
RunAfterPlugins = RunAfterPlugins;
RateLimit = RateLimit;
MsgStringLimit = 500; --// Max message string length to prevent long length chat spam server crashing (chat & command bar); Anything over will be truncated;
MaxChatCharacterLimit = 250; --// Roblox chat character limit; The actual limit of the Roblox chat's textbox is 200 characters; I'm paranoid so I added 50 characters; Users should not be able to send a message larger than that;
RateLimits = {
Remote = 0.01;
Command = 0.1;
Chat = 0.1;
CustomChat = 0.1;
RateLog = 10;
};
Remote = function(p, cliData, com, ...)
local key = tostring(p.UserId)
local keys = Remote.Clients[key]
if p and p:IsA("Player") then
if not com or type(com) ~= "string" or #com > 50 or cliData == "BadMemes" or com == "BadMemes" then
Anti.Detected(p, "Kick", (tostring(com) ~= "BadMemes" and tostring(com)) or tostring(select(1, ...)))
elseif cliData and type(cliData) ~= "table" then
Anti.Detected(p, "Kick", "Invalid Client Data (r10002)")
--elseif cliData and keys and cliData.Module ~= keys.Module then
-- Anti.Detected(p, "Kick", "Invalid Client Module (r10006)")
else
local args = {...}
local rateLimitCheck = RateLimit(p, "Remote")
if keys then
keys.LastUpdate = os.time()
keys.Received += 1
if type(com) == "string" then
if com == keys.Special.."GET_KEY" then
if keys.LoadingStatus == "WAITING_FOR_KEY" then
Remote.Fire(p,keys.Special.."GIVE_KEY",keys.Key)
keys.LoadingStatus = "LOADING"
keys.RemoteReady = true
AddLog("Script", string.format("%s requested client keys", p.Name))
--else
--Anti.Detected(p, "kick","Communication Key Error (r10003)")
end
AddLog("RemoteFires", {
Text = p.Name.." requested key from server",
Desc = "Player requested key from server",
Player = p;
})
elseif UnEncrypted[com] then
AddLog("RemoteFires", {
Text = p.Name.." fired "..tostring(com),
Desc = "Player fired unencrypted remote command "..com,
Player = p;
})
return {UnEncrypted[com](p,...)}
elseif rateLimitCheck and string.len(com) <= Remote.MaxLen then
local comString = Decrypt(com, keys.Key, keys.Cache)
local command = (cliData.Mode == "Get" and Remote.Returnables[comString]) or Remote.Commands[comString]
AddLog("RemoteFires", {
Text = p.Name.." fired "..tostring(comString).."; Arg1: "..tostring(args[1]),
Desc = "Player fired remote command "..comString.."; "..Functions.ArgsToString(args),
Player = p;
})
if command then
local rets = {TrackTask("Remote: ".. p.Name ..": ".. tostring(comString), command, p, args)}
if not rets[1] then
logError(p, tostring(comString) .. ": ".. tostring(rets[2]))
else
return {unpack(rets, 2)}
end
else
Anti.Detected(p, "Kick", "Invalid Remote Data (r10004)")
end
elseif rateLimitCheck and RateLimit(p, "RateLog") then
Anti.Detected(p, "Log", string.format("Firing RemoteEvent too quickly (>Rate: %s/sec)", 1/Process.RateLimits.Remote));
warn(string.format("%s is firing Adonis's RemoteEvent too quickly (>Rate: %s/sec)", p.Name, 1/Process.RateLimits.Remote));
end
else
Anti.Detected(p, "Log", "Out of Sync (r10005)")
end
end
end
end
end;
Command = function(p, msg, opts, noYield)
opts = opts or {}
if Admin.IsBlacklisted(p) then
return false
end
if #msg > Process.MsgStringLimit and type(p) == "userdata" and p:IsA("Player") and not Admin.CheckAdmin(p) then
msg = string.sub(msg, 1, Process.MsgStringLimit);
end
msg = Functions.Trim(msg)
if string.match(msg, Settings.BatchKey) then
for cmd in string.gmatch(msg,'[^'..Settings.BatchKey..']+') do
cmd = Functions.Trim(cmd)
local waiter = Settings.PlayerPrefix.."wait"
if string.sub(string.lower(cmd), 1, #waiter) == waiter then
local num = string.sub(cmd, #waiter + 1)
if num and tonumber(num) then
wait(tonumber(num))
end
else
Process.Command(p, cmd, opts, false)
end
end
else
local pData = opts.PlayerData or (p and Core.GetPlayer(p));
msg = (pData and Admin.AliasFormat(pData.Aliases, msg)) or msg;
if string.match(msg, Settings.BatchKey) then
Process.Command(p, msg, opts, false)
else
local index, command, matched = Admin.GetCommand(msg)
if not command then
if opts.Check then
Remote.MakeGui(p, "Output", {
Title = "Output";
Message = msg .. " is not a valid command.";
})
return
end
else
local allowed = false
local isSystem = false
local pDat = {
Player = opts.Player or p;
Level = opts.AdminLevel or Admin.GetLevel(p);
isDonor = opts.IsDonor or (Admin.CheckDonor(p) and (Settings.DonorCommands or command.AllowDonors));
}
if opts.isSystem or p == "SYSTEM" then
isSystem = true
allowed = true
p = p or "SYSTEM"
else
allowed = Admin.CheckPermission(pDat, command)
end
if opts.CrossServer and command.CrossServerDenied then
allowed = false;
end
if allowed and Variables.IsStudio and command.NoStudio then
Remote.MakeGui(p, "Output", {
Title = "";
Message = "This command cannot be used in Roblox Studio.";
Color = Color3.new(1, 0, 0);
})
return
end
if allowed and opts.Chat and command.Chattable == false then
Remote.MakeGui(p, "Output", {
Title = "";
Color = Color3.new(1, 0, 0);
Message = "Specified command not permitted as chat message (Command not chattable)";
})
return
end
if allowed then
if not command.Disabled then
local argString = string.match(msg, "^.-"..Settings.SplitKey..'(.+)') or ""
local cmdArgs = command.Args or command.Arguments
local args = (opts.Args or opts.Arguments) or (#cmdArgs > 0 and Functions.Split(argString, Settings.SplitKey, #cmdArgs)) or {}
local taskName = "Command:: ".. p.Name ..": ("..msg..")"
if #args > 0 and not isSystem and command.Filter or opts.Filter then
local safe = {
plr = true;
plrs = true;
username = true;
usernames = true;
players = true;
player = true;
users = true;
user = true;
brickcolor = true;
}
for i, arg in pairs(args) do
if not (cmdArgs[i] and safe[string.lower(cmdArgs[i])]) then
args[i] = service.LaxFilter(arg, p)
end
end
end
if opts.CrossServer or (not isSystem and not opts.DontLog) then
AddLog("Commands", {
Text = ((opts.CrossServer and "[CRS_SERVER] ") or "") .. p.Name;
Desc = matched .. Settings.SplitKey .. table.concat(args, Settings.SplitKey);
Player = p;
})
if Settings.ConfirmCommands then
Functions.Hint("Executed Command: [ "..msg.." ]", {p})
end
end
if noYield then
taskName = "Thread: " .. taskName
end
local ran, error = TrackTask(taskName,
command.Function,
p,
args,
{
PlayerData = pDat,
Options = opts
}
)
if not opts.IgnoreErrors then
if error and type(error) == "string" then
AddLog("Errors", (command.Commands[1] or "Unknown command?") .. " " .. error)
error = (error and string.match(error, ":(.+)$")) or error or "Unknown error"
if not isSystem then
Remote.MakeGui(p, 'Output', {
Title = '',
Message = error,
Color = Color3.new(1, 0, 0)
})
end
elseif error and type(error) ~= "string" and error ~= true then
if not isSystem then
Remote.MakeGui(p,"Output", {
Title = "";
Message = "There was an error but the error was not a string? "..tostring(error);
Color = Color3.new(1, 0, 0);
})
end
end
end
service.Events.CommandRan:Fire(p, {
Message = msg,
Matched = matched,
Args = args,
Command = command,
Index = index,
Success = ran,
Error = error,
Options = opts,
PlayerData = pDat
})
else
if not isSystem and not opts.NoOutput then
Remote.MakeGui(p, "Output", {
Title = "";
Message = "This command has been disabled.";
Color = Color3.new(1, 0, 0);
})
end
end
else
if not isSystem and not opts.NoOutput then
Remote.MakeGui(p, "Output", {
Title = "";
Message = "You are not allowed to run " .. msg;
Color = Color3.new(1, 0, 0);
})
end
return;
end
end
end
end
end;
CrossServerChat = function(data)
if data then
for _, v in pairs(service.GetPlayers()) do
if Admin.GetLevel(v) > 0 then
Remote.Send(v, "handler", "ChatHandler", data.Player, data.Message, "Cross")
end
end
end
end;
CustomChat = function(p, a, b, canCross)
if RateLimit(p, "CustomChat") and not Admin.IsMuted(p) then
if type(a) == "string" then
a = string.sub(a, 1, Process.MsgStringLimit)
end
if b == "Cross" then
if canCross and Admin.CheckAdmin(p) then
Core.CrossServer("ServerChat", {Player = p.Name, Message = a})
--Core.SetData("CrossServerChat",{Player = p.Name, Message = a})
end
else
local target = Settings.SpecialPrefix..'all'
if not b then
b = 'Global'
end
if not service.Players:FindFirstChild(p.Name) then
b='Nil'
end
if string.sub(a,1,1)=='@' then
b='Private'
target,a=string.match(a,'@(.%S+) (.+)')
Remote.Send(p,'Function','SendToChat',p,a,b)
elseif string.sub(a,1,1)=='#' then
if string.sub(a,1,7)=='#ignore' then
target=string.sub(a,9)
b='Ignore'
end
if string.sub(a,1,9)=='#unignore' then
target=string.sub(a,11)
b='UnIgnore'
end
end
for _, v in pairs(service.GetPlayers(p, target, {
DontError = true;
})) do
local a = service.Filter(a, p, v)
if p.Name == v.Name and b ~= "Private" and b ~= "Ignore" and b ~= "UnIgnore" then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Global" then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Team" and p.TeamColor == v.TeamColor then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Local" and p:DistanceFromCharacter(v.Character.Head.Position) < 80 then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Admins" and Admin.CheckAdmin(p) then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Private" and v.Name ~= p.Name then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Nil" then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
--[[elseif b == 'Ignore' and v.Name ~= p.Name then
Remote.Send(v,'AddToTable','IgnoreList',v.Name)
elseif b == 'UnIgnore' and v.Name ~= p.Name then
Remote.Send(v,'RemoveFromTable','IgnoreList',v.Name)--]]
end
end
end
service.Events.CustomChat:Fire(p,a,b)
elseif RateLimit(p, "RateLog") then
Anti.Detected(p, "Log", string.format("CustomChatting too quickly (>Rate: %s/sec)", 1/Process.RateLimits.Chat))
warn(string.format("%s is CustomChatting too quickly (>Rate: %s/sec)", p.Name, 1/Process.RateLimits.Chat))
end
end;
Chat = function(p, msg)
if RateLimit(p, "Chat") then
local isMuted = Admin.IsMuted(p);
if utf8.len(utf8.nfcnormalize(msg)) > Process.MaxChatCharacterLimit and not Admin.CheckAdmin(p) then
Anti.Detected(p, "Kick", "Chatted message over the maximum character limit")
elseif not isMuted then
local msg = string.sub(msg, 1, Process.MsgStringLimit)
local filtered = service.LaxFilter(msg, p)
AddLog(Logs.Chats, {
Text = p.Name..": " .. tostring(filtered);
Desc = tostring(filtered);
Player = p;
})
if Settings.ChatCommands then
if Admin.DoHideChatCmd(p, msg) then
Remote.Send(p,"Function","ChatMessage","> "..msg,Color3.new(1, 1, 1))
Process.Command(p, msg, {Chat = true;})
elseif string.sub(msg, 1, 3)=="/e " then
service.Events.PlayerChatted:Fire(p, msg)
msg = string.sub(msg, 4)
Process.Command(p, msg, {Chat = true;})
elseif string.sub(msg, 1, 8)=="/system " then
service.Events.PlayerChatted:Fire(p, msg)
msg = string.sub(msg, 9)
Process.Command(p, msg, {Chat = true;})
else
service.Events.PlayerChatted:Fire(p, msg)
Process.Command(p, msg, {Chat = true;})
end
else
service.Events.PlayerChatted:Fire(p, msg)
end
elseif isMuted then
local msg = string.sub(msg, 1, Process.MsgStringLimit);
local filtered = service.LaxFilter(msg, p)
AddLog(Logs.Chats, {
Text = "[MUTED] ".. p.Name ..": "..tostring(filtered);
Desc = tostring(filtered);
Player = p;
})
end
elseif RateLimit(p, "RateLog") then
Anti.Detected(p, "Log", string.format("Chatting too quickly (>Rate: %s/sec)", 1/Process.RateLimits.Chat))
warn(string.format("%s is chatting too quickly (>Rate: %s/sec)", p.Name, 1/Process.RateLimits.Chat))
end
end;
--[==[
WorkspaceChildAdded = function(c)
--[[if c:IsA("Model") then
local p = service.Players:GetPlayerFromCharacter(c)
if p then
service.TrackTask(p.Name..": CharacterAdded", Process.CharacterAdded, p)
end
end
-- Moved to PlayerAdded handler
--]]
end;
LogService = function(Message, Type)
--service.Events.Output:Fire(Message, Type)
end;
ErrorMessage = function(Message, Trace, Script)
--[[if Running then
service.Events.ErrorMessage:Fire(Message, Trace, Script)
if Message:lower():find("adonis") or Message:find(script.Name) then
logError(Message)
end
end--]]
end;
]==]
PlayerAdded = function(p)
AddLog("Script", "Doing PlayerAdded Event for ".. p.Name)
local key = tostring(p.UserId)
local keyData = {
Player = p;
Key = Functions.GetRandom();
Cache = {};
Sent = 0;
Received = 0;
LastUpdate = os.time();
FinishedLoading = false;
LoadingStatus = "WAITING_FOR_KEY";
--Special = Core.MockClientKeys and Core.MockClientKeys.Special;
--Module = Core.MockClientKeys and Core.MockClientKeys.Module;
}
Core.PlayerData[key] = nil
Remote.Clients[key] = keyData
local ran, err = Pcall(function()
Routine(function()
if Anti.UserSpoofCheck(p) then
Remote.Clients[key] = nil;
Anti.Detected(p, "kick", "Username Spoofing");
end
end)
local PlayerData = Core.GetPlayer(p)
local level = Admin.GetLevel(p)
local banned, reason = Admin.CheckBan(p)
if banned then
Remote.Clients[key] = nil;
p:Kick(string.format("%s | Reason: %s", Variables.BanMessage, (reason or "No reason provided")))
return "REMOVED"
end
if Variables.ServerLock and level < 1 then
Remote.Clients[key] = nil;
p:Kick(Variables.LockMessage or "::Adonis::\nServer Locked")
return "REMOVED"
end
if Variables.Whitelist.Enabled then
local listed = false
local CheckTable = Admin.CheckTable
for listName, list in pairs(Variables.Whitelist.Lists) do
if CheckTable(p, list) then
listed = true
break;
end
end
if not listed and level == 0 then
Remote.Clients[key] = nil;
p:Kick(Variables.LockMessage or "::Adonis::\nWhitelist Enabled")
return "REMOVED"
end
end
end)
if not ran then
AddLog("Errors", p.Name .." PlayerAdded Failed: ".. tostring(err))
warn("~! :: Adonis :: SOMETHING FAILED DURING PLAYERADDED:")
warn(tostring(err))
end
if Remote.Clients[key] then
Core.HookClient(p)
AddLog("Script", {
Text = p.Name .. " loading started";
Desc = p.Name .. " successfully joined the server";
})
AddLog("Joins", {
Text = p.Name;
Desc = p.Name.." joined the server";
Player = p;
})
--// Get chats
p.Chatted:Connect(function(msg)
local ran, err = TrackTask(p.Name .. "Chatted", Process.Chat, p, msg)
if not ran then
logError(err);
end
end)
--// Character added
p.CharacterAdded:Connect(function(...)
local ran, err = TrackTask(p.Name .. "CharacterAdded", Process.CharacterAdded, p, ...)
if not ran then
logError(err);
end
end)
delay(600, function()
if p.Parent and Core.PlayerData[key] and Remote.Clients[key] and Remote.Clients[key] == keyData and keyData.LoadingStatus ~= "READY" then
AddLog("Script", {
Text = p.Name .. " Failed to Load",
Desc = tostring(keyData.LoadingStatus)..": Client failed to load in time (10 minutes?)",
Player = p;
});
--Anti.Detected(p, "kick", "Client failed to load in time (10 minutes?)");
end
end)
elseif ran and err ~= "REMOVED" then
Anti.RemovePlayer(p, "\n:: Adonis ::\nLoading Error [Missing player, keys, or removed]")
end
end;
PlayerRemoving = function(p)
local data = Core.GetPlayer(p)
local key = tostring(p.UserId)
service.Events.PlayerRemoving:Fire(p)
delay(1, function()
if not service.Players:GetPlayerByUserId(p.UserId) then
Core.PlayerData[key] = nil
end
end)
AddLog("Script", {
Text = string.format("Triggered PlayerRemoving for %s", p.Name);
Desc = "Player left the game (PlayerRemoving)";
Player = p;
})
AddLog("Leaves", {
Text = p.Name;
Desc = p.Name.." left the server";
Player = p;
})
Core.SavePlayerData(p, data)
Variables.TrackingTable[p.Name] = nil
for otherPlrName in pairs(Variables.TrackingTable) do
Variables.TrackingTable[otherPlrName][p] = nil
end
if Commands.UnDisguise then
Commands.UnDisguise.Function(p, {"me"})
end
Variables.IncognitoPlayers[p] = nil
return
end;
FinishLoading = function(p)
local PlayerData = Core.GetPlayer(p)
local level = Admin.GetLevel(p)
local key = tostring(p.UserId)
--// Fire player added
service.Events.PlayerAdded:Fire(p)
AddLog("Script", {
Text = string.format("%s finished loading", p.Name);
Desc = "Client finished loading";
})
--// Run OnJoin commands
for i,v in pairs(Settings.OnJoin) do
TrackTask("Thread: OnJoin_Cmd: ".. tostring(v), Admin.RunCommandAsPlayer, v, p)
AddLog("Script", {
Text = "OnJoin: Executed "..tostring(v);
Desc = "Executed OnJoin command; "..tostring(v)
})
end
--// Start keybind listener
Remote.Send(p, "Function", "KeyBindListener", PlayerData.Keybinds or {})
--// Load some playerdata stuff
if PlayerData.Client and type(PlayerData.Client) == "table" then
if PlayerData.Client.CapesEnabled == true or PlayerData.Client.CapesEnabled == nil then
Remote.Send(p, "Function", "MoveCapes")
end
Remote.Send(p, "SetVariables", PlayerData.Client)
else
Remote.Send(p, "Function", "MoveCapes")
end
--// Load all particle effects that currently exist
Functions.LoadEffects(p)
--// Load admin or non-admin specific things
if level < 1 then
if Settings.AntiSpeed then
Remote.Send(p, "LaunchAnti", "Speed", {
Speed = tostring(60.5 + math.random(9e8)/9e8)
})
end
if Settings.Detection then
Remote.Send(p, "LaunchAnti", "MainDetection")
end
if Settings.AntiBuildingTools then
Remote.Send(p, "LaunchAnti", "AntiTools", {BTools = true})
end
end
--// Finish things up
if Remote.Clients[key] then
Remote.Clients[key].FinishedLoading = true
if p.Character and p.Character.Parent == workspace then
--service.Threads.TimeoutRunTask(p.Name..";CharacterAdded",Process.CharacterAdded,60,p)
local ran, err = TrackTask(p.Name .." CharacterAdded", Process.CharacterAdded, p, p.Character)
if not ran then
logError(err)
end
end
if level > 0 then
local oldVer = Core.GetData("VersionNumber")
local newVer = tonumber(string.match(server.Changelog[1], "Version: (.*)"))
if Settings.Notification then
wait(2)
Remote.MakeGui(p, "Notification", {
Title = "Welcome.";
Message = "Click here for commands.";
Icon = server.MatIcons["Verified user"];
Time = 15;
OnClick = Core.Bytecode("client.Remote.Send('ProcessCommand','"..Settings.Prefix.."cmds')");
})
wait(1)
if oldVer and newVer and newVer > oldVer and level > 300 then
Remote.MakeGui(p, "Notification", {
Title = "Updated!";
Message = "Click to view the changelog.";
Icon = server.MatIcons.Description;
Time = 10;
OnClick = Core.Bytecode("client.Remote.Send('ProcessCommand','"..Settings.Prefix.."changelog')");
})
end
wait(1)
if level > 300 and Settings.DataStoreKey == Defaults.Settings.DataStoreKey then
Remote.MakeGui(p, "Notification", {
Title = "Warning!";
Message = "Using default datastore key!";
Icon = server.MatIcons.Description;
Time = 10;
OnClick = Core.Bytecode([[
local window = client.UI.Make("Window", {
Title = "How to change the DataStore key";
Size = {700,300};
Icon = "rbxassetid://7510994359";
})
window:Add("ImageLabel", {
Image = "rbxassetid://1059543904";
})
window:Ready()
]]);
})
end
end
if newVer then
Core.SetData("VersionNumber", newVer)
end
end
--// REF_1_ALBRT - 57s_Dxl - 100392_659;
--// COMP[[CHAR+OFFSET] < INT[0]]
--// EXEC[[BYTE[N]+BYTE[x]] + ABS[CHAR+OFFSET]]
--// ELSE[[BYTE[A]+BYTE[x]] + ABS[CHAR+OFFSET]]
--// VALU -> c_BYTE ; CAT[STR,x,c_BYTE] -> STR ; OUT[STR]]]
--// [-150x261x247x316x246x243x238x248x302x316x261x247x316x246x234x247x247x302]
--// END_ReF - 100392_659
for v: Player in pairs(Variables.IncognitoPlayers) do
if v == p then continue end
server.Remote.LoadCode(p, [[
for _, p in pairs(service.Players:GetPlayers()) do
if p.UserId == ]]..v.UserId..[[ then
if p:FindFirstChild("leaderstats") then p.leaderstats:Destroy() end
p:Destroy()
end
end]])
end
end
end;
CharacterAdded = function(p, Character, ...)
local key = tostring(p.UserId)
local keyData = Remote.Clients[key]
if keyData then
keyData.PlayerLoaded = true
end
wait()
if Character and keyData and keyData.FinishedLoading then
local level = Admin.GetLevel(p)
--// Wait for UI stuff to finish
wait(1)
if not p:FindFirstChildWhichIsA("PlayerGui") then
p:WaitForChild("PlayerGui", 9e9)
end
Remote.Get(p,"UIKeepAlive")
--//GUI loading
local MakeGui = Remote.MakeGui
local Refresh = Remote.RefreshGui
local RefreshGui = function(gui, ignore, ...)
Refresh(p, gui, ignore, ...)
end
if Variables.NotifMessage then
MakeGui(p, "Notif", {
Message = Variables.NotifMessage
})
end
if Settings.Console and (not Settings.Console_AdminsOnly or (Settings.Console_AdminsOnly and level > 0)) then
RefreshGui("Console")
end
if Settings.HelpButton then
MakeGui(p, "HelpButton")
end
if Settings.TopBarShift then
MakeGui(p, "TopBar")
end
--if Settings.CustomChat then
-- MakeGui(p, "Chat")
--end
--if Settings.PlayerList then
-- MakeGui(p, "PlayerList")
--end
if level < 1 then
if Settings.AntiNoclip then
Remote.Send(p, "LaunchAnti", "HumanoidState")
end
end
--// Check muted
--[=[for ind,admin in pairs(Settings.Muted) do
if Admin.DoCheck(p, admin) then
Remote.LoadCode(p, [[service.StarterGui:SetCoreGuiEnabled("Chat",false) client.Variables.ChatEnabled = false client.Variables.Muted = true]])
end
end--]=]
task.spawn(Functions.Donor, p)
--// Fire added event
service.Events.CharacterAdded:Fire(p, Character, ...)
--// Run OnSpawn commands
for _, v in pairs(Settings.OnSpawn) do
TrackTask("Thread: OnSpawn_Cmd: ".. tostring(v), Admin.RunCommandAsPlayer, v, p)
AddLog("Script", {
Text = "OnSpawn: Executed "..tostring(v);
Desc = "Executed OnSpawn command; "..tostring(v);
})
end
for otherPlrName, trackTargets in pairs(Variables.TrackingTable) do
if trackTargets[p] and server.Commands.Track then
server.Commands.Track.Function(service.Players[otherPlrName], {"@"..p.Name, "true"})
end
end
end
end;
NetworkAdded = function(cli)
wait(0.25)
local p = cli:GetPlayer()
if p then
Core.Connections[cli] = p
AddLog("Script", {
Text = p.Name .. " connected";
Desc = p.Name .. " successfully established a connection with the server";
Player = p;
})
else
AddLog("Script", {
Text = "<UNKNOWN> connected";
Desc = "An unknown user successfully established a connection with the server";
})
end
service.Events.NetworkAdded:Fire(cli)
end;
NetworkRemoved = function(cli)
local p = cli:GetPlayer() or Core.Connections[cli]
Core.Connections[cli] = nil
if p then
AddLog("Script", {
Text = p.Name .. " disconnected";
Desc = p.Name .. " disconnected from the server";
Player = p;
})
else
AddLog("Script", {
Text = "<UNKNOWN> disconnected";
Desc = "An unknown user disconnected from the server";
})
end
service.Events.NetworkRemoved:Fire(cli)
end;
--[[
PlayerTeleported = function(p,data)
end;
]]
};
end
|
--- |
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
local handler = car.Fogs
script.Parent.MouseButton1Click:connect(function()
if car.Body.Fogs.F.L.L.Enabled == false then
handler:FireServer("Lights",1)
script.Parent.BackgroundColor3 = Color3.new(0,255/255,0)
script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0)
for index, child in pairs(car.Body.Fogs.F:GetChildren()) do
child.Transparency = 0
child.L.Enabled = true
end
elseif car.Body.Fogs.F.L.L.Enabled == true then
handler:FireServer("Lights",0)
script.Parent.BackgroundColor3 = Color3.new(0,0,0)
script.Parent.TextStrokeColor3 = Color3.new(0,0,0)
for index, child in pairs(car.Body.Fogs.F:GetChildren()) do
child.Transparency = 1
child.L.Enabled = false
end
end
end)
|
------------------------- |
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "k" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
player.Character.Humanoid.CameraOffset = Vector3.new(-0.14, 0.12, -0.2)
limitButton.Text = "Free Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 70
player.Character.Humanoid.CameraOffset = Vector3.new(-0.14, 0.12, -0.2)
limitButton.Text = "FPV Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Custom")
cam = ("car")
Camera.FieldOfView = 70
player.Character.Humanoid.CameraOffset = Vector3.new(0, 0, 0)
limitButton.Text = "Standard Camera"
wait(3)
limitButton.Text = ""
end
end
end)
|
--Variable for the Camera you want for the menu |
local pc = workspace.PlayCam -- change "playcam" to the object you want to use as the camera (make sure you know the front face)
wait(.001) --waits for .001 seconds, its required dont delete
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!! |
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.MintIceCream -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--[[Chassis Assembly]] |
--Create Steering Axle
local arm=Instance.new("Part",v)
arm.Name="Arm"
arm.Anchored=true
arm.CanCollide=false
arm.FormFactor=Enum.FormFactor.Custom
arm.Size=Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
arm.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,100,100)
arm.TopSurface=Enum.SurfaceType.Smooth
arm.BottomSurface=Enum.SurfaceType.Smooth
arm.Transparency=1
--Create Wheel Spindle
local base=arm:Clone()
base.Parent=v
base.Name="Base"
base.CFrame=base.CFrame*CFrame.new(0,_Tune.AxleSize,0)
base.BottomSurface=Enum.SurfaceType.Hinge
--Create Steering Anchor
local axle=arm:Clone()
axle.Parent=v
axle.Name="Axle"
axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle.BackSurface=Enum.SurfaceType.Hinge
if v.Name=="F" or v.Name=="R" then
local axle2=arm:Clone()
axle2.Parent=v
axle2.Name="Axle"
axle2.CFrame=CFrame.new(v.Position+((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle2.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle2.BackSurface=Enum.SurfaceType.Hinge
MakeWeld(arm,axle2)
end
--Create Suspension
if PGS_ON and _Tune.SusEnabled then
local sa=arm:Clone()
sa.Parent=v
sa.Name="#SA"
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
local aOff = _Tune.FAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-fDistX,-fDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
else
local aOff = _Tune.RAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-rDistX,-rDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
end
local sb=sa:Clone()
sb.Parent=v
sb.Name="#SB"
sb.CFrame=sa.CFrame*CFrame.new(0,0,_Tune.AxleSize)
sb.FrontSurface=Enum.SurfaceType.Hinge
local g = Instance.new("BodyGyro",sb)
g.Name = "Stabilizer"
g.MaxTorque = Vector3.new(0,0,1)
g.P = 0
local sf1 = Instance.new("Attachment",sa)
sf1.Name = "SAtt"
local sf2 = sf1:Clone()
sf2.Parent = sb
if v.Name == "FL" or v.Name == "FR" or v.Name == "F" then
sf1.Position = Vector3.new(fDistX-fSLX,-fDistY+fSLY,_Tune.AxleSize/2)
sf2.Position = Vector3.new(fDistX,-fDistY,-_Tune.AxleSize/2)
elseif v.Name == "RL" or v.Name=="RR" or v.Name == "R" then
sf1.Position = Vector3.new(rDistX-rSLX,-rDistY+rSLY,_Tune.AxleSize/2)
sf2.Position = Vector3.new(rDistX,-rDistY,-_Tune.AxleSize/2)
end
sb:MakeJoints()
local sp = Instance.new("SpringConstraint",v)
sp.Name = "Spring"
sp.Attachment0 = sf1
sp.Attachment1 = sf2
sp.LimitsEnabled = true
sp.Visible=_Tune.SusVisible
sp.Radius=_Tune.SusRadius
sp.Thickness=_Tune.SusThickness
sp.Color=BrickColor.new(_Tune.SusColor)
sp.Coils=_Tune.SusCoilCount
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
g.D = _Tune.FAntiRoll
sp.Damping = _Tune.FSusDamping
sp.Stiffness = _Tune.FSusStiffness
sp.FreeLength = _Tune.FSusLength+_Tune.FPreCompress
sp.MaxLength = _Tune.FSusLength+_Tune.FExtensionLim
sp.MinLength = _Tune.FSusLength-_Tune.FCompressLim
else
g.D = _Tune.RAntiRoll
sp.Damping = _Tune.RSusDamping
sp.Stiffness = _Tune.RSusStiffness
sp.FreeLength = _Tune.RSusLength+_Tune.RPreCompress
sp.MaxLength = _Tune.RSusLength+_Tune.RExtensionLim
sp.MinLength = _Tune.RSusLength-_Tune.RCompressLim
end
MakeWeld(car.Body.CarName.Value.VehicleSeat,sa)
MakeWeld(sb,base)
else
MakeWeld(car.Body.CarName.Value.VehicleSeat,base)
end
--Lock Rear Steering Axle
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
MakeWeld(base,axle)
end
--Weld Assembly
if v.Parent.Name == "RL" or v.Parent.Name == "RR" or v.Name=="R" then
MakeWeld(car.Body.CarName.Value.VehicleSeat,arm)
end
MakeWeld(arm,axle)
arm:MakeJoints()
axle:MakeJoints()
--Weld Miscelaneous Parts
if v:FindFirstChild("SuspensionFixed")~=nil then
ModelWeld(v.SuspensionFixed,car.Body.CarName.Value.VehicleSeat)
end
if v:FindFirstChild("WheelFixed")~=nil then
ModelWeld(v.WheelFixed,axle)
end
if v:FindFirstChild("Fixed")~=nil then
ModelWeld(v.Fixed,arm)
end
--Weld Wheel Parts
if v:FindFirstChild("Parts")~=nil then
ModelWeld(v.Parts,v)
end
--Add Steering Gyro
if v:FindFirstChild("Steer") then
v:FindFirstChild("Steer"):Destroy()
end
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
local steer=Instance.new("BodyGyro",arm)
steer.Name="Steer"
steer.P=_Tune.SteerP
steer.D=_Tune.SteerD
steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
end
--Add Stabilization Gyro
local gyro=Instance.new("BodyGyro",v)
gyro.Name="Stabilizer"
gyro.MaxTorque=Vector3.new(1,0,1)
gyro.P=0
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
gyro.D=_Tune.FGyroDamp
else
gyro.D=_Tune.RGyroDamp
end
--Add Rotational BodyMover
local AV=Instance.new("BodyAngularVelocity",v)
AV.Name="#AV"
AV.angularvelocity=Vector3.new(0,0,0)
AV.maxTorque=Vector3.new(_Tune.PBrakeForce,0,_Tune.PBrakeForce)
AV.P=1e9
end
|
-- SETTINGS ---------------------------------------------------- |
local hasFire = false; -- Exhaust has fire?
local hasSmoke = true; -- Exhaust has smoke?
local lightColor_on = BrickColor.new("Institutional white")
local lightColor_off = headlights[1].BrickColor -- Grab your existing color (recommended)
local brakeColor_on = BrickColor.new("Really red")
local brakeColor_off = BrickColor.new("Reddish brown")
local tiltForce = 1000; -- Force to flip over vehicle |
-------- OMG HAX |
r = game:service("RunService")
local damage = 15
local slash_damage = 15
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "http://www.roblox.com/asset/?id=10548112"
SlashSound.Parent = sword
SlashSound.Volume = 1
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=10548108"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
attack()
wait(1)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
-- Make all the Hotbar Slots |
for i = 1, NumberOfHotbarSlots do
local slot = MakeSlot(HotbarFrame, i)
slot.Frame.Visible = false
if not LowestEmptySlot then
LowestEmptySlot = slot
end
end
InventoryIcon.selected:Connect(function()
if not GuiService.MenuIsOpen then
CanHover = false
BackpackScript.OpenClose()
end
end)
InventoryIcon.deselected:Connect(function()
if InventoryFrame.Visible then
CanHover = true
BackpackScript.OpenClose()
end
end)
LeftBumperButton = NewGui('ImageLabel', 'LeftBumper')
LeftBumperButton.Size = UDim2.new(0, 40, 0, 40)
LeftBumperButton.Position = UDim2.new(0, -LeftBumperButton.Size.X.Offset, 0.5, -LeftBumperButton.Size.Y.Offset/2)
RightBumperButton = NewGui('ImageLabel', 'RightBumper')
RightBumperButton.Size = UDim2.new(0, 40, 0, 40)
RightBumperButton.Position = UDim2.new(1, 0, 0.5, -RightBumperButton.Size.Y.Offset/2)
|
-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000 |
function RayCast(startPos, vec, rayLength)
local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
if hitObject and hitPos then
local distance = rayLength - (hitPos - startPos).magnitude
if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
-- there is a chance here for potential infinite recursion
return RayCast(hitPos, vec, distance)
end
end
return hitObject, hitPos
end
function TagHumanoid(humanoid, player)
-- Add more tags here to customize what tags are available.
while humanoid:FindFirstChild('creator') do
humanoid:FindFirstChild('creator'):Destroy()
end
local creatorTag = Instance.new("ObjectValue")
creatorTag.Value = player
creatorTag.Name = "creator"
creatorTag.Parent = humanoid
DebrisService:AddItem(creatorTag, 1)
end
local function CreateFlash()
if not FlashHolder then
FlashHolder = Instance.new("Part", Tool)
FlashHolder.Name = "FlashHolder"
FlashHolder.Transparency = 1
FlashHolder.CanCollide= false
FlashHolder.FormFactor = "Custom"
FlashHolder.Size = Vector3.new(.4,.4,.4)
FlashHolder.Position = Tool.Handle.Position
local Weld = Instance.new("ManualWeld")
Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Weld.C1 = CFrame.new(0, .4, -2.4, 0, 0, 1, 1, 0, 0, 0, 1, 0)
Weld.Part0 = FlashHolder
Weld.Part1 = Tool.Handle
Weld.Parent = FlashHolder
end
local flash = Instance.new('Fire', FlashHolder)
flash.Color = Color3.new(1, 140 / 255, 0)
flash.SecondaryColor = Color3.new(1, 0, 0)
flash.Size = 0.3
DebrisService:AddItem(flash, FireRate / 1.5)
end
local BulletBase = Instance.new('Part')
BulletBase.FormFactor = Enum.FormFactor.Custom
BulletBase.Size = Vector3.new(1,1,1)
BulletBase.BrickColor = BrickColor.new("Black")
BulletBase.CanCollide = false
BulletBase.Anchored = true
BulletBase.TopSurface = Enum.SurfaceType.Smooth
BulletBase.BottomSurface = Enum.SurfaceType.Smooth
BulletBase.Name = 'Bullet'
local BulletMesh = Instance.new("SpecialMesh")
BulletMesh.MeshType = 'Sphere'
BulletMesh.Scale = Vector3.new(.2,.2,.2)
BulletMesh.Parent = BulletBase
local function CreateBullet(bulletPos, hit)
local bullet = BulletBase:Clone()
bullet.CFrame = CFrame.new(bulletPos)
bullet.Parent = game.Workspace
DebrisService:AddItem(bullet, 2.5)
if hit.Anchored == false then
local weld = Instance.new'Weld'
weld.C0 = hit.CFrame:toObjectSpace(CFrame.new(bulletPos))
weld.Part0 = hit
weld.Part1 = bullet
weld.Parent = bullet
bullet.Anchored = false
end
return bullet
end
local function Reload()
if not Reloading then
Reloading = true
Tool.SetIcon:FireClient(game.Players:GetPlayerFromCharacter(Tool.Parent), "rbxasset://textures\\GunWaitCursor.png")
-- Don't reload if you are already full or have no extra ammo
if AmmoInClip ~= ClipSize then
if PumpTrack then
PumpTrack:Stop()
end
for i = 1,6 do
if PumpTrack then
PumpTrack:Play()
end
if Handle:FindFirstChild('PumpSound') then
Handle.PumpSound:Play()
end
wait(ReloadTime/6)
end
-- Only use as much ammo as you have
local ammoToUse = ClipSize - AmmoInClip
AmmoInClip = AmmoInClip + ammoToUse
UpdateAmmo(AmmoInClip)
end
Tool.SetIcon:FireClient(game.Players:GetPlayerFromCharacter(Tool.Parent), "rbxasset://textures\\GunCursor.png")
Reloading = false
end
end
local CasingBase = Instance.new('Part')
CasingBase.FormFactor = Enum.FormFactor.Custom
CasingBase.Elasticity = 0
CasingBase.Size = Vector3.new(.3,.3,.5)
local CasingMesh = Instance.new('SpecialMesh')
CasingMesh.MeshId = 'http://www.roblox.com/asset/?id=94248124'
CasingMesh.TextureId = 'http://www.roblox.com/asset/?id=94219470' |
--remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld |
if ((parts[i].className == "Part") or (parts[i].className == "Handle") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat") or (parts[i].className == "SkateboardPlatform")) then
if (prev ~= nil) then
local weld = Instance.new("Weld")
weld.Part0 = prev
weld.Part1 = parts[i]
weld.C0 = prev.CFrame:inverse()
weld.C1 = parts[i].CFrame:inverse()
weld.Parent = prev
parts[i].Anchored = false
end
prev = parts[i]
end
end
wait(3)
|
-- Given the cameraCFrame and vertical mouse delta, a cframe will be returned to be used for recoiling the camera
-- @param CFrame
-- @Returns CFrame |
function RecoilSimulator:GetRecoilCFrame(cameraCFrame)
local verticalRecoil = self.weaponDefinition:GetVerticalRecoilVector()
local randomVerticalSpray = self.rng:NextNumber(verticalRecoil.x,verticalRecoil.y)
local horizontalRecoil = self.weaponDefinition:GetHorizontalRecoilVector()
local randomHorizontalSpray = self.rng:NextNumber(horizontalRecoil.x,horizontalRecoil.y)
return CFrame.fromEulerAnglesYXZ( math.rad(randomVerticalSpray), math.rad(randomHorizontalSpray), 0)
end
return RecoilSimulator
|
-- A state object whose value is derived from other objects using a callback. |
export type Computed<T> = StateObject<T> & Dependent & {
-- kind: "Computed" (add this when Luau supports singleton types)
}
|
-- [[ENIIQZ' MOBILE SUPPORT]] |
local Buttons = script.Parent:WaitForChild("Buttons")
local Left = Buttons:WaitForChild("Left")
local Right = Buttons:WaitForChild("Right")
local Brake = Buttons:WaitForChild("Brake")
local Gas = Buttons:WaitForChild("Gas")
if UserInputService.TouchEnabled then
Buttons.Visible = true
end
local function LeftTurn(Touch, GPE)
if Touch.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
end
Left.InputBegan:Connect(LeftTurn)
Left.InputEnded:Connect(LeftTurn) |
--Reset First |
LeftHip.C1 = CFrame.new(3,0,0)
RightHip.C1 = CFrame.new(-3,0,0)
print("Completed")
while true do
LeftHip.C1 = CFrame.new(3,0,0-5)
RightHip.C1 = CFrame.new(-3,0,0+5)
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,-0.5,0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,0.5,-0.5)
sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,0.5,0)
wait()
end
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,0.5,0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,-0.5,-0.5)
sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,-0.5,0)
wait()
end
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,0.5,-0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,-0.5,0.5)
sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,0.5,0)
wait()
end
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,-0.5,-0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,0.5,0.5)
sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,-0.5,0)
wait()
end
end
|
-- Overrides Keyboard:UpdateMovement(inputState) to conditionally consider self.wasdEnabled and let OnRenderStepped handle the movement |
function ClickToMove:UpdateMovement(inputState)
if FFlagUserClickToMoveFollowPathRefactor then
if inputState == Enum.UserInputState.Cancel then
self.keyboardMoveVector = ZERO_VECTOR3
elseif self.wasdEnabled then
self.keyboardMoveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue)
end
else
if inputState == Enum.UserInputState.Cancel then
self.moveVector = ZERO_VECTOR3
elseif self.wasdEnabled then
self.moveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue)
if self.moveVector.magnitude > 0 then
CleanupPath()
ClickToMoveDisplay.CancelFailureAnimation()
end
end
end
end
|
-- NOTE: To use properly please make sure to reject the promise for proper GC if the object requiring
-- this value is GCed. |
return function(instance, propertyName)
assert(typeof(instance) == "Instance", "Bad instance")
assert(type(propertyName) == "string", "Bad propertyName")
local result = instance[propertyName]
if result then
return Promise.resolved(result)
end
local promise = Promise.new()
local conn
promise:Finally(function()
if conn then
conn:Disconnect()
end
end)
conn = instance:GetPropertyChangedSignal(propertyName):Connect(function()
if instance[propertyName] then
promise:Resolve(instance[propertyName])
end
end)
return promise
end
|
-- See if I have a tool |
local spawner = script.Parent
local tool = nil
local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2),
Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2))
local parts = game.Workspace:FindPartsInRegion3(region)
for _, part in pairs(parts) do
if part and part.Parent and part.Parent:IsA("Tool") then
tool = part.Parent
break
end
end
local configTable = spawner.Configurations
local configs = {}
local function loadConfig(configName, defaultValue)
if configTable:FindFirstChild(configName) then
configs[configName] = configTable:FindFirstChild(configName).Value
else
configs[configName] = defaultValue
end
end
loadConfig("SpawnCooldown", 120)
if tool then
tool.Parent = game.ServerStorage
while true do
-- put tool on pad
local toolCopy = tool:Clone()
local handle = toolCopy:FindFirstChild("Handle")
toolCopy.Parent = game.Workspace
local toolOnPad = true
local parentConnection
parentConnection = toolCopy.AncestryChanged:connect(function()
if handle then handle.Anchored = false end
toolOnPad = false
parentConnection:disconnect()
end)
if handle then
handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
handle.Anchored = true
end
-- wait for tool to be removed
while toolOnPad do
if handle then
handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
end
wait()
end
-- wait for cooldown
wait(configs["SpawnCooldown"])
end
end
|
--[[
Table of contents
WCR - Weld Creation
WPR - Weld Parents
WP0 - Weld Part 0
WP1 - Weld Part 1
WC1 - Weld C1
ASCII - Random ASCII art
--]] |
bin = script.Parent |
--[[
Renderer that deals in terms of Roblox Instances. This is the most
well-supported renderer after NoopRenderer and is currently the only
renderer that does anything.
]] |
local Binding = require(script.Parent.Binding)
local Children = require(script.Parent.PropMarkers.Children)
local ElementKind = require(script.Parent.ElementKind)
local SingleEventManager = require(script.Parent.SingleEventManager)
local getDefaultInstanceProperty = require(script.Parent.getDefaultInstanceProperty)
local Ref = require(script.Parent.PropMarkers.Ref)
local Type = require(script.Parent.Type)
local internalAssert = require(script.Parent.internalAssert)
local config = require(script.Parent.GlobalConfig).get()
local applyPropsError = [[
Error applying props:
%s
In element:
%s
]]
local updatePropsError = [[
Error updating props:
%s
In element:
%s
]]
local function identity(...)
return ...
end
local function applyRef(ref, newHostObject)
if ref == nil then
return
end
if typeof(ref) == "function" then
ref(newHostObject)
elseif Type.of(ref) == Type.Binding then
Binding.update(ref, newHostObject)
else
-- TODO (#197): Better error message
error(("Invalid ref: Expected type Binding but got %s"):format(
typeof(ref)
))
end
end
local function setRobloxInstanceProperty(hostObject, key, newValue)
if newValue == nil then
local hostClass = hostObject.ClassName
local _, defaultValue = getDefaultInstanceProperty(hostClass, key)
newValue = defaultValue
end
-- Assign the new value to the object
hostObject[key] = newValue
return
end
local function removeBinding(virtualNode, key)
local disconnect = virtualNode.bindings[key]
disconnect()
virtualNode.bindings[key] = nil
end
local function attachBinding(virtualNode, key, newBinding)
local function updateBoundProperty(newValue)
local success, errorMessage = xpcall(function()
setRobloxInstanceProperty(virtualNode.hostObject, key, newValue)
end, identity)
if not success then
local source = virtualNode.currentElement.source
if source == nil then
source = "<enable element tracebacks>"
end
local fullMessage = updatePropsError:format(errorMessage, source)
error(fullMessage, 0)
end
end
if virtualNode.bindings == nil then
virtualNode.bindings = {}
end
virtualNode.bindings[key] = Binding.subscribe(newBinding, updateBoundProperty)
updateBoundProperty(newBinding:getValue())
end
local function detachAllBindings(virtualNode)
if virtualNode.bindings ~= nil then
for _, disconnect in pairs(virtualNode.bindings) do
disconnect()
end
end
end
local function applyProp(virtualNode, key, newValue, oldValue)
if newValue == oldValue then
return
end
if key == Ref or key == Children then
-- Refs and children are handled in a separate pass
return
end
local internalKeyType = Type.of(key)
if internalKeyType == Type.HostEvent or internalKeyType == Type.HostChangeEvent then
if virtualNode.eventManager == nil then
virtualNode.eventManager = SingleEventManager.new(virtualNode.hostObject)
end
local eventName = key.name
if internalKeyType == Type.HostChangeEvent then
virtualNode.eventManager:connectPropertyChange(eventName, newValue)
else
virtualNode.eventManager:connectEvent(eventName, newValue)
end
return
end
local newIsBinding = Type.of(newValue) == Type.Binding
local oldIsBinding = Type.of(oldValue) == Type.Binding
if oldIsBinding then
removeBinding(virtualNode, key)
end
if newIsBinding then
attachBinding(virtualNode, key, newValue)
else
setRobloxInstanceProperty(virtualNode.hostObject, key, newValue)
end
end
local function applyProps(virtualNode, props)
for propKey, value in pairs(props) do
applyProp(virtualNode, propKey, value, nil)
end
end
local function updateProps(virtualNode, oldProps, newProps)
-- Apply props that were added or updated
for propKey, newValue in pairs(newProps) do
local oldValue = oldProps[propKey]
applyProp(virtualNode, propKey, newValue, oldValue)
end
-- Clean up props that were removed
for propKey, oldValue in pairs(oldProps) do
local newValue = newProps[propKey]
if newValue == nil then
applyProp(virtualNode, propKey, nil, oldValue)
end
end
end
local RobloxRenderer = {}
function RobloxRenderer.isHostObject(target)
return typeof(target) == "Instance"
end
function RobloxRenderer.mountHostNode(reconciler, virtualNode)
local element = virtualNode.currentElement
local hostParent = virtualNode.hostParent
local hostKey = virtualNode.hostKey
if config.internalTypeChecks then
internalAssert(ElementKind.of(element) == ElementKind.Host, "Element at given node is not a host Element")
end
if config.typeChecks then
assert(element.props.Name == nil, "Name can not be specified as a prop to a host component in Roact.")
assert(element.props.Parent == nil, "Parent can not be specified as a prop to a host component in Roact.")
end
local instance = Instance.new(element.component)
virtualNode.hostObject = instance
local success, errorMessage = xpcall(function()
applyProps(virtualNode, element.props)
end, identity)
if not success then
local source = element.source
if source == nil then
source = "<enable element tracebacks>"
end
local fullMessage = applyPropsError:format(errorMessage, source)
error(fullMessage, 0)
end
instance.Name = tostring(hostKey)
local children = element.props[Children]
if children ~= nil then
reconciler.updateVirtualNodeWithChildren(virtualNode, virtualNode.hostObject, children)
end
instance.Parent = hostParent
virtualNode.hostObject = instance
applyRef(element.props[Ref], instance)
if virtualNode.eventManager ~= nil then
virtualNode.eventManager:resume()
end
end
function RobloxRenderer.unmountHostNode(reconciler, virtualNode)
local element = virtualNode.currentElement
applyRef(element.props[Ref], nil)
for _, childNode in pairs(virtualNode.children) do
reconciler.unmountVirtualNode(childNode)
end
detachAllBindings(virtualNode)
virtualNode.hostObject:Destroy()
end
function RobloxRenderer.updateHostNode(reconciler, virtualNode, newElement)
local oldProps = virtualNode.currentElement.props
local newProps = newElement.props
if virtualNode.eventManager ~= nil then
virtualNode.eventManager:suspend()
end
-- If refs changed, detach the old ref and attach the new one
if oldProps[Ref] ~= newProps[Ref] then
applyRef(oldProps[Ref], nil)
applyRef(newProps[Ref], virtualNode.hostObject)
end
local success, errorMessage = xpcall(function()
updateProps(virtualNode, oldProps, newProps)
end, identity)
if not success then
local source = newElement.source
if source == nil then
source = "<enable element tracebacks>"
end
local fullMessage = updatePropsError:format(errorMessage, source)
error(fullMessage, 0)
end
local children = newElement.props[Children]
if children ~= nil then
reconciler.updateVirtualNodeWithChildren(virtualNode, virtualNode.hostObject, children)
end
if virtualNode.eventManager ~= nil then
virtualNode.eventManager:resume()
end
return virtualNode
end
return RobloxRenderer
|
-- << SETUP >>
-- Donor Commands |
local donorCommands = {}
for _, command in pairs(main.commandInfo) do
if command.RankName == "Donor" then
table.insert(donorCommands, command)
end
end
|
----------------------------------------------------------------------------------------------- |
script.Parent:WaitForChild("Speedo")
script.Parent:WaitForChild("Tach")
script.Parent:WaitForChild("ln")
script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")
local player=game.Players.LocalPlayer
local gauges = script.Parent
local values = script.Parent.Parent.Values
local mouse=player:GetMouse()
local car = script.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false
local _Tune = require(car["A-Chassis Tune"])
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
|
--Change sound id to the id you want to play |
debounce = false
script.Parent.Touched:connect(function(hit)
debounce = true
script.Parent.Parent.Map3:Destroy()
game.Lighting.FogColor = Color3.fromRGB(29, 29, 0)
game.Lighting.FogEnd = 500
end)
|
-- humanoidAnimatePlayEmote.lua |
local Figure = script.Parent
local Torso = Figure:WaitForChild("Torso")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightHip = Torso:WaitForChild("Right Hip")
local LeftHip = Torso:WaitForChild("Left Hip")
local Neck = Torso:WaitForChild("Neck")
local Humanoid = Figure:WaitForChild("Humanoid")
local pose = "Standing"
local EMOTE_TRANSITION_TIME = 0.1
local userAnimateScaleRunSuccess, userAnimateScaleRunValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserAnimateScaleRun") end)
local userAnimateScaleRun = userAnimateScaleRunSuccess and userAnimateScaleRunValue
local function getRigScale()
if userAnimateScaleRun then
return Figure:GetScale()
else
return 1
end
end
local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0
local animTable = {}
local animNames = {
idle = {
{ id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
{ id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
},
walk = {
{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
},
run = {
{ id = "run.xml", weight = 10 }
},
jump = {
{ id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
},
fall = {
{ id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
},
climb = {
{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
},
sit = {
{ id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
},
toolnone = {
{ id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
},
toolslash = {
{ id = "http://www.roblox.com/asset/?id=129967390", weight = 10 } |
-- Call this from a function bound to Renderstep with Input Priority |
function VehicleController:Update(moveVector: Vector3, cameraRelative: boolean, usingGamepad: boolean)
if self.vehicleSeat then
if cameraRelative then
-- This is the default steering mode
moveVector = moveVector + Vector3.new(self.steer, 0, self.throttle)
if usingGamepad and onlyTriggersForThrottle and useTriggersForThrottle then
self.vehicleSeat.ThrottleFloat = -self.throttle
else
self.vehicleSeat.ThrottleFloat = -moveVector.Z
end
self.vehicleSeat.SteerFloat = moveVector.X
return moveVector, true
else
-- This is the path following mode
local localMoveVector = self.vehicleSeat.Occupant.RootPart.CFrame:VectorToObjectSpace(moveVector)
self.vehicleSeat.ThrottleFloat = self:ComputeThrottle(localMoveVector)
self.vehicleSeat.SteerFloat = self:ComputeSteer(localMoveVector)
return ZERO_VECTOR3, true
end
end
return moveVector, false
end
function VehicleController:ComputeThrottle(localMoveVector)
if localMoveVector ~= ZERO_VECTOR3 then
local throttle = -localMoveVector.Z
return throttle
else
return 0.0
end
end
function VehicleController:ComputeSteer(localMoveVector)
if localMoveVector ~= ZERO_VECTOR3 then
local steerAngle = -math.atan2(-localMoveVector.x, -localMoveVector.z) * (180 / math.pi)
return steerAngle / self.autoPilot.MaxSteeringAngle
else
return 0.0
end
end
function VehicleController:SetupAutoPilot()
-- Setup default
self.autoPilot.MaxSpeed = self.vehicleSeat.MaxSpeed
self.autoPilot.MaxSteeringAngle = AUTO_PILOT_DEFAULT_MAX_STEERING_ANGLE
-- VehicleSeat should have a MaxSteeringAngle as well.
-- Or we could look for a child "AutoPilotConfigModule" to find these values
-- Or allow developer to set them through the API as like the CLickToMove customization API
end
return VehicleController
|
--[[
Generates symbols used to denote property change handlers when working with
the `New` function.
]] |
local function OnChange(propertyName: string)
return {
type = "Symbol",
name = "OnChange",
key = propertyName
}
end
return OnChange
|
-- |
script.Parent.OnServerEvent:Connect(function(p)
local Character = p.Character
local Humanoid = Character.Humanoid
local RootPart = Character.HumanoidRootPart
local anim = Humanoid:LoadAnimation(script.Anim)
anim:Play()
Humanoid.AutoRotate = false
script.Parent.Parent.Parent.Handle2.sfx:Play()
local vel9 = Instance.new("BodyVelocity", RootPart)
vel9.MaxForce = Vector3.new(1,1,1) * 1000000;
vel9.Parent = RootPart
vel9.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
vel9.Name = "SmallMoveVel"
game.Debris:AddItem(vel9,3)
wait(.5)
script.Parent.Parent.Parent.Handle2.Handle2.Sword.Transparency = 1
script.Parent.Parent.Parent.Handle1.Sword.Transparency = 0
for _,Particles in pairs(script.Parent.Parent.Parent.Void.Void:GetDescendants()) do
if Particles:IsA("ParticleEmitter") then
Particles:Emit(Particles:GetAttribute("EmitCount"))
end
end
local FX = Assets["None"]:Clone()
FX.CanCollide = false
FX.CastShadow = false
FX.Anchored = true
FX.Parent = workspace.Effects
FX.Transparency = 1
FX.CFrame = RootPart.CFrame * CFrame.new(0,0,0)
local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(30, 30, 30))
local hitlist = {}
for _,v in pairs(hitcontent) do
if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
if not hitlist[v.Parent.Humanoid] then
hitlist[v.Parent.Humanoid] = true
local RootPart2 = v.Parent.HumanoidRootPart
v.Parent.Humanoid:TakeDamage(30)
local vel0 = Instance.new("BodyVelocity", RootPart2)
vel0.MaxForce = Vector3.new(1,1,1) * 1000000;
vel0.Parent = RootPart2
vel0.Velocity = Vector3.new(1,1,1) * v.Parent:WaitForChild("HumanoidRootPart").CFrame.UpVector * .5
vel0.Name = "SmallMoveVel"
game.Debris:AddItem(vel0,3)
end
end
end
wait(1.7)
script.Parent.Parent.Parent.Handle2.Handle2.Sword.Transparency = 0
script.Parent.Parent.Parent.Handle1.Sword.Transparency = 1
script.Parent.Parent.Parent.Handle2.Handle2.Attachment.JcutFlareParticle:Emit(15)
script.Parent.Parent.Parent.Handle2.Sheath:Play()
Humanoid.AutoRotate = true
FX:Destroy()
end)
|
-- See if I have a tool |
local spawner = script.Parent
local tool = nil
local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2),
Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2))
local parts = game.Workspace:FindPartsInRegion3(region)
for _, part in pairs(parts) do
if part and part.Parent and part.Parent:IsA("Tool") then
tool = part.Parent
break
end
end
local configTable = spawner.Configurations
local configs = {}
local function loadConfig(configName, defaultValue)
if configTable:FindFirstChild(configName) then
configs[configName] = configTable:FindFirstChild(configName).Value
else
configs[configName] = defaultValue
end
end
loadConfig("SpawnCooldown", 60)
if tool then
tool.Parent = game.ServerStorage
while true do
-- put tool on pad
local toolCopy = tool:Clone()
local handle = toolCopy:FindFirstChild("Handle")
toolCopy.Parent = game.Workspace
local toolOnPad = true
local parentConnection
parentConnection = toolCopy.AncestryChanged:connect(function()
if handle then handle.Anchored = false end
toolOnPad = false
parentConnection:disconnect()
end)
if handle then
handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
handle.Anchored = true
end
-- wait for tool to be removed
while toolOnPad do
if handle then
handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
end
wait()
end
-- wait for cooldown
wait(configs["SpawnCooldown"])
end
end
|
-- you can add a minimum size (optional) |
minimumSize = Vector2.new(240, 160)
resizer.makeResizable(frameToResize, minimumSize)
resizer.makeDraggable(frameToResize)
|
--!strict |
local startAngle = -15
local endAngle = 15
local function Map(n: number, oldMin: number, oldMax: number, min: number, max: number): number
return (min + ((max - min) * ((n - oldMin) / (oldMax - oldMin))))
end
local function run(LightChanger)
local lights = LightChanger:GetLights("Numbered")
LightChanger:Tilt(50)
for groupNumber, lightGroup in lights do
local percent = (groupNumber - 1) / (#lights - 1)
local angle = Map(percent, 0, 1, startAngle, endAngle)
LightChanger:Pan(angle, lightGroup)
end
end
return function(LightChangerA, LightChangerB)
run(LightChangerA)
run(LightChangerB)
end
|
--------------| SYSTEM SETTINGS |-------------- |
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Green"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
--[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 2; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 4; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 0;
["Admin"] = 0;
["Settings"] = 0;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
RankRequiredToViewIcon = 1;
WelcomeRankNotice = false; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = false; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 8; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 2; -- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
["fly"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["fly2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["speed"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["jumpPower"] = {
Limit = 10000;
IgnoreLimit = 3;
};
};
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
|
--task.spawn(function()
-- while task.wait(60) do
-- current_version = script.Parent.Connector:InvokeServer(url)
-- check_version()
-- end
--end) |
local url = "https://40-percent-updates.smktd.repl.co/get_updates"
local update_log = script.Parent.Connector:InvokeServer(url)
local main = script.Parent.Parent.Parent
local log = main.Properties.UpdateLog
log.Value = update_log
|
--// H key, Horn |
mouse.KeyUp:connect(function(key)
if key=="DPadLeft" then
script.Parent.Parent.Horn.TextTransparency = 0.8
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 8
veh.Lightbar.middle.Yelp.Volume = 8
veh.Lightbar.middle.Priority.Volume = 8
veh.Lightbar.middle.Hilo.Volume = 8
veh.Lightbar.middle.Rwail.Volume = 8
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end)
|
-- Indicator class |
local Indicator = {}
Indicator.all = {}
function Indicator:new(newIndicator)
local newIndicator = newIndicator or {}
|
--// Connections |
L_8_.InputBegan:connect(function(L_89_arg1, L_90_arg2)
if not L_90_arg2 then
if L_89_arg1.KeyCode == L_7_.StartupKey then
if not L_14_ and L_15_ then
L_15_ = false
L_35_.Text = 'STATUS: ' .. 'STARTING UP'
L_41_:FireServer()
L_10_:WaitForChild('StartUp'):Play()
wait(L_7_.StartupTime) -- 26.13
L_10_:WaitForChild('Spin'):Play()
L_10_:WaitForChild('StartUp'):Stop()
L_35_.Text = 'STATUS: ' .. 'ONLINE'
L_14_ = true
L_36_.Text = L_4_.Name
else
TurnOff()
L_31_:Destroy()
L_15_ = true
script:Destroy()
end
end
if L_14_ then
if L_89_arg1.KeyCode == L_7_.UpKey and not L_19_ then
L_19_ = true
while L_19_ do
L_9_:wait()
L_28_ = L_28_ + L_10_.CFrame.upVector.unit * L_7_.UpSpeed
end
end;
if L_89_arg1.KeyCode == L_7_.DownKey and not L_20_ then
L_20_ = true
while L_20_ do
L_9_:wait()
L_28_ = L_28_ + L_10_.CFrame.upVector.unit * -L_7_.DownSpeed
end
end;
if L_89_arg1.KeyCode == L_7_.ForwardKey and not L_21_ then
L_21_ = true
while L_21_ do
L_9_:wait()
L_28_ = L_28_ + L_10_.CFrame.lookVector.unit * L_7_.ForwardSpeed
L_29_ = CFrame.Angles(math.rad(-L_7_.FrontRotation), 0, 0)
end
L_29_ = CFrame.Angles(0, 0, 0)
end;
if L_89_arg1.KeyCode == L_7_.BackwardKey and not L_22_ then
L_22_ = true
while L_22_ do
L_9_:wait()
L_28_ = L_28_ + L_10_.CFrame.lookVector.unit * -L_7_.BackwardSpeed
L_29_ = CFrame.Angles(math.rad(L_7_.BackRotation), 0, 0)
end
L_29_ = CFrame.Angles(0, 0, 0)
end;
if L_89_arg1.KeyCode == L_7_.RightKey and not L_23_ then
L_23_ = true
while L_23_ do
L_9_:wait()
L_28_ = L_28_ + L_10_.CFrame.rightVector.unit * L_7_.RightSpeed
L_29_ = CFrame.Angles(0, 0, math.rad(-L_7_.RightRotation))
end
L_29_ = CFrame.Angles(0, 0, 0)
end;
if L_89_arg1.KeyCode == L_7_.LeftKey and not L_24_ then
L_24_ = true
while L_24_ do
L_9_:wait()
L_28_ = L_28_ + L_10_.CFrame.rightVector.unit * -L_7_.LeftSpeed
L_29_ = CFrame.Angles(0, 0, math.rad(L_7_.LeftRotation))
end
L_29_ = CFrame.Angles(0, 0, 0)
end;
if L_89_arg1.UserInputType == L_7_.MouseToggleKey and L_25_ then
if not L_27_ then
L_27_ = true
else
L_27_ = false
end
end;
if L_89_arg1.KeyCode == Enum.KeyCode.C and not L_16_ then
L_16_ = true
while L_16_ do
for L_91_forvar1, L_92_forvar2 in pairs(L_4_:WaitForChild('Weaponry'):GetChildren()) do
if L_92_forvar2:IsA('BasePart') and L_92_forvar2.Name == 'MG' then
L_92_forvar2.Fire:Play()
spawn(function ()
Fire(L_92_forvar2)
end)
end
end
wait(60 / L_7_.FireRate)
end
end;
if L_89_arg1.KeyCode == Enum.KeyCode.F and not L_17_ and L_26_ and L_18_ > 0 then
L_17_ = true
while L_17_ and L_26_ and L_18_ > 0 do
for L_93_forvar1, L_94_forvar2 in pairs(L_4_:WaitForChild('Weaponry'):GetChildren()) do
if L_94_forvar2:IsA('BasePart') and L_94_forvar2.Name == 'ATG' then
L_94_forvar2.Fire:Play()
spawn(function ()
FireATG(L_94_forvar2)
end)
end
end
L_26_ = false
wait(60 / L_7_.RocketFireRate)
L_26_ = true
end
end;
end
end;
end)
L_8_.InputEnded:connect(function(L_95_arg1, L_96_arg2)
if not L_96_arg2 then
if L_95_arg1.KeyCode == L_7_.UpKey and L_19_ then
L_19_ = false
end;
if L_95_arg1.KeyCode == L_7_.DownKey and L_20_ then
L_20_ = false
end;
if L_95_arg1.KeyCode == L_7_.ForwardKey and L_21_ then
L_21_ = false
end;
if L_95_arg1.KeyCode == L_7_.BackwardKey and L_22_ then
L_22_ = false
end;
if L_95_arg1.KeyCode == L_7_.RightKey and L_23_ then
L_23_ = false
end;
if L_95_arg1.KeyCode == L_7_.LeftKey and L_24_ then
L_24_ = false
end;
if L_95_arg1.KeyCode == Enum.KeyCode.C and L_16_ then
L_16_ = false
for L_97_forvar1, L_98_forvar2 in pairs(L_4_:WaitForChild('Weaponry'):GetChildren()) do
if L_98_forvar2:IsA('BasePart') and L_98_forvar2.Name == 'MG' then
L_98_forvar2.Fire:Stop()
end
end
end;
if L_95_arg1.KeyCode == Enum.KeyCode.F and L_17_ then
L_17_ = false
end;
end
end)
L_2_:WaitForChild('Humanoid').Died:connect(function()
TurnOff()
L_31_:Destroy()
L_15_ = true
script:Destroy()
end)
L_8_.JumpRequest:connect(function()
if L_15_ then
if L_1_.PlayerGui:FindFirstChild('Heli_Control') then
L_1_.PlayerGui['Heli_Control']:Destroy()
end
end
end)
|
-- |
Ways = {
front = CFrame.new(0,0,0),
back = CFrame.Angles(0,math.rad(180),0),
top = CFrame.Angles(math.rad(90),0,0),
bottom = CFrame.Angles(-math.rad(90),0,0),
left = CFrame.Angles(0,math.rad(90),0),
right = CFrame.Angles(0,-math.rad(90),0)
}
Side = function(MC,Way)
if not Ways[Way:lower()] then return end
return MC*Ways[Way:lower()]
end
GBCF = function(CF,AddV)
local AddedAm = Side(CF,"front").lookVector*AddV.z+Side(CF,"top").lookVector*AddV.y+Side(CF,"right").lookVector*AddV.x
return CF+AddedAm
end
Close = false
Opened = false
Button = script.Parent.Button
Parts = script.Parent.Parts
cc = Instance.new("ClickDetector",Button)
cc.archivable = false
cc.MouseClick:connect(function()
print("MouseClick")
if Opened then Close = true return end
Opened = true |
--Turning: |
car.LeftMotor.DesiredAngle = seat.SteerFloat * 0.5
car.RightMotor.DesiredAngle = seat.SteerFloat * 0.5 |
-- Function to shake the screen |
local function shakeScreen(magnitude, duration)
local shakeOffset = Vector3.new(
math.random(-magnitude * 100, magnitude * 100) / 100,
math.random(-magnitude * 100, magnitude * 100) / 100,
math.random(-magnitude * 100, magnitude * 100) / 100
)
local shakeCFrame = camera.CFrame + shakeOffset
local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
local tween = game:GetService("TweenService"):Create(camera, tweenInfo, {CFrame = shakeCFrame})
tween:Play()
end
|
--[=[
@param predicate (value: any) -> boolean
@return Option
Returns `self` if this option has a value and the predicate returns `true.
Otherwise, returns None.
]=] |
function Option:Filter(predicate)
if self:IsNone() or not predicate(self._v) then
return Option.None
else
return self
end
end
|
--// ] key, Spotlight |
mouse.KeyDown:connect(function(key)
if key=="x" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.Remotes.SpotlightEvent:FireServer(true)
end
end)
|
-- same as jump for now |
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = 3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
RightShoulder.DesiredAngle = 1.57
return
end
if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
return
end
if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Seated") then
moveSit()
return
end
local climbFudge = 0
if (pose == "Running") then
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
amplitude = 1
frequency = 9
elseif (pose == "Climbing") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
amplitude = 1
frequency = 9
climbFudge = 3.14
else
amplitude = 0.1
frequency = 1
end
desiredAngle = amplitude * math.sin(time*frequency)
RightShoulder.DesiredAngle = desiredAngle + climbFudge
LeftShoulder.DesiredAngle = desiredAngle - climbFudge
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
local tool = getTool()
if tool then
animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
-- Called to update all of the look-angles being tracked
-- on the client, as well as our own client look-angles.
-- This is called during every RunService Heartbeat. |
function CharacterRealism:UpdateLookAngles(delta)
-- Update our own look-angles with no latency
local pitch, yaw = self:ComputeLookAngle()
self:OnLookReceive(self.Player, pitch, yaw)
-- Submit our look-angles if they have changed enough.
local lastUpdate = self.LastUpdate or 0
local now = os.clock()
if (now - lastUpdate) > .5 then
pitch = Util:RoundNearestInterval(pitch, .05)
yaw = Util:RoundNearestInterval(yaw, .05)
if pitch ~= self.Pitch then
self.Pitch = pitch
self.Dirty = true
end
if yaw ~= self.Yaw then
self.Yaw = yaw
self.Dirty = true
end
if self.Dirty then
self.Dirty = false
self.LastUpdate = now
self.SetLookAngles:FireServer(pitch, yaw)
end
end
-- Update all of the character look-angles
local camera = workspace.CurrentCamera
local camPos = camera.CFrame.Position
local player = self.Player
local dropList
for character, rotator in pairs(self.Rotators) do
if not character.Parent then
if not dropList then
dropList = {}
end
dropList[character] = true
continue
end
local owner = Players:GetPlayerFromCharacter(character)
local dist = owner and owner:DistanceFromCharacter(camPos) or 0
if owner ~= player and dist > 30 then
continue
end
local lastStep = rotator.LastStep or 0
local stepDelta = now - lastStep
local humanoid = character:FindFirstChildOfClass("Humanoid")
local rootPart = humanoid and humanoid.RootPart
if not rootPart then
continue
end
local pitchState = rotator.Pitch
self:StepValue(pitchState, stepDelta)
local yawState = rotator.Yaw
self:StepValue(yawState, stepDelta)
local motors = rotator.Motors
rotator.LastStep = now
if not motors then
continue
end
for name, factors in pairs(self.RotationFactors) do
local data = motors and motors[name]
if not data then
continue
end
local motor = data.Motor
local origin = data.Origin
if origin then
local part0 = motor.Part0
local setPart0 = origin.Parent
if part0 and part0 ~= setPart0 then
local newOrigin = part0:FindFirstChild(origin.Name)
if newOrigin and newOrigin:IsA("Attachment") then
origin = newOrigin
data.Origin = newOrigin
end
end
origin = origin.CFrame
elseif data.C0 then
origin = data.C0
else
continue
end
local pitch = pitchState.Current or 0
local yaw = yawState.Current or 0
if rotator.SnapFirstPerson and name == "Head" then
end
local fPitch = pitch * factors.Pitch
local fYaw = yaw * factors.Yaw
-- HACK: Make the arms rotate with a tool.
if name:sub(-4) == " Arm" or name:sub(-8) == "UpperArm" then
local tool = character:FindFirstChildOfClass("Tool")
if tool and not CollectionService:HasTag(tool, "NoArmRotation") then
if name:sub(1, 5) == "Right" and rootPart:GetRootPart() ~= rootPart then
fPitch = pitch * 1.3
fYaw = yaw * 1.3
else
fYaw = yaw * .8
end
end
end
local dirty = false
if fPitch ~= pitchState.Value then
pitchState.Value = fPitch
dirty = true
end
if fYaw ~= yawState.Value then
yawState.Value = fYaw
dirty = true
end
if dirty then
local rot = origin - origin.Position
local cf = CFrame.Angles(0, fPitch, 0)
* CFrame.Angles(fYaw, 0, 0)
motor.C0 = origin * rot:Inverse() * cf * rot
end
end
end
-- If the dropList is declared, remove any characters that
-- were indexed into it. This is done after iterating over
-- the rotators to avoid problems with removing data from
-- a table while iterating over said table.
if dropList then
for character in pairs(dropList) do
local rotator = self.Rotators[character]
local listener = rotator and rotator.Listener
if listener then
listener:Disconnect()
end
self.Rotators[character] = nil
end
end
end
|
-- camera settings |
player.CameraMaxZoomDistance = 0.5 -- force first person
camera.FieldOfView = 90
humanoid.CameraOffset = Vector3.new(0, 0, -0.5)
|
--[=[
@within TableUtil
@function Reverse
@param tbl table
@return table
Reverses the array.
```lua
local t = {1, 5, 10}
local tReverse = TableUtil.Reverse(t)
print(tReverse) --> {10, 5, 1}
```
:::note Arrays only
This function works on arrays, but not dictionaries.
]=] |
local function Reverse<T>(tbl: { T }): { T }
local n = #tbl
local tblRev = table.create(n)
for i = 1, n do
tblRev[i] = tbl[n - i + 1]
end
return tblRev
end
|
--[[Steering]] |
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .03 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 150 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
-- Reset the camera look vector when the camera is enabled for the first time |
local SetCameraOnSpawn = true
local hasGameLoaded = false
local GestureArea = nil
local GestureAreaManagedByControlScript = false
local function layoutGestureArea(portraitMode)
if GestureArea and not GestureAreaManagedByControlScript then
if portraitMode then
GestureArea.Size = UDim2.new(1, 0, .6, 0)
GestureArea.Position = UDim2.new(0, 0, 0, 0)
else
GestureArea.Size = UDim2.new(1, 0, .5, -18)
GestureArea.Position = UDim2.new(0, 0, 0, 0)
end
end
end
|
--- Replace with true/false to force the chat type. Otherwise this will default to the setting on the website. |
module.BubbleChatEnabled = true--PlayersService.BubbleChat
module.ClassicChatEnabled = false--PlayersService.ClassicChat
|
--------END SIDE SQUARES-------- |
game.Workspace.audiencebackleft1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part2.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part5.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part8.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part2.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part5.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part8.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.audiencebackright1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.post1.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.post2.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
if game.Workspace.DoorFlashing.Value == false then
game.Workspace.DoorColored.Value = true |
-- Similar to Signal:Fire(...), but uses deferred. It does not reuse the
-- same coroutine like Fire. |
function Signal:FireDeferred(...)
local item = self._handlerListHead
while item do
task.defer(item._fn, ...)
item = item._next
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.