prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[
Executes all enqueued tasks, and clears out the task lists ready for new
tasks.
]]
|
function Scheduler.runTasks()
-- if no tasks were enqueued, exit early
if not willUpdate then
return
end
-- execute property changes
for instance, propertyTable in pairs(propertyChanges) do
for property, value in pairs(propertyTable) do
if value == None then
value = nil
end
instance[property] = value
end
end
-- run deferred callbacks
for callback in pairs(callbacks) do
callback()
end
willUpdate = false
table.clear(propertyChanges)
table.clear(callbacks)
end
RunService:BindToRenderStep(
"__FusionUIScheduler",
Enum.RenderPriority.Last.Value,
Scheduler.runTasks
)
return Scheduler
|
--[[ <<DO NOT DELETE THIS MODULE>>
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/ Build 6.42S
SecondLogic @ Inspare
>>Manual
Basically...everything you can and would ever want to touch is in the tuning module. EVERYTHING
Torque Curve Tune Visualizer:
https://www.desmos.com/calculator/2uo3hqwdhf
Basic Tips:
--Installation
>Everything is built-in (assembly, welding, suspension, gyros), so all you have to worry about is placing the wheels and the seat.
>Body parts go in the "Body" section.
>Wheel parts such as 3D rims and brake disks go in the "Parts" section of the wheel.
>Suspension-Anchored parts such as suspension wishbones and linkages go in the "SuspensionFixed" section.
>Axle-Anchored parts such as calipers go in the "WheelFixed" section.
>You can add or remove wheels. To add a wheel, simply copy one of the wheels and make sure it's named one of the following: "F","FL","FR","R","RL","RR".
>Wheels need to be aligned with the axes of the seat. Don't rotate the seat relative to the wheels as it may cause welding problems.
>All wheel offsets are applied in the tuning module. Do NOT manually add offset to the wheels. Steering axis is centered on the wheel part by default.
>Seat offset can be adjusted in the "MiscWeld" module under "Initialize".
>Use the "Misc" section for scripted/moving parts and apply welding using the "MiscWeld" module under "Initialize".
--Tuning
>Reduce weight(density) if setup is lacking torque. Increase density if setup has too much torque.
>Add downforce to the wheels manually if setup is lacking grip or use a downforce plugin.
>Dialing in ratios used in real cars is an easy way to have a realisticly tuned transmission.
>Modifying the "Drive" script may affect the integrity of the system.
>Custom scripts should be put in the "Plugins" folder. Using plugins made by other users is encouraged.
>When writing custom plugins, you can reference the values within the "Values" folder inside the A-Chassis Interface.
>It is a good practice to make plugins compatible with any setup and providing a usage manual if a plugin is released.
>Yes, you can remove/change the default plugins that come with the kit. The drive system will still work perfectly.
--Updates
>To update, simply just replace the entire "A-Chassis Tune" module of an existing car with a newer version of the module.
>You may want to copy the tune values and plugins from the old module, but dont simply overwrite the tune module as new values may be added.
>>Changelog
[5/20/17 : Build 6.42S] - ABS and PGS Standardization
[Added ABS]
-Modulates brakes when locking
-Added threshold value for slip allowance
-Added control toggles for ABS
-Added ABS indicator and control mapping to stock UI
[Split Density Tuning for PGS and Legacy]
-Added standardized weight scaling values to tune
-Default weight tuning set to 1 cubic stud : 50 lbs for PGS
-Default weight tuning set to 1 cubic stud : 10 lbs for Legacy
-Split front and rear density to PGS and Legacy
-Split brake force tuning to PGS and Legacy
[Added Tune Values]
-TCSEnabled: Sets whether or not the car will have TCS
-ABSEnabled: Sets whether or not the car will have ABS
-LoadDelay: Sets a delay time before initializing car
[Bug Fix: Axle Size Initialization]
-Car applies proper axle size
-Added AxleDensity value which sets axle density
-Fixed miscelaneous wheel part welding
[Added Changable Stock Gauge Units]
-Added units system for stock gauges
-Added default units: MPH [1 stud : 10 in], KP/H [1 stud : 10 in], SPS
-Custom units can be added or removed
-Click on speed to change between units
-Moved Controls button to middle for better visibility
[Code Documentation]
-Extensive documentation and commenting within scripts for better readability
-Improved warning message for oversized mass condition
[5/4/17 : Build 6.41S] - Standardized Weight
[Added automatic weight system]
-Added tune values for car weight, center of gravity, and wheel density
-Weight standard: 100 lbs = 1 cubic stud mass
-Applies weight at initialization
[Scaled Down Power Delivery]
-Horsepower output now at 1/10 because of lighter weight standard
-Added FDMult value in transmission for gear ratio scaling without having to change Final Drive (useful for low HP tunes)
[Optimized value for Anchor Offset]
-Changed "SusOffset" to "Anchor Offset"
-New anchor offset is now based off of wishbone length and wishbone angle.
-Anchor offset now labelled for forward, lateral, and vertical offsets.
[Split some tune values to F/R]
-Suspension values for front and rear are now independently tunable.
-Front and rear brakes can be tuned independently.
[Tune Module Housekeeping]
-Rearranged and documented several of the values within the tune module.
-Removed GyroP and GyroMaxTorque for simplicity. Dampening values are still present.
-Changed some decimal values to percent values
[1/2/17 : Build 6.40S] - Suspension
"S" Build number identifies suspension build
[Added suspension system for PGS Physics Solver]
-Suspension uses ROBLOX constraints and is automatically generated with the chassis
-Added tune values for suspension
-Temporarily removed caster tuning
[Steering Fix]
-Added tune value 'ReturnSpeed' which determines how fast wheels return to default orientation
[New Torque Curve Equation]
-New equation gives more control over the shape of the torque curve
-Engine values have been replaced with the new equation's variables
-Added link to desmos graph for the torque curve visualization
[10/31/16 : Build 6.33] - Semi-Automatic
[Added semi-automatic transmission mode]
-'TransModes' now accepts "Semi" value for semi-automatic.
-Updated AC6_Stock_Gauges to include semi-automatic mode.
[Fixed disengaging p-brake]
-P-Brake now remains engaged if player gets into then vehicle.
[Fixed FE Support for AC6_Stock_Sound]
-Sounds should now work properly with Filtering Enabled.
[8/5/16 : Build 6.32] - Differential System
[Implemented differential system]
-Differential controls torque distibution between wheels that are spinning at different rates
-Added tune values 'FDiffSlipThres', 'FDiffLockThres', 'RDiffSlipThres', 'RDiffLockThres', 'CDiffSlipThres', and 'CDiffLockThres'.
-'DiffSlipThres' determine the threshold of the speed difference between the wheels. Full lock applies at max threshold.
-A lower slip threshold value will make the diff more aggressive.
-'DiffLockThres' determines the bias of the differential.
-A lock threshold value more than 50 puts more torque into the slipping wheel (moving towards an open diff).
-A lock threshold value less than 50 puts more torque into the grounded wheel (moving towards a locked diff).
[Fixed multiple wheel support]
-The chassis can now use more than just the default 4 set of wheels. Just copy an existing wheel and place accordingly.
-Differential works with auxiliary wheels.
[7/13/16 : Build 6.31] - Peripheral Settings
[Added peripheral adjustment values]
-Moved controller and mouse deadzone values to the "Controls" section of the tune.
-Split controller deadzone into left and right input.
-Moved mouse control width to "Conrols" secton. This value now operates based off of % of screed width.
[Updated stock Controls Module]
-Added sliders for controller and mouse deadzone values.
-Added slider for mouse control width.
[6/15/16 : Build 6.3] - Motercisly
[Better motorcycle system support]
-Added wheel configurations "F" and "R" for single wheel settup.
-"F" and "R" wheels will have axle parts on both sides for better balance.
-These wheel configurations will ignore outor rotation value and will rotated based off of the inner rotation value only.
-Camber and Toe cannot be applied to these wheel configurations. Caster will still be applied as normal.
[Bug fixes]
-Caster now applies after wheel part rotations so wheel parts dont rotate with caster.
-Fixed Clutch re-engaging automatically when shifting out of neutral.
[6/4/16 : Build 6.21] - AC6 Official Public Kit Release
[Plugin FilteringEnabled compatability made easier]
-System now detects if there is a RemoteEvent or RemoteFunction inside a plugin. These will be parented directly under the car.
-The RemoteEvent/RemoteFunction needs to be a direct child of the plugin for it to be detected.
-Scripts inside the RemoteEvent/RemoteFunction should be disabled. They will be enabled after initialization.
-Be careful as this system is suceptible to name collisions. Name your RemoteEvents/RemoteFunctions uniquely.
-Stock AC6 Sound plugin is now FE compatible.
[Controls Panel now a plugin instead of integrated]
-Separated controls panel from Drive script. The controls panel is now a plugin.
-The "Controls" folder appears inside the interface on Drive startup. Use this folder to reference button mapping values for custom controls plugins.
-"ControlsOpen" value added. This is a safety toggle when changing control values. This value can be manipulated by plugins.
[New tune values]
-Added 'AutoFlip' tune value. This determines if the car automatically flips itself over when upside down.
-Added 'StAxisOffset' tune value. This offsets the center of the steering axis. Positive value = offset outward.
-Added 'SteerD', 'SteerMaxTorque', and 'SteerP' values which set the steering axle gyro properties.
[MiscWeld streamlining]
-Added "Misc" section to the main sections. This should contain scripted/moving parts.
-Parts in this section are NOT WELDED AUTOMATICALLY. Use the "MiscWeld" module to weld these parts. The "Misc" section is pre-referenced as 'misc'.
[Bug fixes]
-Fixed flip gyro not resetting when gyro is active and driver leaves car.
-Fixed issue with switching transmission modes.
--]]
|
return "6.42S"
|
-- Events
|
local Events = ReplicatedStorage.Events
local RedeemCode = Events.RedeemCode
|
--[=[
Given a list of brios of brios, flattens that list into a brio with
just one T value.
@param brioTable { any: Brio<Brio<T> | T>}
@return Brio<{T}>
]=]
|
function BrioUtils.flatten(brioTable)
local newValue = {}
local brios = {}
for key, brio in pairs(brioTable) do
if Brio.isBrio(brio) then
if brio:IsDead() then
return Brio.DEAD
else
table.insert(brios, brio)
newValue[key] = brio:GetValue()
end
else
newValue[key] = brio
end
end
return BrioUtils.first(brios, newValue)
end
|
-- stops specific anim
|
function module.stopSpecific(name,hum)
local AnimationTracks = hum:GetPlayingAnimationTracks()
for i, track in pairs (AnimationTracks) do
if track.Name == name then
track:Stop()
end
end
end
|
--end
|
for i, model in pairs(petModelFolder) do
ContentProvider:PreloadAsync({model})
Loaded += 1
Gui.Frame.TextLabel.Text = Loaded.."/"..toLoad.. " asset loaded"
end
TweenService:Create(Gui.Frame, erase, {BackgroundTransparency = 1}):Play()
Gui.Enabled = false
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
|
-- Properties
|
local OptimalEffects = false
local RenderDistance = 400
local ScreenCullingEnabled = true
local ScreenCullingRadius = 16
FastCast.DebugLogging = false
FastCast.VisualizeCasts = false
FastCast.RayExit = true -- Only applies for Wall Penetration.
local Beam = Instance.new("Beam")
Beam.TextureSpeed = 0
Beam.LightEmission = 0
Beam.LightInfluence = 1
Beam.Transparency = NumberSequence.new(0)
local Caster = FastCast.new()
local function AddressTableValue(enabled, level, v1, v2)
if v1 ~= nil and enabled and level then
return ((level == 1 and v1.Level1) or (level == 2 and v1.Level2) or (level == 3 and v1.Level3) or v2)
else
return v2
end
end
local function MakeImpactFX(Hit, Position, Normal, Material, ParentToPart, ClientModule, Misc, Replicate, IsMelee)
local SurfaceCF = CFrame.new(Position, Position + Normal)
local HitEffectEnabled = ClientModule.HitEffectEnabled
local HitSoundIDs = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundIDs, ClientModule.HitSoundIDs)
local HitSoundPitchMin = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundPitchMin, ClientModule.HitSoundPitchMin)
local HitSoundPitchMax = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundPitchMax, ClientModule.HitSoundPitchMax)
local HitSoundVolume = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundVolume, ClientModule.HitSoundVolume)
local CustomHitEffect = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.CustomHitEffect, ClientModule.CustomHitEffect)
local BulletHoleEnabled = ClientModule.BulletHoleEnabled
local BulletHoleSize = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletHoleSize, ClientModule.BulletHoleSize)
local BulletHoleTexture = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletHoleTexture, ClientModule.BulletHoleTexture)
local PartColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PartColor, ClientModule.PartColor)
local BulletHoleVisibleTime = ClientModule.BulletHoleVisibleTime
local BulletHoleFadeTime = ClientModule.BulletHoleFadeTime
if IsMelee then
HitEffectEnabled = ClientModule.MeleeHitEffectEnabled
HitSoundIDs = ClientModule.MeleeHitSoundIDs
HitSoundPitchMin = ClientModule.MeleeHitSoundPitchMin
HitSoundPitchMax = ClientModule.MeleeHitSoundPitchMax
HitSoundVolume = ClientModule.MeleeHitSoundVolume
CustomHitEffect = ClientModule.CustomMeleeHitEffect
BulletHoleEnabled = ClientModule.MarkerEffectEnabled
BulletHoleSize = ClientModule.MarkerEffectSize
BulletHoleTexture = ClientModule.MarkerEffectTexture
BulletHoleVisibleTime = ClientModule.MarkerEffectVisibleTime
BulletHoleFadeTime = ClientModule.MarkerEffectFadeTime
PartColor = ClientModule.MarkerPartColor
end
if HitEffectEnabled then
local Attachment = Instance.new("Attachment")
Attachment.CFrame = SurfaceCF
Attachment.Parent = Workspace.Terrain
local Sound
local function Spawner(material)
if Misc.HitEffectFolder[material.Name]:FindFirstChild("MaterialSounds") then
local tracks = Misc.HitEffectFolder[material.Name].MaterialSounds:GetChildren()
local rn = math.random(1, #tracks)
local track = tracks[rn]
if track ~= nil then
Sound = track:Clone()
if track:FindFirstChild("Pitch") then
Sound.PlaybackSpeed = Random.new():NextNumber(track.Pitch.Min.Value, track.Pitch.Max.Value)
else
Sound.PlaybackSpeed = Random.new():NextNumber(HitSoundPitchMin, HitSoundPitchMax)
end
if track:FindFirstChild("Volume") then
Sound.Volume = Random.new():NextNumber(track.Volume.Min.Value, track.Volume.Max.Value)
else
Sound.Volume = HitSoundVolume
end
Sound.Parent = Attachment
end
else
Sound = Instance.new("Sound",Attachment)
Sound.SoundId = "rbxassetid://"..HitSoundIDs[math.random(1, #HitSoundIDs)]
Sound.PlaybackSpeed = Random.new():NextNumber(HitSoundPitchMin, HitSoundPitchMax)
Sound.Volume = HitSoundVolume
end
for i, v in pairs(Misc.HitEffectFolder[material.Name]:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
if Particle.PartColor.Value then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
Particle.Color = ColorSequence.new(HitPartColor, HitPartColor)
end
Thread:Delay(0.01, function()
if OptimalEffects then
local QualityLevel = UserSettings().GameSettings.SavedQualityLevel
if QualityLevel == Enum.SavedQualitySetting.Automatic then
local Compressor = 1 / 2
Particle:Emit(Count * Compressor)
else
local Compressor = QualityLevel.Value / 21
Particle:Emit(Count * Compressor)
end
else
Particle:Emit(Count)
end
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
Sound:Play()
if BulletHoleEnabled then
local Hole = Instance.new("Attachment")
Hole.Parent = ParentToPart and Hit or Workspace.Terrain
Hole.WorldCFrame = SurfaceCF * CFrame.Angles(math.rad(90), math.rad(180), 0)
if ParentToPart then
local Scale = BulletHoleSize
if Misc.HitEffectFolder[material.Name]:FindFirstChild("MaterialHoleSize") then
Scale = Misc.HitEffectFolder[material.Name].MaterialHoleSize.Value
end
local A0 = Instance.new("Attachment")
local A1 = Instance.new("Attachment")
local BeamClone = Beam:Clone()
BeamClone.Width0 = Scale
BeamClone.Width1 = Scale
if Misc.HitEffectFolder[material.Name]:FindFirstChild("MaterialDecals") then
local Decals = Misc.HitEffectFolder[material.Name].MaterialDecals:GetChildren()
local Chosen = math.random(1, #Decals)
local Decal = Decals[Chosen]
if Decal ~= nil then
BeamClone.Texture = "rbxassetid://"..Decal.Value
if Decal.PartColor.Value then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
end
else
BeamClone.Texture = "rbxassetid://"..BulletHoleTexture[math.random(1, #BulletHoleTexture)]
if PartColor then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
end
BeamClone.Attachment0 = A0
BeamClone.Attachment1 = A1
A0.Parent = Hit
A1.Parent = Hit
A0.WorldCFrame = Hole.WorldCFrame * CFrame.new(Scale / 2, -0.01, 0) * CFrame.Angles(math.rad(90), 0, 0)
A1.WorldCFrame = Hole.WorldCFrame * CFrame.new(-Scale / 2, -0.01, 0) * CFrame.Angles(math.rad(90), math.rad(180), 0)
BeamClone.Parent = Workspace.Terrain
Thread:Delay(BulletHoleVisibleTime, function()
if BulletHoleVisibleTime > 0 then
if OptimalEffects then
if Replicate then
local t0 = os.clock()
while Hole ~= nil do
local Alpha = math.min((os.clock() - t0) / BulletHoleFadeTime, 1)
if BeamClone then BeamClone.Transparency = NumberSequence.new(Math.Lerp(0, 1, Alpha)) end
if Alpha == 1 then break end
Thread:Wait()
end
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
else
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
end
else
local t0 = os.clock()
while Hole ~= nil do
local Alpha = math.min((os.clock() - t0) / BulletHoleFadeTime, 1)
if BeamClone then BeamClone.Transparency = NumberSequence.new(Math.Lerp(0, 1, Alpha)) end
if Alpha == 1 then break end
Thread:Wait()
end
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
end
else
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
end
end)
else
Debris:AddItem(Hole, 5)
end
end
end
if not CustomHitEffect then
if Misc.HitEffectFolder:FindFirstChild(Hit.Material) then
Spawner(Hit.Material)
else
Spawner(Misc.HitEffectFolder.Custom)
end
else
Spawner(Misc.HitEffectFolder.Custom)
end
Debris:AddItem(Attachment, 10)
end
end
local function MakeBloodFX(Hit, Position, Normal, Material, ParentToPart, ClientModule, Misc, Replicate, IsMelee)
local SurfaceCF = CFrame.new(Position, Position + Normal)
local BloodEnabled = ClientModule.BloodEnabled
local HitCharSndIDs = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndIDs, ClientModule.HitCharSndIDs)
local HitCharSndPitchMin = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndPitchMin, ClientModule.HitCharSndPitchMin)
local HitCharSndPitchMax = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndPitchMax, ClientModule.HitCharSndPitchMax)
local HitCharSndVolume = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndVolume, ClientModule.HitCharSndVolume)
local BloodWoundEnabled = ClientModule.BloodWoundEnabled
local BloodWoundTexture = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundTexture, ClientModule.BloodWoundTexture)
local BloodWoundSize = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundSize, ClientModule.BloodWoundSize)
local BloodWoundTextureColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundTextureColor, ClientModule.BloodWoundTextureColor)
local BloodWoundPartColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundPartColor, ClientModule.BloodWoundPartColor)
local BloodWoundVisibleTime = ClientModule.BloodWoundVisibleTime
local BloodWoundFadeTime = ClientModule.BloodWoundFadeTime
if IsMelee then
BloodEnabled = ClientModule.MeleeBloodEnabled
HitCharSndIDs = ClientModule.MeleeHitCharSndIDs
HitCharSndPitchMin = ClientModule.MeleeHitCharSndPitchMin
HitCharSndPitchMax = ClientModule.MeleeHitCharSndPitchMax
HitCharSndVolume = ClientModule.MeleeHitCharSndVolume
BloodWoundEnabled = ClientModule.MeleeBloodWoundEnabled
BloodWoundTexture = ClientModule.MeleeBloodWoundSize
BloodWoundSize = ClientModule.MeleeBloodWoundTexture
BloodWoundTextureColor = ClientModule.MeleeBloodWoundTextureColor
BloodWoundPartColor = ClientModule.MeleeBloodWoundVisibleTime
BloodWoundVisibleTime = ClientModule.MeleeBloodWoundFadeTime
BloodWoundFadeTime = ClientModule.MeleeBloodWoundPartColor
end
if BloodEnabled then
local Attachment = Instance.new("Attachment")
Attachment.CFrame = SurfaceCF
Attachment.Parent = Workspace.Terrain
local Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://"..HitCharSndIDs[math.random(1, #HitCharSndIDs)]
Sound.PlaybackSpeed = Random.new():NextNumber(HitCharSndPitchMin, HitCharSndPitchMax)
Sound.Volume = HitCharSndVolume
Sound.Parent = Attachment
for i, v in pairs(Misc.BloodEffectFolder:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
Thread:Delay(0.01, function()
if OptimalEffects then
local QualityLevel = UserSettings().GameSettings.SavedQualityLevel
if QualityLevel == Enum.SavedQualitySetting.Automatic then
local Compressor = 1 / 2
Particle:Emit(Count * Compressor)
else
local Compressor = QualityLevel.Value / 21
Particle:Emit(Count * Compressor)
end
else
Particle:Emit(Count)
end
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
Sound:Play()
Debris:AddItem(Attachment, 10)
if BloodWoundEnabled then
local Hole = Instance.new("Attachment")
Hole.Parent = ParentToPart and Hit or Workspace.Terrain
Hole.WorldCFrame = SurfaceCF * CFrame.Angles(math.rad(90), math.rad(180), 0)
if ParentToPart then
local A0 = Instance.new("Attachment")
local A1 = Instance.new("Attachment")
local BeamClone = Beam:Clone()
BeamClone.Width0 = BloodWoundSize
BeamClone.Width1 = BloodWoundSize
BeamClone.Texture = "rbxassetid://"..BloodWoundTexture[math.random(1, #BloodWoundTexture)]
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, BloodWoundTextureColor), ColorSequenceKeypoint.new(1, BloodWoundTextureColor)})
if BloodWoundPartColor then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
BeamClone.Attachment0 = A0
BeamClone.Attachment1 = A1
A0.Parent = Hit
A1.Parent = Hit
A0.WorldCFrame = Hole.WorldCFrame * CFrame.new(BloodWoundSize / 2, -0.01, 0) * CFrame.Angles(math.rad(90), 0, 0)
A1.WorldCFrame = Hole.WorldCFrame * CFrame.new(-BloodWoundSize / 2, -0.01, 0) * CFrame.Angles(math.rad(90), math.rad(180), 0)
BeamClone.Parent = Workspace.Terrain
Thread:Delay(BloodWoundVisibleTime, function()
if BloodWoundVisibleTime > 0 then
if OptimalEffects then
if Replicate then
local t0 = os.clock()
while Hole ~= nil do
local Alpha = math.min((os.clock() - t0) / BloodWoundFadeTime, 1)
if BeamClone then BeamClone.Transparency = NumberSequence.new(Math.Lerp(0, 1, Alpha)) end
if Alpha == 1 then break end
Thread:Wait()
end
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
else
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
end
else
local t0 = os.clock()
while Hole ~= nil do
local Alpha = math.min((os.clock() - t0) / BloodWoundFadeTime, 1)
if BeamClone then BeamClone.Transparency = NumberSequence.new(Math.Lerp(0, 1, Alpha)) end
if Alpha == 1 then break end
Thread:Wait()
end
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
end
else
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if BeamClone then BeamClone:Destroy() end
if Hole then Hole:Destroy() end
end
end)
else
Debris:AddItem(Hole, 5)
end
end
end
end
local function OnRayHit(SegmentVelocity, CosmeticBulletObject, Origin, Direction, Hit, Position, Normal, Material, Tool, ClientModule, Misc, Replicate)
local ShowEffects = ScreenCullingEnabled and (ScreenCulling(Position, ScreenCullingRadius) and (Position - Camera.CFrame.p).Magnitude <= RenderDistance) or (Position - Camera.CFrame.p).Magnitude <= RenderDistance
CosmeticBulletObject.Transparency = 1
for i, v in pairs(CosmeticBulletObject:GetDescendants()) do
if (v:IsA("BasePart") or v:IsA("Decal") or v:IsA("Texture")) then
v.Transparency = 1
elseif v:IsA("ParticleEmitter") then
v.Enabled = false
elseif v:IsA("Sound") then
v:Stop()
elseif v:IsA("PointLight") then
v.Enabled = false
--[[elseif v:IsA("Trail") then -- There is a case that trail is barely visible when projectile hits (especially at high speed). So I marked it as comment.
v.Enabled = false]]
elseif v:IsA("Beam") then
v.Enabled = false
end
end
Debris:AddItem(CosmeticBulletObject, 5) -- 10
if not AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosiveEnabled, ClientModule.ExplosiveEnabled) then
if Hit and Hit.Parent then
if Hit.Name == "_glass" then
if Replicate then
ShatterGlass:FireServer(Hit, Position, Direction)
end
else
local Distance = (Position - Origin).Magnitude
local Target = Hit:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if ShowEffects then
MakeBloodFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
if Replicate then
if TargetHumanoid.Health > 0 then
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Tool, ClientModule, TargetHumanoid, TargetTorso, Hit, Misc, Distance)
end)
if Tool and Tool.GunClient:FindFirstChild("MarkerEvent") then
Tool.GunClient.MarkerEvent:Fire(ClientModule, Hit.Name == "Head" and ClientModule.HeadshotEnabled)
end
end
end
else
if ShowEffects then
MakeImpactFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
end
end
end
else
if ClientModule.ExplosionSoundEnabled then
local SoundTable = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionSoundIDs, ClientModule.ExplosionSoundIDs)
local Attachment = Instance.new("Attachment")
Attachment.CFrame = CFrame.new(Position)
Attachment.Parent = Workspace.Terrain
local Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://"..SoundTable[math.random(1, #SoundTable)]
Sound.PlaybackSpeed = Random.new():NextNumber(AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionSoundPitchMin, ClientModule.ExplosionSoundPitchMin), AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionSoundPitchMax, ClientModule.ExplosionSoundPitchMax))
Sound.Volume = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionSoundVolume, ClientModule.ExplosionSoundVolume)
Sound.Parent = Attachment
Sound:Play()
Debris:AddItem(Attachment, 10)
end
local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionRadius, ClientModule.ExplosionRadius)
Explosion.BlastPressure = 0
Explosion.ExplosionType = Enum.ExplosionType.NoCraters
Explosion.Position = Position
Explosion.Parent = Camera
local SurfaceCF = CFrame.new(Position, Position + Normal)
if ClientModule.CustomExplosion then
Explosion.Visible = false
if ShowEffects then
local Attachment = Instance.new("Attachment")
Attachment.CFrame = SurfaceCF
Attachment.Parent = Workspace.Terrain
for i, v in pairs(Misc.ExplosionEffectFolder:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
Thread:Delay(0.01, function()
if OptimalEffects then
local QualityLevel = UserSettings().GameSettings.SavedQualityLevel
if QualityLevel == Enum.SavedQualitySetting.Automatic then
local Compressor = 1 / 2
Particle:Emit(Count * Compressor)
else
local Compressor = QualityLevel.Value / 21
Particle:Emit(Count * Compressor)
end
else
Particle:Emit(Count)
end
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
Debris:AddItem(Attachment, 10)
end
end
local HitHumanoids = {}
Explosion.Hit:Connect(function(HitPart, HitDist)
if HitPart and Replicate then
if HitPart.Parent and HitPart.Name == "HumanoidRootPart" or HitPart.Name == "Head" then
local Target = HitPart:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid then
if TargetHumanoid.Health > 0 then
if not HitHumanoids[TargetHumanoid] then
if ClientModule.ExplosionKnockback then
local Multipler = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionKnockbackMultiplierOnTarget, ClientModule.ExplosionKnockbackMultiplierOnTarget)
local DistanceFactor = HitDist / AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionRadius, ClientModule.ExplosionRadius)
DistanceFactor = 1 - DistanceFactor
local VelocityMod = (TargetTorso.Position - Explosion.Position).Unit * AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionKnockbackPower, ClientModule.ExplosionKnockbackPower) --* DistanceFactor
local AirVelocity = TargetTorso.Velocity - Vector3.new(0, TargetTorso.Velocity.y, 0) + Vector3.new(VelocityMod.X, 0, VelocityMod.Z)
if DamageModule.CanDamage(Target, Tool.Parent, ClientModule.FriendlyFire) then
local TorsoFly = Instance.new("BodyVelocity")
TorsoFly.MaxForce = Vector3.new(math.huge, 0, math.huge)
TorsoFly.Velocity = AirVelocity
TorsoFly.Parent = TargetTorso
TargetTorso.Velocity = TargetTorso.Velocity + Vector3.new(0, VelocityMod.Y * Multipler, 0)
Debris:AddItem(TorsoFly, 0.25)
else
if TargetHumanoid.Parent.Name == Player.Name then
Multipler = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosionKnockbackMultiplierOnPlayer, ClientModule.ExplosionKnockbackMultiplierOnPlayer)
local TorsoFly = Instance.new("BodyVelocity")
TorsoFly.MaxForce = Vector3.new(math.huge, 0, math.huge)
TorsoFly.Velocity = AirVelocity
TorsoFly.Parent = TargetTorso
TargetTorso.Velocity = TargetTorso.Velocity + Vector3.new(0, VelocityMod.Y * Multipler, 0)
Debris:AddItem(TorsoFly, 0.25)
end
end
end
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Tool, ClientModule, TargetHumanoid, TargetTorso, Hit, Misc, HitDist)
end)
if Tool and Tool.GunClient:FindFirstChild("MarkerEvent") then
Tool.GunClient.MarkerEvent:Fire(ClientModule, Hit.Name == "Head" and ClientModule.HeadshotEnabled)
end
HitHumanoids[TargetHumanoid] = true
end
end
end
elseif HitPart.Name == "_glass" then
ShatterGlass:FireServer(HitPart, HitPart.Position, Direction)
end
end
end)
end
end
local function CanRayPenetrate(SegmentVelocity, Origin, Direction, Hit, Position, Normal, Material, Tool, ClientModule, Misc, Replicate)
local ShowEffects = ScreenCullingEnabled and (ScreenCulling(Position, ScreenCullingRadius) and (Position - Workspace.CurrentCamera.CFrame.p).Magnitude <= RenderDistance) or (Position - Workspace.CurrentCamera.CFrame.p).Magnitude <= RenderDistance
if Hit and Hit.Parent then
if Hit.Name == "_glass" then
if Replicate then
ShatterGlass:FireServer(Hit, Position, Direction)
end
return "penetratedObject" -- Penetrate Object
else
local Distance = (Position - Origin).Magnitude
local Target = Hit:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if ShowEffects then
MakeBloodFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
if Replicate then
if TargetHumanoid.Health > 0 then
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Tool, ClientModule, TargetHumanoid, TargetTorso, Hit, Misc, Distance)
end)
if Tool and Tool.GunClient:FindFirstChild("MarkerEvent") then
Tool.GunClient.MarkerEvent:Fire(ClientModule, Hit.Name == "Head" and ClientModule.HeadshotEnabled)
end
end
end
return "penetratedHumanoid" -- Penetrate Humanoid
else
if ShowEffects then
MakeImpactFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
return "penetratedObject" -- Penetrate Object
end
end
end
end
local function CanRayPenetrateHumanoid(SegmentVelocity, PenetrationAmount, Origin, Direction, Hit, Position, Normal, Material, Tool, ClientModule, Misc, Replicate)
local ShowEffects = ScreenCullingEnabled and (ScreenCulling(Position, ScreenCullingRadius) and (Position - Workspace.CurrentCamera.CFrame.p).Magnitude <= RenderDistance) or (Position - Workspace.CurrentCamera.CFrame.p).Magnitude <= RenderDistance
if Hit and Hit.Parent then
local Target = Hit:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
if (Hit.Transparency > 0.75
or Hit.Name == "Missile"
or Hit.Name == "Handle"
or Hit.Name == "Effect"
or Hit.Name == "Bullet"
or Hit.Name == "Laser"
or string.lower(Hit.Name) == "water"
or Hit.Name == "Rail"
or Hit.Name == "Arrow"
or (TargetHumanoid and (TargetHumanoid.Health == 0 or not DamageModule.CanDamage(Target, Tool.Parent, ClientModule.FriendlyFire)))
--[[or (Hit.Parent:FindFirstChildOfClass("Tool") or Hit.Parent.Parent:FindFirstChildOfClass("Tool"))]]) then
return true -- Penetrate Blacklisted Object
else
local Distance = (Position - Origin).Magnitude
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if PenetrationAmount > 0 then
if ShowEffects then
MakeBloodFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
if Replicate then
if TargetHumanoid.Health > 0 then
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Tool, ClientModule, TargetHumanoid, TargetTorso, Hit, Misc, Distance)
end)
if Tool and Tool.GunClient:FindFirstChild("MarkerEvent") then
Tool.GunClient.MarkerEvent:Fire(ClientModule, Hit.Name == "Head" and ClientModule.HeadshotEnabled)
end
end
end
return true -- Penetrate Humanoid
--[[else
-- We must check if penetrationAmount reachs 0
if penetrationAmount <= 0 then
MakeImpactFX(hitPart, hitPoint, normal, material, true, hitData[2], hitData[3], hitData[6])
end]]
end
end
end
end
return false -- Can't penetrate
end
local function OnRayExited(SegmentVelocity, Origin, Direction, Hit, Position, Normal, Material, Tool, ClientModule, Misc, Replicate)
local ShowEffects = ScreenCullingEnabled and (ScreenCulling(Position, ScreenCullingRadius) and (Position - Camera.CFrame.p).Magnitude <= RenderDistance) or (Position - Camera.CFrame.p).Magnitude <= RenderDistance
if Hit and Hit.Parent then
if Hit.Name == "_glass" then
return
else
local Target = Hit:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if ShowEffects then
MakeBloodFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
else
if ShowEffects then
MakeImpactFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate)
end
end
end
end
end
local function OnRayUpdated(CastOrigin, SegmentOrigin, SegmentDirection, Length, SegmentVelocity, CosmeticBulletObject, ClientModule, Replicate)
-- Whenever the caster steps forward by one unit, this function is called
-- The bullet argument is the same object passed into the fire function
local BulletLength = CosmeticBulletObject.Size.Z / 2 -- This is used to move the bullet to the right spot based on a CFrame offset
local BaseCFrame = CFrame.new(SegmentOrigin, SegmentOrigin + SegmentDirection)
if ClientModule.CanSpinPart then
CosmeticBulletObject.CFrame = BaseCFrame * CFrame.new(0, 0, -(Length - BulletLength)) * CFrame.Angles(math.rad(-360 * (os.clock() * ClientModule.SpinX - math.floor(os.clock() * ClientModule.SpinX))), math.rad(-360 * (os.clock() * ClientModule.SpinY - math.floor(os.clock() * ClientModule.SpinY))), math.rad(-360 * (os.clock() * ClientModule.SpinZ - math.floor(os.clock() * ClientModule.SpinZ))))
else
CosmeticBulletObject.CFrame = BaseCFrame * CFrame.new(0, 0, -(Length - BulletLength))
end
if not Replicate and ClientModule.WhizSoundEnabled and CosmeticBulletObject.Parent and CosmeticBulletObject:FindFirstChild("Whizzed") then
local Whizzed = CosmeticBulletObject:FindFirstChild("Whizzed")
if not Whizzed.Value then
local Mag = (Camera.CFrame.p - CosmeticBulletObject.Position).Magnitude
if Mag < ClientModule.WhizDistance then
--local Loudness = 1 - (mag / whizData[5])
local WhizSound = Instance.new("Sound")
WhizSound.SoundId = "rbxassetid://"..ClientModule.WhizSoundID[math.random(1, #ClientModule.WhizSoundID)]
WhizSound.Volume = ClientModule.WhizSoundVolume --Loudness
WhizSound.PlaybackSpeed = Random.new():NextNumber(ClientModule.WhizSoundPitchMin, ClientModule.WhizSoundPitchMax)
WhizSound.Name = "WhizSound"
WhizSound.Parent = SoundService
WhizSound:Play()
Debris:AddItem(WhizSound, WhizSound.TimeLength / WhizSound.PlaybackSpeed)
Whizzed.Value = true
end
end
end
end
function ProjectileHandler:VisualizeHitEffect(Type, Hit, Position, Normal, Material, ClientModule, Misc, Replicate)
if Replicate then
VisualizeHitEffect:FireServer(Type, Hit, Position, Normal, Material, ClientModule, Misc, nil)
end
local ShowEffects = ScreenCullingEnabled and (ScreenCulling(Position, ScreenCullingRadius) and (Position - Camera.CFrame.p).Magnitude <= RenderDistance) or (Position - Camera.CFrame.p).Magnitude <= RenderDistance
if ShowEffects then
if Type == "Normal" then
MakeImpactFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate, true)
elseif Type == "Blood" then
MakeBloodFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate, true)
end
end
end
function ProjectileHandler:SimulateProjectile(Tool, Handle, ClientModule, Directions, FirePointObject, MuzzlePointObject, Misc, Replicate)
if ClientModule and Tool and Handle then
if Replicate then
VisualizeBullet:FireServer(Tool, Handle, ClientModule, Directions, FirePointObject, MuzzlePointObject, Misc, nil)
end
if ClientModule.MuzzleFlashEnabled then
for i, v in pairs(Misc.MuzzleFolder:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = MuzzlePointObject
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
Thread:Delay(0.01, function()
Particle:Emit(Count)
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
end
if ClientModule.MuzzleLightEnabled then
local Light = Instance.new("PointLight")
Light.Brightness = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightBrightness, ClientModule.LightBrightness)
Light.Color = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightColor, ClientModule.LightColor)
Light.Range = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightRange, ClientModule.LightRange)
Light.Shadows = ClientModule.LightShadows
Light.Enabled = true
Light.Parent = MuzzlePointObject
Debris:AddItem(Light, ClientModule.VisibleTime)
end
for _, Direction in pairs(Directions) do
if FirePointObject ~= nil then
local Origin, Dir = FirePointObject.WorldPosition, Direction
local IgnoreList = {Camera, Tool, Tool.Parent}
local HumanoidRootPart = Tool.Parent:WaitForChild("HumanoidRootPart", 1)
local TipCFrame = FirePointObject.WorldCFrame
local TipPos = TipCFrame.Position
local TipDir = TipCFrame.LookVector
local AmountToCheatBack = math.abs((HumanoidRootPart.Position - TipPos):Dot(TipDir)) + 1
local GunRay = Ray.new(TipPos - TipDir.Unit * AmountToCheatBack, TipDir.Unit * AmountToCheatBack)
local HitPart, HitPoint = Workspace:FindPartOnRayWithIgnoreList(GunRay, IgnoreList, false, true)
if HitPart and math.abs((TipPos - HitPoint).Magnitude) > 0 then
Origin = HitPoint - TipDir.Unit * 0.1
--Dir = TipDir.Unit
end
local MyMovementSpeed = HumanoidRootPart.Velocity
local ModifiedBulletSpeed = (Dir * AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletSpeed, ClientModule.BulletSpeed)) -- + MyMovementSpeed
local Bullet = Projectiles[AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ProjectileType, ClientModule.ProjectileType)]:Clone()
Bullet.CFrame = CFrame.new(Origin, Origin + Dir)
Bullet.Parent = Camera
if not Replicate then
local Whizzed = Instance.new("BoolValue")
Whizzed.Name = "Whizzed"
Whizzed.Value = false
Whizzed.Parent = Bullet
end
for _, v in pairs(Bullet:GetDescendants()) do
if v:IsA("ParticleEmitter") then
v.Enabled = true
elseif v:IsA("Sound") then
v:Play()
elseif v:IsA("PointLight") then
v.Enabled = true
elseif v:IsA("Trail") then
v.Enabled = true
elseif v:IsA("Beam") then
v.Enabled = true
end
end
local PenetrationDepth = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PenetrationDepth, ClientModule.PenetrationDepth)
local PenetrationAmount = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PenetrationAmount, ClientModule.PenetrationAmount)
local PenetrationData
if (PenetrationDepth > 0 or PenetrationAmount > 0) and not AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExplosiveEnabled, ClientModule.ExplosiveEnabled) then
PenetrationData = {penetrationType = ClientModule.PenetrationType, penetrationDepth = PenetrationDepth, canPenetrateFunction = CanRayPenetrate, penetrationAmount = PenetrationAmount, canPenetrateHumanoidFunction = CanRayPenetrateHumanoid}
end
Caster:FireWithBlacklist(Origin,
Dir * AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.Range, ClientModule.Range),
ModifiedBulletSpeed,
IgnoreList,
Bullet,
true,
AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.Acceleration, ClientModule.Acceleration),
Tool,
ClientModule,
Misc,
Replicate,
PenetrationData)
end
end
end
end
Caster.LengthChanged:Connect(OnRayUpdated)
Caster.RayHit:Connect(OnRayHit)
Caster.RayExited:Connect(OnRayExited)
return ProjectileHandler
|
--[=[
Constructs a Janitor object.
]=]
|
function Janitor.new()
local self = setmetatable({}, Janitor)
self._objects = {}
return self
end
|
--Made by Luckymaxer
|
Mouse_Icon = "rbxasset://textures/GunCursor.png"
Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
Tool = script.Parent
Mouse = nil
function UpdateIcon()
if Mouse then
Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
end
end
function OnEquipped(ToolMouse)
Mouse = ToolMouse
UpdateIcon()
end
function OnChanged(Property)
if Property == "Enabled" then
UpdateIcon()
end
end
Tool.Equipped:Connect(OnEquipped)
Tool.Changed:Connect(OnChanged)
|
--Protected Turn 4--: Standard GYR with a protected turn for four signal directions
|
--Each side takes turn having protected turns
--A permissive cycle follows
--TurnSignal1 & Signal1 goes first, then TurnSignal1a& & Signal1a , then TurnSignal2 & Signal2, and finally TurnSignal2a & Signal2a
--USES: Signal1, Signal1a, Signal2, Signal2a, Turn1, Turn1a, Turn2, Turn2a
while true do
PedValues = script.Parent.Parent.PedValues
SignalValues = script.Parent.Parent.SignalValues
TurnValues = script.Parent.Parent.TurnValues
|
-- connect events
|
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)
|
------------------------------------------------------------------------------------------------------------------------------------------------------
|
local Workspace = game:GetService('Workspace')
local Players = game:GetService('Players')
local RunService = game:GetService('RunService')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local LocalPlayer = Players.LocalPlayer
local LocalMouse = LocalPlayer:GetMouse()
local LocalCamera = Workspace.CurrentCamera
local MaxCameraZoomCount = 5
local CameraZoomCount = -MaxCameraZoomCount
LocalCamera.CameraType = Enum.CameraType.Scriptable
|
-- If in-game, enable ctrl hotkeys for undoing and redoing
|
if Mode == 'Tool' then
AssignHotkey({ 'LeftControl', 'Z' }, History.Undo);
AssignHotkey({ 'RightControl', 'Z' }, History.Undo);
AssignHotkey({ 'LeftControl', 'Y' }, History.Redo);
AssignHotkey({ 'RightControl', 'Y' }, History.Redo);
end;
function CloneSelection()
-- Clones selected parts
-- Make sure that there are items in the selection
if #Selection.Items == 0 then
return;
end;
-- Send the cloning request to the server
local Clones = SyncAPI:Invoke('Clone', Selection.Items);
-- Put together the history record
local HistoryRecord = {
Clones = Clones;
Unapply = function (HistoryRecord)
-- Reverts this change
-- Deselect the clones
Selection.Remove(HistoryRecord.Clones, false);
-- Remove the clones
SyncAPI:Invoke('Remove', HistoryRecord.Clones);
end;
Apply = function (HistoryRecord)
-- Reapplies this change
-- Restore the clones
SyncAPI:Invoke('UndoRemove', HistoryRecord.Clones);
end;
};
-- Register the history record
History.Add(HistoryRecord);
-- Select the clones
Selection.Replace(Clones);
-- Play a confirmation sound
PlayConfirmationSound();
-- Flash the outlines of the new parts
coroutine.wrap(Selection.FlashOutlines)();
end;
ConfirmationSound = Create 'Sound' {
Name = 'BTActionCompletionSound';
Pitch = 1.5;
SoundId = Assets.ActionCompletionSound;
Volume = 1;
};
function PlayConfirmationSound()
-- Plays a confirmation beep sound
-- Trigger the sound locally
SoundService:PlayLocalSound(ConfirmationSound);
end;
function DeleteSelection()
-- Deletes selected items
-- Put together the history record
local HistoryRecord = {
Parts = Support.CloneTable(Selection.Items);
Unapply = function (HistoryRecord)
-- Reverts this change
-- Restore the parts
SyncAPI:Invoke('UndoRemove', HistoryRecord.Parts);
-- Select the restored parts
Selection.Replace(HistoryRecord.Parts);
end;
Apply = function (HistoryRecord)
-- Applies this change
-- Deselect the parts
Selection.Remove(HistoryRecord.Parts, false);
-- Remove the parts
SyncAPI:Invoke('Remove', HistoryRecord.Parts);
end;
};
-- Deselect parts before deleting
Selection.Remove(HistoryRecord.Parts, false);
-- Perform the removal
SyncAPI:Invoke('Remove', HistoryRecord.Parts);
-- Register the history record
History.Add(HistoryRecord);
end;
|
--Made by Stickmasterluke
|
sp=script.Parent
speedboost=1 --100% speed bonus
speedforsmoke=10 --smoke apears when character running >= 10 studs/second.
function waitfor(a,b,c)
local c=c or 5*60
local d=tick()+c
while a:FindFirstChild(b)==nil and tick()<=d do
wait()
end
return a:FindFirstChild(b)
end
local tooltag=waitfor(script,"ToolTag",2)
if tooltag~=nil then
local tool=tooltag.Value
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16+10*speedboost
local t=sp:FindFirstChild("Torso")
if t~=nil then
smokepart=Instance.new("Part")
smokepart.FormFactor="Custom"
smokepart.Size=Vector3.new(0,0,0)
smokepart.TopSurface="Smooth"
smokepart.BottomSurface="Smooth"
smokepart.CanCollide=false
smokepart.Transparency=1
local weld=Instance.new("Weld")
weld.Name="SmokePartWeld"
weld.Part0=t
weld.Part1=smokepart
weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
weld.Parent=smokepart
smokepart.Parent=sp
smoke=Instance.new("Fire")
smoke.Enabled=t.Velocity.magnitude>speedforsmoke
smoke.Size=5
smoke.Parent=smokepart
h.Running:connect(function(speed)
if smoke and smoke~=nil then
smoke.Enabled=speed>speedforsmoke
end
end)
end
end
while tool~=nil and tool.Parent==sp and h~=nil do
sp.ChildRemoved:wait()
end
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16
end
end
if smokepart~=nil then
smokepart:remove()
end
script:remove()
|
--[[
remoteProperty = RemoteProperty.new(value: any [, overrideClass: string])
remoteProperty:Get(): any
remoteProperty:Set(value: any): void
remoteProperty:Replicate(): void [Only for table values]
remoteProperty:Destroy(): void
remoteProperty.Changed(newValue: any): Connection
--]]
|
local Signal = require(script.Parent.Parent.Signal)
local IS_SERVER = game:GetService("RunService"):IsServer()
local typeClassMap = {
boolean = "BoolValue";
string = "StringValue";
table = "RemoteEvent";
CFrame = "CFrameValue";
Color3 = "Color3Value";
BrickColor = "BrickColorValue";
number = "NumberValue";
Instance = "ObjectValue";
Ray = "RayValue";
Vector3 = "Vector3Value";
["nil"] = "ObjectValue";
}
local RemoteProperty = {}
RemoteProperty.__index = RemoteProperty
function RemoteProperty.Is(object)
return type(object) == "table" and getmetatable(object) == RemoteProperty
end
function RemoteProperty.new(value, overrideClass)
assert(IS_SERVER, "RemoteProperty can only be created on the server")
if overrideClass ~= nil then
assert(type(overrideClass) == "string", "OverrideClass must be a string; got " .. type(overrideClass))
assert(overrideClass:match("Value$"), "OverrideClass must be of super type ValueBase (e.g. IntValue); got " .. overrideClass)
end
local t = typeof(value)
local class = overrideClass or typeClassMap[t]
assert(class, "RemoteProperty does not support type \"" .. t .. "\"")
local self = setmetatable({
_value = value;
_type = t;
_isTable = (t == "table");
_object = Instance.new(class);
}, RemoteProperty)
if self._isTable then
local req = Instance.new("RemoteFunction")
req.Name = "TableRequest"
req.Parent = self._object
function req.OnServerInvoke(_player)
return self._value
end
self.Changed = Signal.new()
else
self.Changed = self._object.Changed
end
self:Set(value)
return self
end
function RemoteProperty:Replicate()
if self._isTable then
self:Set(self._value)
end
end
function RemoteProperty:Set(value)
if self._isTable then
self._object:FireAllClients(value)
self.Changed:Fire(value)
else
self._object.Value = value
end
self._value = value
end
function RemoteProperty:Get()
return self._value
end
function RemoteProperty:Destroy()
self._object:Destroy()
end
return RemoteProperty
|
--[=[
Set the value of the property for a specific player. This
will override the value used by `Set` (and the initial value
set for the property when created).
This value _can_ be `nil`. In order to reset the value for a
given player and let the player use the top-level value held
by this property, either use `Set` to set all players' data,
or use `ClearFor`.
```lua
remoteProperty:SetFor(somePlayer, "CustomData")
```
]=]
|
function RemoteProperty:SetFor(player: Player, value: any)
if player.Parent then
self._perPlayer[player] = if value == nil then None else value
end
self._rs:Fire(player, value)
end
|
--// Scripted by Trackplayer
--// Do not edit the code if you don't know what are you doing.
|
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(0.7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
local openSound = script.Parent.Open
local closeSound = script.Parent.Close
local click = script.Parent.ClickDetector
local center = script.Parent.Parent.Center
local origin = script.Parent.Parent.Parent.Door1Origin
local toGo = script.Parent.Parent.Parent.Door1ToGo
local isOpen = false
local isMoving = false
click.MouseClick:Connect(function()
if isOpen == false and isMoving == false then
isMoving = true
isOpen = true
TweenService:Create(center, Info, {CFrame = toGo.CFrame}):Play()
openSound:Play()
wait(0.7)
isMoving = false
elseif isOpen == true and isMoving == false then
isMoving = true
isOpen = false
TweenService:Create(center, Info, {CFrame = origin.CFrame}):Play()
wait(0.5)
closeSound:Play()
wait(0.2)
isMoving = false
end
end)
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Persimmon",Paint)
end)
|
----------------------------------
------------FUNCTIONS-------------
----------------------------------
|
function UnDigify(digit)
if digit < 1 or digit > 61 then
return ""
elseif digit == 1 then
return "1"
elseif digit == 2 then
return "!"
elseif digit == 3 then
return "2"
elseif digit == 4 then
return "@"
elseif digit == 5 then
return "3"
elseif digit == 6 then
return "4"
elseif digit == 7 then
return "$"
elseif digit == 8 then
return "5"
elseif digit == 9 then
return "%"
elseif digit == 10 then
return "6"
elseif digit == 11 then
return "^"
elseif digit == 12 then
return "7"
elseif digit == 13 then
return "8"
elseif digit == 14 then
return "*"
elseif digit == 15 then
return "9"
elseif digit == 16 then
return "("
elseif digit == 17 then
return "0"
elseif digit == 18 then
return "q"
elseif digit == 19 then
return "Q"
elseif digit == 20 then
return "w"
elseif digit == 21 then
return "W"
elseif digit == 22 then
return "e"
elseif digit == 23 then
return "E"
elseif digit == 24 then
return "r"
elseif digit == 25 then
return "t"
elseif digit == 26 then
return "T"
elseif digit == 27 then
return "y"
elseif digit == 28 then
return "Y"
elseif digit == 29 then
return "u"
elseif digit == 30 then
return "i"
elseif digit == 31 then
return "I"
elseif digit == 32 then
return "o"
elseif digit == 33 then
return "O"
elseif digit == 34 then
return "p"
elseif digit == 35 then
return "P"
elseif digit == 36 then
return "a"
elseif digit == 37 then
return "s"
elseif digit == 38 then
return "S"
elseif digit == 39 then
return "d"
elseif digit == 40 then
return "D"
elseif digit == 41 then
return "f"
elseif digit == 42 then
return "g"
elseif digit == 43 then
return "G"
elseif digit == 44 then
return "h"
elseif digit == 45 then
return "H"
elseif digit == 46 then
return "j"
elseif digit == 47 then
return "J"
elseif digit == 48 then
return "k"
elseif digit == 49 then
return "l"
elseif digit == 50 then
return "L"
elseif digit == 51 then
return "z"
elseif digit == 52 then
return "Z"
elseif digit == 53 then
return "x"
elseif digit == 54 then
return "c"
elseif digit == 55 then
return "C"
elseif digit == 56 then
return "v"
elseif digit == 57 then
return "V"
elseif digit == 58 then
return "b"
elseif digit == 59 then
return "B"
elseif digit == 60 then
return "n"
elseif digit == 61 then
return "m"
else
return "?"
end
end
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
local TweenService = game:GetService("TweenService")
function Tween(obj,Goal,Time,...)
local TwInfo = TweenInfo.new(Time,...)
local twn = TweenService:Create(obj, TwInfo, Goal)
twn:Play()
twn.Completed:wait()
return
end
function max(key)
local Properties = {}
Properties.Size = Vector3.new(7,key.Size.Y,key.Size.Z)
Tween(key,Properties,.1,Enum.EasingStyle.Linear)
Properties = {}
Properties.Size = Vector3.new(.4,key.Size.Y,key.Size.Z)
Tween(key,Properties,.1,Enum.EasingStyle.Linear)
return
end
function notmax(key,amt)
local Properties = {}
Properties.Size = Vector3.new(key.Size.x + amt,key.Size.Y,key.Size.Z)
Tween(key,Properties,.1,Enum.EasingStyle.Linear)
Properties = {}
Properties.Size = Vector3.new(.4,key.Size.Y,key.Size.Z)
Tween(key,Properties,.1,Enum.EasingStyle.Linear)
return
end
function hit(key,amt)
if key then
if key.Size.x + amt >= 7 then
max(key)
else
notmax(key,amt)
end
end
return
end
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local key = Keys.Keys:FindFirstChild(note1)
local note2 = note1 + 1
local note3 = note1 + 2
local note0 = note1 - 1
local note01 = note1 - 2
if note2 == 62 then
note2 = Keys.Keys:FindFirstChild("1")
else
note2 = Keys.Keys:FindFirstChild(note2)
end
if note3 == 62 then
note3 = Keys.Keys:FindFirstChild("1")
elseif note3 == 63 then
note3 = Keys.Keys:FindFirstChild("2")
else
note3 = Keys.Keys:FindFirstChild(note3)
end
if note0 == 0 then
note0 = Keys.Keys:FindFirstChild("61")
else
note0 = Keys.Keys:FindFirstChild(note0)
end
if note01 == 0 then
note01 = Keys.Keys:FindFirstChild("61")
elseif note01 == -1 then
note01 = Keys.Keys:FindFirstChild("60")
else
note01 = Keys.Keys:FindFirstChild(note01)
end
coroutine.resume(coroutine.create(hit),key,3)
coroutine.resume(coroutine.create(hit),note2,1.5)
coroutine.resume(coroutine.create(hit),note3,.6)
coroutine.resume(coroutine.create(hit),note0,1.5)
coroutine.resume(coroutine.create(hit),note01,.6)
return
end
|
-- Created by BobNoobington
|
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local car = script.Parent.Car.Value
local values = script.Parent.Values.Gear
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "v" then
for index, child in ipairs(script.Parent:GetChildren()) do
if child.ClassName == "Frame" or child.ClassName == "ImageLabel" or child.ClassName == "TextButton" then
child.Visible = not child.Visible
end
end
end
end)
|
--------------------------------------------------------------------------------------------
-- Popper uses the level geometry find an upper bound on subject-to-camera distance.
--
-- Hard limits are applied immediately and unconditionally. They're generally caused
-- when level geometry intersects with the near plane (with exceptions, see below).
--
-- Soft limits are only applied under certain conditions.
-- They're caused when level geometry occludes the subject without actually intersecting
-- with the near plane at the target distance.
--
-- Soft limits can be promoted to hard limits and hard limits can be demoted to soft limits.
-- We usually don't want the latter to happen.
--
-- A soft limit will be promoted to a hard limit if an obstruction
-- lies between the current and target camera positions.
--------------------------------------------------------------------------------------------
|
local subjectRoot
local subjectPart
camera:GetPropertyChangedSignal('CameraSubject'):Connect(function()
local subject = camera.CameraSubject
if subject:IsA('Humanoid') then
subjectPart = subject.RootPart
elseif subject:IsA('BasePart') then
subjectPart = subject
else
subjectPart = nil
end
end)
local function canOcclude(part)
-- Occluders must be:
-- 1. Opaque
-- 2. Interactable
-- 3. Not in the same assembly as the subject
if FFlagUserPoppercamLooseOpacityThreshold then
return
getTotalTransparency(part) < 0.25 and
part.CanCollide and
subjectRoot ~= (part:GetRootPart() or part) and
not part:IsA('TrussPart')
else
return
part.Transparency < 0.95 and
part.CanCollide and
subjectRoot ~= (part:GetRootPart() or part)
end
end
|
-- OBJECTS
|
if Configuration.DoorSoundsEnabled == false then
Folder.Objects.Door:Destroy()
end
if Configuration.DresserSoundsEnabled == false then
Folder.Objects.Dresser:Destroy()
end
if Configuration.WardrobeSoundsEnabled == false then
Folder.Objects.Wardore:Destroy()
end
|
--[[
Controller for the break lights on the vehicle
]]
|
local VehicleLightsComponent = {}
|
--!strict
--[[
A utility used to assert that two objects are value-equal recursively. It
outputs fairly nicely formatted messages to help diagnose why two objects
would be different.
This should only be used in tests.
]]
|
local function deepEqual(a: any, b: any): (boolean, string?)
if typeof(a) ~= typeof(b) then
local message = ("{1} is of type %s, but {2} is of type %s"):format(typeof(a), typeof(b))
return false, message
end
if typeof(a) == "table" then
local visitedKeys = {}
for key, value in pairs(a) do
visitedKeys[key] = true
local success, innerMessage = deepEqual(value, b[key])
if not success and innerMessage then
local message = innerMessage
:gsub("{1}", ("{1}[%s]"):format(tostring(key)))
:gsub("{2}", ("{2}[%s]"):format(tostring(key)))
return false, message
end
end
for key, value in pairs(b) do
if not visitedKeys[key] then
local success, innerMessage = deepEqual(value, a[key])
if not success and innerMessage then
local message = innerMessage
:gsub("{1}", ("{1}[%s]"):format(tostring(key)))
:gsub("{2}", ("{2}[%s]"):format(tostring(key)))
return false, message
end
end
end
return true, nil
end
if a == b then
return true, nil
end
local message = "{1} ~= {2}"
return false, message
end
local function assertDeepEqual(a, b)
local success, innerMessageTemplate = deepEqual(a, b)
if not success and innerMessageTemplate then
local innerMessage = innerMessageTemplate:gsub("{1}", "first"):gsub("{2}", "second")
local message = ("Values were not deep-equal.\n%s"):format(innerMessage)
error(message, 2)
end
end
return assertDeepEqual
|
--Rocket.Touched:connect(OnTouched)
|
while script.Parent == Rocket do
ExplodeClone = Explode:clone()
ExplodeClone.Name = "Effect"
ExplodeClone.BrickColor = BrickColor.new("White")
ExplodeClone.Position = Rocket.Position
ExplodeClone.Mesh.Scale = Vector3.new(1,1,1)*5
ExplodeClone.CFrame = ExplodeClone.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-10000,10000)/100,math.random(-10000,10000)/100,math.random(-10000,10000)/100)
ExplodeClone.Parent = game.Players.LocalPlayer.Character.Torso
NewScript = Rocket.Trail:clone()
NewScript.Disabled = false
NewScript.Parent = ExplodeClone
if Target.Value ~= nil and Target.Value.Parent ~= nil then
if Target.Value then idealVelocity = --[[SPEED *]] (Target.Value.Position - Rocket.Position).unit end
Rocket.Velocity = --[[SPEED *]] (Rocket.Velocity + 0.125 * (idealVelocity - Rocket.Velocity)).unit
Rocket.CFrame = CFrame.new(Rocket.Position, Rocket.Position + Rocket.Velocity)
end
local hit,pos = raycast(Rocket.Position,((Rocket.CFrame * CFrame.new(0,0,-5)).p-Rocket.Position).unit,5)
if hit then
OnTouched(hit,pos)
end
Rocket.CFrame = Rocket.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0, 0, math.rad(18))
game:GetService("RunService").Stepped:wait()
end
|
-------------------
|
local function SetCollisionGroupRecursive(Object)
if Object:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(Object, CollisionGroupName)
end
for _, Objects in pairs(Object:GetChildren()) do
SetCollisionGroupRecursive(Objects)
end
end
local function OnCharacterAdded(Character)
SetCollisionGroupRecursive(Character)
end
local function OnPlayerAdded(Player)
Player.CharacterAdded:Connect(OnCharacterAdded)
end
local function OnMobAdded(Mob)
SetCollisionGroupRecursive(Mob)
end
|
-- Uses this UI instead of Roblox's for when data is loading using ContentStreaming
|
local LoadingFrame = script.Parent.LoadingFrame
local GuiService = game:GetService("GuiService")
local player = game.Players.LocalPlayer
GuiService:SetGameplayPausedNotificationEnabled(false)
local function onPauseStateChanged()
if player.GameplayPaused then
LoadingFrame.Visible = true
else
LoadingFrame.Visible = false
end
end
player:GetPropertyChangedSignal("GameplayPaused"):Connect(onPauseStateChanged)
|
-- GiveFlagBucks()
-- end
--end
--script.Parent.Tabs.Main.BCart.MouseButton1Click:Connect(function()
-- game.ReplicatedStorage.Remotes.GiveFlagBucks:FireServer()
-- game.ReplicatedStorage.Remotes.EndPurchase:FireServer()
--end)
| |
--ModulateSwitch
|
function KeepModulateActive()
repeat wait()
ModVal.Value = true
until ModSwch.Value == false or Power.Value == false
ModVal.Value = false
end
ModSwch.Changed:Connect(function()
if ModSwch.Value == true then
ModSwch.Parent.P1.Transparency = 1
ModSwch.Parent.P2.Transparency = 0
ClickSound:Play()
if Power.Value == true then
KeepModulateActive()
end
else
ModSwch.Parent.P1.Transparency = 0
ModSwch.Parent.P2.Transparency = 1
ClickSound:Play()
ModVal.Value = false
end
end)
|
-- Requires
|
local APIEquipment = require(ReplicatedStorage.Common.APIEquipment)
local APICharacterState = require(ReplicatedStorage.Common.APICharacterState)
|
-- This is taken from Roact internal implementation details as a temporary helper
-- so that we can control warnings spew and also validate warning logs in unit tests.
-- We should clean it up and turn it into a nice central logging facility later on.
|
local outputEnabled = true
local collectors = {}
local function createLogInfo()
local logInfo = {
warnings = {},
}
setmetatable(logInfo, {
__tostring = function(self)
return ("LogInfo\n\tWarnings (%d):\n\t\t%s"):format(
#self.warnings,
table.concat(self.warnings, "\n\t\t")
)
end,
})
return logInfo
end
local Logging = {}
function Logging.capture(callback)
local collector = createLogInfo()
local wasOutputEnabled = outputEnabled
outputEnabled = false
collectors[collector] = true
local success, result = pcall(callback)
collectors[collector] = nil
outputEnabled = wasOutputEnabled
assert(success, result)
return collector
end
function Logging.warn(message)
for collector in pairs(collectors) do
table.insert(collector.warnings, message)
end
if outputEnabled then
warn(message)
end
end
return Logging
|
-- This module enables you to place Icon wherever you like within the data model while
-- still enabling third-party applications (such as HDAdmin/Nanoblox) to locate it
-- This is necessary to prevent two TopbarPlus applications initiating at runtime which would
-- cause icons to overlap with each other
|
local replicatedStorage = game:GetService("ReplicatedStorage")
local TopbarPlusReference = {}
function TopbarPlusReference.addToReplicatedStorage()
local existingItem = replicatedStorage:FindFirstChild(script.Name)
if existingItem then
return false
end
local objectValue = Instance.new("ObjectValue")
objectValue.Name = script.Name
objectValue.Value = script.Parent
objectValue.Parent = replicatedStorage
return objectValue
end
function TopbarPlusReference.getObject()
local objectValue = replicatedStorage:FindFirstChild(script.Name)
if objectValue then
return objectValue
end
return false
end
return TopbarPlusReference
|
Rocket.CanCollide = false
|
Tool.Note:clone().Parent = Rocket
Tool.RocketScript:clone().Parent = Rocket
--Tool.Explosion:clone().Parent = Rocket
--Tool.Swoosh:clone().Parent = Rocket
function fire(vTarget)
local vCharacter = Tool.Parent;
local vHandle = Tool:findFirstChild("Handle")
if vHandle == nil then
print("Handle not found")
return
end
local chord = Tool.Ichord:clone()
if (Tool.mode.Value==1) then
chord = Tool.Ichord:clone()
elseif (Tool.mode.Value==2) then
chord = Tool.IVIIchord:clone()
elseif (Tool.mode.Value==3) then
chord = Tool.Vchord:clone()
elseif (Tool.mode.Value==4) then
chord = Tool.VVIIchord:clone()
elseif (Tool.mode.Value==5) then
chord = Tool.IVchord:clone()
elseif (Tool.mode.Value==6) then
chord = Tool.IIIchord:clone()
end
chord.Name = "chord"
local dir = Vector3.new(math.random()-.5, 1, math.random() - .5).unit
local missile = Rocket:clone()
chord.Parent = missile
script.Parent.pitchmode:Clone().Parent = missile
local pos = vHandle.Position + Vector3.new(0, 5 ,0)
--missile.Position = pos
missile.CFrame = CFrame.new(pos, pos + dir)
missile.BodyVelocity.velocity = dir * 30
local vPlayer = game.Players:playerFromCharacter(vCharacter)
if vPlayer == nil then
print("Player not found")
end
missile.RocketScript.Disabled = false
missile.Parent = game.Workspace
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
local targetPos = humanoid.TargetPoint
fire(targetPos)
Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
|
--[[Weight and CG]]
|
Tune.Weight = 5202 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 4.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
--Listen for input
|
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant ~= nil then
seat.Sound.Volume = 1
seat.Sound.PlaybackSpeed = 2
for i,v in pairs(script.Parent.Parts.Effect.EffectPart:GetChildren()) do
if v.Name == "Effect" then
v.Enabled = true
end
end
else
seat.Sound.Volume = 0
seat.Sound.PlaybackSpeed = 2
for i,v in pairs(script.Parent.Parts.Effect.EffectPart:GetChildren()) do
if v.Name == "Effect" then
v.Enabled = false
end
end
end
end)
seat:GetPropertyChangedSignal("Throttle"):Connect(function()
local goal = {}
local goal2 = {}
goal.Force = Vector3.new(seat.Throttle, 0, 0) * 100000
if seat.Throttle == 1 then goal2.PlaybackSpeed = 4 else goal2.PlaybackSpeed = 2 end
local Sound = TS:Create(seat.Sound,TI,goal2)
local Throttle = TS:Create(vectorForce,TI,goal)
Throttle:Play()
Sound:Play()
end)
seat:GetPropertyChangedSignal("Steer"):Connect(function()
torque.Torque = Vector3.new(0, -seat.Steer, 0) * 500000
end)
|
-- Tool's current status
|
local ToolStatus = Tool:WaitForChild("ToolStatus")
local SpawnedSegway = ToolStatus:WaitForChild("SpawnedSegway")
local HasSpawnedSegway = ToolStatus:WaitForChild("HasSpawnedSegway")
local IsCoolingDown = false
|
--[ Functions ]--
|
function CreateWeld(Part, CF)
local w = Instance.new("Weld")
w.Name = "LegWeld"
w.Parent = Torso
w.Part0 = Torso
w.Part1 = Part
w.C1 = CF
end
function StandUp()
Humanoid.CameraOffset = Vector3.new(0, 0, 0)
-- Right Leg
RH.Part1 = RL
-- Left Leg
LH.Part1 = LL
-- Delete Welds
for i, s in pairs(Torso:GetChildren()) do
if (s.Name == "LegWeld") and (s.ClassName == "Weld") then
s:Destroy()
end
end
-- Raise Character
RJ.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
RJ.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
end
|
--Make the part when touched enable the "ParticleEmitter" inside of it ad then disable it after 1 second
|
checkpoint.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid") then
local emitter = checkpoint.ParticleEmitter
emitter.Enabled = true
wait(0.3)
emitter.Enabled = false
end
end)
function onCheckpointTouched(hit)
if hit and hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid") then
local player = Players:GetPlayerFromCharacter(hit.Parent)
local checkpointData = ServerStorage:FindFirstChild("CheckpointData")
if not checkpointData then
checkpointData = Instance.new("Folder")
checkpointData.Name = "CheckpointData"
checkpointData.Parent = ServerStorage
end
local userIdString = tostring(player.UserId)
local checkpointValue = checkpointData:FindFirstChild(userIdString)
if checkpointValue.Value == script.Parent then
script.CheckPointPopup.Enabled=true
wait(2)
script.CheckPointPopup.Enabled=false
end
end
end
|
-- Updated 10/14/2014 - Updated to 1.0.3
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
|
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
local function CallOnChildren(Instance, FunctionToCall)
-- Calls a function on each of the children of a certain object, using recursion.
FunctionToCall(Instance)
for _, Child in next, Instance:GetChildren() do
CallOnChildren(Child, FunctionToCall)
end
end
local function GetNearestParent(Instance, ClassName)
-- Returns the nearest parent of a certain class, or returns nil
local Ancestor = Instance
repeat
Ancestor = Ancestor.Parent
if Ancestor == nil then
return nil
end
until Ancestor:IsA(ClassName)
return Ancestor
end
local function GetBricks(StartInstance)
local List = {}
-- if StartInstance:IsA("BasePart") then
-- List[#List+1] = StartInstance
-- end
CallOnChildren(StartInstance, function(Item)
if Item:IsA("BasePart") then
List[#List+1] = Item;
end
end)
return List
end
local function Modify(Instance, Values)
-- Modifies an Instance by using a table.
assert(type(Values) == "table", "Values is not a table");
for Index, Value in next, Values do
if type(Index) == "number" then
Value.Parent = Instance
else
Instance[Index] = Value
end
end
return Instance
end
local function Make(ClassType, Properties)
-- Using a syntax hack to create a nice way to Make new items.
return Modify(Instance.new(ClassType), Properties)
end
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
local function HasWheelJoint(Part)
for _, SurfaceName in pairs(Surfaces) do
for _, HingSurfaceName in pairs(HingSurfaces) do
if Part[SurfaceName].Name == HingSurfaceName then
return true
end
end
end
return false
end
local function ShouldBreakJoints(Part)
--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
-- definitely some edge cases.
if NEVER_BREAK_JOINTS then
return false
end
if HasWheelJoint(Part) then
return false
end
local Connected = Part:GetConnectedParts()
if #Connected == 1 then
return false
end
for _, Item in pairs(Connected) do
if HasWheelJoint(Item) then
return false
elseif not Item:IsDescendantOf(script.Parent) then
return false
end
end
return true
end
local function WeldTogether(Part0, Part1, JointType, WeldParent)
--- Weld's 2 parts together
-- @param Part0 The first part
-- @param Part1 The second part (Dependent part most of the time).
-- @param [JointType] The type of joint. Defaults to weld.
-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
-- @return The weld created.
JointType = JointType or "Weld"
local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
Modify(NewWeld, {
Name = "qCFrameWeldThingy";
Part0 = Part0;
Part1 = Part1;
C0 = CFrame.new();--Part0.CFrame:inverse();
C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
Parent = Part1;
})
if not RelativeValue then
RelativeValue = Make("CFrameValue", {
Parent = Part1;
Name = "qRelativeCFrameWeldValue";
Archivable = true;
Value = NewWeld.C1;
})
end
return NewWeld
end
local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
-- @param MainPart The part to weld the model to (can be in the model).
-- @param [JointType] The type of joint. Defaults to weld.
-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
for _, Part in pairs(Parts) do
if ShouldBreakJoints(Part) then
Part:BreakJoints()
end
end
for _, Part in pairs(Parts) do
if Part ~= MainPart then
WeldTogether(MainPart, Part, JointType, MainPart)
end
end
end
local function PerfectionWeld()
local Tool = GetNearestParent(script, "Tool")
local Parts = GetBricks(script.Parent)
local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
if PrimaryPart then
WeldParts(Parts, PrimaryPart, "Weld", false)
else
warn("qWeld - Unable to weld part")
end
return Tool
end
local Tool = PerfectionWeld()
if Tool and script.ClassName == "Script" then
--- Don't bother with local scripts
script.Parent.AncestryChanged:connect(function()
PerfectionWeld()
end)
end
|
-------------------------------------
|
Tool = script.Parent
p = Instance.new("Part")
p.Parent = game.Lighting
p.Name = "BulletTexture"
p.CanCollide = false
p.formFactor = "Custom"
p.Size = Vector3.new(1,0.1,1)
p.Transparency = 1
g = Instance.new("SpecialMesh")
g.Parent = p
run = 0
equiped=false
dw = false
sp=script.Parent
RayLength=1000
Spread=0.0001
enabled=true
reloading=false
down=false
r=game:service("RunService")
last=0
last2=0
last3=0
last4=0
last5=0
last6=0
UseDouble = false
function check()
sp.Name=ToolName.."-("..tostring(sp.Ammo.Value)..")"
end
function computeDirection(vec)
return vec.unit
end
|
-- Tips
|
function Icon:setTip(text)
assert(typeof(text) == "string" or text == nil, "Expected string, got "..typeof(text))
local textSize = textService:GetTextSize(text, 12, Enum.Font.GothamSemibold, Vector2.new(1000, 20-6))
self.instances.tipLabel.Text = text
self.instances.tipFrame.Size = UDim2.new(0, textSize.X+6, 0, 20)
self.instances.tipFrame.Parent = (text and activeItems) or self.instances.iconContainer
self.tipText = text
if self.hovering then
self:_displayTip(true)
end
return self
end
function Icon:_displayTip(visibility)
local newVisibility = visibility
local tipFrame = self.instances.tipFrame
if self.tipText == nil then
return
elseif userInputService.TouchEnabled and not self._draggingFinger then
return
end
if newVisibility == true then
-- When the user moves their cursor/finger, update tip to match the position
local function updateTipPositon(x, y)
local newX = x
local newY = y
local camera = workspace.CurrentCamera
local viewportSize = camera and camera.ViewportSize
if userInputService.TouchEnabled then
--tipFrame.AnchorPoint = Vector2.new(0.5, 0.5)
local desiredX = newX - tipFrame.Size.X.Offset/2
local minX = 0
local maxX = viewportSize.X - tipFrame.Size.X.Offset
local desiredY = newY + THUMB_OFFSET + 60
local minY = tipFrame.AbsoluteSize.Y + THUMB_OFFSET + 64 + 3
local maxY = viewportSize.Y - tipFrame.Size.Y.Offset
newX = math.clamp(desiredX, minX, maxX)
newY = math.clamp(desiredY, minY, maxY)
elseif IconController.controllerModeEnabled then
local indicator = TopbarPlusGui.Indicator
local newPos = indicator.AbsolutePosition
newX = newPos.X - tipFrame.Size.X.Offset/2 + indicator.AbsoluteSize.X/2
newY = newPos.Y + 90
else
local desiredX = newX
local minX = 0
local maxX = viewportSize.X - tipFrame.Size.X.Offset - 48
local desiredY = newY
local minY = tipFrame.Size.Y.Offset+3
local maxY = viewportSize.Y
newX = math.clamp(desiredX, minX, maxX)
newY = math.clamp(desiredY, minY, maxY)
end
--local difX = tipFrame.AbsolutePosition.X - tipFrame.Position.X.Offset
--local difY = tipFrame.AbsolutePosition.Y - tipFrame.Position.Y.Offset
--local globalX = newX - difX
--local globalY = newY - difY
--tipFrame.Position = UDim2.new(0, globalX, 0, globalY-55)
tipFrame.Position = UDim2.new(0, newX, 0, newY-20)
end
local cursorLocation = userInputService:GetMouseLocation()
if cursorLocation then
updateTipPositon(cursorLocation.X, cursorLocation.Y)
end
self._hoveringMaid:give(self.instances.iconButton.MouseMoved:Connect(updateTipPositon))
end
-- Change transparency of relavent tip instances
for _, settingName in pairs(self._uniqueSettings.tip) do
self:_update(settingName)
end
end
|
--[=[
@param ... any
@return args: ...any
Serializes the arguments and returns the serialized values.
]=]
|
function Ser.SerializeArgsAndUnpack(...: any): ...any
local args = Ser.SerializeArgs(...)
return table.unpack(args, 1, args.n)
end
|
--Automatic Gauge Scaling
|
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
script.Parent.Gear.Text = gearText
end)
function PBrake()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end
script.Parent.Parent.Values.PBrake.Changed:connect(PBrake)
function Gear()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "MV"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "MV"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "MV"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(script.Parent.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
for i=1,30 do
for _,v in pairs(script.Parent.Frame:GetChildren()) do
v.BackgroundTransparency=1-(i/60)
end
script.Parent.TMode.TextTransparency=1-(i/30)
wait(.01)
end
wait(.1)
Gear()
PBrake()
|
-- ROBLOX deviation: function to check whether a table is an array
-- https://stackoverflow.com/questions/7526223/how-do-i-know-if-a-table-is-an-array/52697380#52697380
|
local function is_array(t)
if type(t) ~= "table" then
return false
end
-- objects always return empty size
if #t > 0 then
return true
end
-- only object can have empty length with elements inside
for k, v in pairs(t) do
return false
end
-- if no elements it can be array and not at same time
return true
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {
spacing = 8,
image = "rbxasset://textures/Cursors/Gamepad/Pointer.png",
imageSize = Vector2.new(2, 2)
};
local v2 = Instance.new("Model");
v2.Name = "PathDisplayPoints";
local v3 = Instance.new("Part");
v3.Anchored = true;
v3.CanCollide = false;
v3.Transparency = 1;
v3.Name = "PathDisplayAdornee";
v3.CFrame = CFrame.new(0, 0, 0);
v3.Parent = v2;
local v4 = {};
for v5 = 1, 30 do
local v6 = Instance.new("ImageHandleAdornment");
v6.Archivable = false;
v6.Adornee = v3;
v6.Image = v1.image;
v6.Size = v1.imageSize;
v4[v5] = v6;
end;
local u1 = 30;
local function u2()
local v7 = v4[1];
if not v7 then
return;
end;
v4[1] = v4[u1];
v4[u1] = nil;
u1 = u1 - 1;
return v7;
end;
local u3 = {};
function v1.setCurrentPoints(p1)
if typeof(p1) == "table" then
u3 = p1;
return;
end;
u3 = {};
end;
local u4 = {};
local function u5(p2)
u1 = u1 + 1;
v4[u1] = p2;
end;
function v1.clearRenderedPath()
for v8, v9 in ipairs(u4) do
v9.Parent = nil;
u5(v9);
end;
u4 = {};
v2.Parent = nil;
end;
local function u6(p3, p4)
if u1 == 0 then
return;
end;
local v10, v11, v12 = workspace:FindPartOnRayWithIgnoreList(Ray.new(p3 + Vector3.new(0, 2, 0), Vector3.new(0, -8, 0)), { game.Players.LocalPlayer.Character, workspace.CurrentCamera });
if not v10 then
return;
end;
local v13 = u2();
v13.CFrame = CFrame.new(v11, v11 + v12);
v13.Parent = v2;
return v13;
end;
function v1.renderPath()
v1.clearRenderedPath();
if not u3 or #u3 == 0 then
return;
end;
local v14 = #u3;
local v15 = 0;
u4[1] = u6(u3[v14], true);
if not u4[1] then
return;
end;
while true do
local v16 = u3[v14];
if v14 < 2 then
break;
end;
local v17 = u3[v14 - 1] - v16;
local l__magnitude__18 = v17.magnitude;
if l__magnitude__18 < v15 then
v15 = v15 - l__magnitude__18;
v14 = v14 - 1;
else
local v19 = u6(v16 + v17.unit * v15, false);
if v19 then
u4[#u4 + 1] = v19;
end;
v15 = v15 + v1.spacing;
end;
end;
v2.Parent = workspace.CurrentCamera;
end;
return v1;
|
-- Dark was here
|
local nearplayer
local Players = game:GetService("Players")
function MakeAMove()
nearplayer = false
if (tick()-holdOrder < holdDuration) then return end
if stance == "wander" then
for _,Player in next, Players:GetPlayers() do
if Player.Character and Player.Character.PrimaryPart then
local dis = (Player.Character.PrimaryPart.CFrame.Position - root.CFrame.Position).Magnitude
if dis >= 500 then
nearplayer = true
break
end
end
end
if nearplayer then
task.wait(math.random(1, 1 + 1/2))
return
end
local collisionRay = Ray.new(
(root.CFrame*CFrame.new(0,100,-15)).p ,
Vector3.new(0,-1000,0)
)
local part,pos,norm,mat = workspace:FindPartOnRayWithIgnoreList(collisionRay,shark:GetDescendants())
--local asdf = Instance.new("Part")
--asdf.Anchored = true
--asdf.Size = Vector3.new(2,2,2)
--asdf.CFrame = CFrame.new(pos)
--asdf.Parent = workspace
if part then
if part == workspace.Terrain and mat ~= Enum.Material.Water then
-- redirect
destination =( (root.CFrame*CFrame.Angles(0,math.rad(math.random(90,270)),0))*CFrame.new(0,0,-40)).p
holdOrder = tick()
elseif part == workspace.Terrain and mat == Enum.Material.Water then
if (tick()-lastAdjustment) > nextAdjustment then
lastAdjustment = tick()
nextAdjustment = math.random(10,30)
destination =( (root.CFrame*CFrame.Angles(0,math.rad(math.random(0,359)),0))*CFrame.new(0,0,-40)).p
holdDuration = 2
holdOrder = tick()
else
destination = (root.CFrame*CFrame.new(0,0,-25)).p
end
end
elseif part and part~= workspace.Terrain then
destination = (root.CFrame*CFrame.new(0,0,-25)).p
elseif not part then
destination = ((root.CFrame*CFrame.Angles(0,math.rad(180),0))*CFrame.new(0,0,-40)).p
holdDuration = 4
holdOrder = tick()
end
bodyPos.Position = Vector3.new(destination.X,-6,destination.Z)
bodyGyro.CFrame = CFrame.new(CFrame.new(root.CFrame.p.X,-6,root.CFrame.p.Z).p,CFrame.new(destination.X,-6,destination.Z).p)
elseif stance == "attack" then
bodyPos.Position = destination
bodyGyro.CFrame = CFrame.new(root.Position,Vector3.new(destination.X,root.Position.Y,destination.Z))
if (shark.PrimaryPart.Position-target.PrimaryPart.Position).magnitude < 25 then
-- lunge and hold
if target.Humanoid.SeatPart then
game.ReplicatedStorage.Events.NPCAttack:Fire(target.Humanoid.SeatPart.Parent,math.random(1000))
else
game.ReplicatedStorage.Events.NPCAttack:Fire(game.Players:GetPlayerFromCharacter(target),90)
end
shark.Head.SharkEat:Play()
local emitter = game.ReplicatedStorage.Particles.Teeth:Clone()
emitter.Parent = shark.Head
emitter.EmissionDirection = Enum.NormalId.Top
wait()
emitter:Emit(1)
holdOrder = tick()
holdDuration = 2
end
end
end -- end of MakeAMove()
MakeAMove()
local scanSurroundings = coroutine.wrap(function()
while true do
stance = "wander"
local surroundingParts = workspace:FindPartsInRegion3WithIgnoreList(Region3.new(
shark.PrimaryPart.Position+Vector3.new(-60,-3,-60),
shark.PrimaryPart.Position+Vector3.new(60,10,60)),
shark:GetChildren())
for _,v in next,surroundingParts do
if v.Parent:FindFirstChild("Humanoid") and v.Parent.Humanoid.Health > 0 then
-- we have a player in the radius
local playerRay = Ray.new(v.Position+Vector3.new(0,10,0),Vector3.new(0,-50,0))
local part,pos,norm,mat = workspace:FindPartOnRay(playerRay,v.Parent)
if part == workspace.Terrain and mat ~= Enum.Material.Water then
-- don't set to attack
else
stance = "attack"
target = v.Parent
-- destination = v.Parent.PrimaryPart.Position
destination = (CFrame.new(root.CFrame.p,Vector3.new(v.Parent.PrimaryPart.CFrame.p.x, -9,v.Parent.PrimaryPart.CFrame.p.z))*CFrame.new(0,0,-50)).p
break
-- change y height of shark
end
end
end
if stance == "wander" then
scanInterval = 1
target = nil
MakeAMove()
elseif stance == "attack" then
scanInterval = .1
MakeAMove()
end
wait(scanInterval)
end -- end of wtd
end)
scanSurroundings()
|
--[[ Created by a member of Scripting Helpers: PGenocide ]]
|
--
|
-- Roact
|
local new = Roact.createElement
local Slider = require(script:WaitForChild('Slider'))
|
---
|
---ForCode
script.Parent["1"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["2"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["3"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["4"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["5"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["6"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["7"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["8"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["9"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
script.Parent["0"].ClickDetector.MouseClick:Connect(function()
huh.ButtonSound:Play()
folder.CodePrivate.Value = folder.CodePrivate.Value .."I"
end)
---
|
--[[ArrowTx = {
[1]=146678603,
[2]=146678613,
[3]=146678618,
[4]=146678637,
[5]=146678647,
[6]=146678656,
[7]=146678671
}
Scroll = false
ArrowInd = script.Parent.Car.Screen.SurfaceGui.Frame.Arrow
Direction.Changed:connect(function()
if Scroll then return end
Scroll = true
if Direction.Value == "U" then
ArrowInd.Rotation = 0
repeat
for i=1,7 do
ArrowInd.Image = "http://www.roblox.com/asset/?id="..ArrowTx[i]
wait()
end
until Direction.Value == "N"
end
if Direction.Value == "D" then
ArrowInd.Rotation = 180
repeat
for i=1,7 do
ArrowInd.Image = "http://www.roblox.com/asset/?id="..ArrowTx[i]
wait()
end
until Direction.Value == "N"
end
ArrowInd.Image = "http://www.roblox.com/asset/?id=0"
Scroll = false
end)
]]
|
--
|
--Obj
|
local server = ServerScriptService.Framework
local shared = ReplicatedStorage.Framework
local Main = server.Main
local Local = server.Local
local Shared = shared.Main
local SharedLocal = shared.Local
local Internal = shared.Internal
|
-------------------------------------Gun info
|
ToolName="M110"
ClipSize=10
ReloadTime=.25
Firerate=.1
MinSpread=0
MaxSpread=0
SpreadRate=0
BaseDamage=67
automatic=false
burst=false
shot=false --Shotgun
BarrlePos=Vector3.new(-2.20,.40,0)
Cursors={"rbxasset://textures\\GunCursor.png"}
ReloadCursor="rbxasset://textures\\GunWaitCursor.png"
|
--// # key, ManOn
|
mouse.KeyDown:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Man:Play()
veh.Lightbar.middle.Wail.Volume = 0
veh.Lightbar.middle.Yelp.Volume = 0
veh.Lightbar.middle.Priority.Volume = 0
script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
veh.Lightbar.MANUAL.Transparency = 0
end
end)
|
-- Set the Text property to a random string of 100 characters
|
if textLabel then
textLabel.Text = generateRandomString(100)
end
|
--!nonstrict
--[[
ControlModule - This ModuleScript implements a singleton class to manage the
selection, activation, and deactivation of the current character movement controller.
This script binds to RenderStepped at Input priority and calls the Update() methods
on the active controller instances.
The character controller ModuleScripts implement classes which are instantiated and
activated as-needed, they are no longer all instantiated up front as they were in
the previous generation of PlayerScripts.
2018 PlayerScripts Update - AllYourBlox
--]]
|
local ControlModule = {}
ControlModule.__index = ControlModule
|
--list of admin ids
--71560306 (guest)
--61385600 (tornado)
--60127374 (dark)
--118860335 (klevin)
--262491334 (icarus)
--647654469 (real)
--19634055 (jericho)
--192203600 (potato)
--15889415 (littlekittehs)
--50809949 (ufhbrfc)
--36675421 (bluenin12)
--79849873 (pvpfire_123)
| |
--- Solve direction and length of the ray by comparing current and last frame's positions
-- @param point type
|
function solver:Solve(point: {[string]: any}): (Vector3, Vector3)
--- Translate localized bone positions to world space values
local originBone: Bone = point.Instances[1]
local vector: Vector3 = point.Instances[2]
local pointToWorldSpace: Vector3 = originBone.TransformedWorldCFrame.Position + vector
--- If LastPosition is nil (caused by if the hitbox was stopped previously), rewrite its value to the current point position
if not point.LastPosition then
point.LastPosition = pointToWorldSpace
end
local origin: Vector3 = point.LastPosition
local direction: Vector3 = pointToWorldSpace - (point.LastPosition or EMPTY_VECTOR)
point.WorldSpace = pointToWorldSpace
return origin, direction
end
function solver:UpdateToNextPosition(point: {[string]: any}): Vector3
return point.WorldSpace
end
function solver:Visualize(point: {[string]: any}): CFrame
return CFrame.lookAt(point.WorldSpace, point.LastPosition)
end
return solver
|
------------------------------------------------------------------
|
local GUIA1Visible = true
local GUIB1Visible = true
local GUIA2Visible = true
local GUIB2Visible = true
|
-- Check if GetTranslatorForPlayerAsync succeeded
|
if res then
-- If succeeded, translate assets here using translator
-- Listen for a change in player's locale ID
translator:GetPropertyChangedSignal("LocaleId"):Connect(OnLocaleIdChanged)
else
print('GetTranslatorForPlayerAsync failed: ' .. translator)
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0
script:WaitForChild("Idle")
if not FE then
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
for i,v in pairs(script:GetChildren()) do
v.Parent=car.DriveSeat
end
car.DriveSeat.Idle:Play()
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
car.DriveSeat.Idle.Pitch = (car.DriveSeat.Idle.SetPitch.Value - car.DriveSeat.Idle.SetRev.Value*_RPM/_Tune.Redline)*on^2
end
else
local handler = car.AC6_FE_Sounds
handler:FireServer("newSound","Idle",car.DriveSeat,script.Idle.SoundId,0,true)
handler:FireServer("playSound","Idle")
local pitch=0
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
pitch = (script.Idle.SetPitch.Value - script.Idle.SetRev.Value*_RPM/_Tune.Redline)*on^2
handler:FireServer("updateSound","Idle",script.Idle.SoundId,pitch,script.Idle.Volume)
end
end
|
--[[ TELEPORT SERVICE ]]
|
--
if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
warn("Booting Server !")
local waitTime = 10
Players.PlayerAdded:connect(function(player)
wait(waitTime)
waitTime = waitTime / 2
TeleportService:Teleport(game.PlaceId, player)
end)
for _,player in pairs(Players:GetPlayers()) do
TeleportService:Teleport(game.PlaceId, player)
wait(waitTime)
waitTime = waitTime / 2
end
else
game:BindToClose(function()
local con
if (#Players:GetPlayers() == 0) then
return
end
if (game:GetService("RunService"):IsStudio()) then
return
end
for i,v in pairs(game.Players:GetChildren()) do
AddUI(v)
end
con = Players.PlayerAdded:connect(function(v)
wait(1)
AddUI(v)
end)
wait(10)
con:Disconnect()
local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
for _,player in pairs(Players:GetPlayers()) do
TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
end
Players.PlayerAdded:connect(function(player)
TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
end)
while (#Players:GetPlayers() > 0) do
wait(1)
end
end)
end
|
--------------------------------------------------------------#
|
function Tween(instance,tweeninformation,goals)
TweenService:Create(instance,tweeninformation,goals):Play()
end
LightGroup = script.Parent.Parent.Parent.Misc.Trunk.Lights:GetChildren()
while true do
wait(0)
if script.Parent.on.Value then
for i = 1,#LightGroup do
Tween(LightGroup[i],TweenInfo.new(deltatime),{Transparency = 0})
Tween(LightGroup[i].Light,TweenInfo.new(deltatime),{Brightness = 2})
end
else
for i = 1,#LightGroup do
Tween(LightGroup[i],TweenInfo.new(deltatime),{Transparency = 1})
Tween(LightGroup[i].Light,TweenInfo.new(deltatime),{Brightness = 0})
end
end
end
|
--[[
ErrorReporter is designed to handle all of the logic of parsing information from errors,
and sending it to the appropriate places.
]]
|
local configuration = require(script.Parent.Parent.Config)
|
----- Private Variables -----
|
local HatchBind = ServerScriptService.HatchBind
local Remotes = ReplicatedStorage.Remote
|
-- Create the collision groups and set them to not collide with each other
|
local function collisionGroupExists(groupName)
local groups = PhysicsService:GetRegisteredCollisionGroups()
for _, group in ipairs(groups) do
if group.name == groupName then
return true
end
end
return false
end
if not collisionGroupExists(npcGroup) then
PhysicsService:RegisterCollisionGroup(npcGroup)
end
if not collisionGroupExists(playerGroup) then
PhysicsService:RegisterCollisionGroup(playerGroup)
end
PhysicsService:CollisionGroupSetCollidable(npcGroup, playerGroup, false)
|
--// Processing
|
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
local script = script
local service = Vargs.Service
local client = Vargs.Client
local Anti, Core, Functions, Process, Remote, UI, Variables
local function Init()
UI = client.UI;
Anti = client.Anti;
Core = client.Core;
Variables = client.Variables
Functions = client.Functions;
Process = client.Process;
Remote = client.Remote;
Process.Init = nil;
end
local function RunLast()
--[[client = service.ReadOnly(client, {
[client.Variables] = true;
[client.Handlers] = true;
G_API = true;
G_Access = true;
G_Access_Key = true;
G_Access_Perms = true;
Allowed_API_Calls = true;
HelpButtonImage = true;
Finish_Loading = true;
RemoteEvent = true;
ScriptCache = true;
Returns = true;
PendingReturns = true;
EncodeCache = true;
DecodeCache = true;
Received = true;
Sent = true;
Service = true;
Holder = true;
GUIs = true;
LastUpdate = true;
RateLimits = true;
Init = true;
RunLast = true;
RunAfterInit = true;
RunAfterLoaded = true;
RunAfterPlugins = true;
}, true)--]]
Process.RunLast = nil;
end
local function RunAfterLoaded(data)
--// Events
--service.NetworkClient.ChildRemoved:Connect(function() wait(30) client.Anti.Detected("crash", "Network client disconnected") end)
--service.NetworkClient.ChildAdded:Connect(function() client.Anti.Detected("crash", "Network client reconnected?") end)
service.Player.Chatted:Connect(service.EventTask("Event: ProcessChat", Process.Chat))
service.Player.CharacterRemoving:Connect(service.EventTask("Event: CharacterRemoving", Process.CharacterRemoving))
service.Player.CharacterAdded:Connect(service.Threads.NewEventTask("Event: CharacterAdded", Process.CharacterAdded))
service.LogService.MessageOut:Connect(Process.LogService) --service.Threads.NewEventTask("EVENT:MessageOut",client.Process.LogService,60))
service.ScriptContext.Error:Connect(Process.ErrorMessage) --service.Threads.NewEventTask("EVENT:ErrorMessage",client.Process.ErrorMessage,60))
--// Get RateLimits
Process.RateLimits = Remote.Get("RateLimits") or Process.RateLimits;
Process.RunAfterLoaded = nil;
end
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
client.Process = {
Init = Init;
RunLast = RunLast;
RunAfterLoaded = RunAfterLoaded;
RateLimits = { --// Defaults; Will be updated with server data at client run
Remote = 0.02;
Command = 0.1;
Chat = 0.1;
RateLog = 10;
};
Remote = function(data, com, ...)
local args = {...}
Remote.Received += 1
if type(com) == "string" then
if com == `{client.DepsName}GIVE_KEY` then
if not Core.Key then
log("~! Set remote key")
Core.Key = args[1]
log("~! Call Finish_Loading()")
client.Finish_Loading()
end
elseif Core.Key then
local comString = Remote.Decrypt(com,Core.Key)
local command = (data.Mode == "Get" and Remote.Returnables[comString]) or Remote.Commands[comString]
if command then
--local ran,err = pcall(command, args) --task service.Threads.RunTask(`REMOTE:{comString}`,command,args)
local rets = {service.TrackTask(`Remote: {comString}`, command, args)}
if not rets[1] then
logError(rets[2])
else
return {unpack(rets, 2)};
end
end
end
end
end;
LogService = function(Message, Type)
--service.FireEvent("Output", Message, Type)
end;
ErrorMessage = function(Message, Trace, Script)
--service.FireEvent("ErrorMessage", Message, Trace, Script)
if Message and Message ~= "nil" and Message ~= "" and (string.find(Message,":: Adonis ::") or string.find(Message,script.Name) or Script == script) then
logError(`{Message} - {Trace}`)
end
--if (Script == nil or (not Trace or Trace == "")) and not (Trace and string.find(Trace,"CoreGui.RobloxGui")) then
--Anti.Detected("log",`Scriptless/Traceless error found. Script: {Script} - Trace: {Trace}`)
--end
end;
Chat = function(msg)
--service.FireEvent("Chat",msg)
if not service.Player or service.Player.Parent ~= service.Players then
Remote.Fire("ProcessChat",msg)
end
end;
CharacterAdded = function(...)
service.Events.CharacterAdded:Fire(...)
task.wait()
UI.GetHolder()
end;
CharacterRemoving = function()
if Variables.UIKeepAlive then
for ind,g in client.GUIs do
if g.Class == "ScreenGui" or g.Class == "GuiMain" or g.Class == "TextLabel" then
if not (g.Object:IsA("ScreenGui") and not g.Object.ResetOnSpawn) and g.CanKeepAlive then
g.KeepAlive = true
g.KeepParent = g.Object.Parent
g.Object.Parent = nil
elseif not g.CanKeepAlive then
pcall(g.Destroy, g)
end
end
end
end
if Variables.GuiViewFolder then
Variables.GuiViewFolder:Destroy()
Variables.GuiViewFolder = nil
end
if Variables.ChatEnabled then
service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end
if Variables.PlayerListEnabled then
service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
end
local textbox = service.UserInputService:GetFocusedTextBox()
if textbox then
textbox:ReleaseFocus()
end
service.Events.CharacterRemoving:Fire()
end
}
end
|
--------------------------------------------------------------------------
|
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 1 ,
FTargetFriction = 0.8 ,
FMinFriction = .6 ,
RWearSpeed = 1 ,
RTargetFriction = 0.8 ,
RMinFriction = .6 ,
--Tire Slip
TCSOffRatio = 1 ,
WheelLockRatio = 1/1 , --SS6 Default = 1/4
WheelspinRatio = 1/9 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = 0 , --SS6 Default = .5
RElasticity = 0 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
|
-- string stm_lstring(Stream S)
-- @S - Stream object to read from
|
local function stm_lstring(S)
local len = S:s_szt()
local str
if len ~= 0 then str = stm_string(S, len):sub(1, -2) end
return str
end
|
-- отображение списка серверов
-----------------------------------------------------------------
|
local max_players = 50 -- ограничитель числа игроков на сервере
|
--// Weapon Parts
|
local L_52_ = L_1_:WaitForChild('AimPart')
local L_53_
local L_54_ = L_1_:WaitForChild('Grip')
local L_55_ = L_1_:WaitForChild('FirePart')
local L_56_
local L_57_ = L_1_:WaitForChild('Mag')
local L_58_ = L_1_:WaitForChild('Bolt')
|
-- debug.profileend("AI Offload Loop")
|
end
end)
|
--print(ChosenNTID)
|
NightTheme.SoundId = "rbxassetid://" .. ChosenNTID
NightTheme.Ended:Connect(function()
UpdateNightThemeID()
end)
end
NightTheme:Play()
UpdateNightThemeID()
game:GetService("RunService").RenderStepped:Connect(function()
if Rake ~= nil and Rake:FindFirstChild("HumanoidRootPart") ~= nil then
if CharacterRoot ~= nil and ChracterHumanoid ~= nil then -- Check if The rake, Player character, Player character humanoid still exist
RangeMagnitude = (Rake.HumanoidRootPart.Position - CharacterRoot.Position).magnitude
if Rake.Stunning.Value == true then
StunDebounce = true
if RangeMagnitude < 70 then
ReplayDebounce = true
end
StopSound()
elseif Rake.Stunning.Value == false or ChracterHumanoid.Health > 0 then
StunDebounce = false
if ReplayDebounce == true and RangeMagnitude < 70 then
ReplayDebounce = false
StartSound()
end
end
if RangeMagnitude < 70 and Debounce1 == false and StunDebounce == false then
Debounce1 = true
StartSound()
elseif RangeMagnitude > 70 and StunDebounce == false and Debounce1 == true then
Debounce1 = false
ReplayDebounce = false
StopSound()
end
if RangeMagnitude < 90 and RangeMagnitude > 70 and StunDebounce == false and not Debounce2 then
Debounce2 = true
StopSound()
NearTheme:Play()
elseif Debounce2 and Debounce1 or StunDebounce or RangeMagnitude > 90 then
NearTheme:Stop()
Debounce2 = false
end
if RakeTheme.IsPlaying then
if RangeMagnitude > 70 then
Debounce1 = false
ReplayDebounce = false
StopSound()
end
if Rake.NPC.Health <= 0 then
script.Parent:Destroy()
end
if ChracterHumanoid.Health <= 0 then
StopSound()
end
if RangeMagnitude < 70 and RangeMagnitude > 35 then
RakeTheme.PlaybackSpeed = 0.95
end
if RangeMagnitude < 35 and RangeMagnitude > 20 then
RakeTheme.PlaybackSpeed = 1
end
if RangeMagnitude < 20 then
RakeTheme.PlaybackSpeed = 1.05
end
end
end
end
end)
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 5
local slash_damage = 10
local lunge_damage = 30
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
if (hit.Parent == nil) then return end -- happens when bullet hits sword
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 lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
---- Locales -----
|
local Event = game:GetService("ReplicatedStorage").Events.Cases.Case1
|
--[[
Defines utilities for working with 'list-like' tables.
]]
|
return {
filter = require(script.filter),
filterMap = require(script.filterMap),
find = require(script.find),
foldLeft = require(script.foldLeft),
foldRight = require(script.foldRight),
getRange = require(script.getRange),
join = require(script.join),
map = require(script.map),
removeIndex = require(script.removeIndex),
removeRange = require(script.removeRange),
removeValue = require(script.removeValue),
replaceIndex = require(script.replaceIndex),
reverse = require(script.reverse),
sort = require(script.sort),
}
|
-- Events
|
local events = ReplicatedStorage.Events
local actionEvents = events.ActionEvents
local bind = actionEvents.Bind
local unbind = actionEvents.Unbind
local action1 = actionEvents.Action1
|
-- Profile object:
|
local Profile = {
--[[
Data = {}, -- [table] -- Loaded once after ProfileStore:LoadProfileAsync() finishes
MetaData = {}, -- [table] -- Updated with every auto-save
GlobalUpdates = GlobalUpdates, -- [GlobalUpdates]
_profile_store = ProfileStore, -- [ProfileStore]
_profile_key = "", -- [string]
_release_listeners = [ScriptSignal] / nil, -- [table / nil]
_hop_ready_listeners = [ScriptSignal] / nil, -- [table / nil]
_hop_ready = false,
_view_mode = true / nil, -- [bool / nil]
_load_timestamp = os.clock(),
_is_user_mock = false, -- ProfileStore.Mock
--]]
}
Profile.__index = Profile
function Profile:IsActive() --> [bool]
local loaded_profiles = self._is_user_mock == true and self._profile_store._mock_loaded_profiles or self._profile_store._loaded_profiles
return loaded_profiles[self._profile_key] == self
end
function Profile:GetMetaTag(tag_name) --> value
local meta_data = self.MetaData
if meta_data == nil then
return nil
-- error("[ProfileService]: This Profile hasn't been loaded before - MetaData not available")
end
return self.MetaData.MetaTags[tag_name]
end
function Profile:SetMetaTag(tag_name, value)
if type(tag_name) ~= "string" then
error("[ProfileService]: tag_name must be a string")
elseif string.len(tag_name) == 0 then
error("[ProfileService]: Invalid tag_name")
end
if self._view_mode == true then
error("[ProfileService]: Can't set meta tag in view mode")
end
if self:IsActive() == false then
error("[ProfileService]: PROFILE EXPIRED - Meta tags can't be set")
end
self.MetaData.MetaTags[tag_name] = value
end
function Profile:Reconcile()
ReconcileTable(self.Data, self._profile_store._profile_template)
end
function Profile:ListenToRelease(listener) --> [ScriptConnection] (place_id / nil, game_job_id / nil)
if type(listener) ~= "function" then
error("[ProfileService]: Only a function can be set as listener in Profile:ListenToRelease()")
end
if self._view_mode == true then
error("[ProfileService]: Can't listen to Profile release in view mode")
end
if self:IsActive() == false then
-- Call release listener immediately if profile is expired
local place_id
local game_job_id
local active_session = self.MetaData.ActiveSession
if active_session ~= nil then
place_id = active_session[1]
game_job_id = active_session[2]
end
listener(place_id, game_job_id)
return {
Disconnect = function() end,
}
else
return self._release_listeners:Connect(listener)
end
end
function Profile:Save()
if self._view_mode == true then
error("[ProfileService]: Can't save Profile in view mode")
end
if self:IsActive() == false then
error("[ProfileService]: PROFILE EXPIRED - Can't save Profile")
end
-- Reject save request if a save is already pending in the queue - this will prevent the user from
-- unecessary API request spam which we could not meaningfully execute anyways!
if IsCustomWriteQueueEmptyFor(self._profile_store._profile_store_lookup, self._profile_key) == true then
-- We don't want auto save to trigger too soon after manual saving - this will reset the auto save timer:
RemoveProfileFromAutoSave(self)
AddProfileToAutoSave(self)
-- Call save function in a new thread:
coroutine.wrap(SaveProfileAsync)(self)
end
end
function Profile:Release()
if self._view_mode == true then
error("[ProfileService]: Can't release Profile in view mode")
end
if self:IsActive() == true then
coroutine.wrap(SaveProfileAsync)(self, true) -- Call save function in a new thread with release_from_session = true
end
end
function Profile:ListenToHopReady(listener) --> [ScriptConnection] ()
if type(listener) ~= "function" then
error("[ProfileService]: Only a function can be set as listener in Profile:ListenToHopReady()")
end
if self._view_mode == true then
error("[ProfileService]: Can't listen to HopReady in view mode")
end
if self._hop_ready == true then
coroutine.wrap(listener)()
return {
Disconnect = function() end,
}
else
return self._hop_ready_listeners:Connect(listener)
end
end
function Profile:Identify() --> [string]
return IdentifyProfile(
self._profile_store._profile_store_name,
self._profile_store._profile_store_scope,
self._profile_key
)
end
|
--heroking--
|
local debounce = true
local door = script.Door:Clone()
script.Parent.Touched:connect(function(hit)
door.Value = script.Parent.Parent.Door
if not debounce then return end
if hit.Parent:findFirstChild("Humanoid") then
debounce = false
local player = game.Players:playerFromCharacter(hit.Parent)
if not player.PlayerGui:findFirstChild("Keypad") then
local main = Instance.new("GuiMain")
main.Name = "Keypad"
local runscript = script.LocalScript:Clone()
script.Parent.Parent.CODE:Clone().Parent = runscript
door:Clone().Parent = runscript
main.Parent = player.PlayerGui
script.Parent.Frame:Clone().Parent = main
repeat wait() until player.Character
runscript:Clone().Parent = player.Character
end
wait(5)
debounce = true
end
end
)
|
--set up ghost following you
|
Spawn(function()
while Alive do
local torsoAt = Character.Torso.Position
local toGhost = Body.Position - torsoAt
toGhost = Vector3.new(toGhost.x, 0, toGhost.z).unit
local ghostAt = torsoAt + toGhost*3 + Vector3.new(0, 2 + 1*math.sin(tick()), 0)
local Under = CFrame.new(ghostAt):toWorldSpace(CFrame.new(Vector3.new(0,-1,0)));
local Raycast = Ray.new(ghostAt, (Under.p-ghostAt).unit*100);
local StandOn = game.Workspace:FindPartOnRay(Raycast,Character);
if StandOn then
print(StandOn);
ghostAt = Vector3.new(ghostAt.X,StandOn.Position.Y+(StandOn.Size.Y/2)+(Body.Size.Y/2),ghostAt.Z);
end;
--
Body.Float.position = ghostAt
Body.Rotate.cframe = Character.Torso.CFrame
wait()
Body.Anchored = false;
Body.CanCollide = false;
Body:SetNetworkOwner(nil)
end
end)
|
--// Connections
|
L_83_.OnClientEvent:connect(function(L_158_arg1, L_159_arg2, L_160_arg3, L_161_arg4, L_162_arg5, L_163_arg6, L_164_arg7)
if L_158_arg1 and not L_15_ then
MakeFakeArms()
L_27_ = L_20_:WaitForChild('MainGui'):clone()
L_27_.Parent = L_2_.PlayerGui
L_25_ = L_27_:WaitForChild('Others')
L_26_ = L_25_:WaitForChild('Kill')
L_28_ = L_159_arg2
L_29_ = L_160_arg3
L_30_ = L_161_arg4
L_31_ = L_162_arg5
L_32_ = L_163_arg6
L_33_ = L_164_arg7
L_34_ = L_44_.Bolt
L_64_ = L_33_.C1
L_65_ = L_33_.C0
if L_1_:FindFirstChild('AimPart2') then
L_39_ = L_1_:WaitForChild('AimPart2')
end
if L_1_:FindFirstChild('FirePart2') then
L_42_ = L_1_.FirePart2
end
if L_23_.FirstPersonOnly then
L_2_.CameraMode = Enum.CameraMode.LockFirstPerson
end
--uis.MouseIconEnabled = false
L_5_.FieldOfView = 70
L_15_ = true
elseif L_15_ then
if L_3_ and L_3_.Humanoid and L_3_.Humanoid.Health > 0 and L_9_ then
Stand()
end
L_46_ = false
L_49_ = false
L_48_ = false
Shooting = false
L_74_ = 70
RemoveArmModel()
L_27_:Destroy()
if L_3_:FindFirstChild('Right Arm') and L_3_:FindFirstChild('Left Arm') then
L_3_['Right Arm'].LocalTransparencyModifier = 0
L_3_['Left Arm'].LocalTransparencyModifier = 0
end
L_2_.CameraMode = Enum.CameraMode.Classic
L_82_.MouseIconEnabled = true
L_5_.FieldOfView = 70
L_15_ = false
L_82_.MouseDeltaSensitivity = L_37_
L_4_.Icon = "http://www.roblox.com/asset?id=0"
end
end)
|
--[[
Adds specified elevator to elevator collision group
]]
|
function CollisionGroupsController.addElevator(elevator)
for _, child in pairs(elevator:GetChildren()) do
if child:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(child, Constants.CollisionGroup.Elevator)
end
end
end
return CollisionGroupsController
|
-- Boolean
|
local cooldown = 0.4
local lastSound = ""
|
--[[Susupension]]
|
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 10 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.RAntiRoll = 10 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Black" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
-- Variables
|
local Content = script.Parent.Content
local UIGrid = Content.UIGridLayout
local Characters = game.ServerStorage.Characters
local GetCellSize = game.ReplicatedStorage.Remotes.GetCellSize
local Player = script.Parent.Parent.Parent.Parent.Parent
local SelectedCharacter = script.Parent.Parent.Parent.Preview.SelectedCharacter
local Debounce = false
|
--[=[
@within Comm
@private
@interface Server
.BindFunction (parent: Instance, name: string, fn: FnBind, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
.WrapMethod (parent: Instance, tbl: table, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
.CreateSignal (parent: Instance, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteSignal
.CreateProperty (parent: Instance, name: string, value: any, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteProperty
Server Comm
]=]
--[=[
@within Comm
@private
@interface Client
.GetFunction (parent: Instance, name: string, usePromise: boolean, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): (...: any) -> any
.GetSignal (parent: Instance, name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): ClientRemoteSignal
.GetProperty (parent: Instance, name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): ClientRemoteProperty
Client Comm
]=]
|
function Server.BindFunction(parent: Instance, name: string, func: Types.FnBind, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?): RemoteFunction
assert(Util.IsServer, "BindFunction must be called from the server")
local folder = Util.GetCommSubFolder(parent, "RF"):Expect("Failed to get Comm RF folder")
local rf = Instance.new("RemoteFunction")
rf.Name = name
local hasInbound = type(inboundMiddleware) == "table" and #inboundMiddleware > 0
local hasOutbound = type(outboundMiddleware) == "table" and #outboundMiddleware > 0
local function ProcessOutbound(player, ...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(outboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return table.unpack(args, 1, args.n)
end
if hasInbound and hasOutbound then
local function OnServerInvoke(player, ...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return ProcessOutbound(player, func(player, table.unpack(args, 1, args.n)))
end
rf.OnServerInvoke = OnServerInvoke
elseif hasInbound then
local function OnServerInvoke(player, ...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return func(player, table.unpack(args, 1, args.n))
end
rf.OnServerInvoke = OnServerInvoke
elseif hasOutbound then
local function OnServerInvoke(player, ...)
return ProcessOutbound(player, func(player, ...))
end
rf.OnServerInvoke = OnServerInvoke
else
rf.OnServerInvoke = func
end
rf.Parent = folder
return rf
end
function Server.WrapMethod(parent: Instance, tbl: {}, name: string, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?): RemoteFunction
assert(Util.IsServer, "WrapMethod must be called from the server")
local fn = tbl[name]
assert(type(fn) == "function", "Value at index " .. name .. " must be a function; got " .. type(fn))
return Server.BindFunction(parent, name, function(...) return fn(tbl, ...) end, inboundMiddleware, outboundMiddleware)
end
function Server.CreateSignal(parent: Instance, name: string, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?)
assert(Util.IsServer, "CreateSignal must be called from the server")
local folder = Util.GetCommSubFolder(parent, "RE"):Expect("Failed to get Comm RE folder")
local rs = RemoteSignal.new(folder, name, inboundMiddleware, outboundMiddleware)
return rs
end
function Server.CreateProperty(parent: Instance, name: string, initialValue: any, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?)
assert(Util.IsServer, "CreateProperty must be called from the server")
local folder = Util.GetCommSubFolder(parent, "RP"):Expect("Failed to get Comm RP folder")
local rp = RemoteProperty.new(folder, name, initialValue, inboundMiddleware, outboundMiddleware)
return rp
end
return Server
|
-- (Hat Giver Script - Loaded.)
|
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "GreenTopHat"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(0,-0.25,0)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0,.15,0.00)
wait(5)
debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
----- Loaded Modules -----
|
local PlayerData = require(ServerScriptService.PlayerData.Manager)
local PetConfig = require(ReplicatedStorage.Config.Pet)
local Stat = require(ReplicatedStorage.Utils.Stats)
|
-- This is in charge of the animations for the character. Pretty much stole it from the default character. Removed emote stuff.
|
function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"
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 },
},
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 }
|
--------------------------------------------------------------------------
|
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .3 ,
FTargetFriction = 0.7 ,
FMinFriction = .5 ,
RWearSpeed = .3 ,
RTargetFriction = 0.7 ,
RMinFriction = .5 ,
--Tire Slip
TCSOffRatio = 1 ,
WheelLockRatio = 1/2 , --SS6 Default = 1/4
WheelspinRatio = 1/1.1 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = 0 , --SS6 Default = .5
RElasticity = 0 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
|
--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 == "SpawnLocation") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat")) 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)
|
--// All remote events will have a no-opt OnServerEvent connecdted on construction
|
local function CreateEventIfItDoesntExist(parentObject, objectName)
local obj = CreateIfDoesntExist(parentObject, objectName, "RemoteEvent")
obj.OnServerEvent:Connect(emptyFunction)
return obj
end
CreateEventIfItDoesntExist(EventFolder, "OnNewMessage")
CreateEventIfItDoesntExist(EventFolder, "OnMessageDoneFiltering")
CreateEventIfItDoesntExist(EventFolder, "OnNewSystemMessage")
CreateEventIfItDoesntExist(EventFolder, "OnChannelJoined")
CreateEventIfItDoesntExist(EventFolder, "OnChannelLeft")
CreateEventIfItDoesntExist(EventFolder, "OnMuted")
CreateEventIfItDoesntExist(EventFolder, "OnUnmuted")
CreateEventIfItDoesntExist(EventFolder, "OnMainChannelSet")
CreateEventIfItDoesntExist(EventFolder, "ChannelNameColorUpdated")
CreateEventIfItDoesntExist(EventFolder, "SayMessageRequest")
CreateEventIfItDoesntExist(EventFolder, "SetBlockedUserIdsRequest")
CreateIfDoesntExist(EventFolder, "GetInitDataRequest", "RemoteFunction")
CreateIfDoesntExist(EventFolder, "MutePlayerRequest", "RemoteFunction")
CreateIfDoesntExist(EventFolder, "UnMutePlayerRequest", "RemoteFunction")
EventFolder = useEvents
local function CreatePlayerSpeakerObject(playerObj)
--// If a developer already created a speaker object with the
--// name of a player and then a player joins and tries to
--// take that name, we first need to remove the old speaker object
local speaker = ChatService:GetSpeaker(playerObj.Name)
if (speaker) then
ChatService:RemoveSpeaker(playerObj.Name)
end
speaker = ChatService:InternalAddSpeakerWithPlayerObject(playerObj.Name, playerObj, false)
for _, channel in pairs(ChatService:GetAutoJoinChannelList()) do
speaker:JoinChannel(channel.Name)
end
speaker:InternalAssignEventFolder(EventFolder)
speaker.ChannelJoined:connect(function(channel, welcomeMessage)
local log = nil
local channelNameColor = nil
local channelObject = ChatService:GetChannel(channel)
if (channelObject) then
log = channelObject:GetHistoryLogForSpeaker(speaker)
channelNameColor = channelObject.ChannelNameColor
end
EventFolder.OnChannelJoined:FireClient(playerObj, channel, welcomeMessage, log, channelNameColor)
end)
speaker.Muted:connect(function(channel, reason, length)
EventFolder.OnMuted:FireClient(playerObj, channel, reason, length)
end)
speaker.Unmuted:connect(function(channel)
EventFolder.OnUnmuted:FireClient(playerObj, channel)
end)
ChatService:InternalFireSpeakerAdded(speaker.Name)
end
EventFolder.SayMessageRequest.OnServerEvent:connect(function(playerObj, message, channel)
if type(message) ~= "string" then
return
elseif not validateMessageLength(message) then
return
end
if type(channel) ~= "string" then
return
elseif not validateChannelNameLength(channel) then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if (speaker) then
if playerObj.Chat.Value == true then
return speaker:SayMessage(message, channel)
end
end
return nil
end)
EventFolder.MutePlayerRequest.OnServerInvoke = function(playerObj, muteSpeakerName)
if type(muteSpeakerName) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if speaker then
local muteSpeaker = ChatService:GetSpeaker(muteSpeakerName)
if muteSpeaker then
speaker:AddMutedSpeaker(muteSpeaker.Name)
return true
end
end
return false
end
EventFolder.UnMutePlayerRequest.OnServerInvoke = function(playerObj, unmuteSpeakerName)
if type(unmuteSpeakerName) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if speaker then
local unmuteSpeaker = ChatService:GetSpeaker(unmuteSpeakerName)
if unmuteSpeaker then
speaker:RemoveMutedSpeaker(unmuteSpeaker.Name)
return true
end
end
return false
end
|
--// Scripted by Trackplayer
--// Do not edit the code if you don't know what are you doing.
|
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(0.7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
local openSound = script.Parent.Open
local closeSound = script.Parent.Close
local click = script.Parent.ClickDetector
local center = script.Parent.Parent.Center
local origin = script.Parent.Parent.Parent.Door2Origin
local toGo = script.Parent.Parent.Parent.Door2ToGo
local isOpen = false
local isMoving = false
click.MouseClick:Connect(function()
if isOpen == false and isMoving == false then
isMoving = true
isOpen = true
TweenService:Create(center, Info, {CFrame = toGo.CFrame}):Play()
openSound:Play()
wait(0.7)
isMoving = false
elseif isOpen == true and isMoving == false then
isMoving = true
isOpen = false
TweenService:Create(center, Info, {CFrame = origin.CFrame}):Play()
wait(0.5)
closeSound:Play()
wait(0.2)
isMoving = false
end
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("Torso")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("Torso");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
Spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
Wait(0.3);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=10 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(8);
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=10;
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=30;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=0.004;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
else
Notice=false;
NoticeDebounce=false;
local RandomWalk=math.random(1,150);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
if RandomWalk==1 then
JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="ColdBloodedKiller";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=500;
JeffTheKillerHumanoid.JumpPower=60;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end;
|
--Update Camera Pos after Phys Update
|
RS.Heartbeat:Connect(function()
if Mode == 1 then
if UIS.MouseBehavior ~= Enum.MouseBehavior.Default and Camera.CameraType ~= Enum.CameraType.Custom then
UIS.MouseBehavior = Enum.MouseBehavior.Default
Camera.CameraType = Enum.CameraType.Custom
end
elseif Mode == 2 then
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
Camera.CameraType = Enum.CameraType.Scriptable
local LookDelta = UIS:GetMouseDelta()
local X = Look.X - LookDelta.Y*Sensitivity
Look = Vector2.new((X >= MaxLook and MaxLook) or (X <= -MaxLook and -MaxLook) or X,
(Look.Y - LookDelta.X*Sensitivity) % 360)
Camera.CFrame = CFrame.new(HRP.Position + CamOffset)
* CFrame.Angles(0,math.rad(Look.Y),0)
* CFrame.Angles(math.rad(Look.X),0,0)
elseif Mode == 3 then
UIS.MouseBehavior = Enum.MouseBehavior.Default
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(HRP.Position + CamOffset)
* CFrame.Angles(0,math.rad(Look.Y),0)
* CFrame.Angles(math.rad(Look.X),0,0)
end
end)
SetSettings.OnClientEvent:Connect(function(camMode)
if camMode then
HidePlayer()
Mode = 2
else
ShowPlayer()
Mode = 1
end
end)
UIS.InputBegan:Connect(function(input)
--Swap Between First and Third Person and Lock the Mouse
if input.KeyCode == FPSLock then
if Mode == 2 then Mode = 3
elseif Mode == 3 then Mode = 2 end
end
end)
Player.CharacterAdded:Connect(CharacterRespawn)
|
--[[Steering]]
|
Tune.SteerInner = 39 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 38 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .3 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .3 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
--local NOT_A_PROMISE = "Invalid argument #1 to 'Janitor:AddPromise' (Promise expected, got %s (%s))"
|
local Janitor = {
ClassName = "Janitor";
__index = {
CurrentlyCleaning = true;
[IndicesReference] = nil;
};
}
local TypeDefaults = {
["function"] = true;
RBXScriptConnection = "Disconnect";
}
|
--------------| 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 = "Blue"; -- 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 = 9161622880; -- 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 = {}; -- 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 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- 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 = 3;
WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = true; -- 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 = 4; -- 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 = 3; -- 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;
};
|
--[=[
@class InsertServiceUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local InsertService = game:GetService("InsertService")
local Promise = require("Promise")
local InsertServiceUtils = {}
|
--[[
Like andThen, but the value passed into the handler is also the
value returned from the handler.
]]
|
function Promise.prototype:tap(tapCallback)
assert(type(tapCallback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:tap"))
return self:_andThen(debug.traceback(nil, 2), function(...)
local callbackReturn = tapCallback(...)
if Promise.is(callbackReturn) then
local length, values = pack(...)
return callbackReturn:andThen(function()
return unpack(values, 1, length)
end)
end
return ...
end)
end
|
--[[
Plugins for this gun kit are basically functions that will run at specific times, i.e. When a key is pressed, when the gun is
fired, when the gun is aimed, etc.
HOW TO USE IT:
KEYDOWN PLUGIN:
Let's say you wanted to toggle a laser whenever you press the "v" key:
You would create a table like the example below
The first element would be "Key = INSERT_KEY_HERE"
The second element would be "Description = INSERT_DESCRIPTION_HERE"
The third element would be "Plugin = INSERT_FUNCTION_HERE"
So whenever you press the "v" key, the plugin function will run
Pretty useful if you want to add extra code to the script without actually having to modify the script
NOTE: Only the keydown plugin requires this table. Every other plugin just needs a function
EVERY OTHER PLUGIN:
Let's say you wanted to make a shell eject whenever the gun was fired:
You would add function called "Plugin = INSERT_FUNCTION_HERE"
That's it; If you want other stuff to happen when the gun is fired, you would either put it all into 1 function, or
you would add more Plugins to the "Firing" table. Like so:
Firing = {
Plugin = function()
--Code
end;
Plugin = function()
--Code
end;
Plugin = function()
--Code
end;
};
That's really it, you just need to know some basic scripting to use it. If you have more questions, pm me.
NOTE: The plugins run seperate from the code in the Gun_Main. For example, if you have a plugin that ejects a shell 1 second
after the gun is fired, the gun's firing speed won't be affected in any way.
--]]
|
local Gun = script.Parent.Parent.Parent
local player = game.Players.LocalPlayer
local Plugins = {
KeyDown = {
{ --This is a plugin for a toggleable laser
Key = "g"; --This is the key you press to activate the plugin
Description = "Toggle Laser"; --This is what the description of the key will be in the controls
Plugin = function() --This is the actual plugin function
local Laser = Gun:WaitForChild("LaserLight") --These few lines wait for the necessary bricks/models
local Handle = Gun:WaitForChild("Grip")
local ignoreCode = Gun.Program_Client:WaitForChild("ignoreCode")
local ignoreModel = game.Workspace:WaitForChild("BulletModel: " .. player.Name)
local ignoreList = {}
local PlyrName = game.Players:GetPlayerFromCharacter(Gun.Parent).Name
local playerFolder = ignoreModel
local RS = game:GetService("RunService")
local function createLaserDot() --This function creates the red laser dot
local laserDot = Instance.new("Part")
laserDot.Transparency = 1
laserDot.Name = "laserDot"
laserDot.Anchored = true
laserDot.CanCollide = false
laserDot.FormFactor = Enum.FormFactor.Custom
laserDot.Size = Vector3.new(0.25, 0.25, 1)
local laserGui = Instance.new("SurfaceGui")
laserGui.CanvasSize = Vector2.new(100, 100)
laserGui.Parent = laserDot
local laserImage = Instance.new("ImageLabel")
laserImage.BackgroundTransparency = 1
laserImage.Size = UDim2.new(1, 0, 1, 0)
laserImage.Image = "http://www.roblox.com/asset/?id=131394739"
laserImage.Parent = laserGui
--[[local laserLight = Instance.new("SurfaceLight")
laserLight.Angle = 180
laserLight.Brightness = math.huge
laserLight.Color = Color3.new(1, 0, 0)
laserLight.Face = Enum.NormalId.Back
laserLight.Range = 5
laserLight.Shadows = true
laserLight.Parent = laserDot]]
return laserDot
end
local function getHitSurfaceCFrame(Pos, Obj) --This function returns the proper cframe based on the face that the position is on
local surfaceCF = {
{"Back", Obj.CFrame * CFrame.new(0, 0, Obj.Size.z)};
{"Bottom", Obj.CFrame * CFrame.new(0, -Obj.Size.y, 0)};
{"Front", Obj.CFrame * CFrame.new(0, 0, -Obj.Size.z)};
{"Left", Obj.CFrame * CFrame.new(-Obj.Size.x, 0, 0)};
{"Right", Obj.CFrame * CFrame.new(Obj.Size.x, 0, 0)};
{"Top", Obj.CFrame * CFrame.new(0, Obj.Size.y, 0)}
}
local closestDist = math.huge
local closestSurface = nil
for _,v in pairs(surfaceCF) do
local surfaceDist = (Pos - v[2].p).magnitude
if surfaceDist < closestDist then
closestDist = surfaceDist
closestSurface = v
end
end
local surfaceDir = CFrame.new(Obj.CFrame.p, closestSurface[2].p)
local surfaceDist = surfaceDir.lookVector * ((Obj.CFrame.p - closestSurface[2].p).magnitude / 2 - 0.25)
local surfaceOffset = Pos - closestSurface[2].p + surfaceDist
local surfaceCFrame = surfaceDir + surfaceDist + surfaceOffset
return surfaceCFrame
end
local laserDot = createLaserDot() --The code is cleaner when the laser creating code is in a function
Laser.Transparency = (Laser.Transparency == 1 and 0 or 1) --Toggles the laser on or off
while math.floor(Laser.Transparency) == 0 do --This loop will keep running as long as the laser is visible
if (not game.Players:GetPlayerFromCharacter(Gun.Parent)) then break end --This checks if the gun is a child of the character
local newRay = Ray.new(Laser.Position, Handle.CFrame.lookVector * 999)
local H, P = game.Workspace:FindPartOnRayWithIgnoreList(newRay, ignoreList)
if H and (H and H.Transparency >= 1 or H.CanCollide == false) then
table.insert(ignoreList, H)
end
local Distance = (P - Laser.Position).magnitude
Laser.Mesh.Offset = Vector3.new(0, Distance / 2, 0)
Laser.Mesh.Scale = Vector3.new(0.075, Distance / 0.2, 0.075)
if H then
laserDot.CFrame = getHitSurfaceCFrame(P, H) --If the laser hits a part then position the dot on the part
laserDot.Parent = playerFolder
else
laserDot.Parent = nil --If the laser doesn't hit a part then temporarily remove the laser dor
end
RS.RenderStepped:wait()
end
laserDot:Destroy() --These lines reset the laser if the laser is transparent or the gun was deselected
Laser.Transparency = 1
Laser.Mesh.Offset = Vector3.new()
Laser.Mesh.Scale = Vector3.new(0.075, 0, 0.075)
end;
};
};
}
return Plugins
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.