prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Make variables for the player and camera |
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart", true)
local camera = game.Workspace.CurrentCamera
|
-- Overloads BaseCamera:GetSubjectPosition() with
-- the GetSubjectPosition function of the FpsCamera. |
function FpsCamera:MountBaseCamera(BaseCamera)
local base = BaseCamera.GetSubjectPosition
self.GetBaseSubjectPosition = base
if base then
BaseCamera.GetBaseSubjectPosition = base
BaseCamera.GetSubjectPosition = self.GetSubjectPosition
else
self:Warn("MountBaseCamera - Could not find BaseCamera:GetSubjectPosition()!")
end
end
|
-------- OMG HAX |
r = game:service("RunService")
local damage = 99999999999999999999999999999999999999
local slash_damage = 99999999999999999999999999999999
local lunge_damage = 99999999999999999999999999999999
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
if (hit.Parent == nil) then return end -- happens when bullet hits sword
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
local force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.HumanoidRootPart
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--// F key, HornOff |
mouse.KeyUp:connect(function(key)
if key=="h" then
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 8
veh.Lightbar.middle.Yelp.Volume = 8
veh.Lightbar.middle.Priority.Volume = 8
veh.Lightbar.HORN.Transparency = 1
end
end)
|
--use this to determine if you want this human to be harmed or not, returns boolean |
function checkTeams(otherHuman)
return not (sameTeam(otherHuman) and not FriendlyFire)
end
function getKnife()
local knife = Handle:clone()
knife.Transparency = 0
knife.Hit.Pitch = math.random(90, 110)/100
local lift = Instance.new("BodyForce")
lift.force = Vector3.new(0, 196.2, 0) * knife:GetMass() * 0.8
lift.Parent = knife
local proj = Tool.Projectile:Clone()
proj.Disabled = false
proj.Parent = knife
return knife
end
function equippedLoop()
while Equipped do
local dt = Heartbeat:wait()
if AttackPower < 1 then
AttackPower = AttackPower + dt * AttackRecharge
if AttackPower > 1 then
AttackPower = 1
end
end
Handle.Transparency = 1 - AttackPower
end
end
function onLeftDown(mousePos)
local knife = getKnife()
knife.CFrame = CFrame.new(Handle.Position, mousePos)
knife.Velocity = knife.CFrame.lookVector * AttackSpeed * AttackPower
local damage = AttackDamage * AttackPower
local touched
touched = knife.Touched:connect(function(part)
if part:IsDescendantOf(Tool.Parent) then return end
if contains(Knives, part) then return end
if part.Parent and part.Parent:FindFirstChild("Humanoid") then
local human = part.Parent.Humanoid
if checkTeams(human) then
tagHuman(human)
human:TakeDamage(damage)
knife.Hit:Play()
end
end
knife.Projectile:Destroy()
local w = Instance.new("Weld")
w.Part0 = part
w.Part1 = knife
w.C0 = part.CFrame:toObjectSpace(knife.CFrame)
w.Parent = w.Part0
touched:disconnect()
end)
table.insert(Knives, knife)
knife.Parent = workspace
game:GetService("Debris"):AddItem(knife, 3.5)
delay(2, function()
knife.Transparency = 1
end)
Remote:FireClient(getPlayer(), "PlayAnimation", "Throw")
Handle.Throw.Pitch = 0.8 + 0.4 * AttackPower
Handle.Throw:Play()
AttackPower = 0
end
function onRemote(player, func, ...)
if player ~= getPlayer() then return end
if func == "LeftDown" then
onLeftDown(...)
end
end
function onEquip()
Equipped = true
equippedLoop()
end
function onUnequip()
Equipped = false
end
Remote.OnServerEvent:connect(onRemote)
Tool.Equipped:connect(onEquip)
Tool.Unequipped:connect(onUnequip)
|
-- declarations |
local toolAnim = "None"
local toolAnimTime = 0
local jumpAnimTime = 0
local jumpAnimDuration = 0.31
local toolTransitionTime = 0.1
local fallTransitionTime = 0.2
|
------------------------------ |
targetparts = {}
function updatecam()
camupdater = runservice.RenderStepped:connect(function()
workspace.CurrentCamera.CFrame = CFrame.new(Cam.CFrame.p,TARGET.CFrame.p)
end)
end
function click()
if mouse.Hit ~= nil then
for i,v in pairs(workspace:GetChildren()) do
if v:IsAncestorOf(mouse.Target) then
if v.Name == TN[1] or TN[2] or TN[3] or TN[4] or TN[5] or TN[6] or TN[7] or TN[8] or TN[9] or TN[10] then -- Cant think of any other way rn sos
TARGET = mouse.Target
db = true
else
db = false
end
end
end
if db == false then
db = true
TARGET = mouse.Hit.p
local targetpart = Instance.new("Part",workspace)
targetpart.Transparency = 1
targetpart.CanCollide = false
targetpart.Anchored = true
targetpart.Name = "TARGET"
targetpart.CFrame = mouse.Hit
table.insert(targetparts,targetpart)
TARGET = targetpart
db = false
end
if TARGET ~= nil then
prnt.Main.Lock.LOCK.ZIndex = 2
prnt.Main.Lock.LOCK.TextColor3 = Color3.new(0,255,0)
else
prnt.Main.Lock.LOCK.ZIndex = 0
prnt.Main.Lock.LOCK.TextColor3 = Color3.new(0.65,0.65,0.65)
end
end
end
function keys(k,gpe)
if not gpe then
if k.KeyCode == Enum.KeyCode.E then -- zoom in
activekey = true
while activekey == true do
wait()
if workspace.CurrentCamera.FieldOfView > 20 then
workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView - 1
else
workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView - 0.5
end
end
elseif k.KeyCode == Enum.KeyCode.Q then -- zoom out
activekey = true
while activekey == true do
wait()
if workspace.CurrentCamera.FieldOfView > 20 then
workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView + 1
else
workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView + 0.5
end
end
elseif k.KeyCode == Enum.KeyCode.G then -- Un/Track target
if TARGET ~= nil then
if activekey == true then
activekey = false
workspace.CurrentCamera.CameraType = "Custom"
workspace.CurrentCamera.CameraSubject = Cam
game.Players.LocalPlayer.CameraMaxZoomDistance = 1
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
camupdater:disconnect()
else
activekey = true
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
workspace.CurrentCamera.CameraType = "Scriptable"
game.Players.LocalPlayer.CameraMaxZoomDistance = 1
if camupdater then
camupdater:disconnect()
end
updatecam()
end
end
elseif k.KeyCode == Enum.KeyCode.H then -- UnTarget
for _,v in ipairs(targetparts) do
v:destroy()
end
TARGET = nil
prnt.Main.Lock.LOCK.ZIndex = 0
prnt.Main.Lock.LOCK.TextColor3 = Color3.new(0.65,0.65,0.65)
camupdater:disconnect()
activekey = false
workspace.CurrentCamera.CameraType = "Custom"
workspace.CurrentCamera.CameraSubject = Cam
game.Players.LocalPlayer.CameraMaxZoomDistance = 1
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
elseif k.KeyCode == Enum.KeyCode.F then
if TARGET ~= nil then
pathtoremote.RemoteFunction:InvokeServer(TARGET)
end
elseif k.KeyCode == Enum.KeyCode.R then
pathtoremote.RemoteEvent2:FireServer()
elseif k.KeyCode == Enum.KeyCode.T then
pathtoremote.RemoteEvent:FireServer()
end
end
end
function keysoff(k,gpe)
if not gpe then
if k.KeyCode == Enum.KeyCode.E then
if activekey == true then
activekey = false
end
elseif k.KeyCode == Enum.KeyCode.Q then
if activekey == true then
activekey = false
end
end
end
end
pathtoremote.RemoteEvent2.OnClientEvent:connect(function()
TARGET = nil
prnt.Main.Lock.LOCK.ZIndex = 0
prnt.Main.Lock.LOCK.TextColor3 = Color3.new(0.65,0.65,0.65)
camupdater:disconnect()
activekey = false
workspace.CurrentCamera.CameraType = "Custom"
workspace.CurrentCamera.CameraSubject = Cam
game.Players.LocalPlayer.CameraMaxZoomDistance = 1
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
end)
UIS.InputBegan:connect(keys)
UIS.InputEnded:connect(keysoff)
mouse.Button1Up:connect(click)
|
-- Decompiled with the Synapse X Luau decompiler. |
while true do
wait(0.5);
ts = game:GetService("TweenService");
ti2 = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0);
local l__Parent__1 = script.Parent;
ts:Create(l__Parent__1, ti2, {
TextSize = 35
}):Play();
wait(0.5);
ts:Create(l__Parent__1, ti2, {
TextSize = 30
}):Play();
end;
|
--Steer Gyro Tuning |
Tune.SteerD = 100 -- Steering Dampening
Tune.SteerMaxTorque = 4500 -- Steering Force
Tune.SteerP = 1200 -- Steering Aggressiveness
|
-- setup emote chat hook
--[[game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
local emote = ""
if msg == "/e dance" then
emote = dances[math.random(1, #dances)]
elseif (string.sub(msg, 1, 3) == "/e ") then
emote = string.sub(msg, 4)
elseif (string.sub(msg, 1, 7) == "/emote ") then
emote = string.sub(msg, 8)
end
if (pose == "Standing" and emoteNames[emote] ~= nil) then
playAnimation(emote, 0.1, Humanoid)
end
end)--]] | |
--// This method is to be used with the new filter API. This method takes the
--// TextFilterResult objects and converts them into the appropriate string
--// messages for each player. |
function methods:InternalSendFilteredMessageWithFilterResult(inMessageObj, channelName)
local messageObj = ShallowCopy(inMessageObj)
local oldFilterResult = messageObj.FilterResult
local player = self:GetPlayer()
local msg = ""
pcall(function()
if (messageObj.IsFilterResult) then
if (player) then
msg = oldFilterResult:GetChatForUserAsync(player.UserId)
else
msg = oldFilterResult:GetNonChatStringForBroadcastAsync()
end
else
msg = oldFilterResult
end
end)
--// Messages of 0 length are the result of two users not being allowed
--// to chat, or GetChatForUserAsync() failing. In both of these situations,
--// messages with length of 0 should not be sent.
if (#msg > 0) then
messageObj.Message = msg
messageObj.FilterResult = nil
self:InternalSendFilteredMessage(messageObj, channelName)
end
end
function methods:InternalSendSystemMessage(messageObj, channelName)
local success, err = pcall(function()
self:LazyFire("eReceivedSystemMessage", messageObj, channelName)
if self.PlayerObj then
self.EventFolder.OnNewSystemMessage:FireClient(self.PlayerObj, messageObj, channelName)
end
end)
if not success and err then
print("Error sending internal system message: " ..err)
end
end
function methods:UpdateChannelNameColor(channelName, channelNameColor)
self:LazyFire("eChannelNameColorUpdated", channelName, channelNameColor)
if self.PlayerObj then
self.EventFolder.ChannelNameColorUpdated:FireClient(self.PlayerObj, channelName, channelNameColor)
end
end
|
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {
Notices = true
};
for v2, v3 in pairs(script.Parent.Parent:GetChildren()) do
if v3:IsA("Frame") then
if v1[v3.Name] then
v3.Visible = true;
else
v3.Visible = false;
end;
elseif v3:IsA("Folder") then
for v4, v5 in pairs(v3:GetChildren()) do
if v5:IsA("Frame") then
v5.Visible = false;
end;
end;
end;
end;
|
-- wandering |
spawn(function()
while vars.Wandering.Value == false and human.Health > 0 do
vars.Chasing.Value = false
vars.Wandering.Value = true
local desgx, desgz = hroot.Position.x+math.random(-WanderX,WanderX), hroot.Position.z+math.random(-WanderZ,WanderZ)
local function checkw(t)
local ci = 3
if ci > #t then
ci = 3
end
if t[ci] == nil and ci < #t then
repeat ci = ci + 1 wait() until t[ci] ~= nil
return Vector3.new(1,0,0) + t[ci]
else
ci = 3
return t[ci]
end
end
path = pfs:FindPathAsync(hroot.Position, Vector3.new(desgx, 0, desgz))
waypoint = path:GetWaypoints()
local connection;
local direct = Vector3.FromNormalId(Enum.NormalId.Front)
local ncf = hroot.CFrame * CFrame.new(direct)
direct = ncf.p.unit
local rootr = Ray.new(hroot.Position, direct)
local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)
if path and waypoint or checkw(waypoint) then
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
human:MoveTo( checkw(waypoint).Position )
human.Jump = false
end
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
connection = human.Changed:connect(function()
human.Jump = true
end)
human:MoveTo( waypoint[4].Position )
else
human.Jump = false
end
if connection then
connection:Disconnect()
end
else
for i = 3, #waypoint do
human:MoveTo( waypoint[i].Position )
end
end
wait(math.random(4,6))
vars.Wandering.Value = false
end
end)
|
--// All global vars will be wiped/replaced except script |
return function(data)
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local scr = client.UI.Prepare(script.Parent.Parent)
local window = scr.Window
local msg = data.Message
local color = data.Color
local found = client.UI.Get("Output")
if found then
for i,v in pairs(found) do
local p = v.Object
if p and p.Parent then
p.Window.Position = UDim2.new(0.5, 0, 0.5, p.Window.Position.Y.Offset+160)
end
end
end
window.Main.ScrollingFrame.ErrorText.Text = msg
window.Main.ScrollingFrame.ErrorText.TextColor3 = color
window.Close.MouseButton1Down:Connect(function()
gTable.Destroy()
end)
spawn(function()
local sound = Instance.new("Sound",service.LocalContainer())
sound.SoundId = "rbxassetid://160715357"
sound.Volume = 2
sound:Play()
wait(0.8)
sound:Destroy()
end)
gTable.Ready()
wait(5)
gTable.Destroy()
end
|
--[[
CameraShakePresets.Bump
CameraShakePresets.Explosion
CameraShakePresets.Earthquake
CameraShakePresets.BadTrip
CameraShakePresets.HandheldCamera
CameraShakePresets.Vibration
CameraShakePresets.RoughDriving
--]] |
local CameraShakeInstance = require(script.Parent.CameraShakeInstance)
local CameraShakePresets = {
-- A high-magnitude, short, yet smooth shake.
-- Should happen once.
Bump = function()
local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
c.RotationInfluence = Vector3.new(1, 1, 1)
return c
end;
-- An intense and rough shake.
-- Should happen once.
Explosion = function()
local c = CameraShakeInstance.new(5, 10, 0,.8)
c.PositionInfluence = Vector3.new(.5,.5,.5)
c.RotationInfluence = Vector3.new(1,1,1)
return c
end;
-- A continuous, rough shake
-- Sustained.
Earthquake = function()
local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
c.RotationInfluence = Vector3.new(1, 1, 4)
return c
end;
-- A bizarre shake with a very high magnitude and low roughness.
-- Sustained.
BadTrip = function()
local c = CameraShakeInstance.new(10, 0.15, 5, 10)
c.PositionInfluence = Vector3.new(0, 0, 0.15)
c.RotationInfluence = Vector3.new(2, 1, 4)
return c
end;
-- A subtle, slow shake.
-- Sustained.
HandheldCamera = function()
local c = CameraShakeInstance.new(1, 0.25, 5, 10)
c.PositionInfluence = Vector3.new(0, 0, 0)
c.RotationInfluence = Vector3.new(1, 0.5, 0.5)
return c
end;
-- A very rough, yet low magnitude shake.
-- Sustained.
Vibration = function()
local c = CameraShakeInstance.new(0.4, 20, 2, 2)
c.PositionInfluence = Vector3.new(0, 0.15, 0)
c.RotationInfluence = Vector3.new(1.25, 0, 4)
return c
end;
-- A slightly rough, medium magnitude shake.
-- Sustained.
RoughDriving = function()
local c = CameraShakeInstance.new(1, 2, 1, 1)
c.PositionInfluence = Vector3.new(0, 0, 0)
c.RotationInfluence = Vector3.new(1, 1, 1)
return c
end;
}
return setmetatable({}, {
__index = function(t, i)
local f = CameraShakePresets[i]
if (type(f) == "function") then
return f()
end
error("No preset found with index \"" .. i .. "\"")
end;
})
|
---[[ Window Settings ]] |
module.MinimumWindowSize = UDim2.new(0.3, 0, 0.25, 0)
module.MaximumWindowSize = UDim2.new(1, 0, 1, 0) -- if you change this to be greater than full screen size, weird things start to happen with size/position bounds checking.
module.DefaultWindowPosition = UDim2.new(0, 0, 0, 0)
local extraOffset = (7 * 2) + (5 * 2) -- Extra chatbar vertical offset
module.DefaultWindowSizePhone = UDim2.new(0.5, 0, 0.5, extraOffset)
module.DefaultWindowSizeTablet = UDim2.new(0.4, 0, 0.3, extraOffset)
module.DefaultWindowSizeDesktop = UDim2.new(0.3, 0, 0.25, extraOffset)
|
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]") |
local anim = animTable[animName][idx].anim
if (toolAnimInstance ~= anim) then
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
transitionTime = 0
end
-- load it to the humanoid; get AnimationTrack
toolAnimTrack = humanoid:LoadAnimation(anim)
if priority then
toolAnimTrack.Priority = priority
end
-- play the animation
toolAnimTrack:Play(transitionTime)
toolAnimName = animName
toolAnimInstance = anim
currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
end
end
function stopToolAnimations()
local oldAnim = toolAnimName
if (currentToolAnimKeyframeHandler ~= nil) then
currentToolAnimKeyframeHandler:disconnect()
end
toolAnimName = ""
toolAnimInstance = nil
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
toolAnimTrack = nil
end
return oldAnim
end
|
---- GETTERS AND SETTERS ---- |
local function ModifyTransformation(cast: ActiveCast, velocity: Vector3?, acceleration: Vector3?, position: Vector3?)
local trajectories = cast.StateInfo.Trajectories
local lastTrajectory = trajectories[#trajectories]
-- NEW BEHAVIOR: Don't create a new trajectory if we haven't even used the current one.
if lastTrajectory.StartTime == cast.StateInfo.TotalRuntime then
-- This trajectory is fresh out of the box. Let's just change it since it hasn't actually affected the cast yet, so changes won't have adverse effects.
if (velocity == nil) then
velocity = lastTrajectory.InitialVelocity
end
if (acceleration == nil) then
acceleration = lastTrajectory.Acceleration
end
if (position == nil) then
position = lastTrajectory.Origin
end
lastTrajectory.Origin = position
lastTrajectory.InitialVelocity = velocity
lastTrajectory.Acceleration = position
else
-- The latest trajectory is done. Set its end time and get its location.
lastTrajectory.EndTime = cast.StateInfo.TotalRuntime
local point, velAtPoint = unpack(GetLatestTrajectoryEndInfo(cast))
if (velocity == nil) then
velocity = velAtPoint
end
if (acceleration == nil) then
acceleration = lastTrajectory.Acceleration
end
if (position == nil) then
position = point
end
table.insert(cast.StateInfo.Trajectories, {
StartTime = cast.StateInfo.TotalRuntime,
EndTime = -1,
Origin = position,
InitialVelocity = velocity,
Acceleration = acceleration
})
end
end
function ActiveCastStatic:SetVelocity(velocity: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("SetVelocity", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
ModifyTransformation(self, velocity, nil, nil)
end
function ActiveCastStatic:SetAcceleration(acceleration: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("SetAcceleration", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
ModifyTransformation(self, nil, acceleration, nil)
end
function ActiveCastStatic:SetPosition(position: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("SetPosition", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
ModifyTransformation(self, nil, nil, position)
end
function ActiveCastStatic:GetVelocity(): Vector3
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("GetVelocity", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local currentTrajectory = self.StateInfo.Trajectories[#self.StateInfo.Trajectories]
return GetVelocityAtTime(self.StateInfo.TotalRuntime - currentTrajectory.StartTime, currentTrajectory.InitialVelocity, currentTrajectory.Acceleration)
end
function ActiveCastStatic:GetAcceleration(): Vector3
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("GetAcceleration", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local currentTrajectory = self.StateInfo.Trajectories[#self.StateInfo.Trajectories]
return currentTrajectory.Acceleration
end
function ActiveCastStatic:GetPosition(): Vector3
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("GetPosition", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local currentTrajectory = self.StateInfo.Trajectories[#self.StateInfo.Trajectories]
return GetPositionAtTime(self.StateInfo.TotalRuntime - currentTrajectory.StartTime, currentTrajectory.Origin, currentTrajectory.InitialVelocity, currentTrajectory.Acceleration)
end
|
-- update whether the Character is running or not
--[[Humanoid.Running:Connect(function(speed)
if speed <= .3 then
IsPlayerRunning = false
else
IsPlayerRunning = true
end
end)]] | --// We could just check this on demand...
|
--Rear Suspension |
Tune.RSusDamping = 401 -- Spring Dampening
Tune.RSusStiffness = 14000 -- Spring Force
Tune.FAntiRoll = 18.82 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 54 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
|
-- you can mess with these settings |
local easingtime = 0.1 --0~1
local walkspeeds = {
enabled = true;
walkingspeed = 16;
backwardsspeed = 10;
sidewaysspeed = 15;
diagonalspeed = 16;
runningspeed = 25;
runningFOV= 85;
}
|
--[[
]] |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AvatarEditor = ReplicatedStorage.AvatarEditor
local GuiLib = require(AvatarEditor.Client.GuiLib.LazyLoader)
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Signal = require(AvatarEditor.Shared.Util.Signal)
local Promise = require(AvatarEditor.Shared.Util.Promise)
local Settings = require(AvatarEditor.Shared.Settings)
local Class = {}
Class.__index = Class
function Class.new(frame, searchState)
local self = setmetatable({}, Class)
self.State = searchState
self.SearchChanged = Signal.new()
self.Maid = Maid.new()
self.NextSearch = nil
self.SearchPromise = nil
self.Frame = frame
local searchBox = frame.TextBox
local mask = GuiLib.Classes.TextMask.new(searchBox)
self.Maid:GiveTask(mask)
mask:SetMaskType("String")
mask:SetMaxLength(50)
self.Maid:GiveTask(mask.Frame.FocusLost:Connect(function(enterPressed, inputThatCausedFocusLoss)
if not enterPressed then
return
end
local value = mask:GetValue()
self:OnSearchChanged(value, true)
end))
self.Maid:GiveTask(mask.Frame:GetPropertyChangedSignal("Text"):Connect(function()
local value = mask:GetValue()
self:OnSearchChanged(value)
end))
self.Maid:GiveTask(frame.Clear.Activated:Connect(function(inputObject)
searchBox.Text = ""
end))
return self
end
function Class:OnSearchChanged(pattern, focusLost)
local state = self.State
local searchPromise = self.SearchPromise
self.NextSearch = pattern
if searchPromise then
searchPromise:cancel()
end
-- cant believe this works
self.SearchPromise = Promise.new(function(resolve, reject, onCancel)
Promise.delay(Settings.SEARCH_DELAY):andThen(function()
if not onCancel(function() end) then
if state.search == self.NextSearch then
reject("same search")
else
state.search = self.NextSearch
self.SearchChanged:Fire()
resolve()
end
end
end)
end):catch(function()
end)
end
function Class:Destroy()
self.State = nil
self.SearchChanged:Destroy()
self.SearchChanged = nil
self.Maid:DoCleaning()
self.Maid = nil
self.NextSearch = nil
self.SearchPromise = nil
self.Frame = nil
setmetatable(self, nil)
end
return Class
|
-- move the banto to the newfound goal |
walk:Play()
bg.CFrame = CFrame.new(banto.PrimaryPart.Position,goal)
bp.Position = (CFrame.new(banto.PrimaryPart.Position,goal)*CFrame.new(0,0,-100)).p
local start = tick()
repeat task.wait(1/2)
local ray = Ray.new(banto.PrimaryPart.Position,Vector3.new(0,-1000,0)) |
--[[function pm(x)
if game.Players:findFirstChild(script.Parent.Parent.Name)~=nil then
local bob=game.Players:findFirstChild(script.Parent.Parent.Name)
local mess=Instance.new("Message")
while bob:findFirstChild("Message")~=nil do bob.Message:remove() end
mess.Parent=bob
if x==1 then
mess.Text="I Chord"
elseif x==2 then
mess.Text="IV Chord"
elseif x==3 then
mess.Text="V Chord"
elseif x==4 then
mess.Text="V-VII Transition"
elseif x==5 then
mess.Text="I-VII Transition"
elseif x==6 then
mess.Text="III Chord"
end
wait(1)
mess.Parent=nil
end
end]] |
function Leap()
wait(0.25)--Might want to change this
script.Parent.GripForward = Vector3.new(-0,-0,1)
script.Parent.GripPos = Vector3.new(-1, 0, 0)
script.Parent.GripRight = Vector3.new(-1, 0, 0)
script.Parent.GripUp = Vector3.new(0, 1, 0)
wait(0.75)--Might want to change this also...
script.Parent.GripForward = Vector3.new(-0.291, 0.485, 0.825)
script.Parent.GripPos = Vector3.new(-1.5, 0, 0)
script.Parent.GripRight = Vector3.new(-0.857, -0.514, 0)
script.Parent.GripUp = Vector3.new(-0.424, 0.707, -0.565)
end
script.Parent.Parent.Humanoid.Jumping:connect(Leap)
|
-- How many times per second the gun can fire |
local FireRate = 1 / 5.5 |
--// Stances |
function Prone()
UpdateAmmo()
L_104_:FireServer("Prone")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -3, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 4
L_144_ = 4
L_143_ = 0.025
L_61_ = true
Proned2 = Vector3.new(0, 0.5, 0.5)
L_119_(L_9_, CFrame.new(0, -2.4201169, -0.0385534465, -0.99999994, -5.86197757e-012, -4.54747351e-013, 5.52669195e-012, 0.998915195, 0.0465667509, 0, 0.0465667509, -0.998915195), nil, function(L_269_arg1)
return math.sin(math.rad(L_269_arg1))
end, 0.25)
L_119_(L_10_, CFrame.new(1.00000191, -1, -5.96046448e-008, 1.31237243e-011, -0.344507754, 0.938783348, 0, 0.938783467, 0.344507784, -1, 0, -1.86264515e-009) , nil, function(L_270_arg1)
return math.sin(math.rad(L_270_arg1))
end, 0.25)
L_119_(L_11_, CFrame.new(-0.999996185, -1, -1.1920929e-007, -2.58566502e-011, 0.314521015, -0.949250221, 0, 0.94925046, 0.314521164, 1, 3.7252903e-009, 1.86264515e-009) , nil, function(L_271_arg1)
return math.sin(math.rad(L_271_arg1))
end, 0.25)
end
function Stand()
UpdateAmmo()
L_104_:FireServer("Stand")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
L_61_ = false
if not L_60_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_143_ = .2
L_144_ = 17
elseif L_60_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_144_ = 10
L_143_ = 0.02
end
Proned2 = Vector3.new(0, 0, 0)
L_119_(L_9_, CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), nil, function(L_272_arg1)
return math.sin(math.rad(L_272_arg1))
end, 0.25)
L_119_(L_10_, CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0), nil, function(L_273_arg1)
return math.sin(math.rad(L_273_arg1))
end, 0.25)
L_119_(L_11_, CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0), nil, function(L_274_arg1)
return math.sin(math.rad(L_274_arg1))
end, 0.25)
end
function Crouch()
UpdateAmmo()
L_104_:FireServer("Crouch")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 9
L_144_ = 9
L_143_ = 0.035
L_61_ = true
Proned2 = Vector3.new(0, 0, 0)
L_119_(L_9_, CFrame.new(0, -1.04933882, 0, -1, 0, -1.88871293e-012, 1.88871293e-012, -3.55271368e-015, 1, 0, 1, -3.55271368e-015), nil, function(L_275_arg1)
return math.sin(math.rad(L_275_arg1))
end, 0.25)
L_119_(L_10_, CFrame.new(1, 0.0456044674, -0.494239986, 6.82121026e-013, -1.22639676e-011, 1, -0.058873821, 0.998265445, -1.09836602e-011, -0.998265445, -0.058873821, 0), nil, function(L_276_arg1)
return math.sin(math.rad(L_276_arg1))
end, 0.25)
L_119_(L_11_, CFrame.new(-1.00000381, -0.157019258, -0.471293032, -8.7538865e-012, -8.7538865e-012, -1, 0.721672177, 0.692235112, 1.64406284e-011, 0.692235112, -0.721672177, 0), nil, function(L_277_arg1)
return math.sin(math.rad(L_277_arg1))
end, 0.25)
L_119_(L_6_:WaitForChild("Neck"), nil, CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), function(L_278_arg1)
return math.sin(math.rad(L_278_arg1))
end, 0.25)
end
function LeanRight()
if L_87_ ~= 2 then
L_104_:FireServer("LeanRight")
L_119_(L_9_, nil, CFrame.new(0, 0.200000003, 0, -0.939692616, 0, -0.342020124, -0.342020124, 0, 0.939692616, 0, 1, 0), function(L_279_arg1)
return math.sin(math.rad(L_279_arg1))
end, 0.25)
L_119_(L_10_, nil, CFrame.new(0.300000012, 0.600000024, 0, 0, 0.342020124, 0.939692616, 0, 0.939692616, -0.342020124, -1, 0, 0), function(L_280_arg1)
return math.sin(math.rad(L_280_arg1))
end, 0.25)
L_119_(L_11_, nil, nil, function(L_281_arg1)
return math.sin(math.rad(L_281_arg1))
end, 0.25)
L_119_(L_6_:WaitForChild("Clone"), nil, CFrame.new(-0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), function(L_282_arg1)
return math.sin(math.rad(L_282_arg1))
end, 0.25)
if not L_61_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(1, -0.5, 0)
}):Play()
elseif L_61_ then
if L_87_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(1, -1.5, 0)
}):Play()
end
end;
end
end
function LeanLeft()
if L_87_ ~= 2 then
L_104_:FireServer("LeanLeft")
L_119_(L_9_, nil, CFrame.new(0, 0.200000003, 0, -0.939692616, 0, 0.342020124, 0.342020124, 0, 0.939692616, 0, 1, 0), function(L_283_arg1)
return math.sin(math.rad(L_283_arg1))
end, 0.25)
L_119_(L_10_, nil, nil, function(L_284_arg1)
return math.sin(math.rad(L_284_arg1))
end, 0.25)
L_119_(L_11_, nil, CFrame.new(-0.300000012, 0.600000024, 0, 0, -0.342020124, -0.939692616, 0, 0.939692616, -0.342020124, 1, 0, 0), function(L_285_arg1)
return math.sin(math.rad(L_285_arg1))
end, 0.25)
L_119_(L_6_:WaitForChild("Clone"), nil, CFrame.new(0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), function(L_286_arg1)
return math.sin(math.rad(L_286_arg1))
end, 0.25)
if not L_61_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(-1, -0.5, 0)
}):Play()
elseif L_61_ then
if L_87_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(-1, -1.5, 0)
}):Play()
end
end;
end
end
function Unlean()
if L_87_ ~= 2 then
L_104_:FireServer("Unlean")
L_119_(L_9_, nil, CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), function(L_287_arg1)
return math.sin(math.rad(L_287_arg1))
end, 0.25)
L_119_(L_10_, nil, CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), function(L_288_arg1)
return math.sin(math.rad(L_288_arg1))
end, 0.25)
L_119_(L_11_, nil, CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), function(L_289_arg1)
return math.sin(math.rad(L_289_arg1))
end, 0.25)
if L_6_:FindFirstChild('Clone') then
L_119_(L_6_:WaitForChild("Clone"), nil, CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), function(L_290_arg1)
return math.sin(math.rad(L_290_arg1))
end, 0.25)
end
if not L_61_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
elseif L_61_ then
if L_87_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
end
end;
end
end
local L_154_ = false
L_99_.InputBegan:connect(function(L_291_arg1, L_292_arg2)
if not L_292_arg2 and L_15_ == true then
if L_15_ then
if L_291_arg1.KeyCode == Enum.KeyCode.C then
if L_87_ == 0 and not L_63_ and L_15_ then
L_87_ = 1
Crouch()
L_88_ = false
L_90_ = true
L_89_ = false
elseif L_87_ == 1 and not L_63_ and L_15_ then
L_87_ = 2
Prone()
L_90_ = false
L_88_ = true
L_89_ = false
L_154_ = true
end
end
if L_291_arg1.KeyCode == Enum.KeyCode.X then
if L_87_ == 2 and not L_63_ and L_15_ then
L_154_ = false
L_87_ = 1
Crouch()
L_88_ = false
L_90_ = true
L_89_ = false
elseif L_87_ == 1 and not L_63_ and L_15_ then
L_87_ = 0
Stand()
L_88_ = false
L_90_ = false
L_89_ = true
end
end
end
end
end)
|
----------//Animation Loader\\---------- |
function EquipAnim()
AnimDebounce = false
pcall(function()
AnimData.EquipAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
AnimDebounce = true
end
function IdleAnim()
pcall(function()
AnimData.IdleAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
AnimDebounce = true
end
function SprintAnim()
AnimDebounce = false
pcall(function()
AnimData.SprintAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function HighReady()
pcall(function()
AnimData.HighReady({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function LowReady()
pcall(function()
AnimData.LowReady({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function Patrol()
pcall(function()
AnimData.Patrol({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function ReloadAnim()
pcall(function()
AnimData.ReloadAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function TacticalReloadAnim()
pcall(function()
AnimData.TacticalReloadAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function JammedAnim()
pcall(function()
AnimData.JammedAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function PumpAnim()
reloading = true
pcall(function()
AnimData.PumpAnim({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
reloading = false
end
function MagCheckAnim()
CheckingMag = true
pcall(function()
AnimData.MagCheck({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
CheckingMag = false
end
function meleeAttack()
pcall(function()
AnimData.meleeAttack({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function GrenadeReady()
pcall(function()
AnimData.GrenadeReady({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end
function GrenadeThrow()
pcall(function()
AnimData.GrenadeThrow({
RArmWeld,
LArmWeld,
GunWeld,
WeaponInHand,
ViewModel,
})
end)
end |
-- initialize to idle |
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
while Figure.Parent~=nil do
local _, time = wait(0.1)
move(time)
end
|
-- ====================
-- SNIPER
-- Enable user to use scope
-- ==================== |
SniperEnabled = false;
FieldOfView = 12.5;
MouseSensitive = 0.05; --In percent
SpreadRedution = 1; --In percent.
|
--[[Susupension]] |
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FSusMaxExt = .3 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RSusMaxExt = .3 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Really black" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[[Misc]] |
Tune.LoadDelay = .1 -- Delay before initializing chassis (in seconds)
Tune.AutoStart = false -- Set to false if using manual ignition plugin
Tune.AutoFlip = true -- Set to false if using manual flip plugin
|
--[=[
Removes a prefix from a string if it exists
@param str string
@param prefix string
@return string
]=] |
function String.removePrefix(str: string, prefix: string): string
if str:sub(1, #prefix) == prefix then
return str:sub(#prefix + 1)
else
return str
end
end
|
-- FIXME: This should be updated to be closer to the actual
-- `Object.preventExtensions` functionality in JS. This requires additional
-- support from the VM |
local function preventExtensions<T>(t: Table): T
local name = tostring(t)
return (
setmetatable(t, {
__newindex = function(self, key, value)
local message = ("%q (%s) is not a valid member of %s"):format(tostring(key), typeof(key), name)
error(message, 2)
end,
__metatable = false,
}) :: any
) :: T
end
return preventExtensions
|
-- ㊗ |
function findTorso(pos)
local torso = nil
local dist = 100000
local child = workspace:children()
for i=1, #child do
if child[i].className == "Model" then
local h = child[i]:findFirstChild("Humanoid")
if h ~= nil then
local check = child[i]:findFirstChild("Head")
if check ~= nil then
if (check.Position - pos).magnitude < dist then
torso = check
dist = (check.Position - pos).magnitude
end
end
end
end
end
return torso
end
game:GetService("RunService").Stepped:Connect(function()
local torso = findTorso(script.Parent.Position)
if torso ~= nil then
script.Parent.CFrame = CFrame.new(script.Parent.Position, torso.Position)
end
end)
|
--[=[
Attaches a `finally` handler to this Promise that discards the resolved value and returns the given value from it.
```lua
promise:finallyReturn("some", "values")
```
This is sugar for
```lua
promise:finally(function()
return "some", "values"
end)
```
@param ... any -- Values to return from the function
@return Promise
]=] |
function Promise.prototype:finallyReturn(...)
local length, values = pack(...)
return self:_finally(debug.traceback(nil, 2), function()
return unpack(values, 1, length)
end)
end
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- |
while wait() do
local nrstt = GetTorso(hroot.Position)
if nrstt ~= nil and human.Health > 0 then -- if player detected
vars.Wandering.Value = false
vars.Chasing.Value = true
local function checkw(t)
local ci = 3
if ci > #t then
ci = 3
end
if t[ci] == nil and ci < #t then
repeat ci = ci + 1 wait() until t[ci] ~= nil
return Vector3.new(1,0,0) + t[ci]
else
ci = 3
return t[ci]
end
end
path = pfs:FindPathAsync(hroot.Position, nrstt.Position)
waypoint = path:GetWaypoints()
local connection;
local direct = Vector3.FromNormalId(Enum.NormalId.Front)
local ncf = hroot.CFrame * CFrame.new(direct)
direct = ncf.p.unit
local rootr = Ray.new(hroot.Position, direct)
local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)
if path and waypoint or checkw(waypoint) then
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
human:MoveTo( checkw(waypoint).Position )
human.Jump = false
end
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
connection = human.Changed:connect(function()
human.Jump = true
end)
human:MoveTo( waypoint[4].Position )
else
human.Jump = false
end
hroot.Touched:connect(function(p)
local bodypartnames = GetPlayersBodyParts(nrstt)
if p:IsA'Part' and not p.Name == bodypartnames and phit and phit.Name ~= bodypartnames and phit:IsA'Part' and rootr:Distance(phit.Position) < 5 then
connection = human.Changed:connect(function()
human.Jump = true
end)
else
human.Jump = false
end
end)
if connection then
connection:Disconnect()
end
else
for i = 3, #waypoint do
human:MoveTo( waypoint[i].Position )
end
end
path = nil
waypoint = nil
elseif nrstt == nil then -- if player not detected
vars.Wandering.Value = false
vars.Chasing.Value = false
CchaseName = nil
path = nil
waypoint = nil
human.MoveToFinished:Wait()
end
end
|
--print("building and not player") |
target = nearestBuilding
targetType = nearestBuilding.ClassName
lastLock = tick()
else |
--Thanks For Reading. I Really appreciate the work i did for you! | |
--// Connections |
L_108_.OnClientEvent:connect(function(L_191_arg1, L_192_arg2, L_193_arg3, L_194_arg4, L_195_arg5, L_196_arg6, L_197_arg7)
if L_191_arg1 and not L_15_ then
MakeFakeArms()
L_42_ = L_2_.PlayerGui.MainGui
L_26_ = L_42_:WaitForChild('Others')
L_27_ = L_26_:WaitForChild('Kill')
L_28_ = L_42_:WaitForChild('GameGui'):WaitForChild('AmmoFrame')
L_29_ = L_28_:WaitForChild('Ammo')
L_30_ = L_28_:WaitForChild('AmmoBackground')
L_31_ = L_28_:WaitForChild('MagCount')
L_32_ = L_28_:WaitForChild('MagCountBackground')
L_33_ = L_28_:WaitForChild('DistDisp')
L_34_ = L_28_:WaitForChild('Title')
L_35_ = L_28_:WaitForChild('Mode1')
L_36_ = L_28_:WaitForChild('Mode2')
L_37_ = L_28_:WaitForChild('Mode3')
L_38_ = L_28_:WaitForChild('Mode4')
L_39_ = L_28_:WaitForChild('Mode5')
L_40_ = L_28_:WaitForChild('Stances')
L_41_ = L_42_:WaitForChild('Shading')
L_41_.Visible = false
L_34_.Text = L_1_.Name
UpdateAmmo()
L_43_ = L_192_arg2
L_44_ = L_193_arg3
L_45_ = L_194_arg4
L_46_ = L_195_arg5
L_47_ = L_196_arg6
L_48_ = L_197_arg7
L_49_ = L_62_.Bolt
L_87_ = L_48_.C1
L_88_ = L_48_.C0
if L_1_:FindFirstChild('AimPart2') then
L_57_ = L_1_:WaitForChild('AimPart2')
end
if L_1_:FindFirstChild('FirePart2') then
L_60_ = L_1_.FirePart2
end
if L_24_.FirstPersonOnly then
L_2_.CameraMode = Enum.CameraMode.LockFirstPerson
end
--uis.MouseIconEnabled = false
L_5_.FieldOfView = 70
L_15_ = true
elseif L_15_ then
if L_3_ and L_3_.Humanoid and L_3_.Humanoid.Health > 0 and L_9_ then
Stand()
Unlean()
end
L_93_ = 0
L_80_ = false
L_81_ = false
L_82_ = false
L_64_ = false
L_67_ = false
L_66_ = false
Shooting = false
L_97_ = 70
RemoveArmModel()
L_42_:Destroy()
for L_198_forvar1, L_199_forvar2 in pairs(IgnoreList) do
if L_199_forvar2 ~= L_3_ and L_199_forvar2 ~= L_5_ and L_199_forvar2 ~= L_101_ then
table.remove(IgnoreList, L_198_forvar1)
end
end
if L_3_:FindFirstChild('Right Arm') and L_3_:FindFirstChild('Left Arm') then
L_3_['Right Arm'].LocalTransparencyModifier = 0
L_3_['Left Arm'].LocalTransparencyModifier = 0
end
L_78_ = false
L_69_ = true
L_2_.CameraMode = Enum.CameraMode.Classic
L_107_.MouseIconEnabled = true
L_5_.FieldOfView = 70
L_15_ = false
L_107_.MouseDeltaSensitivity = L_52_
L_4_.Icon = "http://www.roblox.com/asset?id=0"
L_15_ = false
L_4_.TargetFilter = nil
end
end)
|
--[[Controls]] |
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
--Input Handler
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and (_TMode=="Auto" or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 then _ClutchOn = true end
_CGear = math.max(_CGear-1,-1)
--Shift Up [Manual Transmission]
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and (_TMode=="Auto" or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 then _ClutchOn = true end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
--Toggle Clutch
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClutchOn = false
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClutchOn = true
_ClPressing = false
end
--Toggle PBrake
elseif _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then
_PBrake = false
end
end
--Toggle Transmission Mode
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
--Throttle
elseif _IsOn and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1*_GThrotShift
else
_GThrot = _Tune.IdleThrottle/100*_GThrotShift
end
--Brake
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
--Steer Right
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle/100*_GThrotShift
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
--Toggle TCS
elseif _Tune.TCSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then
_TCS = not _TCS
end
--Toggle ABS
elseif _Tune. ABSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then
_ABS = not _ABS
end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)*_GThrotShift
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = _Tune.IdleThrottle/100*_GThrotShift
_GSteerT = 0
_GBrake = 0
if _CGear~=0 then _ClutchOn = true end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
--Automatic Gauge Scaling |
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 54 + 282 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
script.Parent.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
else
if script.Parent.TCS.Visible then
script.Parent.TCS.Visible = false
end
end
end)
script.Parent.Parent.Values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABS.Value then
script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.ABSActive.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = true
script.Parent.ABS.TextColor3 = Color3.new(1,0,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.Parent.Values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
end
else
if script.Parent.ABS.Visible then
script.Parent.ABS.Visible = false
end
end
end)
function PBrake()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end
script.Parent.Parent.Values.PBrake.Changed:connect(PBrake)
function Gear()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "A/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "S/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "M/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(script.Parent.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
wait(.1)
Gear()
PBrake()
|
--------------------
--| Script Logic |--
-------------------- |
VipDoor.Touched:connect(OnTouched)
while true do
RemoveOldTouches()
wait(1/30)
end
|
--[[Brakes]] |
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 15000 -- Front brake force
Tune.RBrakeForce = 15000 -- Rear brake force
Tune.PBrakeForce = 50000 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
--[=[
Returns a brio that dies whenever the first Brio in the list
dies. The value of the Brio is the `...` value.
@param brios {Brio<T>}
@param ... U
@return Brio<U>
]=] |
function BrioUtils.first(brios, ...)
for _, brio in pairs(brios) do
if Brio.isBrio(brio) then
if brio:IsDead() then
return Brio.DEAD
end
end
end
local maid = Maid.new()
local topBrio = Brio.new(...)
for _, brio in pairs(brios) do
if Brio.isBrio(brio) then
maid:GiveTask(brio:GetDiedSignal():Connect(function()
topBrio:Kill()
end))
end
end
maid:GiveTask(topBrio:GetDiedSignal():Connect(function()
maid:DoCleaning()
end))
return topBrio
end
|
-- functions |
local function Display(text, sound)
script.BeepSound:Play()
INFO_GUI.Visible = true
INFO_GUI.Position = UDim2.new(0.5, 0, 0.15, 0)
INFO_GUI.InfoLabel.TextTransparency = 1
INFO_GUI.InfoLabel.TextStrokeTransparency = 1
INFO_GUI.InfoLabel.Text = text
INFO_GUI.BackgroundLabel.Size = UDim2.new(0, 0, 1, 0)
if sound then
if script:FindFirstChild(sound .. "Sound") then
script[sound .. "Sound"]:Play()
end
end
local openInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local closeInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local openTweenA = TweenService:Create(INFO_GUI.InfoLabel, openInfo, {TextTransparency = 0; TextStrokeTransparency = 0; Position = UDim2.new(0.5, 0, 0.2, 0)})
local openTweenB = TweenService:Create(INFO_GUI.BackgroundLabel, openInfo, {Size = UDim2.new(1, 0, 1, 0)})
openTweenA:Play()
openTweenB:Play()
wait(5)
local closeTweenA = TweenService:Create(INFO_GUI.InfoLabel, closeInfo, {TextTransparency = 1; TextStrokeTransparency = 1; Position = UDim2.new(0.5, 0, 0.15, 0)})
local closeTweenB = TweenService:Create(INFO_GUI.BackgroundLabel, closeInfo, {Size = UDim2.new(0, 0, 1, 0)})
closeTweenA:Play()
closeTweenB:Play()
wait(0.5)
INFO_GUI.Visible = false
end
|
--Wheelie tune |
local WheelieD = 2
local WheelieTq = 85
local WheelieP = 5
local WheelieMultiplier = 1.5
local WheelieDivider = 2
|
------------------------- |
function onClicked()
R.Function1.Disabled = true
R.Function2.Disabled = false
R.BrickColor = BrickColor.new("Institutional white")
N.One1.BrickColor = BrickColor.new("Really black")
N.One2.BrickColor = BrickColor.new("Really black")
N.One4.BrickColor = BrickColor.new("Really black")
N.One8.BrickColor = BrickColor.new("Really black")
N.Three4.BrickColor = BrickColor.new("Really black")
N.Four1.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- connect events |
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)
|
--[[
Constructs a new Promise with the given initializing callback.
This is generally only called when directly wrapping a non-promise API into
a promise-based version.
The callback will receive 'resolve' and 'reject' methods, used to start
invoking the promise chain.
For example:
local function get(url)
return Promise.new(function(resolve, reject)
spawn(function()
resolve(HttpService:GetAsync(url))
end)
end)
end
get("https://google.com")
:andThen(function(stuff)
print("Got some stuff!", stuff)
end)
]] |
function Promise.new(callback)
local promise = {
-- Used to locate where a promise was created
_source = debug.traceback(),
-- A tag to identify us as a promise
_type = "Promise",
_status = Promise.Status.Started,
-- A table containing a list of all results, whether success or failure.
-- Only valid if _status is set to something besides Started
_value = nil,
-- If an error occurs with no observers, this will be set.
_unhandledRejection = false,
-- Queues representing functions we should invoke when we update!
_queuedResolve = {},
_queuedReject = {},
}
setmetatable(promise, Promise)
local function resolve(...)
promise:_resolve(...)
end
local function reject(...)
promise:_reject(...)
end
local ok, err = wpcall(callback, resolve, reject)
if not ok and promise._status == Promise.Status.Started then
reject(err)
end
return promise
end
|
----------------------------------------------------------------------------------------------- |
for _,i in pairs (siren:GetChildren()) do
if i:IsA("ImageButton") and i.Name ~= "header" then
if string.match(i.Name,"%l+") == "sr" then
i.MouseButton1Click:connect(function()
script.Parent.siren.Value = tonumber(string.match(i.Name,"%d"))
if script.Parent.siren.Value == 0 then
siren.sr0.Image = imgassets.sirenson
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 1 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailon
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 2 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpon
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 3 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseron
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 4 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hiloon
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 5 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornon
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 6 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleron
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 7 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpon
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleron
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 8 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseron
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleron
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 9 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhiloon
end
end)
end
end
end
for _,i in pairs (seats:GetChildren()) do
if i:IsA("ImageButton") and i.Name ~= "header" then
if string.match(i.Name,"%u%l+") == "Seat" then
local a = seat:findFirstChild("Seat"..tonumber(string.match(i.Name,"%d")))
if a.Value then
i.Image = imgassets.lockon
else
i.Image = imgassets.lockoff
end
i.MouseButton1Click:connect(function()
a.Value = not a.Value
if a.Value then
i.Image = imgassets.lockon
seat.Parent.SSC.Beep:Play()
else
i.Image = imgassets.lockoff
seat.Parent.SSC.Beep:Play()
end
end)
end
end
end
while true do
wait(0.1)
script.Parent.Speed.Text = ("Speed: "..math.floor(seat.Velocity.Magnitude/2))
end
|
--[=[
Yields the current thread until the given Promise completes. Returns the values that the promise resolved with.
```lua
local worked = pcall(function()
print("got", getTheValue():expect())
end)
if not worked then
warn("it failed")
end
```
This is essentially sugar for:
```lua
select(2, assert(promise:await()))
```
**Errors** if the Promise rejects or gets cancelled.
@error any -- Errors with the rejection value if this Promise rejects or gets cancelled.
@yields
@return ...any -- The values the Promise resolved with.
]=] |
function Promise.prototype:expect()
return expectHelper(self:awaitStatus())
end
|
-- ROBLOX FIXME Luau: doesn't see `if element` as nilable table, so we get TypeError: Type 'any?' could not be converted into '{| _owner: {| type: nil |}, _source: Source?, type: any |}' |
local function setCurrentlyValidatingElement(element: any?)
if _G.__DEV__ then
if element then
local owner = element._owner
local stack = describeUnknownElementTypeFrameInDEV(
element.type,
element._source,
owner ~= nil and owner.type or nil
);
-- ROBLOX FIXME Luau: Cannot call non-function ((string?) -> ()) | ((string?) -> ())
(ReactDebugCurrentFrame.setExtraStackFrame :: any)(stack)
else
(ReactDebugCurrentFrame.setExtraStackFrame :: any)(nil)
end
end
end
local function checkPropTypes<P>(
-- ROBLOX deviation START: also checks validateProps if present
propTypes: Object?,
validateProps: (P) -> (boolean, string?)?,
props: P,
-- ROBLOX deviation END
location: string,
componentName: string?,
element: any?
): ()
if _G.__DEV__ or _G.__DISABLE_ALL_WARNINGS_EXCEPT_PROP_VALIDATION__ then
-- deviation: hasOwnProperty shouldn't be relevant to lua objects
-- $FlowFixMe This is okay but Flow doesn't know it.
-- local has = Function.call.bind(Object.prototype.hasOwnProperty)
-- ROBLOX deviation: warns if both propType and validateProps defined.
if propTypes and validateProps then
console.warn(
"You've defined both propTypes and validateProps on "
.. (componentName or "a component")
)
end
-- ROBLOX deviation: also checks validateProps if present
if validateProps then
if typeof(validateProps) ~= "function" then
console.error(
(
"validateProps must be a function, but it is a %s.\nCheck the definition of the component %q."
):format(typeof(validateProps), componentName or "")
)
else
local success, failureReason = validateProps(props)
if not success then
failureReason = failureReason
or "<Validator function did not supply a message>"
local message = string.format(
"validateProps failed on a %s type in %s: %s",
location,
componentName or "<UNKNOWN Component>",
tostring(failureReason)
)
-- ROBLOX deviation: In legacy Roact, prop validation
-- failures throw. We replicate that behavior, even though
-- it differs from propTypes (which only warns)
-- ROBLOX FIXME: align with upstream behavior during React 18 Lua transition
error(message)
end
end
end
if propTypes then
-- ROBLOX deviation: since we can't constrain the generic, we assert so Luau knows propTypes is a table
assert(typeof(propTypes) == "table", "propTypes needs to be a table")
for typeSpecName, _ in propTypes do
-- deviation: since our loop won't hit metatable members, we don't
-- need to worry about encountering inherited properties here
-- if has(propTypes, typeSpecName) then
-- Prop type validation may throw. In case they do, we don't want to
-- fail the render phase where it didn't fail before. So we log it.
-- After these have been cleaned up, we'll local them throw.
local _, result = xpcall(function()
-- This is intentionally an invariant that gets caught. It's the same
-- behavior as without this statement except with a better message.
if typeof(propTypes[typeSpecName]) ~= "function" then
local err = Error.new(
(componentName or "React class")
.. ": "
.. location
.. " type `"
.. typeSpecName
.. "` is invalid; "
.. "it must be a function, usually from the `prop-types` package, but received `"
.. typeof(propTypes[typeSpecName])
.. "`."
.. "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
)
err.name = "Invariant Violation"
error(err)
end
return (propTypes[typeSpecName] :: Function)(
props,
typeSpecName,
componentName,
location,
nil,
"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"
)
end, describeError)
-- ROBLOX deviation: FIXME: Can we expose something from JSPolyfill that
-- will let us verify that this is specifically the Error object
-- defined there? if we check for result.message ~= nil, ReactNewContext.spec:1368 fails
local isErrorObject = typeof(result) == "table"
if result ~= nil and not isErrorObject then
setCurrentlyValidatingElement(element)
console.error(string.format(
-- ROBLOX deviation: s/null/nil
"%s: type specification of %s"
.. " `%s` is invalid; the type checker "
.. "function must return `nil` or an `Error` but returned a %s. "
.. "You may have forgotten to pass an argument to the type checker "
.. "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and "
.. "shape all require an argument).",
componentName or "React class",
location,
typeSpecName,
typeof(result)
))
setCurrentlyValidatingElement(nil)
end
-- ROBLOX FIXME: Luau analyze doesn't understand isErrorObject's effect as a predicate meaning result ~= nil
if
isErrorObject
and loggedTypeFailures[(result :: any).message] == nil
then
-- Only monitor this failure once because there tends to be a lot of the
-- same error.
loggedTypeFailures[tostring((result :: any).message)] = true
setCurrentlyValidatingElement(element)
console.warn(
string.format(
"Failed %s type: %s",
location,
tostring((result :: any).message)
)
)
setCurrentlyValidatingElement(nil)
end
end
end
end
end
return checkPropTypes
|
-- Decompiled with the Synapse X Luau decompiler. |
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.Parent.AlienAnimationREAL.Fired:Fire();
end);
|
--THIS SCRIPT SHOULD ONLY GO IN TORSO, ANYWHERE ELSE MAY DESTROY THE BEY!!!! | |
--WalkSpeedsHere! |
local WalkSpeedWhileCrouching = 5
local CurrentWalkSpeed = 16
|
--[[**
ensures Roblox RaycastParams type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]] |
t.RaycastParams = t.typeof("RaycastParams")
|
-- PUBLIC FUNCTIONS |
function ZoneController.getZones()
local registeredZonesArray = {}
for zone, _ in pairs(registeredZones) do
table.insert(registeredZonesArray, zone)
end
return registeredZonesArray
end
|
--[[ TS:Create(ArmaClone.REG, TweenInfo.new(0), {Transparency = 1}):Play()
if ArmaClone:FindFirstChild("REG2") then
TS:Create(ArmaClone.REG2, TweenInfo.new(0), {Transparency = 1}):Play()
end
TS:Create(ArmaClone.ADS, TweenInfo.new(0), {Transparency = 0}):Play()
]] |
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
else
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
end
elseif AimPartMode == 2 then
tweenFoV(Settings.ChangeFOV[2],120)
if Settings.FocusOnSight2 then
--TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = Settings.Focus2Distance}):Play()
else
--TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = 0}):Play()
end
if Settings.adsMesh2 then
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
else
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
end
end
else
if AimPartMode == 1 then
tweenFoV(Settings.ChangeFOV[1],120)
if Settings.FocusOnSight then
--TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = Settings.Focus1Distance}):Play()
else
--TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = 0}):Play()
end
if Settings.adsMesh1 then
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
else
if Settings.adsMesh1 then
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
end
end
elseif AimPartMode == 2 then
tweenFoV(Settings.ChangeFOV[2],120)
if Settings.FocusOnSight2 then
--TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = Settings.Focus2Distance}):Play()
else
--TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = 0}):Play()
end
if Settings.adsMesh2 then
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
else
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
end
end
end
else
tweenFoV(70,120)
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = 0}):Play()
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
end
elseif Aiming and Equipped then
stance = 0
Evt.Stance:FireServer(stance,Settings,Anims,ArmaClient)
game:GetService('UserInputService').MouseDeltaSensitivity = 1
ArmaClone.Handle.AimUp:Play()
tweenFoV(70,120)
Aiming = false
if Settings.adsMesh1 or Settings.adsMesh2 then
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "REG" then
TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play()
end
end
end
for _,v in pairs(ArmaClone:GetDescendants()) do
if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then
if v.Name == "ADS" then
TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play()
end
end
end
end
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = 0}):Play()
end
end)
Human.Died:connect(function()
ResetWorkspace()
Human:UnequipTools()
Evt.Rappel.CutEvent:FireServer()
Unset()
end)
function onStateChanged(_,state)
if state == Enum.HumanoidStateType.Swimming then
Nadando = true
if Equipped then
Unset()
Humanoid:UnequipTools()
end
else
Nadando = false
end
if ServerConfig.EnableFallDamage then
if state == Enum.HumanoidStateType.Freefall and not falling then
falling = true
local curVel = 0
local peak = 0
while falling do
curVel = HumanoidRootPart.Velocity.magnitude
peak = peak + 1
wait()
end
local damage = (curVel - (ServerConfig.MaxVelocity)) * ServerConfig.DamageMult
if damage > 5 and peak > 20 then
local hurtSound = PastaFX.FallDamage:Clone()
hurtSound.Parent = Player.PlayerGui
hurtSound.Volume = damage/Human.MaxHealth
hurtSound:Play()
Debris:AddItem(hurtSound,hurtSound.TimeLength)
Evt.Damage:FireServer(Human,damage,0,0)
end
elseif state == Enum.HumanoidStateType.Landed or state == Enum.HumanoidStateType.Dead then
falling = false
end
end
end
Evt.ServerBullet.OnClientEvent:Connect(function(SKP_arg1,SKP_arg3,SKP_arg4,SKP_arg5,SKP_arg6,SKP_arg7,SKP_arg8,SKP_arg9,SKP_arg10,SKP_arg11,SKP_arg12)
if SKP_arg1 ~= Jogador and SKP_arg1.Character then
local SKP_01 = SKP_arg3
local SKP_02 = Instance.new("Part")
SKP_02.Parent = workspace.ACS_WorkSpace.Server
SKP_02.Name = SKP_arg1.Name..'_Bullet'
Debris:AddItem(SKP_02, 5)
SKP_02.Shape = "Ball"
SKP_02.Size = Vector3.new(1, 1, 1)
SKP_02.CanCollide = false
SKP_02.CFrame = SKP_01
SKP_02.Transparency = 1
local SKP_03 = SKP_02:GetMass()
local SKP_04 = Instance.new('BodyForce', SKP_02)
SKP_04.Force = Vector3.new(0,SKP_03 * (196.2) - SKP_arg5 * (196.2), 0)
SKP_02.Velocity = SKP_arg7 * SKP_arg6
local SKP_05 = Instance.new('Attachment', SKP_02)
SKP_05.Position = Vector3.new(0.1, 0, 0)
local SKP_06 = Instance.new('Attachment', SKP_02)
SKP_06.Position = Vector3.new(-0.1, 0, 0)
if SKP_arg4 then
local SKP_07 = Instance.new('Trail', SKP_02)
SKP_07.Attachment0 = SKP_05
SKP_07.Attachment1 = SKP_06
SKP_07.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0);
NumberSequenceKeypoint.new(1, 1);
}
)
SKP_07.WidthScale = NumberSequence.new({
NumberSequenceKeypoint.new(0, 2, 0);
NumberSequenceKeypoint.new(1, 0);
}
)
SKP_07.Texture = "rbxassetid://232918622"
SKP_07.TextureMode = Enum.TextureMode.Stretch
SKP_07.LightEmission = 1
SKP_07.Lifetime = 0.2
SKP_07.FaceCamera = true
SKP_07.Color = ColorSequence.new(SKP_arg8)
end
if SKP_arg10 then
local SKP_08 = Instance.new("BillboardGui", SKP_02)
SKP_08.Adornee = SKP_02
local SKP_09 = math.random(375, 475)/10
SKP_08.Size = UDim2.new(SKP_09, 0, SKP_09, 0)
SKP_08.LightInfluence = 0
local SKP_010 = Instance.new("ImageLabel", SKP_08)
SKP_010.BackgroundTransparency = 1
SKP_010.Size = UDim2.new(1, 0, 1, 0)
SKP_010.Position = UDim2.new(0, 0, 0, 0)
SKP_010.Image = "http://www.roblox.com/asset/?id=1047066405"
SKP_010.ImageColor3 = SKP_arg11
SKP_010.ImageTransparency = math.random(2, 5)/15
if SKP_02:FindFirstChild("BillboardGui") ~= nil then
SKP_02.BillboardGui.Enabled = true
end
end
local SKP_011 = {SKP_arg1.Character,SKP_02,workspace.ACS_WorkSpace}
while true do
RS.Heartbeat:wait()
local SKP_012 = Ray.new(SKP_02.Position, SKP_02.CFrame.LookVector*25)
local SKP_013, SKP_014 = workspace:FindPartOnRayWithIgnoreList(SKP_012, SKP_011, false, true)
if SKP_013 then
game.Debris:AddItem(SKP_02,0)
break
end
end
game.Debris:AddItem(SKP_02,0)
return SKP_02
end
end)
Human.StateChanged:connect(onStateChanged)
Evt.ACS_AI.AIBullet.OnClientEvent:Connect(function(SKP_arg1,SKP_arg3,SKP_arg4,SKP_arg5,SKP_arg6,SKP_arg7,SKP_arg8,SKP_arg9,SKP_arg10,SKP_arg11,SKP_arg12)
if SKP_arg1 ~= Jogador then
local SKP_01 = SKP_arg3
local SKP_02 = Instance.new("Part")
SKP_02.Parent = workspace.ACS_WorkSpace.Server
SKP_02.Name = "AI_Bullet"
Debris:AddItem(SKP_02, 5)
SKP_02.Shape = "Ball"
SKP_02.Size = Vector3.new(1, 1, 1)
SKP_02.CanCollide = false
SKP_02.CFrame = SKP_01
SKP_02.Transparency = 1
local SKP_03 = SKP_02:GetMass()
local SKP_04 = Instance.new('BodyForce', SKP_02)
SKP_04.Force = Vector3.new(0,SKP_03 * (196.2) - SKP_arg5 * (196.2), 0)
SKP_02.Velocity = SKP_arg7 * SKP_arg6
local SKP_05 = Instance.new('Attachment', SKP_02)
SKP_05.Position = Vector3.new(0.1, 0, 0)
local SKP_06 = Instance.new('Attachment', SKP_02)
SKP_06.Position = Vector3.new(-0.1, 0, 0)
if SKP_arg4 then
local SKP_07 = Instance.new('Trail', SKP_02)
SKP_07.Attachment0 = SKP_05
SKP_07.Attachment1 = SKP_06
SKP_07.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0);
NumberSequenceKeypoint.new(1, 1);
}
)
SKP_07.WidthScale = NumberSequence.new({
NumberSequenceKeypoint.new(0, 2, 0);
NumberSequenceKeypoint.new(1, 0);
}
)
SKP_07.Texture = "rbxassetid://232918622"
SKP_07.TextureMode = Enum.TextureMode.Stretch
SKP_07.LightEmission = 1
SKP_07.Lifetime = 0.2
SKP_07.FaceCamera = true
SKP_07.Color = ColorSequence.new(SKP_arg8)
end
if SKP_arg10 then
local SKP_08 = Instance.new("BillboardGui", SKP_02)
SKP_08.Adornee = SKP_02
local SKP_09 = math.random(375, 475)/10
SKP_08.Size = UDim2.new(SKP_09, 0, SKP_09, 0)
SKP_08.LightInfluence = 0
local SKP_010 = Instance.new("ImageLabel", SKP_08)
SKP_010.BackgroundTransparency = 1
SKP_010.Size = UDim2.new(1, 0, 1, 0)
SKP_010.Position = UDim2.new(0, 0, 0, 0)
SKP_010.Image = "http://www.roblox.com/asset/?id=1047066405"
SKP_010.ImageColor3 = SKP_arg11
SKP_010.ImageTransparency = math.random(2, 5)/15
if SKP_02:FindFirstChild("BillboardGui") ~= nil then
SKP_02.BillboardGui.Enabled = true
end
end
local SKP_011 = {SKP_02,workspace.ACS_WorkSpace}
while true do
RS.Heartbeat:wait()
local SKP_012 = Ray.new(SKP_02.Position, SKP_02.CFrame.LookVector*25)
local SKP_013, SKP_014 = workspace:FindPartOnRayWithIgnoreList(SKP_012, SKP_011, false, true)
if SKP_013 then
game.Debris:AddItem(SKP_02,0)
break
end
end
game.Debris:AddItem(SKP_02,0)
return SKP_02
end
end)
Evt.ACS_AI.AIShoot.OnClientEvent:Connect(function(Gun)
for _, v in pairs(Gun.Muzzle:GetChildren()) do
if v.Name:sub(1, 7) == "FlashFX" or v.Name:sub(1, 7) == "Smoke" then
v.Enabled = true
end
end
delay(1 / 30, function()
for _, v in pairs(Gun.Muzzle:GetChildren()) do
if v.Name:sub(1, 7) == "FlashFX" or v.Name:sub(1, 7) == "Smoke" then
v.Enabled = false
end
end
end)
end)
|
------//Low Ready Animations |
self.RightLowReady = CFrame.new(-.9, 1.25, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftLowReady = CFrame.new(1,1,-0.6) * CFrame.Angles(math.rad(-45),math.rad(15),math.rad(-25));
self.RightElbowLowReady = CFrame.new(0,-0.45,-.25) * CFrame.Angles(math.rad(-80), math.rad(0), math.rad(0));
self.LeftElbowLowReady = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.RightWristLowReady = CFrame.new(0,0,0.15) * CFrame.Angles(math.rad(20), math.rad(0), math.rad(0));
self.LeftWristLowReady = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name
--// Be sure to update the console gui's code if you change stuff |
return function(data)
local gui = script.Parent.Parent
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local storedChats = client.Variables.StoredChats
local desc = gui.Desc
local nohide = data.KeepChat
local function Expand(ent, point)
ent.MouseLeave:connect(function(x,y)
point.Visible = false
end)
ent.MouseMoved:connect(function(x,y)
point.Text = ent.Desc.Value
point.Size = UDim2.new(0, 10000, 0, 10000)
local bounds = point.TextBounds.X
local rows = math.floor(bounds/500)
rows = rows+1
if rows<1 then rows = 1 end
local newx = 500
if bounds<500 then newx = bounds end
point.Visible = true
point.Size = UDim2.new(0, newx+10, 0, rows*20)
point.Position = UDim2.new(0, x, 0, y-40-(rows*20))
end)
end
local function UpdateChat()
if gui then
local globalTab = gui.Drag.Frame.Frame.Global
local teamTab = gui.Drag.Frame.Frame.Team
local localTab = gui.Drag.Frame.Frame.Local
local adminsTab = gui.Drag.Frame.Frame.Admins
local crossTab = gui.Drag.Frame.Frame.Cross
local entry = gui.Entry
local tester = gui.BoundTest
globalTab:ClearAllChildren()
teamTab:ClearAllChildren()
localTab:ClearAllChildren()
adminsTab:ClearAllChildren()
crossTab:ClearAllChildren()
local globalNum = 0
local teamNum = 0
local localNum = 0
local adminsNum = 0
local crossNum = 0
for i,v in pairs(storedChats) do
local clone = entry:Clone()
clone.Message.Text = service.MaxLen(v.Message,100)
clone.Desc.Value = v.Message
Expand(clone,desc)
if not string.match(v.Player, "%S") then
clone.Nameb.Text = v.Player
else
clone.Nameb.Text = "["..v.Player.."]: "
end
clone.Visible = true
clone.Nameb.Font = "SourceSansBold"
local color = v.Color or BrickColor.White()
clone.Nameb.TextColor3 = color.Color
tester.Text = "["..v.Player.."]: "
local naml = tester.TextBounds.X + 5
if naml>100 then naml = 100 end
tester.Text = v.Message
local mesl = tester.TextBounds.X
clone.Message.Position = UDim2.new(0,naml,0,0)
clone.Message.Size = UDim2.new(1,-(naml+10),1,0)
clone.Nameb.Size = UDim2.new(0,naml,0,20)
clone.Visible = false
clone.Parent = globalTab
local rows = math.floor((mesl+naml)/clone.AbsoluteSize.X)
rows = rows + 1
if rows<1 then rows = 1 end
if rows>3 then rows = 3 end
--rows = rows+1
clone.Parent = nil
clone.Visible = true
clone.Size = UDim2.new(1,0,0,rows*20)
if v.Private then
clone.Nameb.TextColor3 = Color3.new(150/255, 57/255, 176/255)
end
if v.Mode=="Global" then
clone.Position = UDim2.new(0,0,0,globalNum*20)
globalNum = globalNum + 1
if rows>1 then
globalNum = globalNum + rows-1
end
clone.Parent = globalTab
elseif v.Mode=="Team" then
clone.Position = UDim2.new(0,0,0,teamNum*20)
teamNum = teamNum + 1
if rows>1 then
teamNum = teamNum + rows-1
end
clone.Parent = teamTab
elseif v.Mode=="Local" then
clone.Position = UDim2.new(0,0,0,localNum*20)
localNum = localNum + 1
if rows>1 then
localNum = localNum + rows-1
end
clone.Parent = localTab
elseif v.Mode=="Admins" then
clone.Position = UDim2.new(0,0,0,adminsNum*20)
adminsNum = adminsNum + 1
if rows>1 then
adminsNum = adminsNum + rows-1
end
clone.Parent = adminsTab
elseif v.Mode=="Cross" then
clone.Position = UDim2.new(0,0,0,crossNum*20)
crossNum = crossNum + 1
if rows>1 then
crossNum = crossNum + rows-1
end
clone.Parent = crossTab
end
end
globalTab.CanvasSize = UDim2.new(0, 0, 0, ((globalNum)*20))
teamTab.CanvasSize = UDim2.new(0, 0, 0, ((teamNum)*20))
localTab.CanvasSize = UDim2.new(0, 0, 0, ((localNum)*20))
adminsTab.CanvasSize = UDim2.new(0, 0, 0, ((adminsNum)*20))
crossTab.CanvasSize = UDim2.new(0, 0, 0, ((crossNum)*20))
local glob = (((globalNum)*20) - globalTab.AbsoluteWindowSize.Y)
local tea = (((teamNum)*20) - teamTab.AbsoluteWindowSize.Y)
local loc = (((localNum)*20) - localTab.AbsoluteWindowSize.Y)
local adm = (((adminsNum)*20) - adminsTab.AbsoluteWindowSize.Y)
local cro = (((crossNum)*20) - crossTab.AbsoluteWindowSize.Y)
if glob<0 then glob=0 end
if tea<0 then tea=0 end
if loc<0 then loc=0 end
if adm<0 then adm=0 end
if cro<0 then cro=0 end
globalTab.CanvasPosition =Vector2.new(0,glob)
teamTab.CanvasPosition =Vector2.new(0,tea)
localTab.CanvasPosition = Vector2.new(0,loc)
adminsTab.CanvasPosition = Vector2.new(0,adm)
crossTab.CanvasPosition = Vector2.new(0,cro)
end
end
if not storedChats then
client.Variables.StoredChats = {}
storedChats = client.Variables.StoredChats
end
gTable:Ready()
local bubble = gui.Bubble
local toggle = gui.Toggle
local drag = gui.Drag
local frame = gui.Drag.Frame
local frame2 = gui.Drag.Frame.Frame
local box = gui.Drag.Frame.Chat
local globalTab = gui.Drag.Frame.Frame.Global
local teamTab = gui.Drag.Frame.Frame.Team
local localTab = gui.Drag.Frame.Frame.Local
local adminsTab = gui.Drag.Frame.Frame.Admins
local crossTab = gui.Drag.Frame.Frame.Cross
local global = gui.Drag.Frame.Global
local team = gui.Drag.Frame.Team
local localb = gui.Drag.Frame.Local
local admins = gui.Drag.Frame.Admins
local cross = gui.Drag.Frame.Cross
local ChatScript,ChatMain,Chatted = service.Player.PlayerScripts:FindFirstChild("ChatScript")
if ChatScript then
ChatMain = ChatScript:FindFirstChild("ChatMain")
if ChatMain then
Chatted = require(ChatMain).MessagePosted
end
end
if not nohide then
client.Variables.CustomChat = true
client.Variables.ChatEnabled = false
service.StarterGui:SetCoreGuiEnabled('Chat',false)
else
drag.Position = UDim2.new(0,10,1,-180)
end
local dragger = gui.Drag.Frame.Dragger
local fakeDrag = gui.Drag.Frame.FakeDragger
local boxFocused = false
local mode = "Global"
local lastChat = 0
local lastClick = 0
local isAdmin = client.Remote.Get("CheckAdmin")
if not isAdmin then
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
if client.UI.Get("HelpButton") then
toggle.Position = UDim2.new(1, -(45+45),1, -45)
end
local function openGlobal()
globalTab.Visible = true
teamTab.Visible = false
localTab.Visible = false
adminsTab.Visible = false
crossTab.Visible = false
global.Text = "Global"
mode = "Global"
global.BackgroundTransparency = 0
team.BackgroundTransparency = 0.5
localb.BackgroundTransparency = 0.5
if isAdmin then
admins.BackgroundTransparency = 0.5
admins.TextTransparency = 0
cross.BackgroundTransparency = 0.5
cross.TextTransparency = 0
else
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
end
local function openTeam()
globalTab.Visible = false
teamTab.Visible = true
localTab.Visible = false
adminsTab.Visible = false
crossTab.Visible = false
team.Text = "Team"
mode = "Team"
global.BackgroundTransparency = 0.5
team.BackgroundTransparency = 0
localb.BackgroundTransparency = 0.5
admins.BackgroundTransparency = 0.5
if isAdmin then
admins.BackgroundTransparency = 0.5
admins.TextTransparency = 0
cross.BackgroundTransparency = 0.5
cross.TextTransparency = 0
else
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
end
local function openLocal()
globalTab.Visible = false
teamTab.Visible = false
localTab.Visible = true
adminsTab.Visible = false
crossTab.Visible = false
localb.Text = "Local"
mode = "Local"
global.BackgroundTransparency = 0.5
team.BackgroundTransparency = 0.5
localb.BackgroundTransparency = 0
admins.BackgroundTransparency = 0.5
if isAdmin then
admins.BackgroundTransparency = 0.5
admins.TextTransparency = 0
cross.BackgroundTransparency = 0.5
cross.TextTransparency = 0
else
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
end
local function openAdmins()
globalTab.Visible = false
teamTab.Visible = false
localTab.Visible = false
adminsTab.Visible = true
crossTab.Visible = false
admins.Text = "Admins"
mode = "Admins"
global.BackgroundTransparency = 0.5
team.BackgroundTransparency = 0.5
localb.BackgroundTransparency = 0.5
if isAdmin then
admins.BackgroundTransparency = 0
admins.TextTransparency = 0
cross.BackgroundTransparency = 0.5
cross.TextTransparency = 0
else
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
end
local function openCross()
globalTab.Visible = false
teamTab.Visible = false
localTab.Visible = false
adminsTab.Visible = false
crossTab.Visible = true
cross.Text = "Cross"
mode = "Cross"
global.BackgroundTransparency = 0.5
team.BackgroundTransparency = 0.5
localb.BackgroundTransparency = 0.5
if isAdmin then
admins.BackgroundTransparency = 0.5
admins.TextTransparency = 0
cross.BackgroundTransparency = 0
cross.TextTransparency = 0
else
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
end
local function fadeIn()
--[[
frame.BackgroundTransparency = 0.5
frame2.BackgroundTransparency = 0.5
box.BackgroundTransparency = 0.5
for i=0.1,0.5,0.1 do
--wait(0.1)
frame.BackgroundTransparency = 0.5-i
frame2.BackgroundTransparency = 0.5-i
box.BackgroundTransparency = 0.5-i
end-- Disabled ]]
frame.BackgroundTransparency = 0
frame2.BackgroundTransparency = 0
box.BackgroundTransparency = 0
fakeDrag.Visible = true
end
local function fadeOut()
--[[
frame.BackgroundTransparency = 0
frame2.BackgroundTransparency = 0
box.BackgroundTransparency = 0
for i=0.1,0.5,0.1 do
--wait(0.1)
frame.BackgroundTransparency = i
frame2.BackgroundTransparency = i
box.BackgroundTransparency = i
end-- Disabled ]]
frame.BackgroundTransparency = 0.7
frame2.BackgroundTransparency = 1
box.BackgroundTransparency = 1
fakeDrag.Visible = false
end
fadeOut()
frame.MouseEnter:connect(function()
fadeIn()
end)
frame.MouseLeave:connect(function()
if not boxFocused then
fadeOut()
end
end)
toggle.MouseButton1Click:connect(function()
if drag.Visible then
drag.Visible = false
toggle.Image = "rbxassetid://417301749"--417285299"
else
drag.Visible = true
toggle.Image = "rbxassetid://417301773"--417285351"
end
end)
global.MouseButton1Click:connect(function()
openGlobal()
end)
team.MouseButton1Click:connect(function()
openTeam()
end)
localb.MouseButton1Click:connect(function()
openLocal()
end)
admins.MouseButton1Click:connect(function()
if isAdmin or tick() - lastClick>5 then
isAdmin = client.Remote.Get("CheckAdmin")
if isAdmin then
openAdmins()
else
admins.BackgroundTransparency = 0.8
admins.TextTransparency = 0.8
end
lastClick = tick()
end
end)
cross.MouseButton1Click:connect(function()
if isAdmin or tick() - lastClick>5 then
isAdmin = client.Remote.Get("CheckAdmin")
if isAdmin then
openCross()
else
cross.BackgroundTransparency = 0.8
cross.TextTransparency = 0.8
end
lastClick = tick()
end
end)
box.FocusLost:connect(function(enterPressed)
boxFocused = false
if enterPressed and not client.Variables.Muted then
if box.Text~='' and ((mode~="Cross" and tick()-lastChat>=0.5) or (mode=="Cross" and tick()-lastChat>=10)) then
if not client.Variables.Muted then
client.Remote.Send('ProcessCustomChat',box.Text,mode)
lastChat = tick()
if Chatted then
--Chatted:fire(box.Text)
end
end
elseif not ((mode~="Cross" and tick()-lastChat>=0.5) or (mode=="Cross" and tick()-lastChat>=10)) then
local tim
if mode == "Cross" then
tim = 10-(tick()-lastChat)
else
tim = 0.5-(tick()-lastChat)
end
tim = string.sub(tostring(tim),1,3)
client.Functions.SendToChat("SpamBot","Sending too fast! Please wait "..tostring(tim).." seconds.","System")
end
box.Text = "Click here or press the '/' key to chat"
fadeOut()
if mode ~= "Cross" then
lastChat = tick()
end
end
end)
box.Focused:connect(function()
boxFocused = true
if box.Text=="Click here or press the '/' key to chat" then
box.Text = ''
end
fadeIn()
end)
if not nohide then
service.UserInputService.InputBegan:connect(function(InputObject)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and InputObject.UserInputType==Enum.UserInputType.Keyboard and InputObject.KeyCode == Enum.KeyCode.Slash then
if box.Text=="Click here or press the '/' key to chat" then box.Text='' end
service.RunService.RenderStepped:Wait()
box:CaptureFocus()
end
end)
end
local mouse=service.Players.LocalPlayer:GetMouse()
local nx,ny=drag.AbsoluteSize.X,frame.AbsoluteSize.Y--450,200
local dragging=false
local defx,defy=nx,ny
mouse.Move:connect(function(x,y)
if dragging then
nx=defx+(dragger.Position.X.Offset+20)
ny=defy+(dragger.Position.Y.Offset+20)
if nx<260 then nx=260 end
if ny<100 then ny=100 end
frame.Size=UDim2.new(1, 0, 0, ny)
drag.Size=UDim2.new(0, nx, 0, 30)
end
end)
dragger.DragBegin:connect(function(init)
dragging=true
end)
dragger.DragStopped:connect(function(x,y)
dragging=false
defx=nx
defy=ny
dragger.Position=UDim2.new(1,-20,1,-20)
UpdateChat()
end)
UpdateChat()
--[[
if not service.UserInputService.KeyboardEnabled then
warn("User is on mobile :: CustomChat Disabled")
chatenabled = true
drag.Visible = false
service.StarterGui:SetCoreGuiEnabled('Chat',true)
end
--]]
client.Functions.RemoveCustomChat = function()
local chat=gui
if chat then chat:Destroy() client.Variables.ChatEnabled = true service.StarterGui:SetCoreGuiEnabled('Chat',true) end
end
client.Functions.SendToChat = function(plr,message,mode)
if not message then return end
if string.sub(message,1,2)=='/e' then return end
if gui then
local globalTab = gui.Drag.Frame.Frame.Global
local teamTab = gui.Drag.Frame.Frame.Team
local localTab = gui.Drag.Frame.Frame.Local
local adminsTab = gui.Drag.Frame.Frame.Admins
local global = gui.Drag.Frame.Global
local team = gui.Drag.Frame.Team
local localb = gui.Drag.Frame.Local
local admins = gui.Drag.Frame.Admins
local entry = gui.Entry
local bubble = gui.Bubble
local tester = gui.BoundTest
local num = 0
local player
if plr and type(plr) == "userdata" then
player = plr
else
player = {Name = tostring(plr or "System"), TeamColor = BrickColor.White()}
end
if #message>150 then message = string.sub(message,1,150).."..." end
if mode then
if mode=="Private" or mode=="System" then
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Global",Private=true})
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Team",Private=true})
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Local",Private=true})
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Admins",Private=true})
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Cross",Private=true})
else
local plr = player.Name
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=plr,Message=message,Mode=mode})
end
else
local plr = player.Name
table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=plr,Message=message,Mode="Global"})
end
if mode=="Local" then
if not localTab.Visible then
localb.Text = "Local*"
end
elseif mode=="Team" then
if not teamTab.Visible then
team.Text = "Team*"
end
elseif mode=="Admins" then
if not adminsTab.Visible then
admins.Text = "Admins*"
end
elseif mode=="Cross" then
if not crossTab.Visible then
cross.Text = "Cross*"
end
else
if not globalTab.Visible then
global.Text = "Global*"
end
end
if #storedChats>=50 then
table.remove(storedChats,1)
end
UpdateChat()
if not nohide then
if player and type(player)=="userdata" then
local char = player.Character
local head = char:FindFirstChild("Head")
if head then
local cont = service.LocalContainer():FindFirstChild(player.Name.."Bubbles")
if not cont then
cont = Instance.new("BillboardGui",service.LocalContainer())
cont.Name = player.Name.."Bubbles"
cont.StudsOffset = Vector3.new(0,2,0)
cont.SizeOffset = Vector2.new(0,0.5)
cont.Size = UDim2.new(0,200,0,150)
end
cont.Adornee = head
local clone = bubble:Clone()
clone.TextLabel.Text = message
clone.Parent = cont
local xsize = clone.TextLabel.TextBounds.X+40
if xsize>400 then xsize=400 end
clone.Size = UDim2.new(0,xsize,0,50)
if #cont:children()>3 then
cont:children()[1]:Destroy()
end
for i,v in pairs(cont:children()) do
local xsize = v.TextLabel.TextBounds.X+40
if xsize>400 then xsize=400 end
v.Position = UDim2.new(0.5,-xsize/2,1,-(math.abs((i-1)-#cont:children())*50))
end
local cam = service.Workspace.CurrentCamera
local char = player.Character
local head = char:FindFirstChild("Head")
local label = clone.TextLabel
Routine(function()
repeat
if not head then break end
local dist = (head.Position - cam.CoordinateFrame.p).magnitude
if dist <= 50 then
clone.Visible = true
else
clone.Visible = false
end
wait(0.1)
until not clone.Parent or not clone or not head or not head.Parent or not char
end)
wait(10)
if clone then clone:Destroy() end
end
end
end
end
end
local textbox = service.UserInputService:GetFocusedTextBox()
if textbox then
textbox:ReleaseFocus()
end
end
|
-- Connect 'Blocked' event to the 'onPathBlocked' function |
path.Blocked:Connect(onPathBlocked)
|
--CONFIG VARIABLES |
local tweenTime = 20
local closeWaitTime = 3
local easingStyle = Enum.EasingStyle.Quad
local easingDirection = Enum.EasingDirection.InOut
local repeats = 0
local reverse = false
local delayTime = 0 |
--- Update the text entry label |
function Window:UpdateLabel()
Entry.TextLabel.Text = `{Player.Name}@{self.Cmdr.PlaceName}$`
end
|
-- connect events |
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
|
--[[
Knit.CreateService(service): Service
Knit.AddServices(folder): Service[]
Knit.AddServicesDeep(folder): Service[]
Knit.Start(): Promise<void>
Knit.OnStart(): Promise<void>
--]] |
local KnitServer = {}
KnitServer.Version = script.Parent.Version.Value
KnitServer.Services = {}
KnitServer.Util = script.Parent.Util
local knitRepServiceFolder = Instance.new("Folder")
knitRepServiceFolder.Name = "Services"
local Promise = require(KnitServer.Util.Promise)
local Signal = require(KnitServer.Util.Signal)
local Loader = require(KnitServer.Util.Loader)
local Ser = require(KnitServer.Util.Ser)
local RemoteSignal = require(KnitServer.Util.Remote.RemoteSignal)
local RemoteProperty = require(KnitServer.Util.Remote.RemoteProperty)
local TableUtil = require(KnitServer.Util.TableUtil)
local started = false
local startedComplete = false
local onStartedComplete = Instance.new("BindableEvent")
local function CreateRepFolder(serviceName)
local folder = Instance.new("Folder")
folder.Name = serviceName
return folder
end
local function GetFolderOrCreate(parent, name)
local f = parent:FindFirstChild(name)
if (not f) then
f = Instance.new("Folder")
f.Name = name
f.Parent = parent
end
return f
end
local function AddToRepFolder(service, remoteObj, folderOverride)
if (folderOverride) then
remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, folderOverride)
elseif (remoteObj:IsA("RemoteFunction")) then
remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, "RF")
elseif (remoteObj:IsA("RemoteEvent")) then
remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, "RE")
elseif (remoteObj:IsA("ValueBase")) then
remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, "RP")
else
error("Invalid rep object: " .. remoteObj.ClassName)
end
if (not service._knit_rep_folder.Parent) then
service._knit_rep_folder.Parent = knitRepServiceFolder
end
end
function KnitServer.IsService(object)
return type(object) == "table" and object._knit_is_service == true
end
function KnitServer.CreateService(service)
assert(type(service) == "table", "Service must be a table; got " .. type(service))
assert(type(service.Name) == "string", "Service.Name must be a string; got " .. type(service.Name))
assert(#service.Name > 0, "Service.Name must be a non-empty string")
assert(KnitServer.Services[service.Name] == nil, "Service \"" .. service.Name .. "\" already exists")
service = TableUtil.Assign(service, {
_knit_is_service = true;
_knit_rf = {};
_knit_re = {};
_knit_rp = {};
_knit_rep_folder = CreateRepFolder(service.Name);
})
if (type(service.Client) ~= "table") then
service.Client = {Server = service}
else
if (service.Client.Server ~= service) then
service.Client.Server = service
end
end
KnitServer.Services[service.Name] = service
return service
end
function KnitServer.AddServices(folder)
return Loader.LoadChildren(folder)
end
function KnitServer.AddServicesDeep(folder)
return Loader.LoadDescendants(folder)
end
function KnitServer.GetService(serviceName)
assert(type(serviceName) == "string", "ServiceName must be a string; got " .. type(serviceName))
return assert(KnitServer.Services[serviceName], "Could not find service \"" .. serviceName .. "\"")
end
function KnitServer.BindRemoteEvent(service, eventName, remoteEvent)
assert(service._knit_re[eventName] == nil, "RemoteEvent \"" .. eventName .. "\" already exists")
local re = remoteEvent._remote
re.Name = eventName
service._knit_re[eventName] = re
AddToRepFolder(service, re)
end
function KnitServer.BindRemoteFunction(service, funcName, func)
assert(service._knit_rf[funcName] == nil, "RemoteFunction \"" .. funcName .. "\" already exists")
local rf = Instance.new("RemoteFunction")
rf.Name = funcName
service._knit_rf[funcName] = rf
AddToRepFolder(service, rf)
function rf.OnServerInvoke(...)
return Ser.SerializeArgsAndUnpack(func(service.Client, Ser.DeserializeArgsAndUnpack(...)))
end
end
function KnitServer.BindRemoteProperty(service, propName, prop)
assert(service._knit_rp[propName] == nil, "RemoteProperty \"" .. propName .. "\" already exists")
prop._object.Name = propName
service._knit_rp[propName] = prop
AddToRepFolder(service, prop._object, "RP")
end
function KnitServer.Start()
if (started) then
return Promise.Reject("Knit already started")
end
started = true
local services = KnitServer.Services
return Promise.new(function(resolve)
-- Bind remotes:
for _,service in pairs(services) do
for k,v in pairs(service.Client) do
if (type(v) == "function") then
KnitServer.BindRemoteFunction(service, k, v)
elseif (RemoteSignal.Is(v)) then
KnitServer.BindRemoteEvent(service, k, v)
elseif (RemoteProperty.Is(v)) then
KnitServer.BindRemoteProperty(service, k, v)
elseif (Signal.Is(v)) then
warn("Found Signal instead of RemoteSignal (Knit.Util.RemoteSignal). Please change to RemoteSignal. [" .. service.Name .. ".Client." .. k .. "]")
end
end
end
-- Init:
local promisesInitServices = {}
for _,service in pairs(services) do
if (type(service.KnitInit) == "function") then
table.insert(promisesInitServices, Promise.new(function(r)
service:KnitInit()
r()
end))
end
end
resolve(Promise.All(promisesInitServices))
end):Then(function()
-- Start:
for _,service in pairs(services) do
if (type(service.KnitStart) == "function") then
task.spawn(service.KnitStart, service)
end
end
startedComplete = true
onStartedComplete:Fire()
task.defer(function()
onStartedComplete:Destroy()
end)
-- Expose service remotes to everyone:
knitRepServiceFolder.Parent = script.Parent
end)
end
function KnitServer.OnStart()
if (startedComplete) then
return Promise.Resolve()
else
return Promise.FromEvent(onStartedComplete.Event)
end
end
return KnitServer
|
--Weld stuff here |
MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(misc.Wheel.Parts,misc.Wheel.W)
MakeWeld(misc.Popups.Hinge, car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.Parts, misc.Popups.Hinge)
|
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
function updatechar()
for _, v in pairs(character:GetChildren())do
if CanViewBody then
if v.Name == 'Head' then
v.LocalTransparencyModifier = 1
v.CanCollide = false
v.face.LocalTransparencyModifier = 1
end
else
if v:IsA'Part' or v:IsA'UnionOperation' or v:IsA'MeshPart' then
v.LocalTransparencyModifier = 1
v.CanCollide = false
end
end
if v:IsA'Accessory' then
v:FindFirstChild('Handle').LocalTransparencyModifier = 1
v:FindFirstChild('Handle').CanCollide = false
end
if v:IsA'Hat' then
v:FindFirstChild('Handle').LocalTransparencyModifier = 1
v:FindFirstChild('Handle').CanCollide = false
end
end
end
|
--Don't modify this script unless you really know what you're doing. |
local WaitFor = (function(parent, child_name)
local found = parent:FindFirstChild(child_name)
while found == nil do
parent.ChildAdded:wait()
found = parent:FindFirstChild(child_name)
if found then break end
end
return found
end)
local last = { neckC1 = nil, rshoC0 = nil, lshoC0 = nil, rhipC0 = nil, lhipC0 = nil }
local ApplyModifications = (function(weld, char)
local torso = WaitFor(char, "Torso")
local neck = WaitFor(torso, "Neck")
local rsho = WaitFor(torso, "Right Shoulder")
local lsho = WaitFor(torso, "Left Shoulder")
local rhip = WaitFor(torso, "Right Hip")
local lhip = WaitFor(torso, "Left Hip")
local config = script.Parent.Configuration
local head_ang = config["Head Angle"].Value
local legs_ang = config["Legs Angle"].Value
local arms_ang = config["Arms Angle"].Value
local sit_ang = config["Sitting Angle"].Value
local sit_pos = config["Sitting Position"].Value
--First adjust sitting position and angle
--Add 90 to the angle because that's what most people will be expecting.
weld.C1 = weld.C1 * CFrame.fromEulerAnglesXYZ(math.rad((sit_ang) + 90), 0, 0)
weld.C0 = CFrame.new(sit_pos)
last.neckC1 = neck.C1
last.rshoC0 = rsho.C0
last.lshoC0 = lsho.C0
last.rhipC0 = rhip.C0
last.lhipC0 = lhip.C0
--Now adjust the neck angle.
neck.C1 = neck.C1 * CFrame.fromEulerAnglesXYZ(math.rad(head_ang), 0, 0)
--Now adjust the arms angle.
rsho.C0 = rsho.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(arms_ang))
lsho.C0 = lsho.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(-arms_ang))
--Now the legs
rhip.C0 = rhip.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(legs_ang))
lhip.C0 = lhip.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(-legs_ang))
end)
local RevertModifications = (function(weld, char)
--Any modifications done in ApplyModifications have to be reverted here if they
--change any welds - otherwise people will wonder why their head is pointing the wrong way.
local torso = WaitFor(char, "Torso")
local neck = WaitFor(torso, "Neck")
local rsho = WaitFor(torso, "Right Shoulder")
local lsho = WaitFor(torso, "Left Shoulder")
local rhip = WaitFor(torso, "Right Hip")
local lhip = WaitFor(torso, "Left Hip")
--Now adjust the neck angle.
neck.C1 = last.neckC1 or CFrame.new()
rsho.C0 = last.rshoC0 or CFrame.new()
lsho.C0 = last.lshoC0 or CFrame.new()
rhip.C0 = last.rhipC0 or CFrame.new()
lhip.C0 = last.lhipC0 or CFrame.new()
weld:Destroy()
end)
script.Parent.ChildAdded:connect(function(c)
if c:IsA("Weld") then
local character = nil
if c.Part1 ~= nil and c.Part1.Parent ~= nil and c.Part1.Parent:FindFirstChild("Humanoid") ~= nil then
character = c.Part1.Parent
else return end
ApplyModifications(c, character)
end
end)
script.Parent.ChildRemoved:connect(function(c)
if c:IsA("Weld") then
local character = nil
if c.Part1 ~= nil and c.Part1.Parent ~= nil and c.Part1.Parent:FindFirstChild("Humanoid") ~= nil then
character = c.Part1.Parent
else return end
RevertModifications(c, character)
end
end)
|
---[[ Fade Out and In Settings ]] |
module.ChatWindowBackgroundFadeOutTime = 3.5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 30 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 20.0
|
--Turbo Gauge GUI-- |
local fix = 0
function Gauge()
script.Parent.BAnalog.Visible = BoostGaugeVisible
script.Parent.Background.Visible = BoostGaugeVisible
script.Parent.DontTouch.Visible = BoostGaugeVisible
script.Parent.Num.Visible = BoostGaugeVisible
local turbo = ((totalPSI/2)*WasteGatePressure)
local turbo2 = WasteGatePressure
fix = -turbo2 + turbo*2
script.Parent.BAnalog.Rotation= 110 + (totalPSI/2)*220
script.Parent.Num.N1.TextLabel.Text = (math.floor(WasteGatePressure*(4/4)))*TurboCount
script.Parent.Num.N2.TextLabel.Text = (math.floor(WasteGatePressure*(3/4)))*TurboCount
script.Parent.Num.N3.TextLabel.Text = (math.floor(WasteGatePressure*(2/4)))*TurboCount
script.Parent.Num.N4.TextLabel.Text = (math.floor(WasteGatePressure*(1/4)))*TurboCount
script.Parent.Num.N5.TextLabel.Text = 0
script.Parent.Num.N6.TextLabel.Text = -5
end
|
--[[Wheel Stabilizer Gyro]] |
Tune.FGyroDamp = 100 -- Front Wheel Non-Axial Dampening
Tune.RGyroDamp = 100 -- Rear Wheel Non-Axial Dampening
|
-- Number of lines used to draw axis circles |
ArcHandles.CircleSlices = 60
function ArcHandles.new(Options)
local self = setmetatable({}, ArcHandles)
-- Create maid for cleanup on destroyal
self.Maid = Maid.new()
-- Create UI container
local Gui = Instance.new('ScreenGui')
self.Gui = Gui
Gui.Name = 'BTArcHandles'
Gui.IgnoreGuiInset = true
self.Maid.Gui = Gui
-- Create interface
self.IsMouseAvailable = UserInputService.MouseEnabled
self:CreateCircles()
self:CreateHandles(Options)
-- Get camera and viewport information
self.Camera = Workspace.CurrentCamera
self.GuiInset = GuiService:GetGuiInset()
-- Get list of ignorable handle obstacles
self.ObstacleBlacklistIndex = Support.FlipTable(Options.ObstacleBlacklist or {})
self.ObstacleBlacklist = Support.Keys(self.ObstacleBlacklistIndex)
-- Enable handles
self:SetAdornee(Options.Adornee)
self.Gui.Parent = Options.Parent
-- Return new handles
return self
end
function ArcHandles:CreateCircles()
-- Create folder to contain circles
local CircleFolder = Instance.new('Folder')
CircleFolder.Name = 'AxisCircles'
CircleFolder.Parent = self.Gui
local Circles = {}
self.AxisCircles = Circles
-- Determine angle for each circle slice
local CircleSliceAngle = 2 * math.pi / self.CircleSlices
-- Set up each axis
for _, Axis in ipairs(Enum.Axis:GetEnumItems()) do
local AxisColor = self.AxisColors[Axis.Name]
-- Create container for circle
local Circle = Instance.new('Folder', CircleFolder)
Circle.Name = Axis.Name
local Lines = {}
Circles[Axis.Name] = Lines
-- Create lines for circle
for i = 1, self.CircleSlices do
local Line = Instance.new 'CylinderHandleAdornment'
Line.Transparency = 0.4
Line.Color3 = AxisColor
Line.Radius = 0
Line.Height = 0
Line.Parent = Circle
Lines[i] = Line
end
end
end
function ArcHandles:CreateHandles(Options)
-- Create folder to contain handles
local HandlesFolder = Instance.new('Folder')
HandlesFolder.Name = 'Handles'
HandlesFolder.Parent = self.Gui
self.Handles = {}
self.HandleStates = {}
-- Generate a handle for each side
for _, Side in ipairs(Enum.NormalId:GetEnumItems()) do
-- Get axis information
local Axis = self.SideToAxis[Side.Name]
local AxisColor = self.AxisColors[Axis]
-- Create handle
local Handle = Instance.new('ImageButton')
Handle.Name = Side.Name
Handle.Image = 'rbxassetid://2347145012'
Handle.ImageColor3 = AxisColor
Handle.ImageTransparency = 0.33
Handle.AnchorPoint = Vector2.new(0.5, 0.5)
Handle.BackgroundTransparency = 1
Handle.BorderSizePixel = 0
Handle.ZIndex = 1
-- Create handle dot
local HandleDot = Handle:Clone()
HandleDot.Active = false
HandleDot.Size = UDim2.new(0, 4, 0, 4)
HandleDot.Position = UDim2.new(0.5, 0, 0.5, 0)
HandleDot.Parent = Handle
HandleDot.ZIndex = 0
-- Create maid for handle cleanup
local HandleMaid = Maid.new()
self.Maid[Side.Name] = HandleMaid
-- Add handle hover effect
HandleMaid.HoverStart = Handle.MouseEnter:Connect(function ()
Handle.ImageTransparency = 0
self:SetCircleTransparency(Axis, 0)
end)
HandleMaid.HoverEnd = Handle.MouseLeave:Connect(function ()
Handle.ImageTransparency = 0.33
self:SetCircleTransparency(Axis, 0.4)
end)
-- Listen for handle interactions on click
HandleMaid.DragStart = Handle.MouseButton1Down:Connect(function (X, Y)
local InitialHandlePlane = self.HandleStates[Handle].PlaneNormal
local InitialHandleCFrame = self.HandleStates[Handle].HandleCFrame
local InitialAdorneeCFrame = self.HandleStates[Handle].AdorneeCFrame
-- Calculate aim offset
local AimRay = self.Camera:ViewportPointToRay(X, Y)
local AimDistance = (InitialHandleCFrame.p - AimRay.Origin):Dot(InitialHandlePlane) / AimRay.Direction:Dot(InitialHandlePlane)
local AimWorldPoint = (AimDistance * AimRay.Direction) + AimRay.Origin
local InitialDragOffset = InitialAdorneeCFrame:PointToObjectSpace(AimWorldPoint)
-- Run callback
if Options.OnDragStart then
Options.OnDragStart()
end
local function ProcessDragChange(AimScreenPoint)
-- Calculate current aim
local AimRay = self.Camera:ScreenPointToRay(AimScreenPoint.X, AimScreenPoint.Y)
local AimDistance = (InitialHandleCFrame.p - AimRay.Origin):Dot(InitialHandlePlane) / AimRay.Direction:Dot(InitialHandlePlane)
local AimWorldPoint = (AimDistance * AimRay.Direction) + AimRay.Origin
local CurrentDragOffset = InitialAdorneeCFrame:PointToObjectSpace(AimWorldPoint)
-- Calculate angle on dragged axis
local DragAngle
if Axis == 'X' then
local InitialAngle = math.atan2(InitialDragOffset.Y, -InitialDragOffset.Z)
DragAngle = math.atan2(CurrentDragOffset.Y, -CurrentDragOffset.Z) - InitialAngle
elseif Axis == 'Y' then
local InitialAngle = math.atan2(InitialDragOffset.X, InitialDragOffset.Z)
DragAngle = math.atan2(CurrentDragOffset.X, CurrentDragOffset.Z) - InitialAngle
elseif Axis == 'Z' then
local InitialAngle = math.atan2(InitialDragOffset.X, InitialDragOffset.Y)
DragAngle = math.atan2(-CurrentDragOffset.X, CurrentDragOffset.Y) - InitialAngle
end
-- Run drag callback
if Options.OnDrag then
Options.OnDrag(Axis, DragAngle)
end
end
-- Create maid for dragging cleanup
local DragMaid = Maid.new()
HandleMaid.Dragging = DragMaid
-- Perform dragging when aiming anywhere (except handle)
DragMaid.Drag = Support.AddUserInputListener('Changed', {'MouseMovement', 'Touch'}, true, function (Input)
ProcessDragChange(Input.Position)
end)
-- Perform dragging while aiming at handle
DragMaid.InHandleDrag = Handle.MouseMoved:Connect(function (X, Y)
local AimScreenPoint = Vector2.new(X, Y) - self.GuiInset
ProcessDragChange(AimScreenPoint)
end)
-- Finish dragging when input ends
DragMaid.DragEnd = Support.AddUserInputListener('Ended', {'MouseButton1', 'Touch'}, true, function (Input)
HandleMaid.Dragging = nil
end)
-- Fire callback when dragging ends
DragMaid.Callback = function ()
coroutine.wrap(Options.OnDragEnd)()
end
end)
-- Finish dragging when input ends while aiming at handle
HandleMaid.InHandleDragEnd = Handle.MouseButton1Up:Connect(function ()
HandleMaid.Dragging = nil
end)
-- Save handle
Handle.Parent = HandlesFolder
self.Handles[Side.Name] = Handle
end
end
function ArcHandles:Hide()
-- Make sure handles are enabled
if not self.Running then
return self
end
-- Pause updating
self:Pause()
-- Hide UI
self.Gui.Enabled = false
end
function ArcHandles:Pause()
self.Running = false
end
local function IsFirstPerson(Camera)
return (Camera.CFrame.p - Camera.Focus.p).magnitude <= 0.6
end
function ArcHandles:Resume()
-- Make sure handles are disabled
if self.Running then
return self
end
-- Allow handles to run
self.Running = true
-- Update each handle
for Side, Handle in pairs(self.Handles) do
coroutine.wrap(function ()
while self.Running do
self:UpdateHandle(Side, Handle)
RunService.RenderStepped:Wait()
end
end)()
end
-- Update each axis circle
for Axis, Lines in pairs(self.AxisCircles) do
coroutine.wrap(function ()
while self.Running do
self:UpdateCircle(Axis, Lines)
RunService.RenderStepped:Wait()
end
end)()
end
-- Ignore character whenever character enters first person
if Players.LocalPlayer then
coroutine.wrap(function ()
while self.Running do
local FirstPerson = IsFirstPerson(self.Camera)
local Character = Players.LocalPlayer.Character
if Character then
self.ObstacleBlacklistIndex[Character] = FirstPerson and true or nil
self.ObstacleBlacklist = Support.Keys(self.ObstacleBlacklistIndex)
end
wait(0.2)
end
end)()
end
-- Show UI
self.Gui.Enabled = true
end
function ArcHandles:SetAdornee(Item)
-- Return self for chaining
-- Save new adornee
self.Adornee = Item
self.IsAdorneeModel = Item and (Item:IsA 'Model') or nil
-- Attach axis circles to adornee
for Axis, Lines in pairs(self.AxisCircles) do
for _, Line in ipairs(Lines) do
Line.Adornee = Item
end
end
-- Resume handles
if Item then
self:Resume()
else
self:Hide()
end
-- Return handles for chaining
return self
end
function ArcHandles:SetCircleTransparency(Axis, Transparency)
for _, Line in ipairs(self.AxisCircles[Axis]) do
Line.Transparency = Transparency
end
end
local function WorldToViewportPoint(Camera, Position)
-- Get viewport position for point
local ViewportPoint, Visible = Camera:WorldToViewportPoint(Position)
local CameraDepth = ViewportPoint.Z
ViewportPoint = Vector2.new(ViewportPoint.X, ViewportPoint.Y)
-- Adjust position if point is behind camera
if CameraDepth < 0 then
ViewportPoint = Camera.ViewportSize - ViewportPoint
end
-- Return point and visibility
return ViewportPoint, CameraDepth, Visible
end
function ArcHandles:BlacklistObstacle(Obstacle)
if Obstacle then
self.ObstacleBlacklistIndex[Obstacle] = true
self.ObstacleBlacklist = Support.Keys(self.ObstacleBlacklistIndex)
end
end
function ArcHandles:UpdateHandle(Side, Handle)
local Camera = self.Camera
-- Hide handles if not attached to an adornee
if not self.Adornee then
Handle.Visible = false
return
end
-- Get adornee CFrame and size
local AdorneeCFrame = self.IsAdorneeModel and
self.Adornee:GetModelCFrame() or
self.Adornee.CFrame
local AdorneeSize = self.IsAdorneeModel and
self.Adornee:GetModelSize() or
self.Adornee.Size
-- Calculate radius of adornee extents
local ViewportPoint, CameraDepth, Visible = WorldToViewportPoint(Camera, AdorneeCFrame.p)
local StudWidth = 2 * math.tan(math.rad(Camera.FieldOfView) / 2) * CameraDepth
local StudsPerPixel = StudWidth / Camera.ViewportSize.X
local HandlePadding = math.max(1, StudsPerPixel * 14) * (self.IsMouseAvailable and 1 or 1.6)
local AdorneeRadius = AdorneeSize.magnitude / 2
local Radius = AdorneeRadius + 2 * HandlePadding
-- Calculate CFrame of the handle's side
local SideUnitVector = Vector3.FromNormalId(Side)
local HandleCFrame = AdorneeCFrame * CFrame.new(Radius * SideUnitVector)
local AxisCFrame = AdorneeCFrame * Vector3.FromAxis(self.SideToAxis[Side])
local HandleNormal = (AxisCFrame - AdorneeCFrame.p).unit
-- Get viewport position of adornee and the side the handle will be on
local HandleViewportPoint, HandleCameraDepth, HandleVisible = WorldToViewportPoint(Camera, HandleCFrame.p)
-- Display handle if side is visible to the camera
Handle.Visible = HandleVisible
-- Calculate handle size (12 px, or at least 0.5 studs)
local StudWidth = 2 * math.tan(math.rad(Camera.FieldOfView) / 2) * HandleCameraDepth
local PixelsPerStud = Camera.ViewportSize.X / StudWidth
local HandleSize = math.max(12, 0.5 * PixelsPerStud) * (self.IsMouseAvailable and 1 or 1.6)
Handle.Size = UDim2.new(0, HandleSize, 0, HandleSize)
-- Calculate where handles will appear on the screen
Handle.Position = UDim2.new(
0, HandleViewportPoint.X,
0, HandleViewportPoint.Y
)
-- Save handle position
local HandleState = self.HandleStates[Handle] or {}
self.HandleStates[Handle] = HandleState
HandleState.HandleCFrame = HandleCFrame
HandleState.PlaneNormal = HandleNormal
HandleState.AdorneeCFrame = AdorneeCFrame
-- Hide handles if obscured by a non-blacklisted part
local HandleRay = Camera:ViewportPointToRay(HandleViewportPoint.X, HandleViewportPoint.Y)
local TargetRay = Ray.new(HandleRay.Origin, HandleRay.Direction * (HandleCameraDepth - 0.25))
local Target, TargetPoint = Workspace:FindPartOnRayWithIgnoreList(TargetRay, self.ObstacleBlacklist)
if Target then
Handle.ImageTransparency = 1
elseif Handle.ImageTransparency == 1 then
Handle.ImageTransparency = 0.33
end
end
function ArcHandles:UpdateCircle(Axis, Lines)
local Camera = self.Camera
-- Get adornee CFrame and size
local AdorneeCFrame = self.IsAdorneeModel and
self.Adornee:GetModelCFrame() or
self.Adornee.CFrame
local AdorneeSize = self.IsAdorneeModel and
self.Adornee:GetModelSize() or
self.Adornee.Size
-- Get circle information
local AxisVector = Vector3.FromAxis(Axis)
local CircleVector = Vector3.FromNormalId(self.AxisToSide[Axis])
-- Determine circle radius
local ViewportPoint, CameraDepth, Visible = WorldToViewportPoint(Camera, AdorneeCFrame.p)
local StudWidth = 2 * math.tan(math.rad(Camera.FieldOfView) / 2) * CameraDepth
local StudsPerPixel = StudWidth / Camera.ViewportSize.X
local HandlePadding = math.max(1, StudsPerPixel * 14) * (self.IsMouseAvailable and 1 or 1.6)
local AdorneeRadius = AdorneeSize.magnitude / 2
local Radius = AdorneeRadius + 2 * HandlePadding
-- Determine angle of each circle slice
local Angle = 2 * math.pi / #Lines
-- Circle thickness (px)
local Thickness = 1.5
-- Redraw lines for circle
for i, Line in ipairs(Lines) do
-- Calculate arc's endpoints
local From = CFrame.fromAxisAngle(AxisVector, Angle * (i - 1)) *
(CircleVector * Radius)
local To = CFrame.fromAxisAngle(AxisVector, Angle * i) *
(CircleVector * Radius)
local Center = From:Lerp(To, 0.5)
-- Determine thickness of line (in studs)
local ViewportPoint, CameraDepth, Visible = WorldToViewportPoint(Camera, AdorneeCFrame * Center)
local StudWidth = 2 * math.tan(math.rad(Camera.FieldOfView) / 2) * CameraDepth
local StudsPerPixel = StudWidth / Camera.ViewportSize.X
Line.Radius = Thickness * StudsPerPixel / 2
-- Position line between the endpoints
Line.CFrame = CFrame.new(Center, To) *
CFrame.new(0, 0, Line.Radius / 2)
-- Make line span between endpoints
Line.Height = (To - From).magnitude
end
end
function ArcHandles:Destroy()
-- Pause updating
self.Running = nil
-- Clean up resources
self.Maid:Destroy()
end
return ArcHandles
|
--This local script will run only for the player whos character it is in. It's changes to the sounds will replicate as they are changes to the character.
-- util |
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
|
-- Small bug fix where the sound would start playing after the player joined |
player.CharacterAdded:Connect(function()
task.wait(1)
if currentSound.IsPlaying then
currentSound:Stop()
end
end)
|
--[=[
@param defaultFn () -> any
@return value: any
If the option holds a value, returns the value. Otherwise, returns the
result of the `defaultFn` function.
]=] |
function Option:UnwrapOrElse(defaultFn)
if self:IsSome() then
return self:Unwrap()
else
return defaultFn()
end
end
|
--[[ icon_controller:header
## Functions
#### setGameTheme
```lua
IconController.setGameTheme(theme)
```
Sets the default theme which is applied to all existing and future icons.
----
#### setDisplayOrder
```lua
IconController.setDisplayOrder(number)
```
Changes the DisplayOrder of the TopbarPlus ScreenGui to the given value.
----
#### setTopbarEnabled
```lua
IconController.setTopbarEnabled(bool)
```
When set to ``false``, hides all icons created with TopbarPlus. This can also be achieved by calling ``starterGui:SetCore("TopbarEnabled", false)``.
----
#### setGap
```lua
IconController.setGap(integer, alignment)
```
Defines the offset width (i.e. gap) between each icon for the given alignment, ``left``, ``mid``, ``right``, or all alignments if not specified.
----
#### setLeftOffset
```lua
IconController.setLeftOffset(integer)
```
Defines the offset from the left side of the screen to the nearest left-set icon.
----
#### setRightOffset
```lua
IconController.setRightOffset(integer)
```
Defines the offset from the right side of the screen to the nearest right-set icon.
----
#### updateTopbar
```lua
IconController.updateTopbar()
```
Determines how icons should be positioned on the topbar and moves them accordingly.
----
#### clearIconOnSpawn
```lua
IconController.clearIconOnSpawn(icon)
```
Calls destroy on the given icon when the player respawns. This is useful for scenarious where you wish to cleanup icons that are constructed within a Gui with ``ResetOnSpawn`` set to ``true``. For example:
```lua
-- Place at the bottom of your icon creator localscript
local icons = IconController.getIcons()
for _, icon in pairs(icons) do
IconController.clearIconOnSpawn(icon)
end
```
----
#### getIcons
```lua
local arrayOfIcons = IconController.getIcons()
```
Returns all icons as an array.
----
#### getIcon
```lua
local icon = IconController.getIcon(name)
```
Returns the icon with the given name (or ``false`` if not found). If multiple icons have the same name, then one will be returned randomly.
----
#### disableHealthbar
```lua
IconController.disableHealthbar(bool)
```
Hides the fake healthbar (if currently visible) and prevents it becoming visible again (which normally occurs when the player takes damage).
----
## Properties
#### mimicCoreGui
```lua
local bool = IconController.mimicCoreGui --[default: 'true']
```
Set to ``false`` to have the topbar persist even when ``game:GetService("StarterGui"):SetCore("TopbarEnabled", false)`` is called.
----
#### controllerModeEnabled
{read-only}
```lua
local bool = IconController.controllerModeEnabled
```
----
#### leftGap
{read-only}
```lua
local gapNumber = IconController.leftGap --[default: '12']
```
----
#### midGap
{read-only}
```lua
local gapNumber = IconController.midGap --[default: '12']
```
----
#### rightGap
{read-only}
```lua
local gapNumber = IconController.rightGap --[default: '12']
```
----
#### leftOffset
{read-only}
```lua
local offset = IconController.leftGap --[default: '0']
```
----
#### rightOffset
{read-only}
```lua
local offset = IconController.rightGap --[default: '0']
```
--]] | |
--[[
local base64 = Base64.new()
Example:
local myEncodedWord = base64:Encode("Hello")
print(myEncodedWord)
-- outputs: SGVsbG8=
print(base64:Decode(myEncodedWord))
-- outputs: Hello
--]] |
local Alphabet = {}
local Indexes = {}
for Index = 65, 90 do table.insert(Alphabet, Index) end -- A-Z
for Index = 97, 122 do table.insert(Alphabet, Index) end -- a-z
for Index = 48, 57 do table.insert(Alphabet, Index) end -- 0-9
table.insert(Alphabet, 43) -- +
table.insert(Alphabet, 47) -- /
for Index, Character in ipairs(Alphabet) do
Indexes[Character] = Index
end
local Base64 = {
ClassName = "Base64";
__tostring = function(self) return self.ClassName end;
}
Base64.__index = Base64
local bit32_rshift = bit32.rshift
local bit32_lshift = bit32.lshift
local bit32_band = bit32.band
function Base64.new()
return setmetatable({}, Base64)
end
|
-- services |
local Rep = game:GetService("ReplicatedStorage")
local Run = game:GetService("RunService")
local DS = game:GetService("DataStoreService")
local MS = game:GetService("MarketplaceService")
local Debris = game:GetService("Debris")
local Physics = game:GetService("PhysicsService")
local CS = game:GetService("CollectionService")
local HTTP = game:GetService("HttpService")
local SS = game:GetService("ServerStorage")
local SSS = game:GetService("ServerScriptService")
local UIS = game:GetService("UserInputService")
local GU = require(Rep.Modules.GameUtil)
Run.Heartbeat:connect(function()
local minutesAfterMidnight = Rep.Constants.MinutesAfterMidnight.Value
local dayPhase,phaseData = GU.GetDayPhase()
local amount = phaseData.tock*10
Rep.Constants.MinutesAfterMidnight.Value = math.clamp(minutesAfterMidnight+amount,0,1440)
if Rep.Constants.MinutesAfterMidnight.Value >= 1440 then
Rep.Constants.MinutesAfterMidnight.Value = 0
end
end)
|
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
---------------------------------------------------------------------------------------------------- |
,EnableHolster = false
,HolsterTo = 'Torso' -- Put the name of the body part you wanna holster to
,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
,RightArmPos = CFrame.new(-0.85, -0.2, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Server
,LeftArmPos = CFrame.new(1.2,-0.2,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20)) --server
,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(-90), math.rad(0))
,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
,RightPos = CFrame.new(-.9, .1, -1.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Client
,LeftPos = CFrame.new(1.2,-0.2,-1.2) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-5)) --Client
}
return Config
|
--- On Fire |
Signal.Fired = function(eventName)
--- Variables
eventName = string.lower(eventName)
--- Get/create event
local event = GetEvent(eventName)
--
return event.Event
end
|
--[[
Similar to finally, except rejections are propagated through it.
]] |
function Promise.prototype:done(finallyHandler)
assert(
finallyHandler == nil or type(finallyHandler) == "function" or finallyHandler.__call ~= nill,
string.format(ERROR_NON_FUNCTION, "Promise:done")
)
return self:_finally(debug.traceback(nil, 2), finallyHandler, true)
end
|
-- tween the sound to the speed |
local tween = game:GetService("TweenService"):Create(waterSound,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{["Volume"] = math.clamp(speed/maxSpeed,0,1)}) -- end of tweencreate
tween:Play()
end
|
--local part,pos,norm,mat = workspace:FindPartOnRay(ray,shelly)
--shelly:MoveTo(Vector3.new(shelly.PrimaryPart.Position.X,pos.Y+2.25,shelly.PrimaryPart.Position.Z))
--bp.Position = Vector3.new(bp.Position.X,pos.Y+2.25,bp.Position.Z) |
until (shelly.PrimaryPart.Position-goal).magnitude < 10 or tick()-start >15 or not shellyGood |
-- The third number determines how far ahead/back your hat will be placed. Making the number positive will place the hat ahead of
-- you, while making the number negative will place the hat behind you some. | |
-- Nominal distance, set by dollying in and out with the mouse wheel or equivalent, not measured distance |
function BaseCamera:GetCameraToSubjectDistance()
return self.currentSubjectDistance
end
|
--------------------------------------------------------------------- |
local RotatedRegion = {}
RotatedRegion.__index = RotatedRegion
local tNewRegion = t.tuple( t.CFrame, t.Vector3 )
function RotatedRegion.new( centerCFrame: CFrame, size: Vector3 )
assert( tNewRegion(centerCFrame, size) )
local self = setmetatable( {}, RotatedRegion )
self.SurfaceCountsAsCollision = true
self.CFrame = centerCFrame
self.Size = size
self.Planes = {}
for _, enum in next, Enum.NormalId:GetEnumItems() do
local localNormal = Vector3.FromNormalId( enum )
local worldNormal = self.CFrame:VectorToWorldSpace( localNormal )
local distance = ( localNormal * self.Size/2 ).Magnitude
local point = self.CFrame.Position + worldNormal * distance
table.insert( self.Planes, {
Normal = worldNormal;
Point = point;
} )
end
return self
end
local tVector3 = t.Vector3
function RotatedRegion:IsInRegion( vector3 )
assert( tVector3(vector3) )
for _, plane in next, ( self.Planes ) do
local relativePosition = vector3 - plane.Point
if ( self.SurfaceCountsAsCollision ) then
if ( relativePosition:Dot(plane.Normal) >= 0 ) then
return false
end
else
if ( relativePosition:Dot(plane.Normal) > 0 ) then
return false
end
end
end
return true, ( vector3 - self.CFrame.Position ).Magnitude
end
function RotatedRegion:GetPlayersInRegion()
local players = {}
for _, player in pairs( Players:GetPlayers() ) do
local rootPart = player.Character and player.Character:FindFirstChild( "HumanoidRootPart" )
if ( rootPart ) then
if ( self:IsInRegion(rootPart.Position) ) then
table.insert( players, player )
end
end
end
return players
end
function RotatedRegion:CountPlayersInRegion()
return #( self:GetPlayersInRegion() )
end
return RotatedRegion
|
-- COLOR SETTINGS
--[[
COLOR PRESETS:
Headlights
- OEM White
- Xenon
- Pure White
- Brilliant Blue
- Light Green
- Golden Yellow
- Bubu's Purple
- Yellow
Indicators
- Light Orange
- Dark Orange
- Yellow
- Red
For custom color use Color3.fromRGB(R, G, B). You can get your RGB code from the "Color" property.
]] | --
local Low_Beam_Color = "Pure White"
local High_Beam_Color = "Pure White"
local Running_Light_Color = "Pure White"
local Interior_Light_Color = "OEM White"
local Front_Indicator_Color = "Dark Orange"
local Rear_Indicator_Color = "Dark Orange"
local Fog_Light_Color = "Pure White"
local Plate_Light_Color = "Pure White"
|
-- else print("char char")
-- char.Humanoid.CameraOffset = char.Humanoid.CameraOffset
-- end
--end | |
-- Add everything to settings |
local settings = plr:WaitForChild("Settings")
for _, i in pairs(script:GetChildren()) do
i.Parent = settings
end
|
--Deadzone Adjust |
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
|
---------------------------------------Function end here. |
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
--Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
if (check()) then
fire(lookAt)
wait(0.12)
onActivated()
end
return
--Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
|
--// KeyBindings |
FireSelectKey = Enum.KeyCode.V;
CycleSightKey = Enum.KeyCode.T;
LaserKey = Enum.KeyCode.G;
LightKey = Enum.KeyCode.B;
InteractKey = Enum.KeyCode.E;
AlternateAimKey = Enum.KeyCode.Z;
InspectionKey = Enum.KeyCode.H;
AttachmentKey = Enum.KeyCode.LeftControl;
|
--[[
Given a reactive object, updates all dependent reactive objects.
Objects are only ever updated after all of their dependencies are updated,
are only ever updated once, and won't be updated if their dependencies are
unchanged.
]] |
local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
type Set<T> = {[T]: any}
type Descendant = (PubTypes.Dependent & PubTypes.Dependency) | PubTypes.Dependent
local function updateAll(ancestor: PubTypes.Dependency)
--[[
First things first, we need to mark all indirect dependents as needing
an update. This means we can ignore any dependencies that aren't related
to the current update operation.
]]
-- set of all dependents that still need to be updated
local needsUpdateSet: Set<Descendant> = {}
-- the dependents to be processed now
local processNow: {Descendant} = {}
local processNowSize = 0
-- the dependents of the open set to be processed next
local processNext: {Descendant} = {}
local processNextSize = 0
-- initialise `processNow` with dependents of ancestor
for dependent in pairs(ancestor.dependentSet) do
processNowSize += 1
processNow[processNowSize] = dependent
end
repeat
-- if we add to `processNext` this will be false, indicating we need to
-- process more dependents
local processingDone = true
for _, member in ipairs(processNow) do
-- mark this member as needing an update
needsUpdateSet[member] = true
-- add the dependents of the member for processing
-- FIXME: Typed Luau doesn't understand this type narrowing yet
if (member :: any).dependentSet ~= nil then
local member = member :: PubTypes.Dependent & PubTypes.Dependency
for dependent in pairs(member.dependentSet) do
processNextSize += 1
processNext[processNextSize] = dependent
processingDone = false
end
end
end
-- swap in the next dependents to be processed
processNow, processNext = processNext, processNow
processNowSize, processNextSize = processNextSize, 0
table.clear(processNext)
until processingDone
--[[
`needsUpdateSet` is now set up. Now that we have this information, we
can iterate over the dependents once more and update them only when the
relevant dependencies have been updated.
]]
-- re-initialise `processNow` similar to before
processNowSize = 0
table.clear(processNow)
for dependent in pairs(ancestor.dependentSet) do
processNowSize += 1
processNow[processNowSize] = dependent
end
repeat
-- if we add to `processNext` this will be false, indicating we need to
-- process more dependents
local processingDone = true
for _, member in ipairs(processNow) do
-- mark this member as no longer needing an update
needsUpdateSet[member] = nil
--FUTURE: should this guard against errors?
local didChange = member:update()
-- add the dependents of the member for processing
-- optimisation: if nothing changed, then we don't need to add these
-- dependents, because they don't need processing.
-- FIXME: Typed Luau doesn't understand this type narrowing yet
if didChange and (member :: any).dependentSet ~= nil then
local member = member :: PubTypes.Dependent & PubTypes.Dependency
for dependent in pairs(member.dependentSet) do
-- don't add dependents that have un-updated dependencies
local allDependenciesUpdated = true
for dependentDependency in pairs(dependent.dependencySet) do
-- HACK: keys of needsUpdateSet must be Dependents, so
-- since we want to ignore non-Dependents, we just type
-- cast here regardless of safety
if needsUpdateSet[dependentDependency :: any] then
allDependenciesUpdated = false
break
end
end
if allDependenciesUpdated then
processNextSize += 1
processNext[processNextSize] = dependent
processingDone = false
end
end
end
end
if not processingDone then
-- swap in the next dependents to be processed
processNow, processNext = processNext, processNow
processNowSize, processNextSize = processNextSize, 0
table.clear(processNext)
end
until processingDone
--[[
The update is now complete!
]]
end
return updateAll
|
-----------------
--| Functions |--
----------------- |
local function OnActivated()
local myModel = MyPlayer.Character
if Tool.Enabled and myModel and myModel:FindFirstChildOfClass("Humanoid") and myModel.Humanoid.Health > 0 then
Tool.Enabled = false
local Pos = MouseLoc:InvokeClient(MyPlayer)
-- Create a clone of Rocket and set its color
local rocketClone = Rocket:Clone()
DebrisService:AddItem(rocketClone, 30)
rocketClone.BrickColor = MyPlayer.TeamColor
-- Position the rocket clone and launch!
local spawnPosition = (ToolHandle.CFrame * CFrame.new(5, 0, 0)).p
rocketClone.CFrame = CFrame.new(spawnPosition, Pos) --NOTE: This must be done before assigning Parent
rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
rocketClone.Parent = workspace
rocketClone:SetNetworkOwner(nil)
wait(RELOAD_TIME)
Tool.Enabled = true
end
end
function OnEquipped()
MyPlayer = PlayersService:GetPlayerFromCharacter(Tool.Parent)
end
|
--------------------[ ARM CREATION FUNCTION ]----------------------------------------- |
function CreateArms()
local Arms = {}
for i = 0, 1 do
local ArmModel = Instance.new("Model")
ArmModel.Name = "ArmModel"
local Arm = Instance.new("Part")
Arm.BrickColor = (S.FakeArmRealBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.FakeArmColor)
Arm.Transparency = S.FakeArmTransparency
Arm.Name = "Arm"
Arm.CanCollide = false
Arm.Size = VEC3(1, 2, 1)
Arm.Parent = ArmModel
local ArmMesh = Instance.new("SpecialMesh")
ArmMesh.MeshId = "rbxasset://fonts//rightarm.mesh"
ArmMesh.MeshType = Enum.MeshType.FileMesh
ArmMesh.Scale = VEC3(0.65, 1, 0.65)
ArmMesh.Parent = Arm
local Sleeve1 = Instance.new("Part")
Sleeve1.BrickColor = BrickColor.new("Sand green")
Sleeve1.Name = "Sleeve1"
Sleeve1.CanCollide = false
Sleeve1.Size = VEC3(1, 2, 1)
Sleeve1.Parent = ArmModel
local Sleeve1Mesh = Instance.new("BlockMesh")
Sleeve1Mesh.Offset = VEC3(0, 0.66, 0)
Sleeve1Mesh.Scale = VEC3(0.656, 0.35, 0.656)
Sleeve1Mesh.Parent = Sleeve1
local Sleeve1Weld = Instance.new("Weld")
Sleeve1Weld.Part0 = Arm
Sleeve1Weld.Part1 = Sleeve1
Sleeve1Weld.Parent = Arm
local Sleeve2 = Instance.new("Part")
Sleeve2.BrickColor = BrickColor.new("Sand green")
Sleeve2.Name = "Sleeve2"
Sleeve2.CanCollide = false
Sleeve2.Size = VEC3(1, 2, 1)
Sleeve2.Parent = ArmModel
local Sleeve2Mesh = Instance.new("BlockMesh")
Sleeve2Mesh.Offset = VEC3(0, 0.46, 0)
Sleeve2Mesh.Scale = VEC3(0.75, 0.1, 0.75)
Sleeve2Mesh.Parent = Sleeve2
local Sleeve2Weld = Instance.new("Weld")
Sleeve2Weld.Part0 = Arm
Sleeve2Weld.Part1 = Sleeve2
Sleeve2Weld.Parent = Arm
local Glove1 = Instance.new("Part")
Glove1.BrickColor = BrickColor.new("Black")
Glove1.Name = "Glove1"
Glove1.CanCollide = false
Glove1.Size = VEC3(1, 2, 1)
Glove1.Parent = ArmModel
local Glove1Mesh = Instance.new("BlockMesh")
Glove1Mesh.Offset = VEC3(0, -0.4, 0)
Glove1Mesh.Scale = VEC3(0.657, 0.205, 0.657)
Glove1Mesh.Parent = Glove1
local Glove1Weld = Instance.new("Weld")
Glove1Weld.Part0 = Arm
Glove1Weld.Part1 = Glove1
Glove1Weld.Parent = Arm
local Glove2 = Instance.new("Part")
Glove2.BrickColor = BrickColor.new("Black")
Glove2.Name = "Glove2"
Glove2.CanCollide = false
Glove2.Size = VEC3(1, 2, 1)
Glove2.Parent = ArmModel
local Glove2Mesh = Instance.new("BlockMesh")
Glove2Mesh.Offset = VEC3(0, -0.335, 0)
Glove2Mesh.Scale = VEC3(0.69, 0.105, 0.69)
Glove2Mesh.Parent = Glove2
local Glove2Weld = Instance.new("Weld")
Glove2Weld.Part0 = Arm
Glove2Weld.Part1 = Glove2
Glove2Weld.Parent = Arm
local Glove3 = Instance.new("Part")
Glove3.BrickColor = BrickColor.new("Black")
Glove3.Name = "Glove3"
Glove3.CanCollide = false
Glove3.Size = VEC3(1, 2, 1)
Glove3.Parent = ArmModel
local Glove3Mesh = Instance.new("BlockMesh")
Glove3Mesh.Offset = VEC3(0.2 * ((i * 2) - 1), -0.8, 0)
Glove3Mesh.Scale = VEC3(0.257, 0.205, 0.657)
Glove3Mesh.Parent = Glove3
local Glove3Weld = Instance.new("Weld")
Glove3Weld.Part0 = Arm
Glove3Weld.Part1 = Glove3
Glove3Weld.Parent = Arm
table.insert(Arms, {Model = ArmModel, ArmPart = Arm})
end
return Arms
end
|
--[=[
Gets the service by name. Throws an error if the service is not found.
]=] |
function KnitServer.GetService(serviceName: string): Service
assert(started, "Cannot call GetService until Knit has been started")
assert(type(serviceName) == "string", "ServiceName must be a string; got " .. type(serviceName))
return assert(services[serviceName], "Could not find service \"" .. serviceName .. "\"") :: Service
end
|
--Create visual waypoints |
local function createVisualWaypoints(waypoints)
local visualWaypoints = {}
for _, waypoint in ipairs(waypoints) do
local visualWaypointClone = visualWaypoint:Clone()
visualWaypointClone.Position = waypoint.Position
visualWaypointClone.Parent = workspace
visualWaypointClone.Color =
(waypoint == waypoints[#waypoints] and Color3.fromRGB(0, 255, 0))
or (waypoint.Action == Enum.PathWaypointAction.Jump and Color3.fromRGB(255, 0, 0))
or Color3.fromRGB(255, 139, 0)
table.insert(visualWaypoints, visualWaypointClone)
end
return visualWaypoints
end
|
-----------------
--| Variables |--
----------------- |
local PlayersService = Game:GetService('Players')
local DebrisService = Game:GetService('Debris')
local Tool = script.Parent
local Handle = Tool:WaitForChild('Handle')
local FireSound = Handle:WaitForChild('Fire')
local ReloadSound = Handle:WaitForChild('Reload')
local HitFadeSound = script:WaitForChild('HitFade')
local PointLight = Handle:WaitForChild('PointLight')
local Character = nil
local Humanoid = nil
local Player = nil
local BaseShot = nil
|
--[[Transmission]] | --
Tune.Clutch = false -- Implements a realistic clutch.
Tune.TransModes = {"Auto"} --[[
[Modes]
"Manual" ; Traditional clutch operated manual transmission
"DCT" ; Dual clutch transmission, where clutch is operated automatically
"Auto" ; Automatic transmission that shifts for you
>Include within brackets
eg: {"Manual"} or {"DCT", "Manual"}
>First mode is default mode ]]
--[[Transmission]]
Tune.ClutchType = "Auto" --[[
[Types]
"Clutch" : Standard clutch, recommended
"TorqueConverter" : Torque converter, keeps RPM up
"CVT" : CVT, found in scooters
]]
Tune.ClutchMode = "Speed" --[[
[Modes]
"Speed" : Speed controls clutch engagement
"RPM" : Speed and RPM control clutch engagement ]]
--Transmission Settings
Tune.Stall = true -- Stalling, enables the bike to stall. An ignition plugin would be necessary. Disables if Tune.Clutch is false.
Tune.ClutchEngage = 25 -- How fast engagement is (0 = instant, 99 = super slow)
--Torque Converter:
Tune.TQLock = false -- Torque converter starts locking at a certain RPM (see below if set to true)
--Torque Converter and CVT:
Tune.RPMEngage = 5300 -- Keeps RPMs to this level until passed
--Clutch:
Tune.SpeedEngage = 15 -- Speed the clutch fully engages at (Based on SPS)
--Clutch: "RPM" mode
Tune.ClutchRPMMult = 1.0 -- Clutch RPM multiplier, recommended to leave at 1.0
--Manual: Quick Shifter
Tune.QuickShifter = true -- To quickshift, cut off the throttle to upshift, and apply throttle to downshift, all without clutch.
Tune.QuickShiftTime = 0.25 -- Determines how much time you have to quick shift up or down before you need to use the clutch.
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoShiftType = "DCT" --[[
[Types]
"Rev" : Clutch engages fully once RPM reached
"DCT" : Clutch engages after a set time has passed ]]
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)
--Automatic: Revmatching
Tune.ShiftThrot = 100 -- Throttle level when shifting down to revmatch, 0 - 100%
--Automatic: DCT
Tune.ShiftUpTime = 0.25 -- Time required to shift into next gear, from a lower gear to a higher one.
Tune.ShiftDnTime = 0.125 -- Time required to shift into next gear, from a higher gear to a lower one.
Tune.FinalDrive = (30/16)*1 -- (Final * Primary) -- Gearing determines top speed and wheel torque
-- for the final is recommended to divide the size of the rear sprocket to the one of the front sprocket
-- and multiply it to the primary drive ratio, if data is missing, you can also just use a single number
Tune.NeutralRev = true -- Enables you to back up manually in neutral
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 32/5 , -- Neutral and 1st gear are required
--[[ 2 ]] 32/6 ,
--[[ 3 ]] 33/7 ,
--[[ 4 ]] 32/8 ,
--[[ 5 ]] 34/9 ,
--[[ 6 ]] 33/10 ,
}
Tune.Limiter = true -- Enables a speed limiter
Tune.SpeedLimit = 121 -- At what speed (SPS) the limiter engages
|
-- Note, arguments do not match the new math.clamp
-- Eventually we will replace these calls with math.clamp, but right now
-- this is safer as math.clamp is not tolerant of min>max |
function CameraUtils.Clamp(low, high, val)
return math.min(math.max(val, low), high)
end
|
Subsets and Splits