prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Event Bindings
|
Players.PlayerAdded:connect(OnPlayerAdded)
return FlagStandManager
|
-- Want to turn off Invisicam? Be sure to call this after.
|
function Invisicam:Cleanup()
for hit, originalFade in pairs(SavedHits) do
hit.LocalTransparencyModifier = originalFade
end
end
|
--------------------------------------------------------------------------------
|
local function queryPoint(origin, unitDir, dist, lastPos)
debug.profilebegin('queryPoint')
local originalSize = #blacklist
dist = dist + nearPlaneZ
local target = origin + unitDir*dist
local softLimit = inf
local hardLimit = inf
local movingOrigin = origin
repeat
local entryPart, entryPos = workspace:FindPartOnRayWithIgnoreList(ray(movingOrigin, target - movingOrigin), blacklist, false, true)
if entryPart then
if canOcclude(entryPart) then
local wl = {entryPart}
local exitPart = workspace:FindPartOnRayWithWhitelist(ray(target, entryPos - target), wl, true)
local lim = (entryPos - origin).Magnitude
if exitPart then
local promote = false
if lastPos then
promote =
workspace:FindPartOnRayWithWhitelist(ray(lastPos, target - lastPos), wl, true) or
workspace:FindPartOnRayWithWhitelist(ray(target, lastPos - target), wl, true)
end
if promote then
-- Ostensibly a soft limit, but the camera has passed through it in the last frame, so promote to a hard limit.
hardLimit = lim
elseif dist < softLimit then
-- Trivial soft limit
softLimit = lim
end
else
-- Trivial hard limit
hardLimit = lim
end
end
blacklist[#blacklist + 1] = entryPart
movingOrigin = entryPos - unitDir*1e-3
end
until hardLimit < inf or not entryPart
eraseFromEnd(blacklist, originalSize)
debug.profileend()
return softLimit - nearPlaneZ, hardLimit - nearPlaneZ
end
local function queryViewport(focus, dist)
debug.profilebegin('queryViewport')
local fP = focus.p
local fX = focus.rightVector
local fY = focus.upVector
local fZ = -focus.lookVector
local viewport = camera.ViewportSize
local hardBoxLimit = inf
local softBoxLimit = inf
-- Center the viewport on the PoI, sweep points on the edge towards the target, and take the minimum limits
for viewX = 0, 1 do
local worldX = fX*((viewX - 0.5)*projX)
for viewY = 0, 1 do
local worldY = fY*((viewY - 0.5)*projY)
local origin = fP + nearPlaneZ*(worldX + worldY)
local lastPos = camera:ViewportPointToRay(
viewport.x*viewX,
viewport.y*viewY
).Origin
local softPointLimit, hardPointLimit = queryPoint(origin, fZ, dist, lastPos)
if hardPointLimit < hardBoxLimit then
hardBoxLimit = hardPointLimit
end
if softPointLimit < softBoxLimit then
softBoxLimit = softPointLimit
end
end
end
debug.profileend()
return softBoxLimit, hardBoxLimit
end
local function testPromotion(focus, dist, focusExtrapolation)
debug.profilebegin('testPromotion')
local fP = focus.p
local fX = focus.rightVector
local fY = focus.upVector
local fZ = -focus.lookVector
do
-- Dead reckoning the camera rotation and focus
debug.profilebegin('extrapolate')
local SAMPLE_DT = 0.0625
local SAMPLE_MAX_T = 1.25
local maxDist = (getCollisionPoint(fP, focusExtrapolation.posVelocity*SAMPLE_MAX_T) - fP).Magnitude
-- Metric that decides how many samples to take
local combinedSpeed = focusExtrapolation.posVelocity.magnitude
for dt = 0, min(SAMPLE_MAX_T, focusExtrapolation.rotVelocity.magnitude + maxDist/combinedSpeed), SAMPLE_DT do
local cfDt = focusExtrapolation.extrapolate(dt) -- Extrapolated CFrame at time dt
if queryPoint(cfDt.p, -cfDt.lookVector, dist) >= dist then
return false
end
end
debug.profileend()
end
do
-- Test screen-space offsets from the focus for the presence of soft limits
debug.profilebegin('testOffsets')
for _, offset in ipairs(SCAN_SAMPLE_OFFSETS) do
local scaledOffset = offset
local pos, isHit = getCollisionPoint(fP, fX*scaledOffset.x + fY*scaledOffset.y)
if queryPoint(pos, (fP + fZ*dist - pos).Unit, dist) == inf then
return false
end
end
debug.profileend()
end
debug.profileend()
return true
end
local function Popper(focus, targetDist, focusExtrapolation)
debug.profilebegin('popper')
subjectRoot = subjectPart and subjectPart:GetRootPart() or subjectPart
local dist = targetDist
local soft, hard = queryViewport(focus, targetDist)
if hard < dist then
dist = hard
end
if soft < dist and testPromotion(focus, targetDist, focusExtrapolation) then
dist = soft
end
subjectRoot = nil
debug.profileend()
return dist
end
return Popper
|
--Droping Nuke--
|
script.Parent.Parent.Part7:Remove()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[[
Novena Constraint Type: Motorcycle
The Bike Chassis
Avxnturador | Novena
--]]
|
local mouse = game.Players.LocalPlayer:GetMouse()
script.Parent.Parent:WaitForChild("Bike")
local bike = script.Parent.Parent.Bike.Value
local on = script.Parent.Parent.IsOn
local _Tune = require(bike["Tuner"])
if not _Tune.Engine and not _Tune.Electric then return end
script.Parent:WaitForChild("TextLabel").Visible = not on.Value
script.Parent.Parent.IsOn.Changed:connect(function()
script.Parent.TextLabel.Visible = not on.Value
end)
mouse.keyDown:connect(function(k)
if k=="f" then
if not on.Value then
script.Parent.TextLabel.Visible=false
on.Value = true
else
on.Value = false
script.Parent.TextLabel.Visible=true
end
end
end)
|
-- I only made it a model for easier access.
|
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
c.Humanoid.BreakJointsOnDeath = false
c.Humanoid.Died:Connect(function()
c.HumanoidRootPart.RotVelocity = Vector3.new(180,360,90) -- Hopefully makes it so whenever you die, you don't just stand still. Feel free to remove it because this would only work for r6 lols
for _, v in pairs(c:GetDescendants()) do
if v:IsA("Motor6D") then
local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
a0.CFrame = v.C0
a1.CFrame = v.C1
a0.Parent = v.Part0
a1.Parent = v.Part1
local b = Instance.new("BallSocketConstraint")
b.Attachment0 = a0
b.Attachment1 = a1
b.Parent = v.Part0
v:Destroy()
end
end
c.HumanoidRootPart.CanCollide = false
end)
end)
end)
|
----------//Gun System\\----------
|
local L_199_ = nil
char.ChildAdded:connect(function(Tool)
if Tool:IsA('Tool') and Humanoid.Health > 0 and not ToolEquip and Tool:FindFirstChild("ACS_Settings") ~= nil and (require(Tool.ACS_Settings).Type == 'Gun' or require(Tool.ACS_Settings).Type == 'Melee' or require(Tool.ACS_Settings).Type == 'Grenade') then
local L_370_ = true
if char:WaitForChild('Humanoid').Sit and char.Humanoid.SeatPart:IsA("VehicleSeat") or char:WaitForChild('Humanoid').Sit and char.Humanoid.SeatPart:IsA("VehicleSeat") then
L_370_ = false;
end
if L_370_ then
L_199_ = Tool
if not ToolEquip then
--pcall(function()
setup(Tool)
--end)
elseif ToolEquip then
pcall(function()
unset()
setup(Tool)
end)
end;
end;
end
end)
char.ChildRemoved:connect(function(Tool)
if Tool == WeaponTool then
if ToolEquip then
unset()
end
end
end)
Humanoid.Running:Connect(function(speed)
charspeed = speed
if speed > 0.1 then
running = true
else
running = false
end
end)
Humanoid.Swimming:Connect(function(speed)
if Swimming then
charspeed = speed
if speed > 0.1 then
running = true
else
running = false
end
end
end)
Humanoid.Died:Connect(function(speed)
TS:Create(char.Humanoid, TweenInfo.new(1), {CameraOffset = Vector3.new(0,0,0)} ):Play()
ChangeStance = false
Stand()
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Lean()
Equipped = 0
unset()
Evt.NVG:Fire(false)
end)
Humanoid.Seated:Connect(function(IsSeated, Seat)
if IsSeated and Seat and (Seat:IsA("VehicleSeat")) then
unset()
Humanoid:UnequipTools()
CanLean = false
plr.CameraMaxZoomDistance = gameRules.VehicleMaxZoom
else
plr.CameraMaxZoomDistance = game.StarterPlayer.CameraMaxZoomDistance
end
if IsSeated then
Sentado = true
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Stand()
Lean()
else
Sentado = false
CanLean = true
end
end)
Humanoid.Changed:connect(function(Property)
if not gameRules.AntiBunnyHop then return; end;
if Property == "Jump" and Humanoid.Sit == true and Humanoid.SeatPart ~= nil then
Humanoid.Sit = false
elseif Property == "Jump" and Humanoid.Sit == false then
if JumpDelay then
Humanoid.Jump = false
return false
end
JumpDelay = true
delay(0, function()
wait(gameRules.JumpCoolDown)
JumpDelay = false
end)
end
end)
Humanoid.StateChanged:connect(function(Old,state)
if state == Enum.HumanoidStateType.Swimming then
Swimming = true
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Stand()
Lean()
else
Swimming = false
end
if gameRules.EnableFallDamage then
if state == Enum.HumanoidStateType.Freefall and not falling then
falling = true
local curVel = 0
local peak = 0
while falling do
curVel = HumanoidRootPart.Velocity.magnitude
peak = peak + 1
Thread:Wait()
end
local damage = (curVel - (gameRules.MaxVelocity)) * gameRules.DamageMult
if damage > 5 and peak > 20 then
local SKP_02 = SKP_01.."-"..plr.UserId
cameraspring:accelerate(Vector3.new(-damage/20, 0, math.random(-damage, damage)/5))
SwaySpring:accelerate(Vector3.new( math.random(-damage, damage)/5, damage/5,0))
local hurtSound = PastaFx.FallDamage:Clone()
hurtSound.Parent = plr.PlayerGui
hurtSound.Volume = damage/Humanoid.MaxHealth
hurtSound:Play()
Debris:AddItem(hurtSound,hurtSound.TimeLength)
Evt.Damage:InvokeServer(nil, nil, nil, nil, nil, nil, true, damage, SKP_02)
end
elseif state == Enum.HumanoidStateType.Landed or state == Enum.HumanoidStateType.Dead then
falling = false
SwaySpring:accelerate(Vector3.new(0, 2.5, 0))
end
end
end)
mouse.WheelBackward:Connect(function() -- fires when the wheel goes forwards
if ToolEquip and not CheckingMag and not aimming and not reloading and not runKeyDown and AnimDebounce and WeaponData.Type == "Gun" then
mouse1down = false
if GunStance == 0 then
SafeMode = true
GunStance = -1
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
LowReady()
elseif GunStance == -1 then
SafeMode = true
GunStance = -2
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
Patrol()
elseif GunStance == 1 then
SafeMode = false
GunStance = 0
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
IdleAnim()
end
end
if ToolEquip and aimming and Sens > 5 then
Sens = Sens - 5
UpdateGui()
game:GetService('UserInputService').MouseDeltaSensitivity = (Sens/100)
end
end)
mouse.WheelForward:Connect(function() -- fires when the wheel goes backwards
if ToolEquip and not CheckingMag and not aimming and not reloading and not runKeyDown and AnimDebounce and WeaponData.Type == "Gun" then
mouse1down = false
if GunStance == 0 then
SafeMode = true
GunStance = 1
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
HighReady()
elseif GunStance == -1 then
SafeMode = false
GunStance = 0
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
IdleAnim()
elseif GunStance == -2 then
SafeMode = true
GunStance = -1
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
LowReady()
end
end
if ToolEquip and aimming and Sens < 100 then
Sens = Sens + 5
UpdateGui()
game:GetService('UserInputService').MouseDeltaSensitivity = (Sens/100)
end
end)
script.Parent:GetAttributeChangedSignal("Injured"):Connect(function()
local valor = script.Parent:GetAttribute("Injured")
if valor and runKeyDown then
runKeyDown = false
Stand()
if not CheckingMag and not reloading and WeaponData and WeaponData.Type ~= "Grenade" and (GunStance == 0 or GunStance == 2 or GunStance == 3) then
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
IdleAnim()
end
end
if Stances == 0 then
Stand()
elseif Stances == 1 then
Crouch()
end
end)
|
-- Get references to the DockShelf and its children
|
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local aFinderButton = dockShelf.EStore
local opened = aFinderButton.Opened
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent
|
---Steering
|
function Steering()
if _MSteer then
local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
local mdZone = _Tune.Peripherals.MSteerDZone/100
local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
if math.abs(mST)<=mdZone then
_GSteerT = 0
else
_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
end
end
if _GSteerC < _GSteerT then
_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
else
_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
end
local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-_Tune.MinSteer))
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="F" then
v.Arm.Steer.cframe=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
elseif v.Name=="FL" then
if _GSteerC>= 0 then
v.Arm.Steer.cframe=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
else
v.Arm.Steer.cframe=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
end
elseif v.Name=="FR" then
if _GSteerC>= 0 then
v.Arm.Steer.cframe=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
else
v.Arm.Steer.cframe=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
end
end
end
end
|
--------END CREW--------
|
game.Workspace.RRProjector.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.Screens.ProjectionL.Value = game.Workspace.Screens.ProjectionL.Value
game.Workspace.Screens.ProjectionR.Value = game.Workspace.Screens.ProjectionR.Value
|
--[[Weld functions]]
|
local JS = game:GetService("JointsService")
local PGS_ON = workspace:PGSIsEnabled()
function MakeWeld(x,y,type,s)
if type==nil then type="Weld" end
local W=Instance.new(type,JS)
W.Part0=x W.Part1=y
W.C0=x.CFrame:inverse()*x.CFrame
W.C1=y.CFrame:inverse()*x.CFrame
if type=="Motor" and s~=nil then
W.MaxVelocity=s
end
return W
end
function ModelWeld(a,b)
if a:IsA("BasePart") then
MakeWeld(b,a,"Weld")
elseif a:IsA("Model") then
for i,v in pairs(a:GetChildren()) do
ModelWeld(v,b)
end
end
end
function UnAnchor(a)
if a:IsA("BasePart") then a.Anchored=false a.Locked=true end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end
end
|
--[[*
* Parse the given input string.
* @param {String} input
* @param {Object} options
* @return {Object}
]]
| |
-- Returns the key of the specified value, or nil if it could not be found. Unlike IndexOf, this searches every key in the table, not just ordinal indices (arrays)
-- This is inherently slower due to how lookups work, so if your table is structured like an array, use table.find
|
Table.keyOf = function (tbl, value)
for index, obj in pairs(tbl) do
if obj == value then
return index
end
end
return nil
end
|
-- elseif state == "Dead" then
-- wait(.4)
-- animations[state]:AdjustSpeed(0)
|
end
animations[state]:Play()
end
end
end
while true do
game:GetService("RunService").Stepped:wait()
if humanoid.Health > 0 then
if Grounded() then
local speed = Vector3.new(character.HumanoidRootPart.Velocity.X, 0, character.HumanoidRootPart.Velocity.Z).magnitude
if speed > 1 then
ChangeState("Walk")
else
ChangeState("Idle")
end
else
local ySpeed = character.HumanoidRootPart.Velocity.Y
if ySpeed > 0 then
ChangeState("Jump")
else
ChangeState("Fall")
end
end
else
--ChangeState("Dead")
end
end
|
--wait()
|
game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
local hl = script.Highlight:Clone()
hl.Parent = char
end)
|
--[[
LOWGames Studios
Date: 27 October 2022
by Elder
]]
|
--
local v1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
while not v1.Loaded do
game:GetService("RunService").Heartbeat:Wait();
end;
return function(p1, p2, ...)
local v2, v3 = ...;
p1.title.Text = v2;
if v3 == "Mythical" or v3 == "Exclusive" then
p1.title.TextColor3 = Color3.new(1, 1, 1);
v1.Assets.UI.Raritys:FindFirstChild(v3):Clone().Parent = p1.title;
end;
end;
|
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol
|
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local winfob = HUB.Parent.Music
local pal = false
local palpal = HUB.Parent.Palette
local handler = carSeat:WaitForChild('Filter')
local red = 0
local green = 0
local blue = 0
|
--[[
alert_date - дата и время создания сообщения
- image - ссылка на картинку
- text - собственно текст
]]
|
local delete = script.deleteMe:Clone()
while true do
local tmp = alert:GetChildren()
if #tmp then
-- отображение данных
ui.Parent = script
sf:ClearAllChildren()--Remove old frames
ui.Parent = sf
for a,b in pairs(tmp) do
local val = b.text.Value
local image = b.image.Value
-- повесим скрипт на удаление сообщения
local tmp = delete:Clone()
tmp.Parent = b
tmp.Disabled = false
local new = sample:Clone()--Make a clone of the sample frame
new.PName.Text = val -- устанавливаем текст
new.LayoutOrder = a --UIListLayout uses this to sort in the correct order
if image ~= '' then
new.Image.Image = image -- установка картинки
else
new.Image.Parent = nil
|
--/////////// CONFIGURATIONS \\\\\\\\\\\\\\\\\
|
local sensitivity = 1 -- how quick/snappy the sway movements are. Don't go above 2
local swaysize = 1 -- how large/powerful the sway is. Don't go above 2
local includestrafe = false -- if true the fps arms will sway when the character is strafing
local includewalksway = true -- if true, fps arms will sway when you are walking
local includecamerasway = true -- if true, fps arms will sway when you move the camera
local includejumpsway = true -- if true, jumping will have an effect on the viewmodel
local headoffset = 0 -- the height offset from the default camera position of the head.
local firstperson_arm_transparency = 0 -- the transparency of the arms in first person; set to 1 for invisible and set to 0 for fully visible.
local firstperson_waist_movements_enabled = false -- if true, animations will affect the Uppertorso. If false, the uppertorso stays still while in first person (applies to R15 only)
|
--Audio
|
local soundBank = game.ReplicatedStorage.Sounds.NPC.Banto:GetChildren()
banto.Health.Changed:connect(function()
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.Parent = banto.PrimaryPart
hitSound.PlayOnRemove = true
wait()
hitSound:Destroy()
end)
while true do
bp.Parent = banto.PrimaryPart
local goal
repeat
local ray = Ray.new(Vector3.new(origin.p.x+math.random(-tether,tether), banto.PrimaryPart.Position.Y+100, origin.p.z+math.random(-tether,tether)),Vector3.new(0,-130,0))
local part,pos,norm,mat = workspace:FindPartOnRay(ray,banto)
if part == workspace.Terrain and mat ~= Enum.Material.Water then
goal = pos+Vector3.new(0,2.25,0)
end
wait()
until goal
--Set new goal for banto to MoveTo :)
walk:Play()
local pos = banto.PrimaryPart.Position
local cf = CFrame.new(Vector3.new(pos.X, 0, pos.Z), Vector3.new(goal.X, 0, goal.Z))
bg.CFrame = cf
bp.Position = (cf*CFrame.new(0,0,-100)).p
local start = tick()
repeat wait(.5)
local ray = Ray.new(banto.PrimaryPart.Position, Vector3.new(0,-140,0))
until (banto.PrimaryPart.Position-goal).magnitude < 10 or tick()-start >10
walk:Stop()
bp.Parent = nil
wait(math.random(3,8))
end
|
--[[Weight and CG]]
|
Tune.Weight = 2421 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensionws in studs ; larger = more stable)
--[[Width]] 6.5 ,
--[[Height]] 4.8 ,
--[[Length]] 17 }
Tune.WeightDist = 51 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .7 -- 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
|
--me.Size=UDim2.new(0,me.AbsoluteSize.X-76,0,me.AbsoluteSize.Y-76)
--me.TextLabel.Size=UDim2.new(0,me.ScrollingFrame.AbsoluteSize.X-20,0.99,0)
| |
-- Services
|
local Teams = game:GetService("Teams")
local Workspace = game:GetService("Workspace")
local Debris = game:GetService("Debris")
local ContentProvider = game:GetService("ContentProvider")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("DexEvent");
|
--Leave this
|
Heat = 0
if GUI then
script.Parent.Visible = true
else
script.Parent.Visible = false
end
if not FE then
radiator.Oil.Enabled = false
radiator.Antifreeze.Enabled = false
radiator.Liquid.Volume = 0
radiator.Fan:Play()
radiator.Fan.Pitch = 1+FanSpeed
radiator.Steam:Play()
radiator.Liquid:Play()
script.Blown.Value = false
while wait(.2) do
if Heat > FanTemp and Fan == true then
FanCool = -FanSpeed
radiator.Fan.Volume = FanVolume
elseif Heat < FanTempAlpha then
FanCool = 0
radiator.Fan.Volume = 0
end
Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency
Heat = math.max(RunningTemp,(Heat+Load)+FanCool)
if Heat >= BlowupTemp then
Heat = BlowupTemp
radiator.Break:Play()
radiator.Liquid.Volume = .5
radiator.Oil.Enabled = true
radiator.Antifreeze.Enabled = true
script.Parent.Parent.IsOn.Value = false
script.Blown.Value = true
elseif Heat >= BlowupTemp-10 then
radiator.Smoke.Transparency = NumberSequence.new((BlowupTemp-Heat)/10,1)
radiator.Smoke.Enabled = true
radiator.Steam.Volume = math.abs(((BlowupTemp-Heat)-10)/10)
else
radiator.Smoke.Enabled = false
radiator.Steam.Volume = 0
end
script.Celsius.Value = Heat
script.Parent.Temp.Text = math.floor(Heat).."°c"
script.Parent.Temp.TextColor3 = Color3.fromRGB(255,255-((Heat-FanTemp)*10),255-((Heat-FanTemp)*10))
end
else
handler:FireServer("Initialize",FanSpeed)
while wait(.2) do
if Heat > FanTemp and Fan == true then
FanCool = -FanSpeed
handler:FireServer("FanVolume",FanVolume)
else
FanCool = 0
handler:FireServer("FanVolume",0)
end
Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency
Heat = math.max(RunningTemp,(Heat+Load)+FanCool)
if Heat >= BlowupTemp then
Heat = BlowupTemp
handler:FireServer("Blown")
script.Parent.Parent.IsOn.Value = false
script.Blown.Value = true
elseif Heat >= BlowupTemp-10 then
handler:FireServer("Smoke",true,BlowupTemp,Heat)
else
handler:FireServer("Smoke",false,BlowupTemp,Heat)
end
script.Celsius.Value = Heat
script.Parent.Temp.Text = math.floor(Heat).."°c"
end
end
|
--[[**
ensures Roblox UDim2 type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.UDim2 = primitive("UDim2")
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
local prev
local parts = script.Parent:GetChildren()
for i = 1,#parts do
if ((parts[i].className == "Part") or (parts[i].className == "Handle") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat") or (parts[i].className == "SkateboardPlatform")) then
if (prev ~= nil) then
local weld = Instance.new("Weld")
weld.Part0 = prev
weld.Part1 = parts[i]
weld.C0 = prev.CFrame:inverse(Engine)
weld.C1 = parts[i].CFrame:inverse(Part)
weld.Parent = prev
parts[i].Anchored = false
end
prev = parts[i]
end
end
local bp = Instance.new("BodyPosition")
bp.Parent = script.Parent.middle
bp.maxForce = Vector3.new(force,0,force)
bp.D = 250
bp.position = script.Parent.middle.Position
wait()
script.Parent.Hinges.Parta.Transparency = 1
script.Parent.Hinges.Partb.Transparency = 1
local people = script.Parent:GetChildren()
for i = 1,#people do
if people[i].className == "Part" then
people[i].TopSurface = "SmoothNoOutlines"
people[i].BottomSurface = "SmoothNoOutlines"
people[i].LeftSurface = "SmoothNoOutlines"
people[i].RightSurface = "SmoothNoOutlines"
people[i].FrontSurface = "SmoothNoOutlines"
people[i].BackSurface = "SmoothNoOutlines"
people[i].Anchored = false
end end
|
-- The pierce function can also be used for things like bouncing.
-- In reality, it's more of a function that the module uses to ask "Do I end the cast now, or do I keep going?"
-- Because of this, you can use it for logic such as ray reflection or other redirection methods.
-- A great example might be to pierce or bounce based on something like velocity or angle.
-- You can see this implementation further down in the OnRayPierced function.
|
function CanRayPierce(cast, rayResult, segmentVelocity)
-- Let's keep track of how many times we've hit something.
local hits = cast.UserData.Hits
if (hits == nil) then
-- If the hit data isn't registered, set it to 1 (because this is our first hit)
cast.UserData.Hits = 1
else
-- If the hit data is registered, add 1.
cast.UserData.Hits += 1
end
-- And if the hit count is over 3, don't allow piercing and instead stop the ray.
if (cast.UserData.Hits > 3) then
return false
end
-- Now if we make it here, we want our ray to continue.
-- This is extra important! If a bullet bounces off of something, maybe we want it to do damage too!
-- So let's implement that.
local hitPart = rayResult.Instance
if hitPart ~= nil and hitPart.Parent ~= nil then
local humanoid = hitPart.Parent:FindFirstChildOfClass("Humanoid")
if humanoid then
local Player = Players:GetPlayerFromCharacter(Tool.Parent)
humanoid.Health -= 50
TagHumanoid(humanoid, Player)
task.wait(2)
UntagHumanoid(humanoid)
end
end
-- And then lastly, return true to tell FC to continue simulating.
return true
--[[
-- This function shows off the piercing feature literally. Pass this function as the last argument (after bulletAcceleration) and it will run this every time the ray runs into an object.
-- Do note that if you want this to work properly, you will need to edit the OnRayPierced event handler below so that it doesn't bounce.
if material == Enum.Material.Plastic or material == Enum.Material.Ice or material == Enum.Material.Glass or material == Enum.Material.SmoothPlastic then
-- Hit glass, plastic, or ice...
if hitPart.Transparency >= 0.5 then
-- And it's >= half transparent...
return true -- Yes! We can pierce.
end
end
return false
--]]
end
function Fire(direction)
-- Called when we want to fire the gun.
if Tool.Parent:IsA("Backpack") then return end -- Can't fire if it's not equipped.
-- Note: Above isn't in the event as it will prevent the CanFire value from being set as needed.
-- UPD. 11 JUNE 2019 - Add support for random angles.
local directionalCF = CFrame.new(Vector3.new(), direction)
-- Now, we can use CFrame orientation to our advantage.
-- Overwrite the existing Direction value.
local direction = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
-- UPDATE V6: Proper bullet velocity!
-- IF YOU DON'T WANT YOUR BULLETS MOVING WITH YOUR CHARACTER, REMOVE THE THREE LINES OF CODE BELOW THIS COMMENT.
-- Requested by https://www.roblox.com/users/898618/profile/
-- We need to make sure the bullet inherits the velocity of the gun as it fires, just like in real life.
local humanoidRootPart = Tool.Parent:WaitForChild("HumanoidRootPart", 1) -- Add a timeout to this.
local myMovementSpeed = humanoidRootPart.Velocity -- To do: It may be better to get this value on the clientside since the server will see this value differently due to ping and such.
local modifiedBulletSpeed = (direction * BULLET_SPEED)-- + myMovementSpeed -- We multiply our direction unit by the bullet speed. This creates a Vector3 version of the bullet's velocity at the given speed. We then add MyMovementSpeed to add our body's motion to the velocity.
if PIERCE_DEMO then
CastBehavior.CanPierceFunction = CanRayPierce
end
local simBullet = Caster:Fire(FirePointObject.WorldPosition, direction, modifiedBulletSpeed, CastBehavior)
-- Optionally use some methods on simBullet here if applicable.
-- Play the sound
PlayFireSound()
task.wait(0.5)
PlayReloadSound()
end
|
--[=[
@param overridePos Vector2?
@return viewportMouseRay: Ray
Returns the viewport point ray for the mouse at the current mouse
position (or the override position if provided).
]=]
|
function Mouse:GetRay(overridePos)
local mousePos = overridePos or UserInputService:GetMouseLocation()
local viewportMouseRay = workspace.CurrentCamera:ViewportPointToRay(mousePos.X, mousePos.Y)
return viewportMouseRay
end
|
-- Services
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayersService = game:GetService("Players")
|
-- Management of which options appear on the Roblox User Settings screen
|
do
local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts")
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle)
end
function CameraModule.new()
local self = setmetatable({},CameraModule)
-- Current active controller instances
self.activeCameraController = nil
self.activeOcclusionModule = nil
self.activeTransparencyController = nil
self.activeMouseLockController = nil
self.currentComputerCameraMovementMode = nil
-- Connections to events
self.cameraSubjectChangedConn = nil
self.cameraTypeChangedConn = nil
-- Adds CharacterAdded and CharacterRemoving event handlers for all current players
for _,player in pairs(Players:GetPlayers()) do
self:OnPlayerAdded(player)
end
-- Adds CharacterAdded and CharacterRemoving event handlers for all players who join in the future
Players.PlayerAdded:Connect(function(player)
self:OnPlayerAdded(player)
end)
self.activeTransparencyController = TransparencyController.new()
self.activeTransparencyController:Enable(true)
self.activeMouseLockController = MouseLockController.new()
local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent()
if toggleEvent then
toggleEvent:Connect(function()
self:OnMouseLockToggled()
end)
end
self:ActivateCameraController(self:GetCameraControlChoice())
self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode)
self:OnCurrentCameraChanged() -- Does initializations and makes first camera controller
RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end)
-- Connect listeners to camera-related properties
for _, propertyName in pairs(PLAYER_CAMERA_PROPERTIES) do
Players.LocalPlayer:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnLocalPlayerCameraPropertyChanged(propertyName)
end)
end
for _, propertyName in pairs(USER_GAME_SETTINGS_PROPERTIES) do
UserGameSettings:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnUserGameSettingsPropertyChanged(propertyName)
end)
end
game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
self:OnCurrentCameraChanged()
end)
return self
end
function CameraModule:GetCameraMovementModeFromSettings()
local cameraMode = Players.LocalPlayer.CameraMode
-- Lock First Person trumps all other settings and forces ClassicCamera
if cameraMode == Enum.CameraMode.LockFirstPerson then
return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic)
end
local devMode, userMode
if UserInputService.TouchEnabled then
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
else
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevComputerCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
end
if devMode == Enum.DevComputerCameraMovementMode.UserChoice then
-- Developer is allowing user choice, so user setting is respected
return userMode
end
return devMode
end
function CameraModule:ActivateOcclusionModule(occlusionMode: Enum.DevCameraOcclusionMode)
local newModuleCreator
if occlusionMode == Enum.DevCameraOcclusionMode.Zoom then
newModuleCreator = Poppercam
elseif occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
newModuleCreator = Invisicam
else
warn("CameraScript ActivateOcclusionModule called with unsupported mode")
return
end
self.occlusionMode = occlusionMode
-- First check to see if there is actually a change. If the module being requested is already
-- the currently-active solution then just make sure it's enabled and exit early
if self.activeOcclusionModule and self.activeOcclusionModule:GetOcclusionMode() == occlusionMode then
if not self.activeOcclusionModule:GetEnabled() then
self.activeOcclusionModule:Enable(true)
end
return
end
-- Save a reference to the current active module (may be nil) so that we can disable it if
-- we are successful in activating its replacement
local prevOcclusionModule = self.activeOcclusionModule
-- If there is no active module, see if the one we need has already been instantiated
self.activeOcclusionModule = instantiatedOcclusionModules[newModuleCreator]
-- If the module was not already instantiated and selected above, instantiate it
if not self.activeOcclusionModule then
self.activeOcclusionModule = newModuleCreator.new()
if self.activeOcclusionModule then
instantiatedOcclusionModules[newModuleCreator] = self.activeOcclusionModule
end
end
-- If we were successful in either selecting or instantiating the module,
-- enable it if it's not already the currently-active enabled module
if self.activeOcclusionModule then
local newModuleOcclusionMode = self.activeOcclusionModule:GetOcclusionMode()
-- Sanity check that the module we selected or instantiated actually supports the desired occlusionMode
if newModuleOcclusionMode ~= occlusionMode then
warn("CameraScript ActivateOcclusionModule mismatch: ",self.activeOcclusionModule:GetOcclusionMode(),"~=",occlusionMode)
end
-- Deactivate current module if there is one
if prevOcclusionModule then
-- Sanity check that current module is not being replaced by itself (that should have been handled above)
if prevOcclusionModule ~= self.activeOcclusionModule then
prevOcclusionModule:Enable(false)
else
warn("CameraScript ActivateOcclusionModule failure to detect already running correct module")
end
end
-- Occlusion modules need to be initialized with information about characters and cameraSubject
-- Invisicam needs the LocalPlayer's character
-- Poppercam needs all player characters and the camera subject
if occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
-- Optimization to only send Invisicam what we know it needs
if Players.LocalPlayer.Character then
self.activeOcclusionModule:CharacterAdded(Players.LocalPlayer.Character, Players.LocalPlayer )
end
else
-- When Poppercam is enabled, we send it all existing player characters for its raycast ignore list
for _, player in pairs(Players:GetPlayers()) do
if player and player.Character then
self.activeOcclusionModule:CharacterAdded(player.Character, player)
end
end
self.activeOcclusionModule:OnCameraSubjectChanged((game.Workspace.CurrentCamera :: Camera).CameraSubject)
end
-- Activate new choice
self.activeOcclusionModule:Enable(true)
end
end
function CameraModule:ShouldUseVehicleCamera()
local camera = workspace.CurrentCamera
if not camera then
return false
end
local cameraType = camera.CameraType
local cameraSubject = camera.CameraSubject
local isEligibleType = cameraType == Enum.CameraType.Custom or cameraType == Enum.CameraType.Follow
local isEligibleSubject = cameraSubject and cameraSubject:IsA("VehicleSeat") or false
local isEligibleOcclusionMode = self.occlusionMode ~= Enum.DevCameraOcclusionMode.Invisicam
return isEligibleSubject and isEligibleType and isEligibleOcclusionMode
end
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Burgundy",Paint)
end)
|
-- The subset of a Thenable required by things thrown by Suspense.
-- This doesn't require a value to be passed to either handler.
|
export type Wakeable = {
andThen: (
self: Wakeable,
onFulfill: () -> ...any,
onReject: () -> ...any
-- ROBLOX FIXME Luau: needs union type packs to parse () | Wakeable
) -> nil | Wakeable,
-- Special flag to opt out of tracing interactions across a Suspense boundary.
__reactDoNotTraceInteractions: boolean?,
}
|
--handler:FireServer("stopSound",Your sound here)
|
wait()
handler:FireServer("playSound",car.DriveSeat.Rev)
|
--Aspiration Setup
|
_TCount = _Tune.Turbochargers
_TPsi = _Tune.T_Boost*_Tune.Turbochargers
_SCount = _Tune.Superchargers
_SPsi = _Tune.S_Boost*_Tune.Superchargers
|
--[[ << GROUP PERMISSIONS >>
Format: [GroupId] = { [GroupRoleNumber] = "PermissionName", OR PermissionNumber, }; ]]
|
Group_Permissions={
[0] = { [254]="HeadAdmin", [1]="VIP", };
} ;
|
--------RIGHT DOOR --------
|
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(133)
game.Workspace.doorright.pillar.BrickColor = BrickColor.new(106)
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
BulletSpeed = Handle.BulletSpeed.Value
DisappearTime = Handle.BulletDisappearTime.Value
ReloadTime = Handle.ReloadTime.Value
BulletColor = Handle.BulletColor.Value
NozzleOffset = Vector3.new(0, 0.4, -1.1)
Sounds = {
Fire = Handle:WaitForChild("Fire"),
Reload = Handle:WaitForChild("Reload"),
HitFade = Handle:WaitForChild("HitFade")
}
PointLight = Handle:WaitForChild("PointLight")
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
ServerControl.OnServerInvoke = (function(player, Mode, Value, arg)
if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then
return
end
if Mode == "Click" and Value then
Activated(arg)
end
end)
function InvokeClient(Mode, Value)
pcall(function()
ClientControl:InvokeClient(Player, Mode, Value)
end)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function FindCharacterAncestor(Parent)
if Parent and Parent ~= game:GetService("Workspace") then
local humanoid = Parent:FindFirstChild("Humanoid")
if humanoid then
return Parent, humanoid
else
return FindCharacterAncestor(Parent.Parent)
end
end
return nil
end
function GetTransparentsRecursive(Parent, PartsTable)
local PartsTable = (PartsTable or {})
for i, v in pairs(Parent:GetChildren()) do
local TransparencyExists = false
pcall(function()
local Transparency = v["Transparency"]
if Transparency then
TransparencyExists = true
end
end)
if TransparencyExists then
table.insert(PartsTable, v)
end
GetTransparentsRecursive(v, PartsTable)
end
return PartsTable
end
function SelectionBoxify(Object)
local SelectionBox = Instance.new("SelectionBox")
SelectionBox.Adornee = Object
SelectionBox.Color3 = BulletColor
SelectionBox.Parent = Object
return SelectionBox
end
local function Light(Object)
local Light = PointLight:Clone()
Light.Range = (Light.Range + 2)
Light.Parent = Object
end
function FadeOutObjects(Objects, FadeIncrement)
repeat
local LastObject = nil
for i, v in pairs(Objects) do
v.Transparency = (v.Transparency + FadeIncrement)
LastObject = v
end
wait()
until LastObject.Transparency >= 1 or not LastObject
end
function Touched(Projectile, Hit)
if not Hit or not Hit.Parent then
return
end
local character, humanoid = FindCharacterAncestor(Hit)
if character and humanoid and character ~= Character then
local ForceFieldExists = false
for i, v in pairs(character:GetChildren()) do
if v:IsA("ForceField") then
ForceFieldExists = true
end
end
if not ForceFieldExists then
if Projectile then
local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name)
local torso = humanoid.Torso
if HitFadeSound and torso then
HitFadeSound.Parent = torso
HitFadeSound:Play()
end
local explosion = Instance.new("Explosion")
explosion.Parent = game.Workspace
explosion.Position = torso.Position
explosion.BlastRadius = 1
character:BreakJoints()
humanoid.Health = 0
end
end
if Projectile and Projectile.Parent then
Projectile:Destroy()
end
end
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not Player or not Humanoid or Humanoid.Health == 0 then
return
end
end
function Activated(target)
if Tool.Enabled and Humanoid.Health > 0 then
Tool.Enabled = false
InvokeClient("PlaySound", Sounds.Fire)
local HandleCFrame = Handle.CFrame
local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
local ShotCFrame = CFrame.new(FiringPoint, target)
local LaserShotClone = BaseShot:Clone()
LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.velocity = ShotCFrame.lookVector * BulletSpeed
BodyVelocity.Parent = LaserShotClone
LaserShotClone.Touched:connect(function(Hit)
if not Hit or not Hit.Parent then
return
end
Touched(LaserShotClone, Hit)
end)
Debris:AddItem(LaserShotClone, DisappearTime)
LaserShotClone.Parent = game:GetService("Workspace")
wait(0.6) -- FireSound length
InvokeClient("PlaySound", Sounds.Reload)
wait(ReloadTime) -- ReloadSound length
Tool.Enabled = true
end
end
function Unequipped()
end
BaseShot = Instance.new("Part")
BaseShot.Name = "Effect"
BaseShot.Color = BulletColor
BaseShot.Material = Enum.Material.Plastic
BaseShot.Shape = Enum.PartType.Block
BaseShot.TopSurface = Enum.SurfaceType.Smooth
BaseShot.BottomSurface = Enum.SurfaceType.Smooth
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.Locked = true
SelectionBoxify(BaseShot)
Light(BaseShot)
BaseShotSound = Sounds.HitFade:Clone()
BaseShotSound.Parent = BaseShot
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- VALORES DE AJUSTE
----------------------------------------
-- Fator de torque aplicado para fazer as rodas girarem
-- Número maior geralmente significa aceleração mais rápida
|
local TORQUE = 9000
|
--NOTE: We create the rocket once and then clone it when the player fires
|
local Rocket = Instance.new('Part') do
-- Set up the rocket part
Rocket.Name = 'Rocket'
Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
Rocket.Size = ROCKET_PART_SIZE
Rocket.CanCollide = false
-- Add the mesh
local mesh = Instance.new('SpecialMesh', Rocket)
mesh.MeshId = MISSILE_MESH_ID
mesh.Scale = MISSILE_MESH_SCALE
-- Add fire
local fire = Instance.new('Fire', Rocket)
fire.Heat = 5
fire.Size = 2
-- Add a force to counteract gravity
local bodyForce = Instance.new('BodyForce', Rocket)
bodyForce.Name = 'Antigravity'
bodyForce.Force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0)
-- Clone the sounds and set Boom to PlayOnRemove
local swooshSoundClone = SwooshSound:Clone()
swooshSoundClone.Parent = Rocket
local boomSoundClone = BoomSound:Clone()
boomSoundClone.PlayOnRemove = true
boomSoundClone.Parent = Rocket
-- Attach creator tags to the rocket early on
local creatorTag = Instance.new('ObjectValue', Rocket)
creatorTag.Value = MyPlayer
creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
local iconTag = Instance.new('StringValue', creatorTag)
iconTag.Value = Tool.TextureId
iconTag.Name = 'icon'
-- Finally, clone the rocket script and enable it
local rocketScriptClone = RocketScript:Clone()
rocketScriptClone.Parent = Rocket
rocketScriptClone.Disabled = false
end
|
--[[**
ensures Roblox TweenInfo type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.TweenInfo = t.typeof("TweenInfo")
|
--[[ SERVICES ]]
|
local PlayersService = game:GetService('Players')
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
|
-------------------------------------------------------------------
|
function regenerate()
Click.MaxActivationDistance = 0
enabled = false
if DeleteEmptyModels then
GUIText.Text = "DELETING UNUSED MODELS"
for _,v in pairs(game.Workspace:GetDescendants())do
if v.Name == ModelName and v:IsA("Model") then
local Delete = CheckDeletes(v,true)
if Delete == true then
v:Destroy()
end
end
end
end
wait()
if model.PrimaryPart ~= nil and (model.PrimaryPart.CFrame.p-script.Parent.CFrame.p).Magnitude>50 then
model = backup:clone()
model.Parent = game.Workspace
Cooldown()
else
model = backup:clone()
model.Parent = game.Workspace
Cooldown()
end
end
|
--[[
[Horizontal and Vertical limits for head and body tracking.]
[Setting to 0 negates tracking, setting to 1 is normal tracking, and setting to anything higher than 1 goes past real life head/body rotation capabilities.]
--]]
|
local HeadHorFactor = 1
local HeadVertFactor = 0.6
local BodyHorFactor = 0.5
local BodyVertFactor = 0.4
|
--RunService.RenderStepped:Connect(function(step)
-- local ray = Ray.new(char.Head.Position, ((char.Head.CFrame + char.Head.CFrame.LookVector * 2) - char.Head.Position).Position.Unit)
-- local ignoreList = char:GetChildren()
| |
--// bolekinds
|
if game.ServerStorage.ServerData.CatBed.Value == true then
game.ServerStorage["Cat Bed"]:Clone().Parent = workspace
else
if workspace:FindFirstChild("Cat Bed") then
workspace:FindFirstChild("Cat Bed"):Destroy()
end
end
game.ServerStorage.ServerData.CatBed.Changed:Connect(function()
if not workspace:FindFirstChild("Cat Bed") and game.ServerStorage.ServerData.CatBed.Value == true then
game.ServerStorage["Cat Bed"]:Clone().Parent = workspace
else
if game.ServerStorage.ServerData.CatBed.Value == false then
if workspace:FindFirstChild("Cat Bed") then
workspace:FindFirstChild("Cat Bed"):Destroy()
end
end
end
end)
|
--[[ Module Functions ]]
|
--
Chassis = {}
Chassis.root = PackagedVehicle:FindFirstChild("Chassis") --the root of the Chassis model
Chassis.driverSeat = Chassis.root:FindFirstChildOfClass("VehicleSeat")
Chassis.passengerSeats = {
Chassis.root:FindFirstChild("SeatFR"),
Chassis.root:FindFirstChild("SeatRL"),
Chassis.root:FindFirstChild("SeatRR")
}
local randomSuspension = Chassis.root:FindFirstChild("SuspensionFL")
local wheelRadius = randomSuspension.Wheel.Size.y/2
Chassis.driverSeat.MaxSpeed = VehicleParameters.MaxSpeed * wheelRadius
function Chassis.InitializeDrivingValues()
-- Constraint tables always ordered FL, FR, RL, RR
Motors = getVehicleMotors()
local strutSpringsFront = getSprings("StrutFront")
local strutSpringsRear = getSprings("StrutRear")
local torsionSprings = getSprings("TorsionBar")
RedressMount = Chassis.root:WaitForChild("RedressMount")
SteeringPrismatic = constraints:FindFirstChild("SteeringPrismatic")
SteeringPrismatic.UpperLimit = VehicleParameters.MaxSteer
SteeringPrismatic.LowerLimit = -VehicleParameters.MaxSteer
for _,s in pairs(strutSpringsFront) do
adjustSpring(s, ActualStrutSpringStiffnessFront, ActualStrutSpringDampingFront)
end
for _,s in pairs(strutSpringsRear) do
adjustSpring(s, ActualStrutSpringStiffnessRear, ActualStrutSpringDampingRear)
end
for _,s in pairs(torsionSprings) do
adjustSpring(s, ActualTorsionSpringStiffness, ActualTorsionSpringDamping)
end
local chassisChildren = Chassis.root:GetChildren()
for i = 1, #chassisChildren do
local model = chassisChildren[i]
if model:IsA("Model") then
local wheel = model:FindFirstChild("Wheel")
if wheel then
local old = wheel.CustomPhysicalProperties
local new = PhysicalProperties.new(old.Density, VehicleParameters.WheelFriction, old.Elasticity, old.FrictionWeight, old.ElasticityWeight)
wheel.CustomPhysicalProperties = new
end
end
end
setMotorTorque(10000)
end
function Chassis.GetDriverSeat()
return Chassis.driverSeat
end
function Chassis.GetPassengerSeats()
return Chassis.passengerSeats
end
function Chassis.GetBase()
return Chassis.root.PrimaryPart or Chassis.root:FindFirstChild("FloorPanel")
end
|
--[[Drivetrain Initialize]]
|
local Drive={}
--Power Front Wheels
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then table.insert(Drive,v) end end end
--Power Rear Wheels
|
-- TOGGLEABLE METHODS
|
function Icon:setLabel(text, iconState)
text = text or ""
self:set("iconText", text, iconState)
return self
end
function Icon:setCornerRadius(scale, offset, iconState)
local oldCornerRadius = self.instances.iconCorner.CornerRadius
local newCornerRadius = UDim.new(scale or oldCornerRadius.Scale, offset or oldCornerRadius.Offset)
self:set("iconCornerRadius", newCornerRadius, iconState)
return self
end
function Icon:setImage(imageId, iconState)
local textureId = (tonumber(imageId) and "http://www.roblox.com/asset/?id="..imageId) or imageId or ""
return self:set("iconImage", textureId, iconState)
end
function Icon:setOrder(order, iconState)
local newOrder = tonumber(order) or 1
return self:set("order", newOrder, iconState)
end
function Icon:setLeft(iconState)
return self:set("alignment", "left", iconState)
end
function Icon:setMid(iconState)
return self:set("alignment", "mid", iconState)
end
function Icon:setRight(iconState)
if not self.internalIcon then
IconController.setupHealthbar()
end
return self:set("alignment", "right", iconState)
end
function Icon:setImageYScale(YScale, iconState)
local newYScale = tonumber(YScale) or 0.63
return self:set("iconImageYScale", newYScale, iconState)
end
function Icon:setImageRatio(ratio, iconState)
local newRatio = tonumber(ratio) or 1
return self:set("iconImageRatio", newRatio, iconState)
end
function Icon:setLabelYScale(YScale, iconState)
local newYScale = tonumber(YScale) or 0.45
return self:set("iconLabelYScale", newYScale, iconState)
end
function Icon:setBaseZIndex(ZIndex, iconState)
local newBaseZIndex = tonumber(ZIndex) or 1
return self:set("baseZIndex", newBaseZIndex, iconState)
end
function Icon:_updateBaseZIndex(baseValue)
local container = self.instances.iconContainer
local newBaseValue = tonumber(baseValue) or container.ZIndex
local difference = newBaseValue - container.ZIndex
if difference == 0 then return "The baseValue is the same" end
for _, object in pairs(self.instances) do
if object:IsA("GuiObject") then
object.ZIndex = object.ZIndex + difference
end
end
return true
end
function Icon:setSize(XOffset, YOffset, iconState)
if tonumber(XOffset) then
self.forcefullyAppliedXSize = true
self:set("forcedIconSizeX", tonumber(XOffset), iconState)
else
self.forcefullyAppliedXSize = false
self:set("forcedIconSizeX", 32, iconState)
end
if tonumber(YOffset) then
self.forcefullyAppliedYSize = true
self:set("forcedIconSizeY", tonumber(YOffset), iconState)
else
self.forcefullyAppliedYSize = false
self:set("forcedIconSizeY", 32, iconState)
end
local newXOffset = tonumber(XOffset) or 32
local newYOffset = tonumber(YOffset) or (YOffset ~= "_NIL" and newXOffset) or 32
self:set("iconSize", UDim2.new(0, newXOffset, 0, newYOffset), iconState)
return self
end
function Icon:setXSize(XOffset, iconState)
self:setSize(XOffset, "_NIL", iconState)
return self
end
function Icon:setYSize(YOffset, iconState)
self:setSize("_NIL", YOffset, iconState)
return self
end
function Icon:_getContentText(text)
-- This converts richtext (e.g. "<b>Shop</b>") to normal text (e.g. "Shop")
-- This also converts richtext/normaltext into its localized (translated) version
-- This is important when calculating the size of the label/box for instance
self.instances.fakeIconLabel.Text = text
local textToTranslate = self.instances.fakeIconLabel.ContentText
local translatedContentText = typeof(self.instances.iconLabel) == "Instance" and IconController.translator:Translate(self.instances.iconLabel, textToTranslate)
if typeof(translatedContentText) ~= "string" or translatedContentText == "" then
translatedContentText = textToTranslate
end
self.instances.fakeIconLabel.Text = ""
return translatedContentText
end
function Icon:_updateIconSize(_, iconState)
if self._destroyed then return end
-- This is responsible for handling the appearance and size of the icons label and image, in additon to its own size
local X_MARGIN = 12
local X_GAP = 8
local values = {
iconImage = self:get("iconImage", iconState) or "_NIL",
iconText = self:get("iconText", iconState) or "_NIL",
iconFont = self:get("iconFont", iconState) or "_NIL",
iconSize = self:get("iconSize", iconState) or "_NIL",
forcedIconSizeX = self:get("forcedIconSizeX", iconState) or "_NIL",
iconImageYScale = self:get("iconImageYScale", iconState) or "_NIL",
iconImageRatio = self:get("iconImageRatio", iconState) or "_NIL",
iconLabelYScale = self:get("iconLabelYScale", iconState) or "_NIL",
}
for k,v in pairs(values) do
if v == "_NIL" then
return
end
end
local iconContainer = self.instances.iconContainer
if not iconContainer.Parent then return end
-- We calculate the cells dimensions as apposed to reading because there's a possibility the cells dimensions were changed at the exact time and have not yet updated
-- this essentially saves us from waiting a heartbeat which causes additonal complications
local cellSizeXOffset = values.iconSize.X.Offset
local cellSizeXScale = values.iconSize.X.Scale
local cellWidth = cellSizeXOffset + (cellSizeXScale * iconContainer.Parent.AbsoluteSize.X)
local minCellWidth = values.forcedIconSizeX--cellWidth
local maxCellWidth = (cellSizeXScale > 0 and cellWidth) or (self.forcefullyAppliedXSize and minCellWidth) or 9999
local cellSizeYOffset = values.iconSize.Y.Offset
local cellSizeYScale = values.iconSize.Y.Scale
local cellHeight = cellSizeYOffset + (cellSizeYScale * iconContainer.Parent.AbsoluteSize.Y)
local labelHeight = cellHeight * values.iconLabelYScale
local iconContentText = self:_getContentText(values.iconText)
local labelWidth = textService:GetTextSize(iconContentText, labelHeight, values.iconFont, Vector2.new(10000, labelHeight)).X
local imageWidth = cellHeight * values.iconImageYScale * values.iconImageRatio
local usingImage = values.iconImage ~= ""
local usingText = values.iconText ~= ""
local notifPosYScale = 0.5
local desiredCellWidth
local preventClippingOffset = labelHeight/2
if usingImage and not usingText then
desiredCellWidth = 0
notifPosYScale = 0.45
self:set("iconImageVisible", true, iconState)
self:set("iconImageAnchorPoint", Vector2.new(0.5, 0.5), iconState)
self:set("iconImagePosition", UDim2.new(0.5, 0, 0.5, 0), iconState)
self:set("iconImageSize", UDim2.new(values.iconImageYScale*values.iconImageRatio, 0, values.iconImageYScale, 0), iconState)
self:set("iconLabelVisible", false, iconState)
elseif not usingImage and usingText then
desiredCellWidth = labelWidth+(X_MARGIN*2)
self:set("iconLabelVisible", true, iconState)
self:set("iconLabelAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconLabelPosition", UDim2.new(0, X_MARGIN, 0.5, 0), iconState)
self:set("iconLabelSize", UDim2.new(1, -X_MARGIN*2, values.iconLabelYScale, preventClippingOffset), iconState)
self:set("iconLabelTextXAlignment", Enum.TextXAlignment.Center, iconState)
self:set("iconImageVisible", false, iconState)
elseif usingImage and usingText then
local labelGap = X_MARGIN + imageWidth + X_GAP
desiredCellWidth = labelGap + labelWidth + X_MARGIN
self:set("iconImageVisible", true, iconState)
self:set("iconImageAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconImagePosition", UDim2.new(0, X_MARGIN, 0.5, 0), iconState)
self:set("iconImageSize", UDim2.new(0, imageWidth, values.iconImageYScale, 0), iconState)
----
self:set("iconLabelVisible", true, iconState)
self:set("iconLabelAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconLabelPosition", UDim2.new(0, labelGap, 0.5, 0), iconState)
self:set("iconLabelSize", UDim2.new(1, -labelGap-X_MARGIN, values.iconLabelYScale, preventClippingOffset), iconState)
self:set("iconLabelTextXAlignment", Enum.TextXAlignment.Left, iconState)
end
if desiredCellWidth then
if not self._updatingIconSize then
self._updatingIconSize = true
local widthScale = (cellSizeXScale > 0 and cellSizeXScale) or 0
local widthOffset = (cellSizeXScale > 0 and 0) or math.clamp(desiredCellWidth, minCellWidth, maxCellWidth)
self:set("iconSize", UDim2.new(widthScale, widthOffset, values.iconSize.Y.Scale, values.iconSize.Y.Offset), iconState, "_ignorePrevious")
-- This ensures that if an icon is within a dropdown or menu, its container adapts accordingly with this new iconSize value
local parentIcon = self._parentIcon
if parentIcon then
local originalIconSize = UDim2.new(0, desiredCellWidth, 0, values.iconSize.Y.Offset)
if #parentIcon.dropdownIcons > 0 then
self:setAdditionalValue("iconSize", "beforeDropdown", originalIconSize, iconState)
parentIcon:_updateDropdown()
end
if #parentIcon.menuIcons > 0 then
self:setAdditionalValue("iconSize", "beforeMenu", originalIconSize, iconState)
parentIcon:_updateMenu()
end
end
self._updatingIconSize = false
end
end
self:set("iconLabelTextSize", labelHeight, iconState)
self:set("noticeFramePosition", UDim2.new(notifPosYScale, 0, 0, -2), iconState)
self._updatingIconSize = false
end
|
-- Define a function to handle button clicks and ban the player
|
function onBanButtonClicked()
local playerId = tonumber(idTextBox.Text)
if playerId then
local success, result = pcall(function()
return banPlayerRemote:A(playerId)
end)
if success and result then
idTextBox.Text = ""
idTextBox.PlaceholderText = "Player ID"
idTextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
idTextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
else
idTextBox.TextColor3 = Color3.fromRGB(255, 0, 0)
idTextBox.BackgroundColor3 = Color3.fromRGB(255, 200, 200)
idTextBox.PlaceholderText = "Invalid ID"
end
else
idTextBox.TextColor3 = Color3.fromRGB(255, 0, 0)
idTextBox.BackgroundColor3 = Color3.fromRGB(255, 200, 200)
idTextBox.PlaceholderText = "Invalid ID"
end
end
|
--// Extras
|
WalkAnimEnabled = true; -- Set to false to disable walking animation, true to enable
SwayEnabled = true; -- Set to false to disable sway, true to enable
TacticalModeEnabled = true;
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Mesh = Handle:WaitForChild("Mesh")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
BaseUrl = "http://www.roblox.com/asset/?id="
Grips = {
Up = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0),
Out = CFrame.new(0, 0, -1.5, 0, -1, -0, -1, 0, -0, 0, 0, -1),
}
DamageValues = {
BaseDamage = 0,
SlashDamage = 10,
LungeDamage = 15,
}
Damage = DamageValues.BaseDamage
Sounds = {
Slash = Handle:WaitForChild("Slash"),
Lunge = Handle:WaitForChild("Lunge"),
Unsheath = Handle:WaitForChild("Unsheath"),
}
LastAttack = 0
ToolEquipped = false
Tool.Enabled = true
function SwordUp()
Tool.Grip = Grips.Up
end
function SwordOut()
Tool.Grip = Grips.Out
end
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Slash"
Anim.Parent = Tool
end
function Lunge()
Damage = DamageValues.LungeDamage
Sounds.Lunge:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
local Force = Instance.new("BodyVelocity")
Force.velocity = Vector3.new(0, 10, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.5)
Force.Parent = RootPart
wait(0.25)
SwordOut()
wait(0.25)
if Force and Force.Parent then
Force:Destroy()
end
wait(0.5)
SwordUp()
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() then
return
end
local RightArm = (Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand"))
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
end
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
local Tick = RunService.Stepped:wait()
if (Tick - LastAttack) < 0.2 then
Lunge()
else
Attack()
end
Damage = DamageValues.BaseDamage
LastAttack = Tick
Tool.Enabled = true
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and RootPart and RootPart.Parent and Player and Player.Parent) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
RootPart = Character:FindFirstChild("HumanoidRootPart")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Sounds.Unsheath:Play()
end
function Unequipped()
ToolEquipped = false
end
SwordUp()
Handle.Touched:connect(Blow)
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--[[
Detects if an enemy is close by and if the agent can see the enemy.
This will return the currently selected target if one is present
]]
|
function AngleBetweenVectors(a, b)
return math.acos(a:Dot(b) / (a.Magnitude * b.Magnitude))
end
return function( self )
--local Target = self.Target
local ClosestCharacter = nil
local ClosestDistance = self.MaxDetectionRange
--if not Target then
for _,plr in pairs(game.Players:GetPlayers()) do
if plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
local dist = (plr.Character.HumanoidRootPart.Position - self.HumanoidRootPart.Position).magnitude
--[[print("Dot:",self.HumanoidRootPart.CFrame.lookVector:Dot(
plr.Character.HumanoidRootPart.Position
- self.HumanoidRootPart.Position))]]
if dist < ClosestDistance
and -- Get the dot product to see if the NPC can see the player
--[[self.HumanoidRootPart.CFrame.lookVector:Dot(
plr.Character.HumanoidRootPart.Position
- self.HumanoidRootPart.Position) > (self.MaxDetectionAngle/360)]]
math.deg(AngleBetweenVectors(self.HumanoidRootPart.CFrame.lookVector, plr.Character.HumanoidRootPart.Position
- self.HumanoidRootPart.Position)) <= self.MaxDetectionAngle/2
then
ClosestDistance = dist
ClosestCharacter = plr.Character
end
end
end
--end
self.ClosestEnemy = ClosestCharacter
if self.ClosestEnemy then
--print("EnemyIsNearby,",true)
--print("Closest Character:",self.ClosestEnemy.Name)
self:AddAggro( self.ClosestEnemy,.0000001 ) -- we're adding a tiny aggro amount so that damages will take priority
return true
else
--print("EnemyIsNearby,",false)
return false
end
end
|
--///////////////// Internal-Use Methods
--//////////////////////////////////////
|
function methods:InternalDestroy()
for i, channel in pairs(self.Channels) do
channel:InternalRemoveSpeaker(self)
end
self.eDestroyed:Fire()
self.EventFolder = nil
self.eDestroyed:Destroy()
self.eSaidMessage:Destroy()
self.eReceivedMessage:Destroy()
self.eReceivedUnfilteredMessage:Destroy()
self.eMessageDoneFiltering:Destroy()
self.eReceivedSystemMessage:Destroy()
self.eChannelJoined:Destroy()
self.eChannelLeft:Destroy()
self.eMuted:Destroy()
self.eUnmuted:Destroy()
self.eExtraDataUpdated:Destroy()
self.eMainChannelSet:Destroy()
self.eChannelNameColorUpdated:Destroy()
end
function methods:InternalAssignPlayerObject(playerObj)
self.PlayerObj = playerObj
end
function methods:InternalAssignEventFolder(eventFolder)
self.EventFolder = eventFolder
end
function methods:InternalSendMessage(messageObj, channelName)
local success, err = pcall(function()
self:LazyFire("eReceivedUnfilteredMessage", messageObj, channelName)
if self.PlayerObj then
self.EventFolder.OnNewMessage:FireClient(self.PlayerObj, messageObj, channelName)
end
end)
if not success and err then
print("Error sending internal message: " ..err)
end
end
function methods:InternalSendFilteredMessage(messageObj, channelName)
local success, err = pcall(function()
self:LazyFire("eReceivedMessage", messageObj, channelName)
self:LazyFire("eMessageDoneFiltering", messageObj, channelName)
if self.PlayerObj then
self.EventFolder.OnMessageDoneFiltering:FireClient(self.PlayerObj, messageObj, channelName)
end
end)
if not success and err then
print("Error sending internal filtered message: " ..err)
end
end
|
-- Listen for touches
|
Entry.Touched:connect(MovePlayer)
|
--move current data down
|
script.Parent.Parent.AgeBoxtwo.Text=script.Parent.Parent.AgeBox.Text
script.Parent.Parent.NameBoxtwo.Text=script.Parent.Parent.NameBox.Text
script.Parent.Parent.UserIDBoxtwo.Text=script.Parent.Parent.UserIDBox.Text
|
--function tagHumanoid(humanoid)
|
-- todo: make tag expire
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 18
local slash_damage = 18
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = 1
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
attack()
wait(1)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
-- Assign hotkeys for cloning (left or right shift + c)
|
AssignHotkey({ 'LeftShift', 'C' }, CloneSelection);
AssignHotkey({ 'RightShift', 'C' }, CloneSelection);
|
-- Keyboard controller is really keyboard and mouse controller
|
local computerInputTypeToModuleMap = {
[Enum.UserInputType.Keyboard] = Keyboard,
[Enum.UserInputType.MouseButton1] = Keyboard,
[Enum.UserInputType.MouseButton2] = Keyboard,
[Enum.UserInputType.MouseButton3] = Keyboard,
[Enum.UserInputType.MouseWheel] = Keyboard,
[Enum.UserInputType.MouseMovement] = Keyboard,
[Enum.UserInputType.Gamepad1] = Gamepad,
[Enum.UserInputType.Gamepad2] = Gamepad,
[Enum.UserInputType.Gamepad3] = Gamepad,
[Enum.UserInputType.Gamepad4] = Gamepad,
}
local lastInputType
function ControlModule.new()
local self = setmetatable({},ControlModule)
-- The Modules above are used to construct controller instances as-needed, and this
-- table is a map from Module to the instance created from it
self.controllers = {}
self.activeControlModule = nil -- Used to prevent unnecessarily expensive checks on each input event
self.activeController = nil
self.touchJumpController = nil
self.moveFunction = Players.LocalPlayer.Move
self.humanoid = nil
self.lastInputType = Enum.UserInputType.None
self.controlsEnabled = true
-- For Roblox self.vehicleController
self.humanoidSeatedConn = nil
self.vehicleController = nil
self.touchControlFrame = nil
if FFlagUserHideControlsWhenMenuOpen then
GuiService.MenuOpened:Connect(function()
if self.touchControlFrame and self.touchControlFrame.Visible then
self.touchControlFrame.Visible = false
end
end)
GuiService.MenuClosed:Connect(function()
if self.touchControlFrame then
self.touchControlFrame.Visible = true
end
end)
end
self.vehicleController = VehicleController.new(CONTROL_ACTION_PRIORITY)
Players.LocalPlayer.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end)
Players.LocalPlayer.CharacterRemoving:Connect(function(char) self:OnCharacterRemoving(char) end)
if Players.LocalPlayer.Character then
self:OnCharacterAdded(Players.LocalPlayer.Character)
end
RunService:BindToRenderStep("ControlScriptRenderstep", Enum.RenderPriority.Input.Value, function(dt)
self:OnRenderStepped(dt)
end)
UserInputService.LastInputTypeChanged:Connect(function(newLastInputType)
self:OnLastInputTypeChanged(newLastInputType)
end)
UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function()
self:OnTouchMovementModeChange()
end)
Players.LocalPlayer:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function()
self:OnTouchMovementModeChange()
end)
UserGameSettings:GetPropertyChangedSignal("ComputerMovementMode"):Connect(function()
self:OnComputerMovementModeChange()
end)
Players.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
self:OnComputerMovementModeChange()
end)
--[[ Touch Device UI ]]--
self.playerGui = nil
self.touchGui = nil
self.playerGuiAddedConn = nil
GuiService:GetPropertyChangedSignal("TouchControlsEnabled"):Connect(function()
self:UpdateTouchGuiVisibility()
self:UpdateActiveControlModuleEnabled()
end)
if UserInputService.TouchEnabled then
self.playerGui = Players.LocalPlayer:FindFirstChildOfClass("PlayerGui")
if self.playerGui then
self:CreateTouchGuiContainer()
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
else
self.playerGuiAddedConn = Players.LocalPlayer.ChildAdded:Connect(function(child)
if child:IsA("PlayerGui") then
self.playerGui = child
self:CreateTouchGuiContainer()
self.playerGuiAddedConn:Disconnect()
self.playerGuiAddedConn = nil
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
end
end)
end
else
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
end
return self
end
|
--[[**
<description>
Gets the result from the data store. Will yield the first time it is called.
</description>
<parameter name = "defaultValue">
The default result if there is no result in the data store.
</parameter>
<parameter name = "dontAttemptGet">
If there is no cached result, just return nil.
</parameter>
<returns>
The value in the data store if there is no cached result. The cached result otherwise.
</returns>
**--]]
|
function DataStore:Get(defaultValue, dontAttemptGet)
if dontAttemptGet then
return self.value
end
local backupCount = 0
if not self.haveValue then
while not self.haveValue do
local success, error = pcall(self._GetRaw, self)
if not success then
if self.backupRetries then
backupCount = backupCount + 1
if backupCount >= self.backupRetries then
self.backup = true
self.haveValue = true
self.value = self.backupValue
break
end
end
self:Debug("Get returned error:", error)
end
end
if self.value ~= nil then
for _,modifier in pairs(self.beforeInitialGet) do
self.value = modifier(self.value, self)
end
end
end
local value
if self.value == nil and defaultValue ~= nil then --not using "not" because false is a possible value
value = defaultValue
else
value = self.value
end
value = clone(value)
self.value = value
return value
end
|
--[=[
Returns the results from the promise.
:::warning
This API surface will error if the promise is still pending.
:::
@return boolean -- true if resolved, false otherwise.
@return any
]=]
|
function Promise:GetResults()
if self._rejected then
return false, unpack(self._rejected, 1, self._valuesLength)
elseif self._fulfilled then
return true, unpack(self._fulfilled, 1, self._valuesLength)
else
error("Still pending")
end
end
function Promise:_getResolveReject()
return function(...)
self:Resolve(...)
end, function(...)
self:_reject({...}, select("#", ...))
end
end
|
--For Omega Rainbow Katana thumbnail to display a lot of particles.
|
for i, v in pairs(Handle:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = 20
end
end
Tool.Grip = Grips.Up
Tool.Enabled = true
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
return
end
if Hit.Parent:IsA("Model") then
if not Players:GetPlayerFromCharacter(Hit.Parent) then
local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
if character == Character then
return
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health == 0 then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
else
return
end
end
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
if Humanoid then
if Humanoid.RigType == Enum.HumanoidRigType.R6 then
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Slash"
Anim.Parent = Tool
elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
local Anim = Tool:FindFirstChild("R15Slash")
if Anim then
local Track = Humanoid:LoadAnimation(Anim)
Track:Play(0)
end
end
end
end
function Lunge()
Damage = DamageValues.LungeDamage
Sounds.Lunge:Play()
if Humanoid then
if Humanoid.RigType == Enum.HumanoidRigType.R6 then
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
local Anim = Tool:FindFirstChild("R15Lunge")
if Anim then
local Track = Humanoid:LoadAnimation(Anim)
Track:Play(0)
end
end
end
--[[
if CheckIfAlive() then
local Force = Instance.new("BodyVelocity")
Force.velocity = Vector3.new(0, 10, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.4)
Force.Parent = Torso
end
]]
wait(0.2)
Tool.Grip = Grips.Out
wait(0.6)
Tool.Grip = Grips.Up
Damage = DamageValues.SlashDamage
end
Tool.Enabled = true
LastAttack = 0
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
local Tick = RunService.Stepped:wait()
if (Tick - LastAttack < 0.2) then
Lunge()
else
Attack()
end
LastAttack = Tick
--wait(0.5)
Damage = DamageValues.BaseDamage
local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
Name = "R15Slash",
AnimationId = BaseUrl .. Animations.R15Slash,
Parent = Tool
})
local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){
Name = "R15Lunge",
AnimationId = BaseUrl .. Animations.R15Lunge,
Parent = Tool
})
Tool.Enabled = true
end
function CheckIfAlive()
return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChildOfClass("Humanoid")
Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Sounds.Unsheath:Play()
end
function Unequipped()
Tool.Grip = Grips.Up
ToolEquipped = false
end
Tool.Activated:Connect(Activated)
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)
Connection = Handle.Touched:Connect(Blow)
|
-----------------
--| Variables |--
-----------------
|
local PlayersService = Game:GetService('Players')
local Tool = script.Parent
local ToolHandle = Tool.Handle
local ReloadSound = WaitForChild(ToolHandle, 'ReloadSound')
local EquipSound = WaitForChild(ToolHandle, 'Equip')
local MyModel = nil
local MyPlayer = nil
|
-- A variant of the function above that returns the velocity at a given point in time.
|
local function GetVelocityAtTime(time: number, initialVelocity: Vector3, acceleration: Vector3): Vector3
return initialVelocity + acceleration * time
end
local function GetTrajectoryInfo(cast: ActiveCast, index: number): {[number]: Vector3}
assert(cast.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local trajectories = cast.StateInfo.Trajectories
local trajectory = trajectories[index]
local duration = trajectory.EndTime - trajectory.StartTime
local origin = trajectory.Origin
local vel = trajectory.InitialVelocity
local accel = trajectory.Acceleration
return {GetPositionAtTime(duration, origin, vel, accel), GetVelocityAtTime(duration, vel, accel)}
end
local function GetLatestTrajectoryEndInfo(cast: ActiveCast): {[number]: Vector3}
assert(cast.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
return GetTrajectoryInfo(cast, #cast.StateInfo.Trajectories)
end
local function CloneCastParams(params: RaycastParams): RaycastParams
local clone = RaycastParams.new()
clone.CollisionGroup = params.CollisionGroup
clone.FilterType = params.FilterType
clone.FilterDescendantsInstances = params.FilterDescendantsInstances
clone.IgnoreWater = params.IgnoreWater
return clone
end
local function SendRayHit(cast: ActiveCast, resultOfCast: RaycastResult, segmentVelocity: Vector3, cosmeticBulletObject: Instance?)
--cast.RayHit:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
cast.Caster.RayHit:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
end
local function SendRayPierced(cast: ActiveCast, resultOfCast: RaycastResult, segmentVelocity: Vector3, cosmeticBulletObject: Instance?)
--cast.RayPierced:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
cast.Caster.RayPierced:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
end
local function SendLengthChanged(cast: ActiveCast, lastPoint: Vector3, rayDir: Vector3, rayDisplacement: number, segmentVelocity: Vector3, cosmeticBulletObject: Instance?)
--cast.LengthChanged:Fire(cast, lastPoint, rayDir, rayDisplacement, segmentVelocity, cosmeticBulletObject)
cast.Caster.LengthChanged:Fire(cast, lastPoint, rayDir, rayDisplacement, segmentVelocity, cosmeticBulletObject)
end
|
--[[**
ensures value is a number and non-NaN
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
function t.number(value)
local valueType = typeof(value)
if valueType == "number" then
if value == value then
return true
else
return false, "unexpected NaN value"
end
else
return false, string.format("number expected, got %s", valueType)
end
end
|
--phace 1
|
core.Stage4Overload.Enabled=true
wait(4)
CG.CoreStatus.Value="overload"
|
--or script.Parent.RPMManagement.Disabled == false
|
while wait() do
speed = carSeat.Velocity.Magnitude
if carSeat.Throttle ~= 1 and juice == false then
juice = true
for i = 0.3, 0, -0.02 do
wait()
script.Parent.Value.Value = i
end --script.Parent.Value.Value = 0
elseif carSeat.Throttle == 1 and juice == true then
juice = false
for i = 0, 0.3, 0.02 do
wait()
script.Parent.Value.Value = i
end
end
end
|
--==================================================
--Setting
--==================================================
|
local Ammo = math.huge --Amount of Ammo to give. Set it to "math.huge" to refill the gun's ammo.
local GunToRefillAmmo = {
"Pistol",
--Add more gun here if you want
}
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local l__HDAdminMain__1 = _G.HDAdminMain;
function v1.SetupMainVariables(p1, p2)
l__HDAdminMain__1.hdAdminGroup = {
Id = 4676369,
Info = {}
};
l__HDAdminMain__1.hdAdminGroupInfo = {};
l__HDAdminMain__1.settingsBanRecords = {};
l__HDAdminMain__1.alphabet = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
l__HDAdminMain__1.UserIdsFromName = {};
l__HDAdminMain__1.UsernamesFromUserId = {};
l__HDAdminMain__1.validSettings = { "Theme", "NoticeSoundId", "NoticeVolume", "NoticePitch", "ErrorSoundId", "ErrorVolume", "ErrorPitch", "AlertSoundId", "AlertVolume", "AlertPitch", "Prefix" };
l__HDAdminMain__1.commandInfoToShowOnClient = { "Name", "Contributors", "Prefixes", "Rank", "Aliases", "Tags", "Description", "Args", "Loopable" };
l__HDAdminMain__1.products = {
Donor = 5745895,
OldDonor = 2649766
};
l__HDAdminMain__1.materials = { "Plastic", "Wood", "Concrete", "CorrodedMetal", "DiamondPlate", "Foil", "Grass", "Ice", "Marble", "Granite", "Brick", "Pebble", "Sand", "Fabric", "SmoothPlastic", "Metal", "WoodPlanks", "Cobblestone", "Neon", "Glass" };
l__HDAdminMain__1.rankTypes = {
Auto = 4,
Perm = 3,
Server = 2,
Temp = 1
};
if p2 == "Server" then
l__HDAdminMain__1.pd = {};
l__HDAdminMain__1.sd = {};
l__HDAdminMain__1.permissions = {
specificUsers = {},
gamepasses = {},
assets = {},
groups = {},
friends = 0,
freeAdmin = 0,
vipServerOwner = 0,
vipServerPlayer = 0,
owner = true
};
l__HDAdminMain__1.commandInfo = {};
l__HDAdminMain__1.commandRanks = {};
l__HDAdminMain__1.infoOnAllCommands = {
Contributors = {},
Tags = {},
Prefixes = {},
Aliases = {}
};
l__HDAdminMain__1.morphNames = {};
l__HDAdminMain__1.toolNames = {};
l__HDAdminMain__1.commands = {};
l__HDAdminMain__1.playersRanked = {};
l__HDAdminMain__1.playersUnranked = {};
l__HDAdminMain__1.settings.UniversalPrefix = "!";
l__HDAdminMain__1.serverAdmins = {};
l__HDAdminMain__1.owner = {};
l__HDAdminMain__1.ownerId = game.CreatorId;
if game.CreatorType == Enum.CreatorType.Group then
local l__Owner__2 = l__HDAdminMain__1.groupService:GetGroupInfoAsync(game.CreatorId).Owner;
l__HDAdminMain__1.ownerId = l__Owner__2.Id;
l__HDAdminMain__1.ownerName = l__Owner__2.Name;
end;
if game.PlaceId > 0 then
local v3 = l__HDAdminMain__1.marketplaceService:GetProductInfo(game.PlaceId, Enum.InfoType.Asset).Name or "GameNameFailedToLoad";
else
v3 = "GameNameFailedToLoad";
end;
l__HDAdminMain__1.gameName = v3;
l__HDAdminMain__1.listOfTools = {};
l__HDAdminMain__1.ranksAllowedToJoin = 0;
l__HDAdminMain__1.permissionToReplyToPrivateMessage = {};
l__HDAdminMain__1.logs = {
command = {},
chat = {}
};
l__HDAdminMain__1.isStudio = l__HDAdminMain__1.runService:IsStudio();
l__HDAdminMain__1.serverBans = {};
l__HDAdminMain__1.blacklistedVipServerCommands = {};
l__HDAdminMain__1.banned = {};
l__HDAdminMain__1.commandBlocks = {};
for v4 = 1, 3 do
l__HDAdminMain__1.physicsService:CreateCollisionGroup("Group" .. v4);
end;
l__HDAdminMain__1.physicsService:CollisionGroupSetCollidable("Group1", "Group2", false);
elseif p2 == "Client" then
l__HDAdminMain__1.qualifiers = { "me", "all", "others", "random", "admins", "nonAdmins", "friends", "nonFriends", "NBC", "BC", "TBC", "OBC", "R6", "R15", "rthro", "nonRthro" };
l__HDAdminMain__1.colors = {};
l__HDAdminMain__1.topbarEnabled = true;
l__HDAdminMain__1.blur = Instance.new("BlurEffect", l__HDAdminMain__1.camera);
l__HDAdminMain__1.blur.Size = 0;
l__HDAdminMain__1.commandMenus = {};
l__HDAdminMain__1.commandsToDisableCompletely = {
laserEyes = true
};
l__HDAdminMain__1.commandsActive = {};
l__HDAdminMain__1.commandsAllowedToUse = {};
l__HDAdminMain__1.commandsWithMenus = {
Type1 = {
laserEyes = { "Info", "Press and hold to activate." },
fly = { "Input", "Speed" },
fly2 = { "Input", "Speed" },
noclip = { "Input", "Speed" },
noclip2 = { "Input", "Speed" }
},
Type2 = {
cmdbar2 = {}
},
Type3 = {
bubbleChat = {}
}
};
l__HDAdminMain__1.commandSpeeds = {
fly = 50,
fly2 = 50,
noclip = 100,
noclip2 = 25
};
for v5, v6 in pairs(l__HDAdminMain__1.commandSpeeds) do
local v7 = l__HDAdminMain__1.settings.CommandLimits[v5];
if v7 then
local l__Limit__8 = v7.Limit;
if l__Limit__8 < v6 then
l__HDAdminMain__1.commandSpeeds[v5] = l__Limit__8;
end;
end;
end;
l__HDAdminMain__1.infoFramesViewed = {
Speed = true
};
end;
table.sort(l__HDAdminMain__1.settings.Ranks, function(p3, p4)
return p3[1] < p4[1];
end);
end;
return v1;
|
--[[**some things may not work correctly because I coded this from memory while in school,
so if you have any problems, let me know in discord**]]
| |
--Simple function to make the door appear and disappear
|
local clickDetector = script.Parent.ClickDetector
function onMouseClick()
if script.Parent.CanCollide == false then
print "Close door"
local C = script.Parent.Parent:GetChildren()
for i=1, #C do
if (C[i].className == "Part") or (C[i].className == "Seat") or (C[i].className == "WedgePart") or (C[i].className == "CornerWedgePart") or (C[i].className == "VehicleSeat") or (C[i].className == "UnionOperation") then
if C[i].Name == "Window" then
C[i].Transparency = 0.6
else
C[i].Transparency = 0
end
C[i].CanCollide = true
end
end
else
print "Open door"
local C = script.Parent.Parent:GetChildren()
for i=1, #C do
if (C[i].className == "Part") or (C[i].className == "Seat") or (C[i].className == "WedgePart") or (C[i].className == "CornerWedgePart") or (C[i].className == "VehicleSeat") or (C[i].className == "UnionOperation") then
C[i].Transparency = 1
C[i].CanCollide = false
end
end
end
end
clickDetector.MouseClick:connect(onMouseClick)
|
--SETTINGS:
--[
|
defaultWalkSpeed = 16 --The speed the player walks when not running
runSpeed = 24 --The speed the player walks when running
stamina = 100 --The current stamina of the player (this variable can be used to check the stamina level of the player)
maxStamina = 100 --The maximum ammount of stamina the character will regen to
minStaminaToRun = 30 --The minimum amount of stamina required to run
staminaPerSecond = 10 --The ammount of stamina that is used per second when running
staminaRegenPerSecond = 5 --The amount of stamina that is regenerated every second when not running
staminaGui = script.StaminaGui --Change "StaminaGui" to the name of your Gui parented to this script
|
-- update leaderboard
|
spawn(function ()
while wait(LEADERBOARD_UPDATE*60) do
UpdateBoard()
end
end)
|
--// Holstering
|
HolsteringEnabled = false;
HolsterPos = CFrame.new(0.140751064, 0, -0.616261482, -4.10752676e-08, -0.342020065, 0.939692616, -1.49501727e-08, 0.939692557, 0.342020094, -0.99999994, 0, -4.37113847e-08);
|
-- Encuentra el sonido llamado "hyperx" en el servicio de sonido
|
local sound = soundService:FindFirstChild("black")
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
UserInputService = game:GetService("UserInputService")
AmmoDisplay = script:WaitForChild("AmmoDisplay"):Clone()
CastLaser = Tool:WaitForChild("CastLaser"):Clone()
Camera = game:GetService("Workspace").CurrentCamera
BaseUrl = "http://www.roblox.com/asset/?id="
AnimationTracks = {}
LocalObjects = {}
Animations = {
Hold = {Animation = Tool:WaitForChild("Hold"), FadeTime = nil, Weight = nil, Speed = 1, Duration = 2},
Fire = {Animation = Tool:WaitForChild("Fire"), FadeTime = 0.25, Weight = nil, Speed = 0.5, Duration = 0.5},
Reload = {Animation = Tool:WaitForChild("Reload"), FadeTime = nil, Weight = nil, Speed = 1, Duration = 2},
}
Sounds = {
Reload = Handle:WaitForChild("Reload"),
NoAmmo = Handle:WaitForChild("NoAmmo"),
}
Modules = Tool:WaitForChild("Modules")
Functions = require(Modules:WaitForChild("Functions"))
Remotes = Tool:WaitForChild("Remotes")
ServerControl = Remotes:WaitForChild("ServerControl")
ClientControl = Remotes:WaitForChild("ClientControl")
ConfigurationBin = Tool:WaitForChild("Configuration")
Configuration = {}
Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration)
InputCheck = Instance.new("ScreenGui")
InputCheck.Name = "InputCheck"
InputButton = Instance.new("ImageButton")
InputButton.Name = "InputButton"
InputButton.Image = ""
InputButton.BackgroundTransparency = 1
InputButton.ImageTransparency = 1
InputButton.Size = UDim2.new(1, 0, 1, 0)
InputButton.Parent = InputCheck
Cursors = {
Normal = (BaseUrl .. "170908665"),
EnemyHit = (BaseUrl .. "172618259"),
}
Rate = (5 / 5)
FiringOffset = Vector3.new(0, ((Handle.Size.Y / 4) - 0.2), -(Handle.Size.Z / 2))
Reloading = false
MouseDown = false
ToolEquipped = false
Tool.Enabled = true
function SetAnimation(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(AnimationTracks) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(AnimationTracks, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(AnimationTracks, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(AnimationTracks) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop(value.FadeTime)
table.remove(AnimationTracks, i)
end
end
end
end
function ToggleGui()
if not AmmoDisplayClone or not AmmoDisplayClone.Parent then
return
end
local Frame = AmmoDisplayClone.Frame
local Ammo = Frame.Ammo
if Configuration.Ammo.ClipSize.MaxValue > 0 then
Ammo.AmmoCounter.CounterPart.Text = Configuration.Ammo.ClipSize.Value
end
Ammo.MagCounter.CounterPart.Text = Configuration.Ammo.Magazines.Value
end
function Reload()
if Reloading or not Tool.Enabled or Configuration.Ammo.Magazines.Value >= Configuration.Ammo.Magazines.MaxValue then
return
end
Tool.Enabled = false
Reloading = true
ToggleGui()
local CanReload = true
if Configuration.Ammo.ClipSize.MaxValue > 0 and Configuration.Ammo.ClipSize.Value <= 0 then
CanReload = false
else
CanReload = true
end
if CanReload then
Spawn(function()
local Animation = Animations.Reload
OnClientInvoke("PlayAnimation", Animation)
wait(Animation.Duration)
OnClientInvoke("StopAnimation", Animation)
end)
Sounds.Reload:Play()
local AddedClips = ((Configuration.Ammo.Magazines.MaxValue > 0 and (Configuration.Ammo.Magazines.MaxValue - Configuration.Ammo.Magazines.Value)) or Configuration.Ammo.ClipSize.MaxValue)
if Configuration.Ammo.ClipSize.MaxValue > 0 then
AddedClips = ((AddedClips > Configuration.Ammo.ClipSize.Value and Configuration.Ammo.ClipSize.Value) or AddedClips)
end
--[[local ReloadRate = (Configuration.ReloadTime.Value / Configuration.Ammo.Magazines.MaxValue)
for i = 1, AddedClips do
wait(ReloadTime)
Configuration.Ammo.Magazines.Value = (Configuration.Ammo.Magazines.Value + 1)
end]]
wait(Configuration.ReloadTime.Value)
Configuration.Ammo.Magazines.Value = (Configuration.Ammo.Magazines.Value + AddedClips)
Configuration.Ammo.ClipSize.Value = (Configuration.Ammo.ClipSize.Value - AddedClips)
Sounds.Reload:Stop()
ToggleGui()
end
Reloading = false
Tool.Enabled = true
end
function RayTouched(Hit, Position)
if not Hit or not Hit.Parent then
return
end
local character = Hit.Parent
if character:IsA("Hat") then
character = character.Parent
end
if character == Character then
return
end
local humanoid = character:FindFirstChild("Humanoid")
local SoundChosen = Sounds.RayHit
if not humanoid or humanoid.Health == 0 then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and Functions.IsTeamMate(Player, player) then
return
end
Spawn(function()
IconChangeTick = tick()
PlayerMouse.Icon = Cursors.EnemyHit
wait(1)
if (tick() - IconChangeTick) >= 0.95 and ToolEquipped and PlayerMouse then
PlayerMouse.Icon = Cursors.Normal
end
end)
end
function FireRay(StartPosition, TargetPosition)
local Direction = CFrame.new(StartPosition, TargetPosition).lookVector
local RayHit, RayPos, RayNormal = Functions.CastRay(StartPosition, Direction, Configuration.Range.Value, {Character}, false)
local Backpack = Player:FindFirstChild("Backpack")
if Backpack then
local LaserScript = CastLaser:Clone()
local StartPos = Instance.new("Vector3Value")
StartPos.Name = "StartPosition"
StartPos.Value = StartPosition
StartPos.Parent = LaserScript
local TargetPos = Instance.new("Vector3Value")
TargetPos.Name = "TargetPosition"
TargetPos.Value = RayPos
TargetPos.Parent = LaserScript
local RayHit = Instance.new("BoolValue")
RayHit.Name = "RayHit"
RayHit.Value = RayHit
RayHit.Parent = LaserScript
LaserScript.Disabled = false
LaserScript.Parent = Backpack
end
Spawn(function()
InvokeServer("CastLaser", {StartPosition = StartPosition, TargetPosition = RayPos, RayHit = ((RayHit and true) or false)})
end)
Spawn(function()
InvokeServer("RayHit", {Hit = RayHit, Position = RayPos})
end)
RayTouched(RayHit, RayPos)
end
function Button1Pressed(Down)
if not Down and MouseDown then
MouseDown = false
end
end
function KeyPress(Key, Down)
if Key == "r" and Down then
Reload()
end
end
function Activated()
if not Tool.Enabled or not ToolEquipped or Reloading then
return
end
Tool.Enabled = false
if Configuration.Ammo.Magazines.Value > 0 then
local FirstShot = false
if Configuration.Automatic.Value then
MouseDown = true
end
OnClientInvoke("StopAnimation", {Animation = Animations.Fire.Animation, FadeTime = nil})
OnClientInvoke("PlayAnimation", Animations.Fire)
while MouseDown or not FirstShot and ToolEquipped and CheckIfAlive() do
if Configuration.Ammo.Magazines.Value <= 0 or not ToolEquipped or not CheckIfAlive() then
break
end
if not FirstShot then
FirstShot = true
end
local BurstAmount = math.random(Configuration.Burst.Bullets.MinValue, Configuration.Burst.Bullets.MaxValue)
local WithinFiringRange = false
Spawn(function()
InvokeServer("Fire", true)
end)
for i = 1, ((BurstAmount > 0 and BurstAmount) or 1) do
local TargetPosition = OnClientInvoke("MousePosition")
if not TargetPosition then
break
end
TargetPosition = TargetPosition.Position
local StartPosition = (Handle.CFrame * CFrame.new(FiringOffset.X, FiringOffset.Y, FiringOffset.Z)).p
if BurstAmount > 0 then
local Offset = (Configuration.Burst.Offset.Value * 100)
TargetPosition = TargetPosition + Vector3.new((math.random(-Offset.X, Offset.X) * 0.01), (math.random(-Offset.Y, Offset.Y) * 0.01), (math.random(-Offset.Z, Offset.Z) * 0.01))
end
local Accuracy = (Configuration.Accuracy.Value * 100)
TargetPosition = TargetPosition + Vector3.new((math.random(-Accuracy.X, Accuracy.X) * 0.01), (math.random(-Accuracy.Y, Accuracy.Y) * 0.01), (math.random(-Accuracy.Z, Accuracy.Z) * 0.01))
Configuration.Ammo.Magazines.Value = (Configuration.Ammo.Magazines.Value - 1)
FireRay(StartPosition, TargetPosition)
end
ToggleGui()
wait(Configuration.FireRate.Value)
end
OnClientInvoke("StopAnimation", {Animation = Animations.Fire.Animation, FadeTime = 0.25})
else
Tool.Enabled = true
Sounds.NoAmmo:Play()
Reload()
end
MouseDown = false
Tool.Enabled = true
if Configuration.Ammo.Magazines.Value <= 0 then
Sounds.NoAmmo:Play()
Reload()
end
end
function CheckIfAlive()
return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Spawn(function()
PlayerMouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
Button1Pressed(true)
end)
Mouse.Button1Up:connect(function()
Button1Pressed(false)
end)
Mouse.KeyDown:connect(function(Key)
KeyPress(Key, true)
end)
Mouse.KeyUp:connect(function(Key)
KeyPress(Key, false)
end)
Humanoid.CameraOffset = Vector3.new(0, 0.35, 0)
OnClientInvoke("PlayAnimation", Animations.Hold)
local PlayerGui = Player:FindFirstChild("PlayerGui")
if PlayerGui then
if UserInputService.TouchEnabled then
InputCheckClone = InputCheck:Clone()
InputCheckClone.InputButton.InputBegan:connect(function()
InvokeServer("Button1Click", {Down = true})
end)
InputCheckClone.InputButton.InputEnded:connect(function()
InvokeServer("Button1Click", {Down = false})
end)
InputCheckClone.Parent = PlayerGui
end
local function AdjustAmmoDisplay()
local Frame = AmmoDisplayClone.Frame
Frame.CurrentWeapon.Text = Configuration.ToolName.Value
local Ammo = Frame.Ammo
Ammo.AmmoCounter.CounterPart.Text = ((Configuration.Ammo.ClipSize.MaxValue > 0 and Configuration.Ammo.ClipSize.Value) or "--")
Ammo.MagCounter.CounterPart.Text = Configuration.Ammo.Magazines.Value
end
AmmoDisplayClone = AmmoDisplay:Clone()
AdjustAmmoDisplay()
AmmoDisplayClone.Parent = PlayerGui
ToggleGui()
for i, v in pairs({ClipSizeChanged, MagazinesChanged}) do
if v then
v:disconnect()
end
end
ClipSizeChanged = Configuration.Ammo.ClipSize.Changed:connect(function()
AdjustAmmoDisplay()
end)
MagazinesChanged = Configuration.Ammo.Magazines.Changed:connect(function()
AdjustAmmoDisplay()
end)
end
for i, v in pairs({"Left Arm", "Right Arm"}) do
local Arm = Character:FindFirstChild(v)
if Arm then
Spawn(function()
OnClientInvoke("SetLocalTransparencyModifier", {Object = Arm, Transparency = 0, AutoUpdate = false})
end)
end
end
Mouse.Icon = Cursors.Normal
end)
end
function Unequipped()
LocalObjects = {}
if CheckIfAlive() then
Humanoid.CameraOffset = Vector3.new(0, 0, 0)
end
for i, v in pairs(Sounds) do
v:Stop()
end
if PlayerMouse then
PlayerMouse.Icon = ""
end
for i, v in pairs({InputCheckClone, ObjectLocalTransparencyModifier, AmmoDisplayClone, ClipSizeChanged, MagazinesChanged}) do
if tostring(v) == "Connection" then
v:disconnect()
elseif v and v.Parent then
v:Destroy()
end
end
MouseDown = false
for i, v in pairs(AnimationTracks) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
AnimationTracks = {}
ToolEquipped = false
end
function InvokeServer(mode, value)
pcall(function()
local ServerReturn = ServerControl:InvokeServer(mode, value)
return ServerReturn
end)
end
function OnClientInvoke(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" and value then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then
pcall(function()
local ObjectFound = false
for i, v in pairs(LocalObjects) do
if v == value then
ObjectFound = true
end
end
if not ObjectFound then
table.insert(LocalObjects, value)
if ObjectLocalTransparencyModifier then
ObjectLocalTransparencyModifier:disconnect()
end
ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function()
for i, v in pairs(LocalObjects) do
if v.Object and v.Object.Parent then
local CurrentTransparency = v.Object.LocalTransparencyModifier
if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
v.Object.LocalTransparencyModifier = v.Transparency
end
else
table.remove(LocalObjects, i)
end
end
end)
end
end)
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
---------------------------------------------
|
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 1
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 1
PedValues.PedSignal2a.Value = 1
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(26)--Green Time (BEGIN SIGNAL1 GREEN)
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 1
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 2
PedValues.PedSignal2a.Value = 2
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(6) -- Green Time + Time for flashing pedestrian signals
SignalValues.Signal1.Value = 2
SignalValues.Signal1a.Value = 2
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4) -- Yellow Time
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 1
PedValues.PedSignal1a.Value = 1
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(26)--Green Time (BEGIN SIGNAL2 GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 2
PedValues.PedSignal1a.Value = 2
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(6) -- Green Time + Time for flashing pedestrian signals
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 2
SignalValues.Signal2a.Value = 2
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4) -- Yellow Time
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 1
TurnValues.TurnSignal1a.Value = 1
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(12)-- Simultaneous Turn Green
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 2
TurnValues.TurnSignal1a.Value = 2
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4)-- Simultaneous Turn Yellow
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
end
|
--------------| SYSTEM SETTINGS |--------------
|
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "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 = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 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 = 0;
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;
};
|
--// # key, Cruise
|
mouse.KeyDown:connect(function(key)
if key=="n" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.Remotes.CruiseEvent:FireServer(true)
end
end)
|
-- SpeederScripts
|
local SpeederScripts = ReplicatedStorage:FindFirstChild("SpeederScripts")
local Controller = SpeederScripts:FindFirstChild("Controller")
|
--spawn(function()
|
while true do
game:GetService("RunService").Stepped:wait()
for i, part in pairs(car:GetChildren()) do
if part.Name == "Thruster" then
UpdateThruster(part)
end
end
if car.DriveSeat.Occupant then
local ratio = car.DriveSeat.Velocity.magnitude / stats.Speed.Value
car.EngineBlock.Running.Pitch = 1 + ratio / 4
bodyPosition.MaxForce = Vector3.new()
bodyGyro.MaxTorque = Vector3.new()
else
local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
if hit and hit.CanCollide then
bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
else
bodyPosition.MaxForce = Vector3.new()
bodyGyro.MaxTorque = Vector3.new()
end
end
end
|
--the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it
--will be created in several steps rather than as a single function declaration.
|
local function Create_PrivImpl(objectType)
if type(objectType) ~= 'string' then
error("Argument of Create must be a string", 2)
end
--return the proxy function that gives us the nice Create'string'{data} syntax
--The first function call is a function call using Lua's single-string-argument syntax
--The second function call is using Lua's single-table-argument syntax
--Both can be chained together for the nice effect.
return function(dat)
--default to nothing, to handle the no argument given case
dat = dat or {}
--make the object to mutate
local obj = Instance.new(objectType)
local parent = nil
--stored constructor function to be called after other initialization
local ctor = nil
for k, v in pairs(dat) do
--add property
if type(k) == 'string' then
if k == 'Parent' then
-- Parent should always be set last, setting the Parent of a new object
-- immediately makes performance worse for all subsequent property updates.
parent = v
else
obj[k] = v
end
--add child
elseif type(k) == 'number' then
if type(v) ~= 'userdata' then
error("Bad entry in Create body: Numeric keys must be paired with children, got a: "..type(v), 2)
end
v.Parent = obj
--event connect
elseif type(k) == 'table' and k.__eventname then
if type(v) ~= 'function' then
error("Bad entry in Create body: Key `[Create.E\'"..k.__eventname.."\']` must have a function value\
got: "..tostring(v), 2)
end
obj[k.__eventname]:Connect(v)
--define constructor function
elseif k == t.Create then
if type(v) ~= 'function' then
error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, \
got: "..tostring(v), 2)
elseif ctor then
--ctor already exists, only one allowed
error("Bad entry in Create body: Only one constructor function is allowed", 2)
end
ctor = v
else
error("Bad entry ("..tostring(k).." => "..tostring(v)..") in Create body", 2)
end
end
--apply constructor function if it exists
if ctor then
ctor(obj)
end
if parent then
obj.Parent = parent
end
--return the completed object
return obj
end
end
|
--[[
Returns the cached character appearance of specified userId, or nil if it does not exist
]]
|
function CharacterAppearanceCache.getCharacterAppearance(userId)
if appearanceCache[tostring(userId)] then
return appearanceCache[tostring(userId)]
else
Logger.warn("Tried to get character model for ", userId, ", but it doesn't exist!")
return nil
end
end
|
--// Event Connections
|
L_112_.OnClientEvent:connect(function(L_325_arg1, L_326_arg2)
if L_325_arg1 ~= L_2_ then
local L_327_ = L_325_arg1.Character
local L_328_ = L_327_.AnimBase.AnimBaseW
local L_329_ = L_328_.C1
if L_326_arg2 then
L_127_(L_328_, nil , L_327_.Head.CFrame, function(L_330_arg1)
return math.sin(math.rad(L_330_arg1))
end, 0.25)
elseif not L_326_arg2 then
L_127_(L_328_, nil , L_329_, function(L_331_arg1)
return math.sin(math.rad(L_331_arg1))
end, 0.25)
end
end
end)
L_115_.OnClientEvent:connect(function(L_332_arg1, L_333_arg2)
if L_42_ and L_333_arg2 ~= L_2_ and L_24_.CanCallout then
if (L_3_.HumanoidRootPart.Position - L_332_arg1).magnitude <= 10 then
L_41_.Visible = true
local L_334_ = ScreamCalculation()
if L_334_ then
if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then
L_116_:FireServer(L_7_.AHH, L_96_[math.random(0, 21)])
end
end
L_14_:Create(L_41_, TweenInfo.new(0.1), {
BackgroundTransparency = 0.4
}):Play()
delay(0.1, function()
L_14_:Create(L_41_, TweenInfo.new(3), {
BackgroundTransparency = 1
}):Play()
end)
end
end
end)
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name
|
return function(data)
local color = data.Color
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local mouse = localplayer:GetMouse()
local gui = script.Parent.Parent
if color=='off' then
local guis = client.UI.Get("BChat")
if guis then
for i,v in pairs(guis) do
if v ~= gui then
v:Destroy()
end
end
gui:Destroy()
end
else
if playergui:FindFirstChild(gui.Name) then
playergui[gui.Name]:Destroy()
end
local box = gui.Frame.Box
local close = gui.Frame.Close
box.Text='Click here or press ";" to chat'
box.FocusLost:connect(function(enterPressed)
if enterPressed and localplayer.Character:FindFirstChild('Head') and color and box.Text~='Click here or press ";" to chat' then
service.ChatService:Chat(localplayer.Character.Head,service.LaxFilter(box.Text),color)
box.Text='Click here or press ";" to chat'
end
end)
mouse.KeyDown:connect(function(key)
if key==';' then
box:CaptureFocus()
end
end)
close.MouseButton1Click:connect(function()
gui:Destroy()
end)
gTable:Ready()
end
end
|
-- Called when character is about to be removed
|
function Poppercam:CharacterRemoving(char, player)
self.playerCharacters[player] = nil
end
function Poppercam:Update(dt, desiredCameraCFrame, desiredCameraFocus)
if self.popperEnabled then
self.camera = game.Workspace.CurrentCamera
local newCameraCFrame = desiredCameraCFrame
local focusPoint = desiredCameraFocus.p
if FFlagUserPortraitPopperFix and self.subjectPart then
focusPoint = self.subjectPart.CFrame.p
end
local ignoreList = {}
for _, character in pairs(self.playerCharacters) do
ignoreList[#ignoreList + 1] = character
end
for i = 1, #self.vehicleParts do
ignoreList[#ignoreList + 1] = self.vehicleParts[i]
end
-- Get largest cutoff distance
-- Note that the camera CFrame must be set here, because the current implementation of GetLargestCutoffDistance
-- uses the current camera CFrame directly (it cannot yet be passed the desiredCameraCFrame).
local prevCameraCFrame = self.camera.CFrame
self.camera.CFrame = desiredCameraCFrame
self.camera.Focus = desiredCameraFocus
local largest = self.camera:GetLargestCutoffDistance(ignoreList)
-- Then check if the player zoomed since the last frame,
-- and if so, reset our pop history so we stop tweening
local zoomLevel = (desiredCameraCFrame.p - focusPoint).Magnitude
if math.abs(zoomLevel - self.lastZoomLevel) > 0.001 then
self.lastPopAmount = 0
end
-- Finally, zoom the camera in (pop) by that most-cut-off amount, or the last pop amount if that's more
local popAmount = largest
if self.lastPopAmount > popAmount then
popAmount = self.lastPopAmount
end
if popAmount > 0 then
newCameraCFrame = desiredCameraCFrame + (desiredCameraCFrame.lookVector * popAmount)
self.lastPopAmount = popAmount - POP_RESTORE_RATE -- Shrink it for the next frame
if self.lastPopAmount < 0 then
self.lastPopAmount = 0
end
end
self.lastZoomLevel = zoomLevel
-- Stop shift lock being able to see through walls by manipulating Camera focus inside the wall
|
--print("player is closer than 10 studs, prioritize")
|
else
if closestPlayerDist < closestBuildingDist then
|
------------------------------|分割线|------------------------------
|
function BezierCurve.LinearBezierCurves(Frame , FPS , Target , Position1 , Position2)
if typeof(Position1) ~= "Vector3" then
Position1 = Position1.Position
end
if typeof(Position2) ~= "Vector3" then
Position2 = Position2.Position
end
for Index = 0 , Frame , 1 do
local Time = Index / Frame
Target.Position = BezierCurve.Lerp(Position1 , Position2 , Time)
task.wait(1 / FPS)
end
end
function BezierCurve.QuadraticBezierCurves(Frame , FPS , Target , Position1 , Position2 , Position3)
if typeof(Position1) ~= "Vector3" then
Position1 = Position1.Position
end
if typeof(Position2) ~= "Vector3" then
Position2 = Position2.Position
end
if typeof(Position3) ~= "Vector3" then
Position3 = Position3.Position
end
for Index = 0 , Frame , 1 do
local Time = Index / Frame
local Lerp1 = BezierCurve.Lerp(Position1 , Position2 , Time)
local Lerp2 = BezierCurve.Lerp(Position2 , Position3 , Time)
Target.Position = BezierCurve.Lerp(Lerp1 , Lerp2 , Time)
task.wait(1 / FPS)
end
end
function BezierCurve.CubicBezierCurves(Frame , FPS , Target , Position1:Vector3 , Position2 , Position3 , Position4)
if typeof(Position1) ~= "Vector3" then
Position1 = Position1.Position
end
if typeof(Position2) ~= "Vector3" then
Position2 = Position2.Position
end
if typeof(Position3) ~= "Vector3" then
Position3 = Position3.Position
end
if typeof(Position4) ~= "Vector3" then
Position4 = Position4.Position
end
for Index = 0 , Frame , 1 do
local Time = Index / Frame
local Lerp1 = BezierCurve.Lerp(Position1 , Position2 , Time)
local Lerp2 = BezierCurve.Lerp(Position2 , Position3 , Time)
local Lerp3 = BezierCurve.Lerp(Position3 , Position4 , Time)
local InLerp1 = BezierCurve.Lerp(Lerp1 , Lerp2 , Time)
local InLerp2 = BezierCurve.Lerp(Lerp2 , Lerp3 , Time)
Target.Position = BezierCurve.Lerp(InLerp1 , InLerp2 , Time)
task.wait(1 / FPS)
end
end
|
--[[
Singleton manager that controls the systems on the ship.
]]
|
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local TableUtils = require(ReplicatedStorage.Dependencies.LuaUtils.TableUtils)
local Constants = require(ReplicatedStorage.Source.Common.Constants)
local Engine = require(ServerStorage.Source.Systems.Engine)
local Gravity = require(ServerStorage.Source.Systems.Gravity)
local Generator = require(ServerStorage.Source.Systems.Generator)
local Lights = require(ServerStorage.Source.Systems.Lights)
local Camera = require(ServerStorage.Source.Systems.Camera)
local Shield = require(ServerStorage.Source.Systems.Shield)
local SystemManager = {}
local systems = {}
|
--Offset For Each New Ray For The Bullet's Trajectory
|
local offset = (parts.Parent.Gun.Muzzle.CFrame*CFrame.new(math.random(-2,2)/3,100,math.random(-2,2)/3).p
- parts.Parent.Gun.Muzzle.Position).unit
*script.Parent.Stats.GunVelocity.Value
local point1 = parts.Parent.Gun.Muzzle.Position
|
--[[ <<DO NOT DELETE THIS MODULE>>
___ _______ _ _______
/ _ |____/ ___/ / ___ ____ ___ (_)__ /__ __/
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< / /
/_/ |_| \___/_//_/\_,_/___/___/_/___/ /_/ Build 6.5T, Version 6.6
SecondLogic @ Inspare
Avxnturador @ Novena
RikOne2 @ Enjin
>>Manual
Basically, everything you can and would ever want to touch is in the tuning module. EVERYTHING
Torque Curve Tune Visualizer (Boost Included):
https://www.desmos.com/calculator/nap6stpjqf
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 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.
>You can remove/change the default plugins that come with the kit. The drive system will still work perfectly with or without them.
--Updates
>To update, simply just replace the entire "A-Chassis Tune" module of an existing car with a newer version of the module if the car already has AC6T installed. Otherwise it's preferred you copy the new values over.
>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.
>>AC6 T Changelog
[02/15/18 : A-Chassis T Build 6.6] - The Realism Update
[Curves]
-Curves are now perfected due to a re-write of the Horsepower and Torque curves.
-Instead of the HP and Torque being insanely off, it's now perfected.
-Example: A naturally aspirated car with the horsepower at 180 will have its max HP be 180, not 360.
-Works both WITH and WITHOUT Engine and Boost Caching!!!
[New Car Values]
-TCSAmt (The amount of cutoff TCS has on the throttle)
[New Tune Values]
[EDITABLE]
-ShiftTime (The time delay in which you initiate a shift and the car changes gear)
[STANDARDIZED] (Highly recommended you don't touch these in the tune)
-CurveCache (The time delay in which you initiate a shift and the car changes gear)
-CacheInc (The time delay in which you initiate a shift and the car changes gear)
[12/2/17 : A-Chassis T Build 6.5] - The Turbocharged Update
[Turbocharger]
-Utilizing IMeanBiz's turbo scripts, the car now has turbo.
[New Car Values]
-HpNatural (Horsepower made by the engine naturally aspirated)
-TqNatural (Torque made by the engine naturally aspirated)
-HpBoosted (Horsepower made by the turbocharger[s], NOT including HpNatural HP)
-TqBoosted (Torque made by the turbocharger[s], NOT including TqNatural Torque)
-Boost (Total boost [in PSI])
[New Tune Values]
-Should all be self explanatory in the tune.
[New Plugins]
-AC6T Stock Gauges, includes a turbo thing in the middle (when car is turbocharged), can easily be swapped with AC6 default gauges if not wanted.
-Turbocharger sounds, which works regularly
[Rewritten Values]
-Horsepower (Horsepower combined from the engine and turbocharger[s])
-Torque (Torque combined from the engine and turbocharger[s])
>>AC6 Changelog
[6/10/17 : A-Chassis Build 6.52S2] - Fixed Initialization Orientation
[Fixed Initialization Rotation]
-Fixed initialization rotation glitch
[6/8/17 : A-Chassis Build 6.51S2] - More Suspension Tuning
[Re-Added Suspension Values]
-New suspension tuning is now the same as the previous suspension
-AntiRoll and PreCompress are now added to suspension tuning
[Fixes]
-Fixed Rev-Boucing: Car does not stall anymore when rev-bouncing
-Fixed Stock Gauges not showing the the right transmission mode / pbrake mode
[6/8/17 : A-Chassis Build 6.5S2] - Full Suspension Change and Optimization
[New Suspension System]
-Suspension Linkages are now made using axles instead of constraints
-Better overall stability and ease of tuning
-SpringConstraint Tuning has been changed in the tune to more meaningful values
-Added AntiRoll system using gyro dampening on the suspension linkages
-AxleSize affects the size of suspension linkage parts
[Major Performance Optimizations]
-Torque output calculations are now cached (pre-calculated and stored) to reduce runtime cpu load
-Constant multipliers for several lines have been simplified and cached
-Split Engine function into RPM calculation and Power Output
-Split runtime loops into different cycle rates
-RPM calculation, Steering, and External Value updating now run on 60 FPS max (from 30) for smoother steering and RPM tracking.
-Engine Output and Flip now run on 15 FPS max (from 30) to reduce runtime cpu load
-Overall percieved smoothness is now TWICE AS MUCH but runtime cpu load has actually been HALVED!!!
[5/23/17 : A-Chassis Build 6.43S] - STUFF
[Added Tune Values]
-Added WBVisible to set weight brick visibility
[Independent Camera Handling]
-Separated camera handling from Drive script
-Mouse camera is now handled by a plugin
-Custom camera plugin support is now easier
[Stock Plugins Update]
-Added Dynamic Friction as a stock plugin
-Dynamic friction can be tuned within the Simulated script
-Updated default sound plugin
-Added mouse-steer camera plugin
[Code Fixes]
-Fixed missing operation within torque curve
-Slight optimizations during runtime
[5/20/17 : A-Chassis 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 : A-Chassis 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 : A-Chassis 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 : A-Chassis 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 : A-Chassis 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 : A-Chassis 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 : A-Chassis 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 : A-Chassis 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.6"
|
--geração de zumbis
|
local part = game:GetService("ServerStorage").Zombie
while (true) do
wait(5)
local novaparte = part:Clone()
portal = math.random(1,4)
if portal == 1 then
novaparte.Humanoid.RootPart.Position = workspace.Portal1.Position
elseif portal == 2 then
novaparte.Humanoid.RootPart.Position = workspace.Portal2.Position
elseif portal == 3 then
novaparte.Humanoid.RootPart.Position = workspace.Portal4.Position
else
end
novaparte.Parent = workspace
end
|
------------------------------------------------------------------------
-- parse a local function statement
-- * used in statements()
------------------------------------------------------------------------
|
function luaY:localfunc(ls)
local v, b = {}, {} -- expdesc
local fs = ls.fs
self:new_localvar(ls, self:str_checkname(ls), 0)
self:init_exp(v, "VLOCAL", fs.freereg)
luaK:reserveregs(fs, 1)
self:adjustlocalvars(ls, 1)
self:body(ls, b, false, ls.linenumber)
luaK:storevar(fs, v, b)
-- debug information will only see the variable after this point!
self:getlocvar(fs, fs.nactvar - 1).startpc = fs.pc
end
|
-- note: JS version can return anything that's truthy, but that won't work for us since Lua deviates (0 is truthy)
|
type callbackFn<T> = (element: T, index: number, array: Array<T>) -> boolean
type callbackFnWithThisArg<T, U> = (thisArg: U, element: T, index: number, array: Array<T>) -> boolean
type Object = { [string]: any }
|
--You can change the values below to suit your needs
|
local max_mode = 13 --The maximum amount of modes forwards. Set to 0 to disable forwards motion.
local min_mode = -14 --The minimum amount of modes backwards. Set to 0 to disable backwards motion.
local increment_speed = 0.2 --The amount in which the speed value increments with every mode.
|
--[=[
Stops the shake effect. If using `OnSignal` or `BindToRenderStep`, those bound
functions will be disconnected/unbound.
`Stop` is automatically called when the shake effect is completed _or_ when the
`Destroy` method is called.
]=]
|
function Shake:Stop()
self._trove:Clean()
end
|
--Night12207
|
wait(1)
local character = script.Parent
character.HumanoidRootPart.Touched:Connect(function(hit)
if hit:IsA("BasePart") and hit.Locked == false then
hit.CanCollide = false
wait(5)
hit.CanCollide = true
else
print("Child is not a basePart or is Locked")
end
end)
|
---------------------------------------------------------------
|
function onChildAdded(child)
if child.Name == "SeatWeld" then
local human = child.part1.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
print("Human IN")
seat.SirenControl.Control.CarName.Value = human.Parent.Name.."s Car"
s.Parent.SirenControl:clone().Parent = game.Players:findFirstChild(human.Parent.Name).PlayerGui
seat.Start:Play()
wait(1)
seat.Start:Stop()
seat.Engine:Play()
end
end
end
function onChildRemoved(child)
if (child.Name == "SeatWeld") then
local human = child.part1.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
print("Human OUT")
seat.SirenControl.Control.CarName.Value = "Empty Car"
game.Players:findFirstChild(human.Parent.Name).PlayerGui.SirenControl:remove()
seat.Engine:Stop()
end
end
end
script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
|
-- emote bindable hook
|
script:WaitForChild("PlayEmote").OnInvoke = function(emote)
-- Only play emotes when idling
if pose ~= "Standing" then
return
end
if emoteNames[emote] ~= nil then
-- Default emotes
playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
if userPlayEmoteByIdAnimTrackReturn then
return true, currentAnimTrack
else
return true
end
elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
-- Non-default emotes
playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)
if userPlayEmoteByIdAnimTrackReturn then
return true, currentAnimTrack
else
return true
end
end
-- Return false to indicate that the emote could not be played
return false
end
if Character.Parent ~= nil then
-- initialize to idle
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
|
--Admin Command List
--Note: You don't say any " they are for separating only.
--shout/Message kill/PlayerName ban/PlayerName/Reason teleport/PlayerName/PlayerName
--anchor/PlayerName/on anchor/PlayerName/off up/PlayerName give/PlayerName/ToolNameInLighting
--explode/PlayerName merge/VictimName/ControllerName "gleeg snag zip"(Kills everyone.)
--"immortal me/PlayerName/all" "trip me/PlayerName/all" "jumpy me/PlayerName/all" "explode me/PlayerName/all"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.