prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- [ ADVANCED ] --
--[[
[Horizontal and Vertical limits for head and body tracking.]
Setting to 0 negates tracking, setting to 1 is normal tracking, and setting to anything higher than 1 goes past real life head/body rotation capabilities.
--]]
|
local HeadHorFactor = 0.8
local HeadVertFactor = 0.5
local BodyHorFactor = 0.4
local BodyVertFactor = 0.4
|
--[[ if child.Parent and child.Parent.Parent then
end
if child.BackgroundTransparency == 1 then
return true;
end]]
|
return false
end
local function CircleClick(Button, X, Y)
local duration = 0.5
spawn(function()
local effect = Instance.new("ImageLabel", Button)
effect.AnchorPoint = Vector2.new(0.5, 0.5)
effect.BorderSizePixel = 0
effect.ZIndex = Button.ZIndex + 2
effect.BackgroundTransparency = 1
effect.ImageTransparency = 0.96
effect.Image = "rbxasset://textures/whiteCircle.png"
local rounder = Instance.new("UICorner", effect); rounder.CornerRadius = UDim.new(0,8)
effect.Position = UDim2.new(0.5, 0, 0.5, 0)
effect:TweenSize(UDim2.new(0, Button.AbsoluteSize.X * 2.5, 0, Button.AbsoluteSize.X * 2.5), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, duration)
wait(duration)
for i = 1, 10 do
wait(0.04)
effect.ImageTransparency += 0.1
end
effect:Destroy()
end)
end
local function propChange(child, target, list)
for i in next,list do
if target[i] ~= child[i] then
target[i] = child[i];
end
end--lollo was here yes my code is messy
if child.ZIndex == 1 then
child.ZIndex = 2;
end
target.ZIndex = child.ZIndex-1;
end
return function(data, env)
if env then
setfenv(1, env)
end
local gui = script.Parent.Parent;--data.GUI;
local function apply(child)
if not child then return end
if child:IsA("TextButton") or child:IsA("ImageButton") then
child.ClipsDescendants = true
child.AutoButtonColor = false
child.Activated:Connect(function()
CircleClick(child:GetObject())
end)
end
if not child:IsA("TextLabel") and not child:IsA("ImageLabel") and not child:FindFirstChildOfClass("UICorner") then
local rounder = service.New("UICorner",{
CornerRadius = UDim.new(0,5);
Parent = child;
});
end
if child:IsA("TextLabel") and not child:FindFirstChildOfClass("UICorner") then
local rounder = service.New("UICorner",{
CornerRadius = UDim.new(0,6);
Parent = child;
});
-- well how do i convert size to precise offset because i am lazy
child.BackgroundColor3 = Color3.fromRGB(18, 18, 18)
end
if child:IsA("ScrollingFrame") then
if child.Parent and child.Parent.Name == "Frames" then child.BackgroundTransparency = 1; end
child.BottomImage = "rbxasset://textures/ui/Scroll/scroll-bottom.png"
child.MidImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
child.TopImage = "rbxasset://textures/ui/Scroll/scroll-top.png"
child.ScrollBarImageTransparency = 0.75
child.ScrollBarImageColor3 = Color3.fromRGB(255, 255, 255)
--local propList = {
-- Size = true;
-- Visible = true;
-- Position = true;
-- BackgroundTransparency = true;
-- BackgroundColor3 = true;
-- BorderColor3 = true;
-- Rotation = true;
-- SizeConstraint = true;
--}
--local frame = service.New("Frame");
--propChange(child, frame, propList)
child.BackgroundTransparency = 1; --why not
--child.Changed:Connect(function(p)
-- if p ~= "BackgroundTransparency" then
-- propChange(child, frame, propList);
-- end
--end)
--frame.Parent = child.Parent;
end
end
gui.DescendantAdded:Connect(function(child)
if child:IsA("GuiObject") and not ignore(child) then
apply(child);
end
end)
end
|
--wait(math.random(0,5)/10)
|
while true do
wait(0.5)
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end
|
--local freeSpaceX,freeSpaceY,freeSpaceZ = 3,3,2.8
|
local freeSpace = Vector3.new(3,2.8,3)
local box = script.Parent
local contents = box.Contents
local lidOffset = 3
function r(num)
return math.random(-math.abs(num*100),math.abs(num*100))/100
end
local function weldBetween(a, b)
--Make a new Weld and Parent it to a.
local weld = Instance.new("ManualWeld", a)
weld.Part0 = a
weld.Part1 = b
--Get the CFrame of b relative to a.
weld.C0 = a.CFrame:inverse() * b.CFrame
--Return the reference to the weld so that you can change it later.
return weld
end
box.Base.Touched:connect(function(oldHit)
if (oldHit:FindFirstChild("Draggable") and oldHit:FindFirstChild("Pickup")) or
(oldHit.Parent and (oldHit.Parent:FindFirstChild("Draggable") and oldHit.Parent:FindFirstChild("Pickup")))
then
local hit
if oldHit.Parent:IsA("Model") and oldHit.Parent ~= workspace.Items then
hit = oldHit.Parent:Clone()
oldHit.Parent:Destroy()
elseif oldHit.Parent == workspace.Items then
hit = oldHit:Clone()
oldHit:Destroy()
end
if hit.Draggable then
hit.Draggable:Destroy()
end
if hit:IsA("BasePart") then
hit.Anchored = false
hit.CanCollide = false
local vary = freeSpace-hit.Size
-- random x,y,z
print(vary,"as variance")
--hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z))
hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100)
weldBetween(hit, box.PrimaryPart)
elseif hit:IsA("Model") then
for _,v in next,hit:GetDescendants() do
if v:IsA("BasePart") then
v.Anchored = false
v.CanCollide = false
if v == hit.PrimaryPart then continue end
weldBetween(v, hit.PrimaryPart)
end
end
local modelSize= hit:GetExtentsSize()
local vary = freeSpace-modelSize
--hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z)))
hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100))
weldBetween(hit.PrimaryPart, box.PrimaryPart)
end -- end of if hit is a basepart or model
hit.Parent = contents
end
end)
|
-- Blood effects
--if gameRules.BloodSplats then
-- Mods["Realistic Blood"].Parent = game:GetService("ServerScriptService")
--end
| |
-- RemoteSignal
-- Stephen Leitnick
-- December 20, 2021
|
local Players = game:GetService("Players")
local Signal = require(script.Parent.Parent.Parent.Signal)
local Types = require(script.Parent.Parent.Types)
|
-- Now that we're done building the GUI, we Connect to all the major events
| |
-- this is a dummy object that holds the flash made when the gun is fired
|
local FlashHolder = nil
local EquipTrack = nil
local PumpTrack = nil
local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
local GetCellFunction = Workspace.Terrain.GetCell
function RayIgnoreCheck(hit, pos)
if hit then
if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
return true
elseif hit:IsA('Terrain') and pos then
local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
if cellPos then
local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
if cellMat and cellMat == Enum.CellMaterial.Water then
return true
end
end
end
end
return false
end
|
-- Do a line/plane intersection. The line starts at the camera. The plane is at y == 0, normal(0, 1, 0)
--
-- vectorPos - End point of the line.
--
-- Return:
-- cellPos - The terrain cell intersection point if there is one, vectorPos if there isn't.
-- hit - Whether there was a plane intersection. Value is true if there was, false if not.
|
function PlaneIntersection(vectorPos)
local hit = false
local currCamera = game:GetService("Workspace").CurrentCamera
local startPos = Vector3.new(currCamera.CoordinateFrame.p.X, currCamera.CoordinateFrame.p.Y, currCamera.CoordinateFrame.p.Z)
local endPos = Vector3.new(vectorPos.X, vectorPos.Y, vectorPos.Z)
local normal = Vector3.new(0, 1, 0)
local p3 = Vector3.new(0, 0, 0)
local startEndDot = normal:Dot(endPos - startPos)
local cellPos = vectorPos
if startEndDot ~= 0 then
local t = normal:Dot(p3 - startPos) / startEndDot
if(t >=0 and t <=1) then
local intersection = ((endPos - startPos) * t) + startPos
cellPos = game:GetService("Workspace").Terrain:WorldToCell(intersection)
hit = true
end
end
return cellPos, hit
end
|
-- // Events \\ --
|
ProximityPrompt.PromptButtonHoldBegan:Connect(function()
Functions.Flash("Teal")
end)
ProximityPrompt.Triggered:Connect(function(Player)
DoorLogo.Beep:Play()
Functions.Flash("Bright green")
ProximityPrompt.Enabled = false
Functions.Move(true)
wait(2)
Functions.Move(false)
Functions.Flash("Bright red")
ProximityPrompt.Enabled = true
end)
|
--- Give moderator GUI to player
|
function GiveGui(player)
wait() --- prevents console errors
if player then
local debugGui = game.ServerStorage:FindFirstChild("Debug"):Clone()
debugGui.Parent = player
end
end
|
-- Handles behaviours
|
local function characterTouchedBrick(partTouched)
local behaviours = partTouched:FindFirstChild("Behaviours")
if behaviours ~= nil then
behaviours = behaviours:GetChildren()
for i = 1, #behaviours do
if behaviours[i].Value == true then
game.ReplicatedStorage.RemoteEvents.ExecuteBehaviour:FireServer(player.Character, partTouched, behaviours[i].Name)
if string.find(behaviours[i].Name, "Kill") then
SmoothDie()
end
end
end
end
end
function characterAdded(newCharacter)
ResetGame()
bindFuc:Invoke(true)
character = player.Character
humanoid = character:WaitForChild("Humanoid")
animator = humanoid:WaitForChild("Animator")
humanoid.Touched:connect(characterTouchedBrick)
humanoid.Died:connect(OnDie)
SetWalkSpeed(0)
local splashScreen = player.PlayerGui:WaitForChild("StartScreen")
if UserInputService.TouchEnabled == false then
if UserInputService.GamepadEnabled then
splashScreen.StartInstructions.StartLabel.Text = "Press Space or Gamepad A Button to Start"
else
splashScreen.StartInstructions.StartLabel.Text = "Press Space to Start"
end
end
end
local function MoveAction(actionName, inputState, inputObject)
if(not startGame) then
return
end
if inputState == Enum.UserInputState.Begin then
if inputObject.KeyCode == Enum.KeyCode.Left then
left = -1
moveDir = -1
elseif inputObject.KeyCode == Enum.KeyCode.Right then
right = 1
moveDir = 1
end
SetWalkSpeed(moveSpeed)
elseif inputState == Enum.UserInputState.End then
if inputObject.KeyCode == Enum.KeyCode.Left then
left = 0
elseif inputObject.KeyCode == Enum.KeyCode.Right then
right = 0
end
moveDir = left + right
if moveDir == 0 then
SetWalkSpeed(0)
end
end
end
|
--[[
ROBLOX deviation: skipped makeResolveMatcher, makeRejectMatcher
original code lines 144 - 241
]]
| |
--- Calls the transform function on this argument.
-- The return value(s) from this function are passed to all of the other argument methods.
-- Called automatically at instantiation
|
function Argument:Transform()
if #self.TransformedValues ~= 0 then
return
end
local rawValue = self.RawValue
if rawValue == "." and self.Type.Default then
rawValue = self.Type.Default(self.Executor) or ""
self.RawSegmentsAreAutocomplete = true
end
if rawValue == "?" and self.Type.Autocomplete then
local strings, options = self:GetDefaultAutocomplete()
if not options.IsPartial and #strings > 0 then
rawValue = strings[math.random(1, #strings)]
self.RawSegmentsAreAutocomplete = true
end
end
if self.Type.Listable and #self.RawValue > 0 then
local randomMatch = rawValue:match("^%?(%d+)$")
if randomMatch then
local maxSize = tonumber(randomMatch)
if maxSize and maxSize > 0 then
local items = {}
local remainingItems, options = self:GetDefaultAutocomplete()
if not options.IsPartial and #remainingItems > 0 then
for _ = 1, math.min(maxSize, #remainingItems) do
table.insert(items, table.remove(remainingItems, math.random(1, #remainingItems)))
end
rawValue = table.concat(items, ",")
self.RawSegmentsAreAutocomplete = true
end
end
elseif rawValue == "*" or rawValue == "**" then
local strings, options = self:GetDefaultAutocomplete()
if not options.IsPartial and #strings > 0 then
if rawValue == "**" and self.Type.Default then
local defaultString = self.Type.Default(self.Executor) or ""
for i, string in ipairs(strings) do
if string == defaultString then
table.remove(strings, i)
end
end
end
rawValue = table.concat(
strings,
","
)
self.RawSegmentsAreAutocomplete = true
end
end
rawValue = unescapeOperators(rawValue)
local rawSegments = Util.SplitStringSimple(rawValue, ",")
if #rawSegments == 0 then
rawSegments = {""}
end
if rawValue:sub(#rawValue, #rawValue) == "," then
rawSegments[#rawSegments + 1] = "" -- makes auto complete tick over right after pressing ,
end
for i, rawSegment in ipairs(rawSegments) do
self.RawSegments[i] = rawSegment
self.TransformedValues[i] = { self:TransformSegment(rawSegment) }
end
self.TextSegmentInProgress = rawSegments[#rawSegments]
else
rawValue = unescapeOperators(rawValue)
self.RawSegments[1] = unescapeOperators(rawValue)
self.TransformedValues[1] = { self:TransformSegment(rawValue) }
self.TextSegmentInProgress = self.RawValue
end
end
function Argument:TransformSegment(rawSegment)
if self.Type.Transform then
return self.Type.Transform(rawSegment, self.Executor)
else
return rawSegment
end
end
|
-- / Gun Assets / --
|
local GunAssets = script.Parent.GunAssets
|
--[=[
@within TableUtil
@function Extend
@param target table
@param extension table
@return table
Extends the target array with the extension array.
```lua
local t = {10, 20, 30}
local t2 = {30, 40, 50}
local tNew = TableUtil.Extend(t, t2)
print(tNew) --> {10, 20, 30, 30, 40, 50}
```
:::note Arrays only
This function works on arrays, but not dictionaries.
]=]
|
local function Extend(target: Table, extension: Table): Table
local tbl = Copy(target)
for _,v in ipairs(extension) do
table.insert(tbl, v)
end
return tbl
end
|
-- Backwards compatibility
|
Promise.async = Promise.defer
Promise.Async = Promise.defer
|
-- declarations
|
local sGettingUp = newSound("GettingUp", "rbxasset://sounds/action_get_up.mp3")
local sDied = newSound("Died", "rbxasset://sounds/uuhhh.mp3")
local sFreeFalling = newSound("FreeFalling", "rbxasset://sounds/action_falling.mp3")
local sJumping = newSound("Jumping", "rbxasset://sounds/action_jump.mp3")
local sLanding = newSound("Landing", "rbxasset://sounds/action_jump_land.mp3")
local sSplash = newSound("Splash", "rbxasset://sounds/impact_water.mp3")
local sRunning = newSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3")
sRunning.Looped = true
local sSwimming = newSound("Swimming", "rbxasset://sounds/action_swim.mp3")
sSwimming.Looped = true
local sClimbing = newSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3")
sClimbing.Looped = true
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
local hasPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
local filteringEnabled = game.Workspace.FilteringEnabled
local prevState = "None"
|
--[[
Get the current value from a binding
]]
|
function bindingPrototype:getValue()
local internalData = self[InternalData]
--[[
If our source is another binding but we're not subscribed, we'll
return the mapped value from our upstream binding.
This allows us to avoid subscribing to our source until someone
has subscribed to us, and avoid creating dangling connections.
]]
if internalData.upstreamBinding ~= nil and internalData.upstreamDisconnect == nil then
return internalData.valueTransform(internalData.upstreamBinding:getValue())
end
return internalData.value
end
|
-- Create confetti paper.
|
local AmountOfConfetti = 25;
for i=1, AmountOfConfetti do
local p = ConfettiCannon.createParticle(
Vector2.new(0.5,1), -- Position on screen. (Scales)
Vector2.new(math.random(90)-45, math.random(70,100)), -- The direction power of the blast.
script.Parent, -- The frame that these should be displayed on.
{Color3.fromRGB(255,255,100), Color3.fromRGB(255,100,100)} -- The colors that should be used.
);
table.insert(confetti, p);
end;
local confettiColors = {Color3.fromRGB(255,255,100), Color3.fromRGB(255,100,100)};
local confettiActive = false;
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Humanoid__1 = game.Players.LocalPlayer.Character:WaitForChild("Humanoid");
while wait(1) do
if l__Humanoid__1:GetState() ~= Enum.HumanoidStateType.Physics then
script.Parent.TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255);
else
script.Parent.TextLabel.BackgroundColor3 = Color3.fromRGB(9, 137, 207);
end;
end;
|
-- где ищем цели
|
local find=game.Workspace.NPC.Enemy
local function myRay(target,eye,max_dist)
local result= nil
local rayOrigin = eye.Position
local rayDirection = (target.Position-rayOrigin)*2 - Vector3.new(0,5,0)
-- local rayDirection = module.lookAtY (target.Position, eye.Position)
|
--// F key, Horn
|
if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then
script.Parent.Parent.Horn.TextTransparency = 0
veh.Lightbar.middle.Airhorn:Play()
veh.Lightbar.middle.Wail.Volume = 0
veh.Lightbar.middle.Yelp.Volume = 0
veh.Lightbar.middle.Priority.Volume = 0
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end)
|
-- TiltDown()
-- FlyStraight()
-- TiltUp()
|
FlyStraight()
TurnAround()
|
-- [ SETTINGS ] --
|
local StatsName = "Coins" -- Your stats name
local MaxItems = 100 -- Max number of items to be displayed on the leaderboard
local MinValueDisplay = 1 -- Any numbers lower than this will be excluded
local MaxValueDisplay = 10e15 -- (10 ^ 15) Any numbers higher than this will be excluded
local UpdateEvery = 15 -- (in seconds) How often the leaderboard has to update
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local u1 = require(script.Parent.CameraShakeInstance);
function v1.Bump()
local v2 = u1.new(2.5, 4, 0.1, 0.75);
v2.PositionInfluence = Vector3.new(0.15, 0.15, 0.15);
v2.RotationInfluence = Vector3.new(1, 1, 1);
return v2;
end;
function v1.Explosion()
local v3 = u1.new(5, 10, 0, 1.5);
v3.PositionInfluence = Vector3.new(0.25, 0.25, 0.25);
v3.RotationInfluence = Vector3.new(4, 1, 1);
return v3;
end;
function v1.Earthquake()
local v4 = u1.new(0.6, 3.5, 2, 10);
v4.PositionInfluence = Vector3.new(0.25, 0.25, 0.25);
v4.RotationInfluence = Vector3.new(1, 1, 4);
return v4;
end;
function v1.BadTrip()
local v5 = u1.new(10, 0.15, 5, 10);
v5.PositionInfluence = Vector3.new(0, 0, 0.15);
v5.RotationInfluence = Vector3.new(2, 1, 4);
return v5;
end;
function v1.HandheldCamera()
local v6 = u1.new(1, 0.25, 5, 10);
v6.PositionInfluence = Vector3.new(0, 0, 0);
v6.RotationInfluence = Vector3.new(1, 0.5, 0.5);
return v6;
end;
function v1.Vibration()
local v7 = u1.new(0.4, 20, 2, 2);
v7.PositionInfluence = Vector3.new(0, 0.15, 0);
v7.RotationInfluence = Vector3.new(1.25, 0, 4);
return v7;
end;
function v1.RoughDriving()
local v8 = u1.new(1, 2, 1, 1);
v8.PositionInfluence = Vector3.new(0, 0, 0);
v8.RotationInfluence = Vector3.new(1, 1, 1);
return v8;
end;
local v9 = {};
function v9.__index(p1, p2)
local v10 = v1[p2];
if type(v10) == "function" then
return v10();
end;
error("No preset found with index \"" .. p2 .. "\"");
end;
return setmetatable({}, v9);
|
-- only merge property defined on target
|
function mergeProps(source, target)
if not source or not target then return end
for prop, value in pairs(source) do
if target[prop] ~= nil then
target[prop] = value
end
end
end
function methods:CreateGuiObjects(targetParent)
local userDefinedChatWindowStyle
pcall(function()
userDefinedChatWindowStyle= Chat:InvokeChatCallback(Enum.ChatCallbackType.OnCreatingChatWindow, nil)
end)
-- merge the userdefined settings with the ChatSettings
mergeProps(userDefinedChatWindowStyle, ChatSettings)
local BaseFrame = Instance.new("Frame")
BaseFrame.BackgroundTransparency = 1
BaseFrame.Active = ChatSettings.WindowDraggable
BaseFrame.Parent = targetParent
BaseFrame.AutoLocalize = false
local ChatBarParentFrame = Instance.new("Frame")
ChatBarParentFrame.Selectable = false
ChatBarParentFrame.Name = "ChatBarParentFrame"
ChatBarParentFrame.BackgroundTransparency = 1
ChatBarParentFrame.Parent = BaseFrame
local ChannelsBarParentFrame = Instance.new("Frame")
ChannelsBarParentFrame.Selectable = false
ChannelsBarParentFrame.Name = "ChannelsBarParentFrame"
ChannelsBarParentFrame.BackgroundTransparency = 1
ChannelsBarParentFrame.Position = UDim2.new(0, 0, 0, 0)
ChannelsBarParentFrame.Parent = BaseFrame
local ChatChannelParentFrame = Instance.new("Frame")
ChatChannelParentFrame.Selectable = false
ChatChannelParentFrame.Name = "ChatChannelParentFrame"
ChatChannelParentFrame.BackgroundTransparency = 1
ChatChannelParentFrame.BackgroundColor3 = ChatSettings.BackGroundColor
ChatChannelParentFrame.BackgroundTransparency = 0.6
ChatChannelParentFrame.BorderSizePixel = 0
ChatChannelParentFrame.Parent = BaseFrame
local ChatResizerFrame = Instance.new("ImageButton")
ChatResizerFrame.Selectable = false
ChatResizerFrame.Image = ""
ChatResizerFrame.BackgroundTransparency = 0.6
ChatResizerFrame.BorderSizePixel = 0
ChatResizerFrame.Visible = false
ChatResizerFrame.BackgroundColor3 = ChatSettings.BackGroundColor
ChatResizerFrame.Active = true
if bubbleChatOnly() then
ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 0, 0)
else
ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 1, -ChatResizerFrame.AbsoluteSize.Y)
end
ChatResizerFrame.Parent = BaseFrame
local ResizeIcon = Instance.new("ImageLabel")
ResizeIcon.Selectable = false
ResizeIcon.Size = UDim2.new(0.8, 0, 0.8, 0)
ResizeIcon.Position = UDim2.new(0.2, 0, 0.2, 0)
ResizeIcon.BackgroundTransparency = 1
ResizeIcon.Image = "rbxassetid://261880743"
ResizeIcon.Parent = ChatResizerFrame
local function GetScreenGuiParent()
--// Travel up parent list until you find the ScreenGui that the chat window is parented to
local screenGuiParent = BaseFrame
while (screenGuiParent and not screenGuiParent:IsA("ScreenGui")) do
screenGuiParent = screenGuiParent.Parent
end
return screenGuiParent
end
local deviceType = DEVICE_DESKTOP
local screenGuiParent = GetScreenGuiParent()
if (screenGuiParent.AbsoluteSize.X <= PHONE_SCREEN_WIDTH) then
deviceType = DEVICE_PHONE
elseif (screenGuiParent.AbsoluteSize.X <= TABLET_SCREEN_WIDTH) then
deviceType = DEVICE_TABLET
end
local checkSizeLock = false
local function doCheckSizeBounds()
if (checkSizeLock) then return end
checkSizeLock = true
if (not BaseFrame:IsDescendantOf(PlayerGui)) then return end
local screenGuiParent = GetScreenGuiParent()
local minWinSize = ChatSettings.MinimumWindowSize
local maxWinSize = ChatSettings.MaximumWindowSize
local forceMinY = ChannelsBarParentFrame.AbsoluteSize.Y + ChatBarParentFrame.AbsoluteSize.Y
local minSizePixelX = (minWinSize.X.Scale * screenGuiParent.AbsoluteSize.X) + minWinSize.X.Offset
local minSizePixelY = math.max((minWinSize.Y.Scale * screenGuiParent.AbsoluteSize.Y) + minWinSize.Y.Offset, forceMinY)
local maxSizePixelX = (maxWinSize.X.Scale * screenGuiParent.AbsoluteSize.X) + maxWinSize.X.Offset
local maxSizePixelY = (maxWinSize.Y.Scale * screenGuiParent.AbsoluteSize.Y) + maxWinSize.Y.Offset
local absSizeX = BaseFrame.AbsoluteSize.X
local absSizeY = BaseFrame.AbsoluteSize.Y
if (absSizeX < minSizePixelX) then
local offset = UDim2.new(0, minSizePixelX - absSizeX, 0, 0)
BaseFrame.Size = BaseFrame.Size + offset
elseif (absSizeX > maxSizePixelX) then
local offset = UDim2.new(0, maxSizePixelX - absSizeX, 0, 0)
BaseFrame.Size = BaseFrame.Size + offset
end
if (absSizeY < minSizePixelY) then
local offset = UDim2.new(0, 0, 0, minSizePixelY - absSizeY)
BaseFrame.Size = BaseFrame.Size + offset
elseif (absSizeY > maxSizePixelY) then
local offset = UDim2.new(0, 0, 0, maxSizePixelY - absSizeY)
BaseFrame.Size = BaseFrame.Size + offset
end
local xScale = BaseFrame.AbsoluteSize.X / screenGuiParent.AbsoluteSize.X
local yScale = BaseFrame.AbsoluteSize.Y / screenGuiParent.AbsoluteSize.Y
BaseFrame.Size = UDim2.new(xScale, 0, yScale, 0)
checkSizeLock = false
end
BaseFrame.Changed:connect(function(prop)
if (prop == "AbsoluteSize") then
doCheckSizeBounds()
end
end)
ChatResizerFrame.DragBegin:connect(function(startUdim)
BaseFrame.Draggable = false
end)
local function UpdatePositionFromDrag(atPos)
if ChatSettings.WindowDraggable == false and ChatSettings.WindowResizable == false then
return
end
local newSize = atPos - BaseFrame.AbsolutePosition + ChatResizerFrame.AbsoluteSize
BaseFrame.Size = UDim2.new(0, newSize.X, 0, newSize.Y)
if bubbleChatOnly() then
ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 0, 0)
else
ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 1, -ChatResizerFrame.AbsoluteSize.Y)
end
end
ChatResizerFrame.DragStopped:connect(function(endX, endY)
BaseFrame.Draggable = ChatSettings.WindowDraggable
--UpdatePositionFromDrag(Vector2.new(endX, endY))
end)
local resizeLock = false
ChatResizerFrame.Changed:connect(function(prop)
if (prop == "AbsolutePosition" and not BaseFrame.Draggable) then
if (resizeLock) then return end
resizeLock = true
UpdatePositionFromDrag(ChatResizerFrame.AbsolutePosition)
resizeLock = false
end
end)
local function CalculateChannelsBarPixelSize(textSize)
if (deviceType == DEVICE_PHONE) then
textSize = textSize or ChatSettings.ChatChannelsTabTextSizePhone
else
textSize = textSize or ChatSettings.ChatChannelsTabTextSize
end
local channelsBarTextYSize = textSize
local chatChannelYSize = math.max(32, channelsBarTextYSize + 8) + 2
return chatChannelYSize
end
local function CalculateChatBarPixelSize(textSize)
if (deviceType == DEVICE_PHONE) then
textSize = textSize or ChatSettings.ChatBarTextSizePhone
else
textSize = textSize or ChatSettings.ChatBarTextSize
end
local chatBarTextSizeY = textSize
local chatBarYSize = chatBarTextSizeY + (7 * 2) + (5 * 2)
return chatBarYSize
end
if bubbleChatOnly() then
ChatBarParentFrame.Position = UDim2.new(0, 0, 0, 0)
ChannelsBarParentFrame.Visible = false
ChannelsBarParentFrame.Active = false
ChatChannelParentFrame.Visible = false
ChatChannelParentFrame.Active = false
local useXScale = 0
local useXOffset = 0
local screenGuiParent = GetScreenGuiParent()
if (deviceType == DEVICE_PHONE) then
useXScale = ChatSettings.DefaultWindowSizePhone.X.Scale
useXOffset = ChatSettings.DefaultWindowSizePhone.X.Offset
elseif (deviceType == DEVICE_TABLET) then
useXScale = ChatSettings.DefaultWindowSizeTablet.X.Scale
useXOffset = ChatSettings.DefaultWindowSizeTablet.X.Offset
else
useXScale = ChatSettings.DefaultWindowSizeTablet.X.Scale
useXOffset = ChatSettings.DefaultWindowSizeTablet.X.Offset
end
local chatBarYSize = CalculateChatBarPixelSize()
BaseFrame.Size = UDim2.new(useXScale, useXOffset, 0, chatBarYSize)
BaseFrame.Position = ChatSettings.DefaultWindowPosition
else
local screenGuiParent = GetScreenGuiParent()
if (deviceType == DEVICE_PHONE) then
BaseFrame.Size = ChatSettings.DefaultWindowSizePhone
elseif (deviceType == DEVICE_TABLET) then
BaseFrame.Size = ChatSettings.DefaultWindowSizeTablet
else
BaseFrame.Size = ChatSettings.DefaultWindowSizeDesktop
end
BaseFrame.Position = ChatSettings.DefaultWindowPosition
end
if (deviceType == DEVICE_PHONE) then
ChatSettings.ChatWindowTextSize = ChatSettings.ChatWindowTextSizePhone
ChatSettings.ChatChannelsTabTextSize = ChatSettings.ChatChannelsTabTextSizePhone
ChatSettings.ChatBarTextSize = ChatSettings.ChatBarTextSizePhone
end
local function UpdateDraggable(enabled)
BaseFrame.Active = enabled
BaseFrame.Draggable = enabled
end
local function UpdateResizable(enabled)
ChatResizerFrame.Visible = enabled
ChatResizerFrame.Draggable = enabled
local frameSizeY = ChatBarParentFrame.Size.Y.Offset
if (enabled) then
ChatBarParentFrame.Size = UDim2.new(1, -frameSizeY - 2, 0, frameSizeY)
if not bubbleChatOnly() then
ChatBarParentFrame.Position = UDim2.new(0, 0, 1, -frameSizeY)
end
else
ChatBarParentFrame.Size = UDim2.new(1, 0, 0, frameSizeY)
if not bubbleChatOnly() then
ChatBarParentFrame.Position = UDim2.new(0, 0, 1, -frameSizeY)
end
end
end
local function UpdateChatChannelParentFrameSize()
local channelsBarSize = CalculateChannelsBarPixelSize()
local chatBarSize = CalculateChatBarPixelSize()
if (ChatSettings.ShowChannelsBar) then
ChatChannelParentFrame.Size = UDim2.new(1, 0, 1, -(channelsBarSize + chatBarSize + 2 + 2))
ChatChannelParentFrame.Position = UDim2.new(0, 0, 0, channelsBarSize + 2)
else
ChatChannelParentFrame.Size = UDim2.new(1, 0, 1, -(chatBarSize + 2 + 2))
ChatChannelParentFrame.Position = UDim2.new(0, 0, 0, 2)
end
end
local function UpdateChatChannelsTabTextSize(size)
local channelsBarSize = CalculateChannelsBarPixelSize(size)
ChannelsBarParentFrame.Size = UDim2.new(1, 0, 0, channelsBarSize)
UpdateChatChannelParentFrameSize()
end
local function UpdateChatBarTextSize(size)
local chatBarSize = CalculateChatBarPixelSize(size)
ChatBarParentFrame.Size = UDim2.new(1, 0, 0, chatBarSize)
if not bubbleChatOnly() then
ChatBarParentFrame.Position = UDim2.new(0, 0, 1, -chatBarSize)
end
ChatResizerFrame.Size = UDim2.new(0, chatBarSize, 0, chatBarSize)
ChatResizerFrame.Position = UDim2.new(1, -chatBarSize, 1, -chatBarSize)
UpdateChatChannelParentFrameSize()
UpdateResizable(ChatSettings.WindowResizable)
end
local function UpdateShowChannelsBar(enabled)
ChannelsBarParentFrame.Visible = enabled
UpdateChatChannelParentFrameSize()
end
UpdateChatChannelsTabTextSize(ChatSettings.ChatChannelsTabTextSize)
UpdateChatBarTextSize(ChatSettings.ChatBarTextSize)
UpdateDraggable(ChatSettings.WindowDraggable)
UpdateResizable(ChatSettings.WindowResizable)
UpdateShowChannelsBar(ChatSettings.ShowChannelsBar)
ChatSettings.SettingsChanged:connect(function(setting, value)
if (setting == "WindowDraggable") then
UpdateDraggable(value)
elseif (setting == "WindowResizable") then
UpdateResizable(value)
elseif (setting == "ChatChannelsTabTextSize") then
UpdateChatChannelsTabTextSize(value)
elseif (setting == "ChatBarTextSize") then
UpdateChatBarTextSize(value)
elseif (setting == "ShowChannelsBar") then
UpdateShowChannelsBar(value)
end
end)
self.GuiObject = BaseFrame
self.GuiObjects.BaseFrame = BaseFrame
self.GuiObjects.ChatBarParentFrame = ChatBarParentFrame
self.GuiObjects.ChannelsBarParentFrame = ChannelsBarParentFrame
self.GuiObjects.ChatChannelParentFrame = ChatChannelParentFrame
self.GuiObjects.ChatResizerFrame = ChatResizerFrame
self.GuiObjects.ResizeIcon = ResizeIcon
self:AnimGuiObjects()
end
function methods:GetChatBar()
return self.ChatBar
end
function methods:RegisterChatBar(ChatBar)
self.ChatBar = ChatBar
self.ChatBar:CreateGuiObjects(self.GuiObjects.ChatBarParentFrame)
end
function methods:RegisterChannelsBar(ChannelsBar)
self.ChannelsBar = ChannelsBar
self.ChannelsBar:CreateGuiObjects(self.GuiObjects.ChannelsBarParentFrame)
end
function methods:RegisterMessageLogDisplay(MessageLogDisplay)
self.MessageLogDisplay = MessageLogDisplay
self.MessageLogDisplay.GuiObject.Parent = self.GuiObjects.ChatChannelParentFrame
end
function methods:AddChannel(channelName)
if (self:GetChannel(channelName)) then
error("Channel '" .. channelName .. "' already exists!")
return
end
local channel = moduleChatChannel.new(channelName, self.MessageLogDisplay)
self.Channels[channelName:lower()] = channel
channel:SetActive(false)
local tab = self.ChannelsBar:AddChannelTab(channelName)
tab.NameTag.MouseButton1Click:connect(function()
self:SwitchCurrentChannel(channelName)
end)
channel:RegisterChannelTab(tab)
return channel
end
function methods:GetFirstChannel()
--// Channels are not indexed numerically, so this function is necessary.
--// Grabs and returns the first channel it happens to, or nil if none exist.
for i, v in pairs(self.Channels) do
return v
end
return nil
end
function methods:RemoveChannel(channelName)
if (not self:GetChannel(channelName)) then
error("Channel '" .. channelName .. "' does not exist!")
end
local indexName = channelName:lower()
local needsChannelSwitch = false
if (self.Channels[indexName] == self:GetCurrentChannel()) then
needsChannelSwitch = true
self:SwitchCurrentChannel(nil)
end
self.Channels[indexName]:Destroy()
self.Channels[indexName] = nil
self.ChannelsBar:RemoveChannelTab(channelName)
if (needsChannelSwitch) then
local generalChannelExists = (self:GetChannel(ChatSettings.GeneralChannelName) ~= nil)
local removingGeneralChannel = (indexName == ChatSettings.GeneralChannelName:lower())
local targetSwitchChannel = nil
if (generalChannelExists and not removingGeneralChannel) then
targetSwitchChannel = ChatSettings.GeneralChannelName
else
local firstChannel = self:GetFirstChannel()
targetSwitchChannel = (firstChannel and firstChannel.Name or nil)
end
self:SwitchCurrentChannel(targetSwitchChannel)
end
if not ChatSettings.ShowChannelsBar then
if self.ChatBar.TargetChannel == channelName then
self.ChatBar:SetChannelTarget(ChatSettings.GeneralChannelName)
end
end
end
function methods:GetChannel(channelName)
return channelName and self.Channels[channelName:lower()] or nil
end
function methods:GetTargetMessageChannel()
if (not ChatSettings.ShowChannelsBar) then
return self.ChatBar.TargetChannel
else
local curChannel = self:GetCurrentChannel()
return curChannel and curChannel.Name
end
end
function methods:GetCurrentChannel()
return self.CurrentChannel
end
function methods:SwitchCurrentChannel(channelName)
if (not ChatSettings.ShowChannelsBar) then
local targ = self:GetChannel(channelName)
if (targ) then
self.ChatBar:SetChannelTarget(targ.Name)
end
channelName = ChatSettings.GeneralChannelName
end
local cur = self:GetCurrentChannel()
local new = self:GetChannel(channelName)
if new == nil then
error(string.format("Channel '%s' does not exist.", channelName))
end
if (new ~= cur) then
if (cur) then
cur:SetActive(false)
local tab = self.ChannelsBar:GetChannelTab(cur.Name)
tab:SetActive(false)
end
if (new) then
new:SetActive(true)
local tab = self.ChannelsBar:GetChannelTab(new.Name)
tab:SetActive(true)
end
self.CurrentChannel = new
end
end
function methods:UpdateFrameVisibility()
self.GuiObject.Visible = (self.Visible and self.CoreGuiEnabled)
end
function methods:GetVisible()
return self.Visible
end
function methods:SetVisible(visible)
self.Visible = visible
self:UpdateFrameVisibility()
end
function methods:GetCoreGuiEnabled()
return self.CoreGuiEnabled
end
function methods:SetCoreGuiEnabled(enabled)
self.CoreGuiEnabled = enabled
self:UpdateFrameVisibility()
end
function methods:EnableResizable()
self.GuiObjects.ChatResizerFrame.Active = true
end
function methods:DisableResizable()
self.GuiObjects.ChatResizerFrame.Active = false
end
function methods:FadeOutBackground(duration)
self.ChannelsBar:FadeOutBackground(duration)
self.MessageLogDisplay:FadeOutBackground(duration)
self.ChatBar:FadeOutBackground(duration)
self.AnimParams.Background_TargetTransparency = 1
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:FadeInBackground(duration)
self.ChannelsBar:FadeInBackground(duration)
self.MessageLogDisplay:FadeInBackground(duration)
self.ChatBar:FadeInBackground(duration)
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:FadeOutText(duration)
self.MessageLogDisplay:FadeOutText(duration)
self.ChannelsBar:FadeOutText(duration)
end
function methods:FadeInText(duration)
self.MessageLogDisplay:FadeInText(duration)
self.ChannelsBar:FadeInText(duration)
end
function methods:AnimGuiObjects()
self.GuiObjects.ChatChannelParentFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.ChatResizerFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.ResizeIcon.ImageTransparency = self.AnimParams.Background_CurrentTransparency
end
function methods:InitializeAnimParams()
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_CurrentTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(0)
end
function methods:Update(dtScale)
self.ChatBar:Update(dtScale)
self.ChannelsBar:Update(dtScale)
self.MessageLogDisplay:Update(dtScale)
self.AnimParams.Background_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Background_CurrentTransparency,
self.AnimParams.Background_TargetTransparency,
self.AnimParams.Background_NormalizedExptValue,
dtScale
)
self:AnimGuiObjects()
end
|
-- Waits for a new character to be added if the current one is invalid
-- (Ensures that you don't have the old dead character after a respawn)
|
function UTIL.WaitForValidCharacter(player)
local character = player.Character
if not character or not character.Parent or not character:FindFirstChild('Humanoid') or character.Humanoid.Health <= 0 then
player.CharacterAdded:Wait()
wait()
character = player.Character
end
return character
end
|
--[=[
Observes showing a basic pane
@param basicPane BasicPane
@return Observable<boolean>
]=]
|
function BasicPaneUtils.observeShow(basicPane)
return BasicPaneUtils.observeVisible(basicPane):Pipe({
Rx.where(function(isVisible)
return isVisible
end)
})
end
return BasicPaneUtils
|
-- << FUNCTIONS >>
|
function module:GetProductInfo(AssetId, InfoType)
local Success, Value = pcall(main.marketplaceService.GetProductInfo, main.marketplaceService, AssetId, InfoType or Enum.InfoType.Asset)
return Success and Value
end
function module:SaveMap(speaker)
local mapBackup = main.ss:FindFirstChild("HDAdminMapBackup")
if mapBackup then
local terrain = workspace:FindFirstChildOfClass("Terrain")
main.mapBackupTerrain = terrain and terrain:CopyRegion(terrain.MaxExtents)
if speaker then
main:GetModule("cf"):FormatAndFireNotice(speaker, "SaveMap1")
end
mapBackup:ClearAllChildren()
for a,b in pairs(workspace:GetChildren()) do
if not b:IsA("Terrain") and b.Archivable and b.Name ~= "HD Admin" and not b:IsA("Script") and not main.players:GetPlayerFromCharacter(b) then
local copy = b:Clone()
copy.Parent = mapBackup
end
end
if speaker then
main:GetModule("cf"):FormatAndFireNotice(speaker, "SaveMap2")
end
end
end
function module:ExecuteCommand(speaker, args, command, other)
other = other or {}
local returnInfo
local extraDetails = other.ExtraDetails
extraDetails = extraDetails or {}
local unFunction = other.UnFunction
local clientCommand = command.ClientCommand
local clientCommandToActivate = command.ClientCommandToActivate
local commandName = command.Name
--Decide if Undo or Normal function
local functionTypes = {Function = "Function", PreFunction = "PreFunction"}
if unFunction then
for funcType, value in pairs(functionTypes) do
functionTypes[funcType] = "Un"..value
end
end
--Check for PreFunctions
local PreFunction = command[functionTypes.PreFunction]
if PreFunction then
local newArgs, newExtraDetails = PreFunction(speaker, args, command, extraDetails)
args = newArgs or args
extraDetails = newExtraDetails or extraDetails
end
--Client Commands
local plrToFireTo = speaker
local checkForPlr = args[1]
if checkForPlr and type(checkForPlr) == "userdata" and typeof(checkForPlr) == "Instance" and checkForPlr.Parent == main.players and not command.FireToSpeaker then
plrToFireTo = checkForPlr
end
if clientCommand then
if command.FireAllClients then
main.signals.ExecuteClientCommand:FireAllClients{speaker, args, command.Name, other}
else
main.signals.ExecuteClientCommand:FireClient(plrToFireTo, {speaker, args, command.Name, other})
end
elseif clientCommandToActivate then
if unFunction then
main.pd[plrToFireTo].CommandsActive[commandName] = nil
main.signals.DeactivateClientCommand:FireClient(plrToFireTo, {commandName})
else
extraDetails.Speed = tonumber(args[2])
main.pd[plrToFireTo].CommandsActive[commandName] = true
main.signals.ActivateClientCommand:FireClient(plrToFireTo, {commandName, extraDetails})
end
end
--Execute Command Function
local Function = command[functionTypes.Function]
if Function then
returnInfo = Function(speaker, args, command, extraDetails)
end
return returnInfo
end
function module:FormatAndFireError2(plr, noticeName, extraDetails, ...)
local notice = main:GetModule("cf"):FormatNotice2(noticeName, extraDetails, ...)
main.signals.Error:FireClient(plr, notice)
end
function module:FormatAndFireError(plr, noticeName, ...)
local notice = main:GetModule("cf"):FormatNotice(noticeName, ...)
main.signals.Error:FireClient(plr, notice)
end
function module:FormatAndFireNotice2(plr, noticeName, extraDetails, ...)
local notice = main:GetModule("cf"):FormatNotice2(noticeName, extraDetails, ...)
main.signals.Notice:FireClient(plr, notice)
end
function module:FormatAndFireNotice(plr, noticeName, ...)
local notice = main:GetModule("cf"):FormatNotice(noticeName, ...)
main.signals.Notice:FireClient(plr, notice)
end
function module:Error(player, title, message)
main.signals.Error:FireClient(player, {title, message})
end
function module:Notice(player, title, message)
main.signals.Notice:FireClient(player, {title, message})
end
function module:GetAmountOfServers()
local topicId = "GetServers".. math.random(1,100000)
local totalServers = 0
local subFunc = main.messagingService:SubscribeAsync(topicId, function(message)
totalServers = totalServers + 1
end)
main.messagingService:PublishAsync("GetAmountOfServers", topicId)
wait(0.5)
subFunc:Disconnect()
return totalServers
end
function module:DisplayPollResults(plr, data)
main.signals.CreateMenu:FireClient(plr, {MenuName = "pollResults", Data = data, TemplateId = 11})
end
function module:BeginPoll(data, participants)
if participants == nil then
participants = {}
for i,plr in pairs(main.players:GetChildren()) do
table.insert(participants, plr)
end
end
local validPlayers = {}
local votes = {}
local totalParticipants = #participants
--Setup remote
local remote = Instance.new("RemoteEvent")
remote.Name = "HDAdminPoll"..data.PollId
remote.OnServerEvent:Connect(function(plr, answerId)
if validPlayers[plr] then
votes[plr] = answerId
end
end)
remote.Parent = workspace
data.Remote = remote
--Vote players
for i, plr in pairs(participants) do
validPlayers[plr] = true
main.signals.CreateMenu:FireClient(plr, {MenuName = "poll", Data = data, TemplateId = 10})
end
for i = 1, (data.VoteTime + 1) do
wait(1)
local totalVotes = 0
for plr, answerId in pairs(votes) do
totalVotes = totalVotes + 1
end
if totalVotes >= totalParticipants then
break
end
end
--Calculate results
local scores = {}
for i = 1, #data.Answers do
table.insert(scores, 0)
end
data.Results = {}
local totalVotes = 0
local highestScore = 0
for plr, answerId in pairs(votes) do
local score = scores[answerId] + 1
if score > highestScore then
highestScore = score
end
scores[answerId] = score
totalVotes = totalVotes + 1
end
local didNotVote = totalParticipants - totalVotes
if didNotVote > highestScore then
highestScore = didNotVote
end
for i,answer in pairs(data.Answers) do
local answerVotes = scores[i]
table.insert(data.Results, {
Answer = answer;
Votes = answerVotes;
Percentage = answerVotes/highestScore;
}
)
end
table.insert(scores, didNotVote)
table.insert(data.Results, {
Answer = "Did Not Vote";
Votes = didNotVote;
Percentage = didNotVote/highestScore;
})
--Clean up
remote:Destroy()
--Return data
return data, scores
end
function module:GetBannedUserDetails(plrArg)
local targetName, targetId, targetReason
local toScan = {main.serverBans, main.sd.Banland.Records}
local timeNow = os.time()
for section, records in pairs(toScan) do
for i, record in pairs(records) do
local banTime = record.BanTime
if not tonumber(banTime) or timeNow < (banTime-30) then
local userName = main:GetModule("cf"):GetName(record.UserId)
if string.sub(string.lower(userName), 1, #plrArg) == plrArg then
return {userName, record.UserId, record.Reason, record.BannedBy}, record
end
end
end
end
end
function module:BanPlayer(userId, record)
local plr = main.players:GetPlayerByUserId(userId)
--Check if ban expired
local banTime = record.BanTime
if tonumber(banTime) and os.time() > (banTime-30) then
local server = record.Server
if server == "Current" then
local recordToRemovePos = main:GetModule("cf"):FindUserIdInRecord(main.serverBans, record.UserId)
if recordToRemovePos then
table.remove(main.serverBans, recordToRemovePos)
end
else
main:GetModule("SystemData"):InsertStat("Banland", "RecordsToRemove", record)
end
-- Ban player
else
local untilString = "."
local banDateString = "Ban Length: Infinite"
if record.BanTime ~= "Infinite" and plr then
local banTime = record.BanTime
local serverDate = os.date("*t", banTime)
local date
coroutine.wrap(function()
local success, clientDate = pcall(function() return main.signals.GetLocalDate:InvokeClient(plr, banTime) end)
if success then
date = clientDate
else
return
end
end)()
local startTick = tick()
repeat wait(0.1) until date or tick() - startTick > 2
if type(date) ~= "table" then
date = {}
end
banDateString = main:GetModule("cf"):GetBanDateString(date, serverDate)
untilString = ", until:"
end
local serverType = "all servers"
if record.Server == "Current" then
serverType = "this server"
end
local reason = record.Reason
if reason == "" or reason == " " then
reason = "Empty"
else
reason = "'".. reason.."'"
end
local finalBanMessage = "You're banned from "..serverType..untilString.." \n\n"..banDateString.."\n\nReason: ".. reason.."\n"
if plr then
plr:Kick(finalBanMessage)
end
end
end
function module:UpdateBanPlayerArg(speaker, plrArg)
local _, targetPlayersArray, individual = main.modules.Qualifiers:ParseQualifier(plrArg, speaker)
if individual and #targetPlayersArray > 0 then
plrArg = targetPlayersArray[1].Name
end
return plrArg
end
function module:FindUserIdInRecord(records, userId)
for i,record in pairs(records) do
if tostring(record["UserId"]) == tostring(userId) then
return i
end
end
return false
end
function module:GetLog(logName)
local log = {}
for _,record in pairs(main.logs[logName]) do
local newRecord = {}
for detailName, detail in pairs(record) do
newRecord[detailName] = detail
end
table.insert(log, 1, newRecord)
end
return log
end
function module:PrivateMessage(sender, targetPlr, message)
local senderPerms = main.permissionToReplyToPrivateMessage[sender]
if senderPerms == nil then
main.permissionToReplyToPrivateMessage[sender] = {}
end
main.permissionToReplyToPrivateMessage[sender][targetPlr] = true
main:GetModule("cf"):FormatAndFireNotice2(targetPlr, "ReceivedPM", {"PM", sender, message}, sender.Name)
end
function module:GetStat(plr, statName)
if statName then
local leaderstats = plr:FindFirstChild("leaderstats")
if leaderstats then
local stat = leaderstats:FindFirstChild(statName)
if stat then
return stat
end
end
end
end
function module:GetColorFromString(argToProcess)
local finalColor
if argToProcess then
argToProcess = string.lower(argToProcess)
for i, colorInfo in pairs(main.settings.Colors) do
local shortName = string.lower(colorInfo[1])
if (argToProcess == shortName) then
finalColor = colorInfo[3]
break
end
end
if not finalColor then
for i, colorInfo in pairs(main.settings.Colors) do
local fullName = string.lower(colorInfo[2])
if (argToProcess == string.sub(fullName,1,#argToProcess)) then
finalColor = colorInfo[3]
break
end
end
end
end
return finalColor
end
function module:RemoveControlPlr(controller)
if controller and main.pd[controller] then
local controlPlr = main.pd[controller].Items["ControlPlr"]
if controlPlr then
local originalCFrame = controlPlr.FakePlayer.Head.CFrame
controlPlr:Destroy()
main.pd[controller].Items["ControlPlr"] = nil
main:GetModule("MorphHandler"):BecomeTargetPlayer(controller, controller.UserId)
local controllerHead = main:GetModule("cf"):GetHead(controller)
local fakeName = main:GetModule("cf"):GetFakeName(controller)
if controllerHead and fakeName then
fakeName:Destroy()
controllerHead.Transparency = 0
controllerHead.CFrame = originalCFrame
end
end
end
end
function module:RemoveUnderControl(plr)
local underControl = main.pd[plr].Items["UnderControl"]
if underControl then
underControl:Destroy()
main.pd[plr].Items["UnderControl"] = nil
local plrHumanoid = main:GetModule("cf"):GetHumanoid(plr)
if plrHumanoid then
main.signals.SetCameraSubject:FireClient(plr, (plrHumanoid))
--main:GetModule("cf"):SetTransparency(plr.Character, 0, true)
--main:GetModule("cf"):Movement(true, plr)
plr.Character.Parent = workspace
end
end
end
function module:TeleportPlayers(plrsToTeleport, targetPlr)
local targetHead = main:GetModule("cf"):GetHead(targetPlr)
if targetHead then
local totalPlrs = #plrsToTeleport
local gap = 2
for i,plr in pairs(plrsToTeleport) do
local head = main:GetModule("cf"):GetHead(plr)
local targetCFrame = targetHead.CFrame * CFrame.new(-(totalPlrs*(gap/2))+(i*gap)-(gap/2), 0, -4) * CFrame.Angles(0, math.rad(180), 0)
if head then
main:GetModule("cf"):UnSeatPlayer(plr)
head.CFrame = targetCFrame
end
end
end
end
function module:ConvertCharacterToRig(plr, rigType)
--
local humanoid = main:GetModule("cf"):GetHumanoid(plr)
local head = main:GetModule("cf"):GetHead(plr)
if humanoid and head then
local newRig = main.server.Assets["Rig"..rigType]:Clone()
local newHumanoid = newRig.Humanoid
local originalCFrame = head.CFrame
newRig.Name = plr.Name
for a,b in pairs(plr.Character:GetChildren()) do
if b:IsA("Accessory") or b:IsA("Pants") or b:IsA("Shirt") or b:IsA("ShirtGraphic") or b:IsA("BodyColors") then
b.Parent = newRig
elseif b.Name == "Head" and b:FindFirstChild("face") then
newRig.Head.face.Texture = b.face.Texture
end
end
plr.Character = newRig
newRig.Parent = workspace
newRig.Head.CFrame = originalCFrame
--local desc = main.players:GetHumanoidDescriptionFromUserId(plr.UserId)
--newHumanoid:ApplyDescription(desc)
main.signals.ChangeMainVariable:FireClient(plr, {"humanoidRigType", Enum.HumanoidRigType[rigType]})
end
--
end
function module:GetFakeName(plr)
for a,b in pairs(plr.Character:GetChildren()) do
if b:IsA("Model") and b:FindFirstChild("FakeHumanoid") then
return b
end
end
end
function module:CreateFakeName(plr, name)
local head = main:GetModule("cf"):GetHead(plr)
if head then
local fakeName = module:GetFakeName(plr)
if not fakeName then
fakeName = Instance.new("Model")
local fakeHead = head:Clone()
fakeHead.Name = "Head"
fakeHead.Parent = fakeName
fakeHead.face.Transparency = 1
local weld = Instance.new("WeldConstraint")
weld.Part0 = fakeHead
weld.Part1 = head
weld.Parent = fakeHead
local fakeHumanoid = Instance.new("Humanoid")
fakeHumanoid.Name = "FakeHumanoid"
fakeHumanoid.Parent = fakeName
fakeName.Parent = plr.Character
head.Transparency = 1
end
if name then
fakeName.Name = name
end
end
end
function module:RemoveEffect(plr, effectType)
local effectName = "HDAdmin"..effectType
if plr.Character then
for a,b in pairs(plr.Character:GetDescendants()) do
if b.Name == effectName then
b:Destroy()
break
end
end
end
end
function module:CreateEffect(plr, effectType)
local hrp = main:GetModule("cf"):GetHRP(plr)
local targetParent = hrp
if effectType == "ForceField" then
targetParent = plr.Character
end
if hrp then
local effectName = "HDAdmin"..effectType
local effect = targetParent:FindFirstChild(effectName)
if not effect then
effect = Instance.new(effectType)
effect.Name = effectName
effect.Parent = targetParent
end
end
end
function module:UnFreeze(args)
local plr = args[1]
local itemName = "FreezeBlock"
local item = main.pd[plr].Items[itemName]
if item then
main.pd[plr].Items[itemName] = nil
main:GetModule("cf"):Movement(true, plr)
main:GetModule("cf"):SetTransparency(plr.Character, 0)
local head = main:GetModule("cf"):GetHead(plr)
if head then
head.CFrame = item.FreezeClone.Head.CFrame
end
local humanoid = main:GetModule("cf"):GetHumanoid(plr)
if humanoid then
main.signals.SetCameraSubject:FireClient(plr, (humanoid))
end
item:Destroy()
end
end
function module:FilterString(text, fromPlayer, playerTo)
local filteredText = ""
local success, message = pcall(function()
filteredText = main.chat:FilterStringAsync(text, fromPlayer, playerTo)
end)
if not success then
filteredText = "####"
end
return filteredText
end
function module:FilterBroadcast(text, fromPlayer)
local filteredText = ""
local success, message = pcall(function()
filteredText = main.chat:FilterStringForBroadcast(text, fromPlayer)
end)
if not success then
filteredText = "####"
end
return filteredText
end
function module:DonorNotice(player, pdata)
if not pdata.PromptedDonor then
main:GetModule("PlayerData"):ChangeStat(player, "PromptedDonor", true)
main:GetModule("cf"):FormatAndFireNotice(player, "WelcomeDonor")
end
end
function module:CheckAndRankToDonor(player, pdata, gamepassId)
gamepassId = tostring(gamepassId)
if not pdata.Donor and (gamepassId == tostring(main.products.Donor) or gamepassId == tostring(main.products.OldDonor)) then
main:GetModule("PlayerData"):ChangeStat(player, "Donor", true)
module:DonorNotice(player, pdata)
end
end
function module:Unrank(plr)
main:GetModule("PlayerData"):ChangeStat(plr, "Rank", 0)
main.serverAdmins[plr.Name] = nil
main:GetModule("PlayerData"):ChangeStat(plr, "SaveRank", false)
main:GetModule("cf"):FormatAndFireNotice(plr, "UnRank")
return("Unranked")
end
function module:GetRankType(plr)
local rankType = "Server"
local pdata = main.pd[plr]
if pdata then
if pdata.AutomaticRank then
rankType ="Auto"
elseif pdata.SaveRank == true then
rankType = "Perm"
elseif main.serverAdmins[plr.Name] == nil then
rankType = "Temp"
end
end
return rankType
end
function module:SetRank(plr, speakerUserId, rankId, rankType)
main:GetModule("PlayerData"):ChangeStat(plr, "Rank", rankId)
main:GetModule("PlayerData"):ChangeStat(plr, "AutomaticRank", false)
local stringRankType = "rank"
if rankType == "Server" then
main.serverAdmins[plr.Name] = true
elseif rankType == "Perm" then
main:GetModule("PlayerData"):ChangeStat(plr, "PermRankedBy", speakerUserId)
main:GetModule("PlayerData"):ChangeStat(plr, "SaveRank", true)
main.serverAdmins[plr.Name] = nil
stringRankType = "permRank"
elseif rankType == "Temp" then
main.serverAdmins[plr.Name] = nil
stringRankType = "tempRank"
end
local targetRankName = main:GetModule("cf"):GetRankName(rankId)
main:GetModule("cf"):FormatAndFireNotice(plr, "SetRank", stringRankType, targetRankName)
end
function module:RankPlayerCommand(speaker, args, commandRankType)
local plr = args[1]
local targetRankId = args[2]
local plrRank = main.pd[plr].Rank
local speakerRank = main.pd[speaker].Rank
if targetRankId == 0 then
module:Unrank(plr)
return("Unranked")
elseif speakerRank > targetRankId then
module:SetRank(plr, speaker.UserId, targetRankId, commandRankType)
return("Ranked")
end
end
function module:RankPlayerSimple(player, newRank, automaticRank)
local pdata = main.pd[player]
if tonumber(newRank) == nil then
newRank = main:GetModule("cf"):GetRankId(newRank)
end
if pdata.Rank <= newRank then
if automaticRank then
main:GetModule("PlayerData"):ChangeStat(player, "AutomaticRank", newRank)
end
if pdata.Rank < newRank then
main:GetModule("PlayerData"):ChangeStat(player, "Rank", newRank)
end
end
end
return module
|
-- find player's head pos
|
local vCharacter = Tool.Parent
local vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
local head = vCharacter:FindFirstChild("Head")
if not head then return end
local dir = mouse_pos - head.Position
dir = computeDirection(dir)
local launch = head.Position + 5 * dir
local delta = mouse_pos - launch
local dy = delta.y
local new_delta = Vector3.new(delta.x, 0, delta.z)
delta = new_delta
local dx = delta.magnitude
local unit_delta = delta.unit
-- acceleration due to gravity in RBX units
local g = (-9.81 * 20)
local theta = computeLaunchAngle( dx, dy, g)
local vy = math.sin(theta)
local xz = math.cos(theta)
local vx = unit_delta.x * xz
local vz = unit_delta.z * xz
local missile = Pellet:Clone()
missile.Position = launch
missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY
missile.PelletScript.Disabled = false
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = workspace
end
function computeLaunchAngle(dx,dy,grav)
-- arcane
-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
local g = math.abs(grav)
local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
if inRoot <= 0 then
return .25 * math.pi
end
local root = math.sqrt(inRoot)
local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)
local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
local answer1 = math.atan(inATan1)
local answer2 = math.atan(inATan2)
if answer1 < answer2 then return answer1 end
return answer2
end
function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if not humanoid then
print("Humanoid not found")
return
end
local targetPos = MouseLoc:InvokeClient(game:GetService("Players"):GetPlayerFromCharacter(character))
fire(targetPos)
wait(.2)
Tool.Enabled = true
end
script.Parent.Activated:Connect(onActivated)
|
--Refer to Settings.COMPARISON_CHECKS
|
local function comparePosition(self)
if self._currentWaypoint == #self._waypoints then return end
self._position._count = ((self._agent.PrimaryPart.Position - self._position._last).Magnitude <= 0.07 and (self._position._count + 1)) or 0
self._position._last = self._agent.PrimaryPart.Position
if self._position._count >= self._settings.COMPARISON_CHECKS then
if self._settings.JUMP_WHEN_STUCK then
setJumpState(self)
end
declareError(self, self.ErrorType.AgentStuck)
end
end
|
--[[
Create a copy of a list with only values for which `callback` returns true.
Calls the callback with (value, index).
]]
|
local function filter(list, callback)
local new = {}
local index = 1
for i = 1, #list do
local value = list[i]
if callback(value, i) then
new[index] = value
index = index + 1
end
end
return new
end
return filter
|
--[[ Flags ]]
|
local FFlagUserExcludeNonCollidableForPathfindingSuccess, FFlagUserExcludeNonCollidableForPathfindingResult =
pcall(function() return UserSettings():IsUserFeatureEnabled("UserExcludeNonCollidableForPathfinding") end)
local FFlagUserExcludeNonCollidableForPathfinding = FFlagUserExcludeNonCollidableForPathfindingSuccess and FFlagUserExcludeNonCollidableForPathfindingResult
local FFlagUserClickToMoveSupportAgentCanClimbSuccess, FFlagUserClickToMoveSupportAgentCanClimbResult =
pcall(function() return UserSettings():IsUserFeatureEnabled("UserClickToMoveSupportAgentCanClimb2") end)
local FFlagUserClickToMoveSupportAgentCanClimb = FFlagUserClickToMoveSupportAgentCanClimbSuccess and FFlagUserClickToMoveSupportAgentCanClimbResult
|
-- Initialize the tool
|
local WeldTool = {
Name = 'Weld Tool';
Color = BrickColor.new 'Really black';
}
WeldTool.ManualText = [[<font face="GothamBlack" size="16">Weld Tool 🛠</font>
Allows you to weld parts to hold them together.<font size="6"><br /></font>
<b>NOTE: </b>Welds may break if parts are individually moved.]]
|
-- Load countdown GUI
|
local countdownGui = Guis:WaitForChild("CountdownGui")
countdownGui.Parent = player.PlayerGui
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
local MutterDelay = math.random(2,6) -- How many seconds before it makes another sound
|
-- Basic settings
|
local MAX_LENGTH = 30
local filterService = game:GetService("TextService")
game.ReplicatedStorage.Interactions.Server.SetPetName.OnServerInvoke = function(plr, newName)
-- Check length
if string.len(newName) <= MAX_LENGTH then
-- Run through filter service and set
plr.Settings.PetName.Value = newName
-- Set pet name
for _, i in pairs(game.Players:GetPlayers()) do
spawn(function()
game.ReplicatedStorage.Interactions.Client.SetPetName:FireAllClients(plr, filterService:FilterStringAsync(newName, plr.UserId):GetNonChatStringForUserAsync(i.UserId))
end)
end
return "NAME SET"
else
return "TOO LONG"
end
end
|
-- ROBLOX TODO: fix PrettyFormat types imports
|
type PrettyFormatOptions = PrettyFormat_.OptionsReceived
local prettyFormat = PrettyFormat.format
local getSerializers = require(CurrentModule.plugins).getSerializers
local types = require(CurrentModule.types)
type SnapshotData = types.SnapshotData
local SNAPSHOT_VERSION = "1"
|
--[[ By: Brutez. Script Fixed By Xcorrectgamermaster ]]
|
--
local JeffTheKillerScript=script;
repeat wait(0.1)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
local JeffTheKiller=JeffTheKillerScript.Parent;
function raycast(Spos,vec,currentdist)
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
if hit2~=nil and pos2 then
if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
local currentdist=currentdist-(pos2-Spos).magnitude;
return raycast(pos2,vec,currentdist);
end;
end;
return hit2,pos2;
end;
function RayCast(Position,Direction,MaxDistance,IgnoreList)
return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
end;
local JeffTheKillerHumanoid;
for _,Child in pairs(JeffTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JeffTheKillerHumanoid=Child;
end;
end;
local AttackDebounce=false;
local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Knife");
local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
local WalkDebounce=false;
local Notice=false;
local JeffLaughDebounce=false;
local MusicDebounce=false;
local NoticeDebounce=false;
local ChosenMusic;
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0;
function FindNearestBae()
local NoticeDistance=70;
local TargetMain;
for _,TargetModel in pairs(game:GetService("Workspace"):GetChildren())do
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("HumaniodRootPart")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("AttackAnimation"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
wait(0.2);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(20);
if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
end;
end;
wait(1);
AttackDebounce=false;
end);
end;
end;
end;
end;
end;
return TargetMain;
end;
while wait(0.1)do
local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
local Jumpable=false;
if Blockage then
Jumpable=true;
if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
local BlockageHumanoid;
for _,Child in pairs(Blockage.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
BlockageHumanoid=Child;
end;
end;
if Blockage and Blockage:IsA("Terrain")then
local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
if CellMaterial==Enum.CellMaterial.Water then
Jumpable=false;
end;
elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool" then
Jumpable=false;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
wait(1)
JeffTheKillerHumanoid.Jump=true;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
spawn(function()
WalkDebounce=true;
local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
local RayTarget,endPoint=game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
if RayTarget then
local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
JeffTheKillerHeadFootStepClone:Play();
JeffTheKillerHeadFootStepClone:Destroy();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
wait(0.4);
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
wait(0.15);
end
end;
WalkDebounce=false;
end);
end;
local MainTarget=FindNearestBae();
local FoundHumanoid;
if MainTarget then
for _,Child in pairs(MainTarget.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
wait(1)
JeffTheKillerHumanoid.Jump=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<99999999999999999999 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and not JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("RakeThemeVolume").Value;
JeffTheKillerHead:FindFirstChild("RakeTheme"):Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>9999999999999999999 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
if not JeffLaughDebounce then
spawn(function()
JeffLaughDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
JeffLaughDebounce=false;
end);
end;
end;
end;
if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
local MusicChoice=math.random(1,2);
if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
end;
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
ChosenMusic.Volume=0.5;
ChosenMusic:Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
if not MusicDebounce then
spawn(function()
MusicDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
end;
end;
if not MainTarget and not JeffLaughDebounce then
spawn(function()
JeffLaughDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
JeffLaughDebounce=false;
end);
end;
if not MainTarget and not MusicDebounce then
spawn(function()
MusicDebounce=true;
repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
if MainTarget then
Notice=true;
if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Found")then
JeffTheKiller.Target.Value = true;
JeffTheKillerHead:FindFirstChild("Found"):Play();
wait(0.4);
JeffTheKillerHead:FindFirstChild("RakeScream"):Play();
NoticeDebounce=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
JeffTheKillerHumanoid.WalkSpeed=JeffTheKiller.Configuration.WalkSpeed.Value;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=1;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,game:GetService("Workspace"):FindFirstChild("Terrain"));
local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10;
if NeckRotation>-1.5 and NeckRotation<1.5 then
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0);
end;
if NeckRotation<-1.5 then
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.4,0.1,0,0.1,0.9);
elseif NeckRotation>1.5 then
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.1,0.08,0,0.08,-0.2);
end;
else
end;
else
Notice=false;
NoticeDebounce=false;
JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
JeffTheKiller.Target.Value=false;
end;
end;
spawn(function()
local AlreadyDo=false;
while wait(0.1) do
if JeffTheKiller.Target.Value==false and AlreadyDo==false then
JeffTheKiller.Wander.Disabled=false;
AlreadyDo=true;
wait(10);
AlreadyDo=false;
end;
if JeffTheKiller.Target.Value==true and AlreadyDo==false then
JeffTheKiller.Wander.Disabled=true;
AlreadyDo=true;
wait(10);
AlreadyDo=false;
end;
end;
end);
spawn(function()
while JeffTheKillerHumanoid.Health > 1 do
wait(1);
JeffTheKiller:FindFirstChild("Torso").Blood.Enabled = false;
JeffTheKiller:FindFirstChild("Torso").Blood2.Enabled = false;
JeffTheKillerHead.Eye1.BrickColor=BrickColor.new("Institutional white");
JeffTheKillerHead.Eye2.BrickColor=BrickColor.new("Institutional white");
end;
end);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="NPC";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=2000;
JeffTheKillerHumanoid.JumpPower=80;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end;
|
--// Handling Settings
|
Firerate = 60 / 700;
FireMode = 1;
|
-- Create a function to make the bear follow the player
|
function followPlayer(player)
local character = player.Character
if character then
local distance = (bear.PrimaryPart.Position - character.PrimaryPart.Position).Magnitude
if distance < 2 then
bear.Position = character.PrimaryPart.Position
end
end
end
|
--// Functions
|
function Weld(L_35_arg1, L_36_arg2, L_37_arg3)
local L_38_ = Instance.new("Motor6D", L_35_arg1)
L_38_.Part0 = L_35_arg1
L_38_.Part1 = L_36_arg2
L_38_.Name = L_35_arg1.Name
L_38_.C0 = L_37_arg3 or L_35_arg1.CFrame:inverse() * L_36_arg2.CFrame
return L_38_
end
|
--//Services//--
|
local Lighting = game:GetService("Lighting")
|
--- Sets whether the command is in a valid state or not.
-- Cannot submit if in invalid state.
|
function Window:SetIsValidInput(isValid, errorText)
Entry.TextBox.TextColor3 = isValid and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(255, 73, 73)
self.Valid = isValid
self._errorText = errorText
end
function Window:HideInvalidState()
Entry.TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
end
|
-- Keyboard controller is really keyboard and mouse controller
|
local computerInputTypeToModuleMap = {
[Enum.UserInputType.Keyboard] = Keyboard,
[Enum.UserInputType.MouseButton1] = Keyboard,
[Enum.UserInputType.MouseButton2] = Keyboard,
[Enum.UserInputType.MouseButton3] = Keyboard,
[Enum.UserInputType.MouseWheel] = Keyboard,
[Enum.UserInputType.MouseMovement] = Keyboard,
[Enum.UserInputType.Gamepad1] = Gamepad,
[Enum.UserInputType.Gamepad2] = Gamepad,
[Enum.UserInputType.Gamepad3] = Gamepad,
[Enum.UserInputType.Gamepad4] = Gamepad,
}
function ControlModule.new()
local self = setmetatable({},ControlModule)
-- The Modules above are used to construct controller instances as-needed, and this
-- table is a map from Module to the instance created from it
self.controllers = {}
self.activeControlModule = nil -- Used to prevent unnecessarily expensive checks on each input event
self.activeController = nil
self.touchJumpController = nil
self.moveFunction = Players.LocalPlayer.Move
self.humanoid = nil
self.lastInputType = Enum.UserInputType.None
-- For Roblox self.vehicleController
self.humanoidSeatedConn = nil
self.vehicleController = nil
self.touchControlFrame = nil
self.vehicleController = VehicleController.new(CONTROL_ACTION_PRIORITY)
Players.LocalPlayer.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end)
Players.LocalPlayer.CharacterRemoving:Connect(function(char) self:OnCharacterRemoving(char) end)
if Players.LocalPlayer.Character then
self:OnCharacterAdded(Players.LocalPlayer.Character)
end
RunService:BindToRenderStep("ControlScriptRenderstep", Enum.RenderPriority.Input.Value, function(dt) self:OnRenderStepped(dt) end)
UserInputService.LastInputTypeChanged:Connect(function(newLastInputType) self:OnLastInputTypeChanged(newLastInputType) end)
local propertyChangeListeners = {
UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function() self:OnTouchMovementModeChange() end),
Players.LocalPlayer:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function() self:OnTouchMovementModeChange() end),
UserGameSettings:GetPropertyChangedSignal("ComputerMovementMode"):Connect(function() self:OnComputerMovementModeChange() end),
Players.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function() self:OnComputerMovementModeChange() end),
}
--[[ Touch Device UI ]]--
self.playerGui = nil
self.touchGui = nil
self.playerGuiAddedConn = nil
if UserInputService.TouchEnabled then
self.playerGui = Players.LocalPlayer:FindFirstChildOfClass("PlayerGui")
if self.playerGui then
self:CreateTouchGuiContainer()
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
else
self.playerGuiAddedConn = Players.LocalPlayer.ChildAdded:Connect(function(child)
if child:IsA("PlayerGui") then
self.playerGui = child
self:CreateTouchGuiContainer()
self.playerGuiAddedConn:Disconnect()
self.playerGuiAddedConn = nil
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
end
end)
end
else
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
end
return self
end
|
-- A state object whose value is derived from other objects using a callback.
|
export type Computed<T> = PubTypes.Computed<T> & {
_oldDependencySet: Set<PubTypes.Dependency>,
_callback: () -> T,
_value: T
}
|
------------------------------------------------------------------------
-- ORDER OP
------------------------------------------------------------------------
|
local i = 0
for v in string.gmatch([[
MOVE LOADK LOADBOOL LOADNIL GETUPVAL
GETGLOBAL GETTABLE SETGLOBAL SETUPVAL SETTABLE
NEWTABLE SELF ADD SUB MUL
DIV MOD POW UNM NOT
LEN CONCAT JMP EQ LT
LE TEST TESTSET CALL TAILCALL
RETURN FORLOOP FORPREP TFORLOOP SETLIST
CLOSE CLOSURE VARARG
]], "%S+") do
local n = "OP_"..v
luaP.opnames[i] = v
luaP.OpCode[n] = i
luaP.ROpCode[i] = n
i = i + 1
end
luaP.NUM_OPCODES = i
|
-- This module is a class with a new() constructor function
|
VehicleSeating.SetRemotesFolder(RemotesFolder)
VehicleSeating.SetBindableEventsFolder(BindableEventsFolder)
local CharacterRemovingConnection = nil
local DriverSeat = Chassis.GetDriverSeat()
local AdditionalSeats = Chassis.GetPassengerSeats()
local LEG_PARTS_TO_REMOVE = {"RightFoot", "RightLowerLeg", "LeftFoot", "LeftLowerLeg"}
local ATTACHMENTS_TO_REMOVE = {"BodyBackAttachment", "WaistBackAttachment", "HatAttachment"}
local function setHatsAndLegsTransparency(obj, transparency)
if obj:IsA("Humanoid") then
obj = obj.Parent
elseif obj:IsA("Player") then
obj = obj.Character
end
for _, child in ipairs(obj:GetChildren()) do
if child:IsA("Accoutrement") then
local handle = child:FindFirstChild("Handle")
if handle then
local shouldRemove = false
for _, attachmentName in ipairs(ATTACHMENTS_TO_REMOVE) do
if handle:FindFirstChild(attachmentName) then
shouldRemove = true
end
end
if shouldRemove then
handle.Transparency = transparency
end
end
end
end
for _, legName in ipairs(LEG_PARTS_TO_REMOVE) do
local legPart = obj:FindFirstChild(legName)
if legPart then
legPart.Transparency = transparency
end
end
end
local function onExitSeat(obj, seat)
if obj:IsA("Player") then
RemotesFolder.ExitSeat:FireClient(obj, false)
local playerGui = obj:FindFirstChildOfClass("PlayerGui")
if playerGui then
local scriptContainer = playerGui:FindFirstChild(UniqueName .. "_ClientControls")
if scriptContainer then
scriptContainer:Destroy()
end
end
end
setHatsAndLegsTransparency(obj, 0)
if obj:IsA("Humanoid") then
obj.Sit = false
end
if CharacterRemovingConnection then
CharacterRemovingConnection:Disconnect()
CharacterRemovingConnection = nil
end
if seat == DriverSeat then
DriverSeat:SetNetworkOwnershipAuto()
Chassis.Reset()
end
end
local function onEnterSeat(obj, seat)
if seat and seat.Occupant then
local ShouldTakeOffHats = true
local prop = TopModel:GetAttribute("TakeOffAccessories")
if prop ~= nil then
ShouldTakeOffHats = prop
end
if ShouldTakeOffHats then
setHatsAndLegsTransparency(seat.Occupant, 1)
end
end
if not obj:IsA("Player") then
return
end
local playerGui = obj:FindFirstChildOfClass("PlayerGui")
if playerGui then
local screenGui = Instance.new("ScreenGui")
screenGui.Name = UniqueName .. "_ClientControls"
screenGui.ResetOnSpawn = true
screenGui.Parent = playerGui
CharacterRemovingConnection = obj.CharacterRemoving:Connect(function()
onExitSeat(obj)
end)
local localGuiModule = LocalGuiModulePrototype:Clone()
localGuiModule.Parent = screenGui
if seat == DriverSeat then
local driverScript = DriverScriptPrototype:Clone()
driverScript.CarValue.Value = TopModel
driverScript.Parent = screenGui
driverScript.Disabled = false
DriverSeat:SetNetworkOwner(obj)
else
local passengerScript = PassengerScriptPrototype:Clone()
passengerScript.CarValue.Value = TopModel
passengerScript.Parent = screenGui
passengerScript.Disabled = false
end
local scriptsReference = Instance.new("ObjectValue")
scriptsReference.Name = "ScriptsReference"
scriptsReference.Value = Scripts
scriptsReference.Parent = screenGui
end
end
RemotesFolder.LightToggle.OnServerEvent:Connect(function()
Chassis.ToggleLights()
end)
|
--Penthouse OC SPRAY
|
function onTouched(hit)
h = hit.Parent:findFirstChild("Humanoid")
xead = hit.Parent:findFirstChild("Head")
if h ~= nil then
h.Sit = true
h.Health = h.Health - 0.1
if game.Players:FindFirstChild(hit.Parent.Name) ~= nil then
local player = game.Players:FindFirstChild(hit.Parent.Name)
local gui = script.Parent.MaceGui:clone()
local sound = script.Parent.cough:clone()
gui.Parent = player.PlayerGui
gui.Script.Disabled = false
gui.Mute.Disabled = false
local oldsound = xead:FindFirstChild("cough")
if oldsound then oldsound:Destroy() end
if sound then sound.Parent = xead end
if sound then sound:Play() end
if sound then sound.TimePosition = 35 end
end
end
end
script.Parent.Touched:connect(onTouched)
|
--[[
Searches children of an instance, returning the first child containing an attribute
matching the given name and value.
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Sift = require(ReplicatedStorage.Dependencies.Sift)
local Attribute = require(ReplicatedStorage.Source.SharedConstants.Attribute)
local function findFirstChildWithAttribute(
parent: Instance,
attributeName: Attribute.EnumType,
attributeValue: any
): Instance?
local children = parent:GetChildren()
local index = Sift.Array.findWhere(children, function(instance: Instance)
return instance:GetAttribute(attributeName) == attributeValue
end)
return if index then children[index] else nil
end
return findFirstChildWithAttribute
|
-- [[ Variables ]
|
local ActiveHitboxes = {}
local Handler = {}
|
-- Testing AC FE support
|
local event = script.Parent
local car=script.Parent.Parent
local LichtNum = 0
event.OnServerEvent:connect(function(player,data)
if data['ToggleLight'] then
if car.Body.Light.on.Value==true then
car.Body.Light.on.Value=false
else
car.Body.Light.on.Value=true
end
elseif data['EnableBrakes'] then
car.Body.Brakes.on.Value=true
elseif data['DisableBrakes'] then
car.Body.Brakes.on.Value=false
elseif data['ToggleLeftBlink'] then
if car.Body.Left.on.Value==true then
car.Body.Left.on.Value=false
else
car.Body.Left.on.Value=true
end
elseif data['ToggleRightBlink'] then
if car.Body.Right.on.Value==true then
car.Body.Right.on.Value=false
else
car.Body.Right.on.Value=true
end
elseif data['ReverseOn'] then
car.Body.Reverse.on.Value=true
elseif data['ReverseOff'] then
car.Body.Reverse.on.Value=false
elseif data['ToggleStandlicht'] then
if LichtNum == 0 then
LichtNum = 2
car.Body.Headlight.on.Value = true
elseif LichtNum == 1 then
LichtNum = 2
car.Body.Headlight.on.Value = true
elseif LichtNum == 2 then
LichtNum = 3
car.Body.Highlight.on.Value = true
elseif LichtNum == 3 then
LichtNum = 1
car.Body.Highlight.on.Value = false
car.Body.Headlight.on.Value = false
end
elseif data["ToggleHazards"] then
if car.Body.hazards.Value == false then
car.Body.hazards.Value = true
car.Body.Left.on.Value=false
car.Body.Right.on.Value=false
car.Body.Left.on.Value=true
car.Body.Right.on.Value=true
elseif car.Body.hazards.Value == true then
car.Body.hazards.Value = false
car.Body.Left.on.Value=false
car.Body.Right.on.Value=false
end
end
end)
|
--[[
An xpcall() error handler to collect and parse useful information about
errors, such as clean messages and stack traces.
TODO: this should have a 'type' field for runtime type checking!
]]
|
local Package = script.Parent.Parent
local Types = require(Package.Types)
local function parseError(err: string): Types.Error
return {
type = "Error",
raw = err,
message = err:gsub("^.+:%d+:%s*", ""),
trace = debug.traceback(nil, 2)
}
end
return parseError
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 0
local slash_damage = 0
sword = script.Parent.Handle
Tool = script.Parent
function attack()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
attack()
wait(1)
Tool.Enabled = true
end
function onEquipped()
print("Running Move")
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
|
--[[**
ensures value is a number where value <= max
@param max The maximum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberMax(max)
return function(value)
local success = t.number(value)
if not success then
return false
end
if value <= max then
return true
else
return false
end
end
end
|
-- private functions
|
local type = type;
local unpack = unpack;
local insert = table.insert;
local R3 = Region3.new;
local v3 = Vector3.new;
local function centroid(t)
local sum = t[1] - t[1];
for i = 1, #t do sum = sum + t[i]; end;
return sum / #t;
end;
local function classify(part)
if (part.ClassName == "Part") then
if (part.Shape == Enum.PartType.Block) then
return region3.block(part.CFrame, part.Size);
elseif (part.Shape == Enum.PartType.Cylinder) then
return region3.cylinder(part.CFrame, part.Size);
elseif (part.Shape == Enum.PartType.Ball) then
return region3.ellipsoid(part.CFrame, part.Size);
end;
elseif (part.ClassName == "WedgePart") then
return region3.wedge(part.CFrame, part.Size);
elseif (part.ClassName == "CornerWedgePart") then
return region3.cornerWedge(part.CFrame, part.Size);
elseif (part:IsA("BasePart")) then -- mesh, CSG, truss, etc... just use block
return region3.block(part.CFrame, part.Size);
end;
end;
|
--// Init
|
log("Return init function");
return service.NewProxy({
__call = function(self, data)
log("Begin init");
local remoteName,depsName = string.match(data.Name, "(.*)\\(.*)")
Folder = service.Wrap(data.Folder --[[or folder and folder:Clone()]] or Folder)
setfenv(1,setmetatable({}, {__metatable = unique}))
client.Folder = Folder;
client.UIFolder = Folder:WaitForChild("UI",9e9);
client.Shared = Folder:WaitForChild("Shared",9e9);
client.Loader = data.Loader
client.Module = data.Module
client.DepsName = depsName
client.TrueStart = data.Start
client.LoadingTime = data.LoadingTime
client.RemoteName = remoteName
client.Changelog = oldReq(service_UnWrap(client.Shared.Changelog))
do
local MaterialIcons = oldReq(service_UnWrap(client.Shared.MatIcons))
client.MatIcons = setmetatable({}, {
__index = function(self, ind)
local materialIcon = MaterialIcons[ind]
if materialIcon then
self[ind] = string.format("rbxassetid://%d", materialIcon)
return self[ind]
end
end,
__metatable = "Adonis"
})
end
--// Toss deps into a table so we don't need to directly deal with the Folder instance they're in
log("Get dependencies")
for ind,obj in ipairs(Folder:WaitForChild("Dependencies",9e9):GetChildren()) do client.Deps[obj.Name] = obj end
--// Do this before we start hooking up events
log("Destroy script object")
--folder:Destroy()
script.Parent = nil --script:Destroy()
--// Intial setup
log("Initial services caching")
for ind, serv in ipairs(ServicesWeUse) do local temp = service[serv] end
--// Client specific service variables/functions
log("Add service specific")
ServiceSpecific.Player = service.Players.LocalPlayer or (function()
service.Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
return service.Players.LocalPlayer
end)();
ServiceSpecific.PlayerGui = ServiceSpecific.Player:FindFirstChildWhichIsA("PlayerGui");
if not ServiceSpecific.PlayerGui then
Routine(function()
local PlayerGui = ServiceSpecific.Player:WaitForChild("PlayerGui", 120)
if not PlayerGui then
logError("PlayerGui unable to be fetched? [Waited 120 Seconds]")
return;
end
ServiceSpecific.PlayerGui = PlayerGui
end)
end
--[[
-- // Doesn't seem to be used anymore
ServiceSpecific.SafeTweenSize = function(obj, ...)
pcall(obj.TweenSize, obj, ...)
end;
ServiceSpecific.SafeTweenPos = function(obj, ...)
pcall(obj.TweenPosition, obj, ...)
end;
]]
ServiceSpecific.Filter = function(str,from,to)
return client.Remote.Get("Filter",str,(to and from) or service.Player,to or from)
end;
ServiceSpecific.LaxFilter = function(str,from)
return service.Filter(str,from or service.Player,from or service.Player)
end;
ServiceSpecific.BroadcastFilter = function(str,from)
return client.Remote.Get("BroadcastFilter",str,from or service.Player)
end;
ServiceSpecific.IsMobile = function()
return service.UserInputService.TouchEnabled and not service.UserInputService.MouseEnabled and not service.UserInputService.KeyboardEnabled
end;
ServiceSpecific.LocalContainer = function()
if not client.Variables.LocalContainer or not client.Variables.LocalContainer.Parent then
client.Variables.LocalContainer = service.New("Folder")
client.Variables.LocalContainer.Name = "__ADONIS_LOCALCONTAINER_" .. client.Functions.GetRandom()
client.Variables.LocalContainer.Parent = workspace
end
return client.Variables.LocalContainer
end;
--// Load Core Modules
log("Loading core modules")
for ind,load in ipairs(LoadingOrder) do
local modu = Folder.Core:FindFirstChild(load)
if modu then
log("~! Loading Core Module: ".. tostring(load))
LoadModule(modu, true, {script = script}, true)
end
end
--// Start of module loading and server connection process
local runLast = {}
local runAfterInit = {}
local runAfterLoaded = {}
local runAfterPlugins = {}
--// Loading Finisher
client.Finish_Loading = function()
log("Client fired finished loading")
if client.Core.Key then
--// Run anything from core modules that needs to be done after the client has finished loading
log("~! Doing run after loaded")
for i,f in pairs(runAfterLoaded) do
Pcall(f, data);
end
--// Stuff to run after absolutely everything else
log("~! Doing run last")
for i,f in pairs(runLast) do
Pcall(f, data);
end
--// Finished loading
log("Finish loading")
clientLocked = true
client.Finish_Loading = function() end
client.LoadingTime() --origWarn(tostring(time()-(client.TrueStart or startTime)))
service.Events.FinishedLoading:Fire(os.time())
log("~! FINISHED LOADING!")
else
log("Client missing remote key")
client.Kill()("Missing remote key")
end
end
--// Initialize Cores
log("~! Init cores");
for i,name in ipairs(LoadingOrder) do
local core = client[name]
log("~! INIT: ".. tostring(name))
if core then
if type(core) == "table" or (type(core) == "userdata" and getmetatable(core) == "ReadOnly_Table") then
if core.RunLast then
table.insert(runLast, core.RunLast);
core.RunLast = nil;
end
if core.RunAfterInit then
table.insert(runAfterInit, core.RunAfterInit);
core.RunAfterInit = nil;
end
if core.RunAfterPlugins then
table.insert(runAfterPlugins, core.RunAfterPlugins);
core.RunAfterPlugins = nil;
end
if core.RunAfterLoaded then
table.insert(runAfterLoaded, core.RunAfterLoaded);
core.RunAfterLoaded = nil;
end
if core.Init then
log("Run init for ".. tostring(name))
Pcall(core.Init, data);
core.Init = nil;
end
end
end
end
--// Load any afterinit functions from modules (init steps that require other modules to have finished loading)
log("~! Running after init")
for i,f in pairs(runAfterInit) do
Pcall(f, data);
end
--// Load Plugins
log("~! Running plugins")
for index,plugin in ipairs(Folder.Plugins:GetChildren()) do
LoadModule(plugin, false, {script = plugin}); --noenv
end
--// We need to do some stuff *after* plugins are loaded (in case we need to be able to account for stuff they may have changed before doing something, such as determining the max length of remote commands)
log("~! Running after plugins")
for i,f in pairs(runAfterPlugins) do
Pcall(f, data);
end
log("Initial loading complete")
--// Below can be used to determine when all modules and plugins have finished loading; service.Events.AllModulesLoaded:Connect(function() doSomething end)
client.AllModulesLoaded = true;
service.Events.AllModulesLoaded:Fire(os.time());
--[[client = service.ReadOnly(client, {
[client.Variables] = true;
[client.Handlers] = true;
G_API = true;
G_Access = true;
G_Access_Key = true;
G_Access_Perms = true;
Allowed_API_Calls = true;
HelpButtonImage = true;
Finish_Loading = true;
RemoteEvent = true;
ScriptCache = true;
Returns = true;
PendingReturns = true;
EncodeCache = true;
DecodeCache = true;
Received = true;
Sent = true;
Service = true;
Holder = true;
GUIs = true;
LastUpdate = true;
RateLimits = true;
Init = true;
RunAfterInit = true;
RunAfterLoaded = true;
RunAfterPlugins = true;
}, true)--]]
service.Events.ClientInitialized:Fire();
log("~! Return success");
return "SUCCESS"
end;
__metatable = "Adonis";
__tostring = function() return "Adonis" end;
})
|
-- Cutscene duration in seconds
|
local duration = Demo:GetDuration()
|
--Gear Ratios
|
Tune.FinalDrive = 3.32 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 0.009 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 1.7 , -- Reverse, Neutral, and 1st gear are required
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- we could have missed the onEquip event on script start
|
if Board.Controller and not Controller then
onEquip(Board.ControllingHumanoid, Board.Controller)
end
|
-- Tries to update the display according to the time (in minutes after midnight), else displays err
|
function TryUpdate(mins)
local d_hrsTens, d_hrsOnes, d_minsTens, d_minsOnes, d_noon
local c_hrs, c_mins
if mins >= 0 and mins < 1440 then
c_hrs = math.floor(mins/60)
c_mins = mins%60
if USE_MILITARY_TIME then
d_hrsTens = displayMap[math.floor(c_hrs/10)+1]
d_hrsOnes = displayMap[(c_hrs - (math.floor(c_hrs/10)*10))+1]
-- Special case for 2400
if c_hrs == 0 and c_mins == 0 then
d_hrsTens = displayMap[3]
d_hrsOnes = displayMap[5]
end
else
d_hrsTens = displayMap[math.floor(((c_hrs)%12)/10)+1]
d_hrsOnes = displayMap[(((c_hrs)%12) - (math.floor(((c_hrs)%12)/10)*10))+1]
-- Special case for 12:00 A/P M
if c_hrs%12 == 0 then
d_hrsTens = displayMap[2]
d_hrsOnes = displayMap[3]
end
end
d_minsTens = displayMap[math.floor(c_mins/10)+1]
d_minsOnes = displayMap[(c_mins - (math.floor(c_mins/10)*10))+1]
d_noon = (mins >= 720) and noon_P or noon_A
Display(d_hrsTens, d_hrsOnes, d_minsTens, d_minsOnes, d_noon)
else
Error()
end
end
|
--[=[
@within Plasma
@function label
@param text string
@tag widgets
Text.
]=]
|
return Runtime.widget(function(text)
local refs = Runtime.useInstance(function(ref)
local style = Style.get()
create("TextLabel", {
[ref] = "label",
BackgroundTransparency = 1,
Font = Enum.Font.SourceSans,
TextColor3 = style.textColor,
TextSize = 20,
RichText = true,
})
automaticSize(ref.label)
return ref.label
end)
refs.label.Text = text
end)
|
-- This is pcalled because the SetCore methods may not be released yet.
|
pcall(function()
PlayerBlockedEvent = StarterGui:GetCore("PlayerBlockedEvent")
PlayerMutedEvent = StarterGui:GetCore("PlayerMutedEvent")
PlayerUnBlockedEvent = StarterGui:GetCore("PlayerUnblockedEvent")
PlayerUnMutedEvent = StarterGui:GetCore("PlayerUnmutedEvent")
end)
function SendSystemMessageToSelf(message)
local currentChannel = ChatWindow:GetCurrentChannel()
if currentChannel then
local messageData =
{
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = currentChannel.Name,
IsFiltered = true,
MessageLength = string.len(message),
Message = trimTrailingSpaces(message),
MessageType = ChatConstants.MessageTypeSystem,
Time = os.time(),
ExtraData = nil,
}
currentChannel:AddMessageToChannel(messageData)
end
end
function MutePlayer(player)
local mutePlayerRequest = DefaultChatSystemChatEvents:FindFirstChild("MutePlayerRequest")
if mutePlayerRequest then
return mutePlayerRequest:InvokeServer(player.Name)
end
return false
end
if PlayerBlockedEvent then
PlayerBlockedEvent.Event:connect(function(player)
if MutePlayer(player) then
SendSystemMessageToSelf(string.format("Speaker '%s' has been blocked.", player.Name))
end
end)
end
if PlayerMutedEvent then
PlayerMutedEvent.Event:connect(function(player)
if MutePlayer(player) then
SendSystemMessageToSelf(string.format("Speaker '%s' has been muted.", player.Name))
end
end)
end
function UnmutePlayer(player)
local unmutePlayerRequest = DefaultChatSystemChatEvents:FindFirstChild("UnMutePlayerRequest")
if unmutePlayerRequest then
return unmutePlayerRequest:InvokeServer(player.Name)
end
return false
end
if PlayerUnBlockedEvent then
PlayerUnBlockedEvent.Event:connect(function(player)
if UnmutePlayer(player) then
SendSystemMessageToSelf(string.format("Speaker '%s' has been unblocked.", player.Name))
end
end)
end
if PlayerUnMutedEvent then
PlayerUnMutedEvent.Event:connect(function(player)
if UnmutePlayer(player) then
SendSystemMessageToSelf(string.format("Speaker '%s' has been unmuted.", player.Name))
end
end)
end
|
--
|
local Tool = script.Parent
local upAndAway = false
local humanoid = nil
local head = nil
local upAndAwayForce = Tool.Handle.BodyForce
isfloating=false
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = 1.05 -- things float at > 1
local height = nil
local maxRise = 75
function onEquipped()
Tool.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=25498565"
equipped = true
Tool.GripPos = Vector3.new(0,-1,0)
Tool.GripForward = Vector3.new(0,1,0)
Tool.GripRight = Vector3.new(0,0,-1)
Tool.GripUp = Vector3.new(1,0,0)
height = Tool.Parent.Torso.Position.y
lift = recursiveGetLift(Tool.Parent)
float(lift)
end
function onUnequipped()
equipped = false
Tool.GripForward = Vector3.new(1,0,0)
Tool.GripRight = Vector3.new(0,0,1)
Tool.GripUp = Vector3.new(0,1,0)
Tool.Handle.Mesh.Scale = Vector3.new(1,1,1)
end
Tool.Unequipped:connect(onUnequipped)
Tool.Equipped:connect(onEquipped)
Tool.Handle.Touched:connect(onTouched)
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 updateBalloonSize()
local range = (height + maxRise) - Tool.Handle.Position.y
if range < (maxRise/3)*1 then
Tool.Handle.Mesh.Scale = Vector3.new(3,3,3)
elseif range < (maxRise/3)*2 then
Tool.Handle.Mesh.Scale = Vector3.new(2,2,2)
else
Tool.Handle.Mesh.Scale = Vector3.new(1,1,1)
end
end
function float(lift)
if not isfloating then
isfloating=true
while equipped do
lift=recursiveGetLift(Tool.Parent)
upAndAwayForce.force=Vector3.new(0,lift*.8,0)
wait(.2)
--if Tool.Handle.Position.y > height + maxRise then
if Tool.Handle.Position.y>300 then
equipped=false
Tool.Handle.Pop:Play()
Tool.GripPos = Vector3.new(0,-.4,0)
Tool.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=26725510"
end
updateBalloonSize()
end
upAndAwayForce.force=Vector3.new(0,0,0)
isfloating=false
end
end
|
---- locales ----
|
local Button = script.Parent
local InventoryFrame = Button.Parent.InventoryScrollingFrame
local InformationFrame = Button.Parent.InformationFrame
local CaseInventoryFrame = Button.Parent.CaseShopScrollingFrame
local CaseInformationFrame = Button.Parent.CaseInformationFrame
|
---------------------------
--[[
--Main anchor point is the DriveSeat <car.DriveSeat>
Usage:
MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only
ModelWeld(Model,MainPart)
Example:
MakeWeld(car.DriveSeat,misc.PassengerSeat)
MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here
|
MakeWeld(car.Misc.FrontDoor.base,car.DriveSeat)
MakeWeld(car.Misc.FrontDoor.H1.Dr_1,car.Misc.FrontDoor.H1.part1)
MakeWeld(car.Misc.FrontDoor.H1.Dr_2,car.Misc.FrontDoor.H1.part1)
MakeWeld(car.Misc.FrontDoor.H1.To,car.Misc.FrontDoor.H1.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Dr_1,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Dr_2,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Bar_B,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.H1.H2.Bar_C,car.Misc.FrontDoor.H1.H2.part1)
MakeWeld(car.Misc.FrontDoor.Lever.A,car.Misc.FrontDoor.Lever.part1)
MakeWeld(car.Misc.FrontDoor.H1.part0,car.Misc.FrontDoor.H1.part1,"Motor",.015).Name="Motor"
MakeWeld(car.Misc.FrontDoor.H1.H2.part0,car.Misc.FrontDoor.H1.H2.part1,"Motor",.03).Name="Motor"
MakeWeld(car.Misc.FrontDoor.Lever.part0,car.Misc.FrontDoor.Lever.part1,"Motor",.04).Name="Motor"
MakeWeld(car.Misc.FrontDoor.H1.part0,car.Misc.FrontDoor.base)
MakeWeld(car.Misc.FrontDoor.Lever.part0,car.Misc.FrontDoor.base)
MakeWeld(car.Misc.FrontDoor.H1.H2.part0,car.Misc.FrontDoor.H1.To)
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
end
end)
|
--[=[
@param class table | (...any) -> any
@param ... any
@return any
Constructs a new object from either the
table or function given.
If a table is given, the table's `new`
function will be called with the given
arguments.
If a function is given, the function will
be called with the given arguments.
The result from either of the two options
will be added to the trove.
This is shorthand for `trove:Add(SomeClass.new(...))`
and `trove:Add(SomeFunction(...))`.
```lua
local Signal = require(somewhere.Signal)
-- All of these are identical:
local s = trove:Construct(Signal)
local s = trove:Construct(Signal.new)
local s = trove:Construct(function() return Signal.new() end)
local s = trove:Add(Signal.new())
-- Even Roblox instances can be created:
local part = trove:Construct(Instance, "Part")
```
]=]
|
function Trove:Construct(class, ...)
if self._cleaning then
error("Cannot call trove:Construct() while cleaning", 2)
end
local object = nil
local t = type(class)
if t == "table" then
object = class.new(...)
elseif t == "function" then
object = class(...)
end
return self:Add(object)
end
|
--[[
Returns the Window's state
]]
|
function Window:getState()
return self._state
end
|
--/Recoil Modification
|
module.camRecoil = {
RecoilUp = 1
,RecoilTilt = 1
,RecoilLeft = 1
,RecoilRight = 1
}
module.gunRecoil = {
RecoilUp = 1
,RecoilTilt = 1
,RecoilLeft = 1
,RecoilRight = 1
}
module.AimRecoilReduction = 1
module.AimSpreadReduction = 1
module.MinRecoilPower = 1
module.MaxRecoilPower = 1
module.RecoilPowerStepAmount = 1
module.MinSpread = .75
module.MaxSpread = .75
module.AimInaccuracyStepAmount = 1
module.AimInaccuracyDecrease = 1.5
module.WalkMult = .75
module.MuzzleVelocityMod = 1
return module
|
-- METHODS
|
function IconController.setGameTheme(theme)
IconController.gameTheme = theme
local icons = IconController.getIcons()
for _, icon in pairs(icons) do
icon:setTheme(theme)
end
end
function IconController.setDisplayOrder(value)
value = tonumber(value) or TopbarPlusGui.DisplayOrder
TopbarPlusGui.DisplayOrder = value
end
IconController.setDisplayOrder(10)
function IconController.getIcons()
local allIcons = {}
for otherIcon, _ in pairs(topbarIcons) do
table.insert(allIcons, otherIcon)
end
return allIcons
end
function IconController.getIcon(name)
for otherIcon, _ in pairs(topbarIcons) do
if otherIcon.name == name then
return otherIcon
end
end
return false
end
function IconController.disableHealthbar(bool)
local finalBool = (bool == nil or bool)
IconController.healthbarDisabled = finalBool
IconController.healthbarDisabledSignal:Fire(finalBool)
end
function IconController.disableControllerOption(bool)
local finalBool = (bool == nil or bool)
disableControllerOption = finalBool
if IconController.getIcon("_TopbarControllerOption") then
IconController._determineControllerDisplay()
end
end
function IconController.canShowIconOnTopbar(icon)
if (icon.enabled == true or icon.accountForWhenDisabled) and icon.presentOnTopbar then
return true
end
return false
end
function IconController.getMenuOffset(icon)
local alignment = icon:get("alignment")
local alignmentGap = IconController[alignment.."Gap"]
local extendLeft = 0
local extendRight = 0
local additionalRight = 0
if icon.menuOpen then
local menuSize = icon:get("menuSize")
local menuSizeXOffset = menuSize.X.Offset
local direction = icon:_getMenuDirection()
if direction == "right" then
extendRight += menuSizeXOffset + alignmentGap/6--2
elseif direction == "left" then
extendLeft = menuSizeXOffset + 4
extendRight += alignmentGap/3--4
additionalRight = menuSizeXOffset
end
end
return extendLeft, extendRight, additionalRight
end
|
--Text alignment default properties
|
defaults.ContainerHorizontalAlignment = "Left"
defaults.ContainerVerticalAlignment = "Center"
defaults.TextYAlignment = "Bottom" -- Alignment of the text on the line, only makes a difference if the line has variable text sizes
|
--script.Parent.TT.Velocity = script.Parent.TT.CFrame.lookVector *script.Parent.Speed.Value
|
script.Parent.TTT.Velocity = script.Parent.TTT.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.U.Velocity = script.Parent.U.CFrame.lookVector *script.Parent.Speed.Value
|
--local origWarn = warn
|
local startTime = time()
local clientLocked = false
local oldInstNew = Instance.new
local oldReq = require
local Folder = script.Parent
local locals = {}
local client = {}
local service = {}
local ServiceSpecific = {}
local function isModule(module)
for _, modu in client.Modules do
if rawequal(module, modu) then
return true
end
end
return false
end
local function logError(...)
warn("ERROR: ", ...)
if client and client.Remote then
client.Remote.Send("LogError", table.concat({ ... }, " "))
end
end
local oldPrint = print
print = function(...)
oldPrint(":: Adonis ::", ...)
end
|
--valve things
|
local BOVsound = car.DriveSeat.BOV
BOVsound.Volume = 1 --bov volume
BOVsound.Pitch = 1 -- pitch, i wouldn't change this lol
BOVsound.SoundId = "rbxassetid://337982546" --sound, duh.
|
--[[
ValueRemote.OnClientEvent:Connect(function()
Character:WaitForChild("HumanoidRootPart")
Character.HumanoidRootPart.CFrame = Checkpoints[tostring(MaxLevel.Value)].CFrame * CFrame.new(0,2,0)
--print(MaxLevel.Value)
end)]]
| |
--Don't mess with this.
|
function check_players()
wait(2)
for i,v in pairs(game.Players:GetChildren()) do
for x = 1, #banned do
if v.Name == banned[x] then
v:remove()
end
end
end
end
game.Players.ChildAdded:connect(check_players)
|
--[=[
Shallow merges two tables without modifying either.
@param orig table -- Original table
@param new table -- Result
@return table
]=]
|
function Table.merge(orig, new)
local result = table.clone(orig)
for key, val in pairs(new) do
result[key] = val
end
return result
end
|
-- Apply any place specific overrides
|
conf.applyOverride(_placeOverrides[game.PlaceId])
print(string.format("Configuring place %s", game.PlaceId))
|
-- Check if player is walking
|
local check_movement = function()
if humanoid.WalkSpeed > 7 and humanoid.MoveDirection.Magnitude > 0 and humanoid.FloorMaterial ~= Enum.Material.Air then
return true
elseif humanoid.WalkSpeed <= 26 or humanoid.MoveDirection.Magnitude <= 0 or humanoid.FloorMaterial == Enum.Material.Air then
return false
end
end
|
--print(FRP-FLP)
|
F = carSeat.AirPhysics
lv = carSeat.CFrame.lookVector
uv = carSeat.CFrame.upVector
rv = carSeat.CFrame.rightVector
if carSeat.Velocity.Y > 0 then
vy = carSeat.Velocity.Y*50
else
if carSeat.Velocity.Y*-70 > 7000 then
vy = 7000
else
vy = carSeat.Velocity.Y*-70
end
end
vx = carSeat.Velocity.X*-.5
vz = carSeat.Velocity.Z*-.5
--F.Force = Vector3.new(vx, vy*1.4, vz)
F.Force = Vector3.new(0,0,0)
--print(F.Force)
avw = (carSeat.Parent.Parent.Wheels.FL.Wheel.Position.Y + carSeat.Parent.Parent.Wheels.FR.Wheel.Position.Y + carSeat.Parent.Parent.Wheels.RL.Wheel.Position.Y + carSeat.Parent.Parent.Wheels.RR.Wheel.Position.Y)/4
if carSeat.Parent.Parent.RW.Pad.Position.Y < carSeat.Parent.Parent.RW.UPad.Position.Y then flpp = true
count = count + 0.1
else
count = 0 flpp = false
end
if speed < 3 then
vlam = 3
else
vlam = 17
end
if script.Parent.Storage.Autoflip.Value == true then
if count > vlam then
carSeat.Flip.MaxTorque = Vector3.new(400000, 0, 400000) wait(0.5)
else
carSeat.Flip.MaxTorque = Vector3.new(0, 0, 0)
end
else carSeat.Flip.MaxTorque = Vector3.new(0, 0, 0)
end
if avw + 2 < script.av.Value or avw - 2 > script.av.Value then
|
--// Damage Settings
|
BaseDamage = 32; -- Torso Damage
LimbDamage = 28; -- Arms and Legs
ArmorDamage = 10; -- How much damage is dealt against armor (Name the armor "Armor")
HeadDamage = 47; -- If you set this to 100, there's a chance the player won't die because of the heal script
|
--!strict
--[[
PlayerModule - This module requires and instantiates the camera and control modules,
and provides getters for developers to access methods on these singletons without
having to modify Roblox-supplied scripts.
2018 PlayerScripts Update - AllYourBlox
--]]
|
local PlayerModule = {}
PlayerModule.__index = PlayerModule
function PlayerModule.new()
local self = setmetatable({},PlayerModule)
self.cameras = require(script:WaitForChild("CameraModule"))
self.controls = require(script:WaitForChild("ControlModule"))
self.backpack = require(script:WaitForChild("BackpackModule"))
return self
end
function PlayerModule:GetCameras()
return self.cameras
end
function PlayerModule:GetControls()
return self.controls
end
function PlayerModule:GetClickToMoveController()
return self.controls:GetClickToMoveController()
end
return PlayerModule.new()
|
--[[
PartCache V4.0 by Xan the Dragon // Eti the Spirit -- RBX 18406183
Update V4.0 has added Luau Strong Type Enforcement.
Creating parts is laggy, especially if they are supposed to be there for a split second and/or need to be made frequently.
This module aims to resolve this lag by pre-creating the parts and CFraming them to a location far away and out of sight.
When necessary, the user can get one of these parts and CFrame it to where they need, then return it to the cache when they are done with it.
According to someone instrumental in Roblox's backend technology, zeuxcg (https://devforum.roblox.com/u/zeuxcg/summary)...
>> CFrame is currently the only "fast" property in that you can change it every frame without really heavy code kicking in. Everything else is expensive.
- https://devforum.roblox.com/t/event-that-fires-when-rendering-finishes/32954/19
This alone should ensure the speed granted by this module.
HOW TO USE THIS MODULE:
Look at the bottom of my thread for an API! https://devforum.roblox.com/t/partcache-for-all-your-quick-part-creation-needs/246641
--]]
|
local table = require(script:WaitForChild("Table"))
|
-- SETTINGS ----------------------------------------------------
|
local hasFire = true; -- Exhaust has fire?
local hasSmoke = true; -- Exhaust has smoke?
local lightColor_on = BrickColor.new("Institutional white")
local lightColor_off = headlights[1].BrickColor -- Grab your existing color (recommended)
local brakeColor_on = BrickColor.new("Really red")
local brakeColor_off = BrickColor.new("Reddish brown")
local tiltForce = 1000; -- Force to flip over vehicle
|
--rayPart = Instance.new("Part")
--rayPart.Name = "MG Ray"
--rayPart.Transparency = .5
--rayPart.Anchored = true
--rayPart.CanCollide = false
--rayPart.TopSurface = Enum.SurfaceType.Smooth
--rayPart.BottomSurface = Enum.SurfaceType.Smooth
--rayPart.formFactor = Enum.FormFactor.Custom
--rayPart.BrickColor = BrickColor.new("Bright yellow")
--rayPart.Reflectance = 0
--rayPart.Material = Enum.Material.SmoothPlastic
|
function fireCoax()
local MGAmmo = tankStats.MGAmmo;
if MGAmmo.Value <= 0 then
return false;
end;
TFE:FireServer('FireMinigun',parts,tankStats,MGDamage,script.Parent)
wait(1/1200*60);
parts.Parent.Gun.MGFlash.Fire.Enabled = true
wait(0.05);
parts.Parent.Gun.MGFlash.Fire.Enabled = false
return true;
end
|
-- Setup animation objects
|
function scriptChildModified(child: Instance)
local fileList = animNames[child.Name]
if fileList ~= nil then
configureAnimationSet(child.Name, fileList)
end
end
script.ChildAdded:Connect(scriptChildModified)
script.ChildRemoved:Connect(scriptChildModified)
|
-- ONLY SUPPORTS ORDINAL TABLES (ARRAYS). Skips *n* objects in the table, and returns a new table that contains indices (n + 1) to (end of table)
|
Table.skip = function (tbl, n)
return table.move(tbl, n+1, #tbl, 1, table.create(#tbl-n))
end
|
--[=[
Sets a metatable on a table such that it errors when
indexing a nil value
@param target table -- Table to error on indexing
@return table -- The same table, with the metatable set to readonly
]=]
|
function Table.readonly(target)
return setmetatable(target, READ_ONLY_METATABLE)
end
|
------------- Settings
|
local Lighting = game.Lighting
local TweenService = game:GetService("TweenService")
function day()
TweenService:Create(Lighting, TweenInfo.new(Speed), {ClockTime = 12}):Play()
TweenService:Create(Lighting, TweenInfo.new(Speed), {Brightness = 3.05}):Play()
TweenService:Create(Lighting, TweenInfo.new(Speed), {Ambient = Color3.fromRGB(106, 130, 186)}):Play()
TweenService:Create(Lighting, TweenInfo.new(Speed), {ColorShift_Bottom = Color3.fromRGB(0,0,0)}):Play()
end
function night()
TweenService:Create(Lighting, TweenInfo.new(Speed), {ClockTime = 0}):Play()
TweenService:Create(Lighting, TweenInfo.new(Speed), {Brightness = 0.4}):Play()
TweenService:Create(Lighting, TweenInfo.new(Speed), {Ambient = Color3.fromRGB(0,0,0)}):Play()
TweenService:Create(Lighting, TweenInfo.new(Speed), {ColorShift_Bottom = Color3.fromRGB(0,0,0)}):Play()
end
while true do
day()
wait
night()
wait
end
|
-- Activate when setting is checked.
|
script.Activate.Changed:Connect(function(value)
if ( value ) then
activate();
else
deactivate();
end
end);
|
-- fn cst_flt_rdr(string src, int len, fn func)
-- @len - Length of type for reader
-- @func - Reader callback
|
local function cst_flt_rdr(len, func)
return function(S)
local flt = func(S.source, S.index)
S.index = S.index + len
return flt
end
end
local function stm_instructions(S)
local size = S:s_int()
local code = {}
for i = 1, size do
local ins = S:s_ins()
local op = bit.band(ins, 0x3F)
local args = opcode_t[op]
local mode = opcode_m[op]
local data = {value = ins, op = op, A = bit.band(bit.rshift(ins, 6), 0xFF)}
if args == 'ABC' then
data.B = bit.band(bit.rshift(ins, 23), 0x1FF)
data.C = bit.band(bit.rshift(ins, 14), 0x1FF)
data.is_KB = mode.b == 'OpArgK' and data.B > 0xFF -- post process optimization
data.is_KC = mode.c == 'OpArgK' and data.C > 0xFF
elseif args == 'ABx' then
data.Bx = bit.band(bit.rshift(ins, 14), 0x3FFFF)
data.is_K = mode.b == 'OpArgK'
elseif args == 'AsBx' then
data.sBx = bit.band(bit.rshift(ins, 14), 0x3FFFF) - 131071
end
code[i] = data
end
return code
end
local function stm_constants(S)
local size = S:s_int()
local consts = {}
for i = 1, size do
local tt = stm_byte(S)
local k
if tt == 1 then
k = stm_byte(S) ~= 0
elseif tt == 3 then
k = S:s_num()
elseif tt == 4 then
k = stm_lstring(S)
end
consts[i] = k -- offset +1 during instruction decode
end
return consts
end
local function stm_subfuncs(S, src)
local size = S:s_int()
local sub = {}
for i = 1, size do
sub[i] = stm_lua_func(S, src) -- offset +1 in CLOSURE
end
return sub
end
local function stm_lineinfo(S)
local size = S:s_int()
local lines = {}
for i = 1, size do lines[i] = S:s_int() end
return lines
end
local function stm_locvars(S)
local size = S:s_int()
local locvars = {}
for i = 1, size do locvars[i] = {varname = stm_lstring(S), startpc = S:s_int(), endpc = S:s_int()} end
return locvars
end
local function stm_upvals(S)
local size = S:s_int()
local upvals = {}
for i = 1, size do upvals[i] = stm_lstring(S) end
return upvals
end
function stm_lua_func(S, psrc)
local proto = {}
local src = stm_lstring(S) or psrc -- source is propagated
proto.source = src -- source name
S:s_int() -- line defined
S:s_int() -- last line defined
proto.numupvals = stm_byte(S) -- num upvalues
proto.numparams = stm_byte(S) -- num params
stm_byte(S) -- vararg flag
stm_byte(S) -- max stack size
proto.code = stm_instructions(S)
proto.const = stm_constants(S)
proto.subs = stm_subfuncs(S, src)
proto.lines = stm_lineinfo(S)
stm_locvars(S)
stm_upvals(S)
-- post process optimization
for _, v in ipairs(proto.code) do
if v.is_K then
v.const = proto.const[v.Bx + 1] -- offset for 1 based index
else
if v.is_KB then v.const_B = proto.const[v.B - 0xFF] end
if v.is_KC then v.const_C = proto.const[v.C - 0xFF] end
end
end
return proto
end
function stm_lua_bytecode(src)
-- func reader
local rdr_func
-- header flags
local little
local size_int
local size_szt
local size_ins
local size_num
local flag_int
-- stream object
local stream = {
-- data
index = 1,
source = src,
}
assert(stm_string(stream, 4) == '\27Lua', 'invalid Lua signature')
assert(stm_byte(stream) == 0x51, 'invalid Lua version')
assert(stm_byte(stream) == 0, 'invalid Lua format')
little = stm_byte(stream) ~= 0
size_int = stm_byte(stream)
size_szt = stm_byte(stream)
size_ins = stm_byte(stream)
size_num = stm_byte(stream)
flag_int = stm_byte(stream) ~= 0
rdr_func = little and rd_int_le or rd_int_be
stream.s_int = cst_int_rdr(size_int, rdr_func)
stream.s_szt = cst_int_rdr(size_szt, rdr_func)
stream.s_ins = cst_int_rdr(size_ins, rdr_func)
if flag_int then
stream.s_num = cst_int_rdr(size_num, rdr_func)
elseif float_types[size_num] then
stream.s_num = cst_flt_rdr(size_num, float_types[size_num][little and 'little' or 'big'])
else
error('unsupported float size')
end
return stm_lua_func(stream, '@virtual')
end
local function close_lua_upvalues(list, index)
for i, uv in pairs(list) do
if uv.index >= index then
uv.value = uv.store[uv.index] -- store value
uv.store = uv
uv.index = 'value' -- self reference
list[i] = nil
end
end
end
local function open_lua_upvalue(list, index, stack)
local prev = list[index]
if not prev then
prev = {index = index, store = stack}
list[index] = prev
end
return prev
end
local function wrap_lua_variadic(...) return select('#', ...), {...} end
local function on_lua_error(exst, err)
local src = exst.source
local line = exst.lines[exst.pc - 1]
local psrc, pline, pmsg = err:match('^(.-):(%d+):%s+(.+)')
local fmt = '%s:%i: [%s:%i] %s'
line = line or '0'
psrc = psrc or '?'
pline = pline or '0'
pmsg = pmsg or err
error(string.format(fmt, src, line, psrc, pline, pmsg), 0)
end
local function exec_lua_func(exst)
-- localize for easy lookup
local code = exst.code
local subs = exst.subs
local env = exst.env
local upvs = exst.upvals
local vargs = exst.varargs
-- state variables
local stktop = -1
local openupvs = {}
local stack = exst.stack
local pc = exst.pc
while true do
local inst = code[pc]
local op = inst.op
pc = pc + 1
if op < 19 then
if op < 9 then
if op < 4 then
if op < 2 then
if op < 1 then
--[[0 MOVE]]
stack[inst.A] = stack[inst.B]
else
--[[1 LOADK]]
stack[inst.A] = inst.const
end
elseif op > 2 then
--[[3 LOADNIL]]
for i = inst.A, inst.B do stack[i] = nil end
else
--[[2 LOADBOOL]]
stack[inst.A] = inst.B ~= 0
if inst.C ~= 0 then pc = pc + 1 end
end
elseif op > 4 then
if op < 7 then
if op < 6 then
--[[5 GETGLOBAL]]
stack[inst.A] = env[inst.const]
else
--[[6 GETTABLE]]
local index
if inst.is_KC then
index = inst.const_C
else
index = stack[inst.C]
end
stack[inst.A] = stack[inst.B][index]
end
elseif op > 7 then
--[[8 SETUPVAL]]
local uv = upvs[inst.B]
uv.store[uv.index] = stack[inst.A]
else
--[[7 SETGLOBAL]]
env[inst.const] = stack[inst.A]
end
else
--[[4 GETUPVAL]]
local uv = upvs[inst.B]
stack[inst.A] = uv.store[uv.index]
end
elseif op > 9 then
if op < 14 then
if op < 12 then
if op < 11 then
--[[10 NEWTABLE]]
stack[inst.A] = {}
else
--[[11 SELF]]
local A = inst.A
local B = inst.B
local index
if inst.is_KC then
index = inst.const_C
else
index = stack[inst.C]
end
stack[A + 1] = stack[B]
stack[A] = stack[B][index]
end
elseif op > 12 then
--[[13 SUB]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
stack[inst.A] = lhs - rhs
else
--[[12 ADD]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
stack[inst.A] = lhs + rhs
end
elseif op > 14 then
if op < 17 then
if op < 16 then
--[[15 DIV]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
stack[inst.A] = lhs / rhs
else
--[[16 MOD]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
stack[inst.A] = lhs % rhs
end
elseif op > 17 then
--[[18 UNM]]
stack[inst.A] = -stack[inst.B]
else
--[[17 POW]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
stack[inst.A] = lhs ^ rhs
end
else
--[[14 MUL]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
stack[inst.A] = lhs * rhs
end
else
--[[9 SETTABLE]]
local index, value
if inst.is_KB then
index = inst.const_B
else
index = stack[inst.B]
end
if inst.is_KC then
value = inst.const_C
else
value = stack[inst.C]
end
stack[inst.A][index] = value
end
elseif op > 19 then
if op < 29 then
if op < 24 then
if op < 22 then
if op < 21 then
--[[20 LEN]]
stack[inst.A] = #stack[inst.B]
else
--[[21 CONCAT]]
local str = stack[inst.B]
for i = inst.B + 1, inst.C do str = str .. stack[i] end
stack[inst.A] = str
end
elseif op > 22 then
--[[23 EQ]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
if (lhs == rhs) ~= (inst.A ~= 0) then pc = pc + 1 end
else
--[[22 JMP]]
pc = pc + inst.sBx
end
elseif op > 24 then
if op < 27 then
if op < 26 then
--[[25 LE]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
if (lhs <= rhs) ~= (inst.A ~= 0) then pc = pc + 1 end
else
--[[26 TEST]]
if (not stack[inst.A]) == (inst.C ~= 0) then pc = pc + 1 end
end
elseif op > 27 then
--[[28 CALL]]
local A = inst.A
local B = inst.B
local C = inst.C
local params
local sz_vals, l_vals
if B == 0 then
params = stktop - A
else
params = B - 1
end
sz_vals, l_vals = wrap_lua_variadic(stack[A](unpack(stack, A + 1, A + params)))
if C == 0 then
stktop = A + sz_vals - 1
else
sz_vals = C - 1
end
for i = 1, sz_vals do stack[A + i - 1] = l_vals[i] end
else
--[[27 TESTSET]]
local A = inst.A
local B = inst.B
if (not stack[B]) == (inst.C ~= 0) then
pc = pc + 1
else
stack[A] = stack[B]
end
end
else
--[[24 LT]]
local lhs, rhs
if inst.is_KB then
lhs = inst.const_B
else
lhs = stack[inst.B]
end
if inst.is_KC then
rhs = inst.const_C
else
rhs = stack[inst.C]
end
if (lhs < rhs) ~= (inst.A ~= 0) then pc = pc + 1 end
end
elseif op > 29 then
if op < 34 then
if op < 32 then
if op < 31 then
--[[30 RETURN]]
local A = inst.A
local B = inst.B
local vals = {}
local size
if B == 0 then
size = stktop - A + 1
else
size = B - 1
end
for i = 1, size do vals[i] = stack[A + i - 1] end
close_lua_upvalues(openupvs, 0)
return size, vals
else
--[[31 FORLOOP]]
local A = inst.A
local step = stack[A + 2]
local index = stack[A] + step
local limit = stack[A + 1]
local loops
if step == math.abs(step) then
loops = index <= limit
else
loops = index >= limit
end
if loops then
stack[inst.A] = index
stack[inst.A + 3] = index
pc = pc + inst.sBx
end
end
elseif op > 32 then
--[[33 TFORLOOP]]
local A = inst.A
local func = stack[A]
local state = stack[A + 1]
local index = stack[A + 2]
local base = A + 3
local vals
stack[base + 2] = index
stack[base + 1] = state
stack[base] = func
vals = {func(state, index)}
for i = 1, inst.C do stack[base + i - 1] = vals[i] end
if stack[base] ~= nil then
stack[A + 2] = stack[base]
else
pc = pc + 1
end
else
--[[32 FORPREP]]
local A = inst.A
local init, limit, step
init = assert(tonumber(stack[A]), '`for` initial value must be a number')
limit = assert(tonumber(stack[A + 1]), '`for` limit must be a number')
step = assert(tonumber(stack[A + 2]), '`for` step must be a number')
stack[A] = init - step
stack[A + 1] = limit
stack[A + 2] = step
pc = pc + inst.sBx
end
elseif op > 34 then
if op < 36 then
--[[35 CLOSE]]
close_lua_upvalues(openupvs, inst.A)
elseif op > 36 then
--[[37 VARARG]]
local A = inst.A
local size = inst.B
if size == 0 then
size = vargs.size
stktop = A + size - 1
end
for i = 1, size do stack[A + i - 1] = vargs.list[i] end
else
--[[36 CLOSURE]]
local sub = subs[inst.Bx + 1] -- offset for 1 based index
local nups = sub.numupvals
local uvlist
if nups ~= 0 then
uvlist = {}
for i = 1, nups do
local pseudo = code[pc + i - 1]
if pseudo.op == 0 then -- @MOVE
uvlist[i - 1] = open_lua_upvalue(openupvs, pseudo.B, stack)
elseif pseudo.op == 4 then -- @GETUPVAL
uvlist[i - 1] = upvs[pseudo.B]
end
end
pc = pc + nups
end
stack[inst.A] = wrap_lua_func(sub, env, uvlist)
end
else
--[[34 SETLIST]]
local A = inst.A
local C = inst.C
local size = inst.B
local tab = stack[A]
local offset
if size == 0 then size = stktop - A end
if C == 0 then
C = inst[pc].value
pc = pc + 1
end
offset = (C - 1) * FIELDS_PER_FLUSH
for i = 1, size do tab[i + offset] = stack[A + i] end
end
else
--[[29 TAILCALL]]
local A = inst.A
local B = inst.B
local params
if B == 0 then
params = stktop - A
else
params = B - 1
end
close_lua_upvalues(openupvs, 0)
return wrap_lua_variadic(stack[A](unpack(stack, A + 1, A + params)))
end
else
--[[19 NOT]]
stack[inst.A] = not stack[inst.B]
end
exst.pc = pc
end
end
function wrap_lua_func(state, env, upvals)
local st_code = state.code
local st_subs = state.subs
local st_lines = state.lines
local st_source = state.source
local st_numparams = state.numparams
local function exec_wrap(...)
local stack = {}
local varargs = {}
local sizevarg = 0
local sz_args, l_args = wrap_lua_variadic(...)
local exst
local ok, err, vals
for i = 1, st_numparams do stack[i - 1] = l_args[i] end
if st_numparams < sz_args then
sizevarg = sz_args - st_numparams
for i = 1, sizevarg do varargs[i] = l_args[st_numparams + i] end
end
exst = {
varargs = {list = varargs, size = sizevarg},
code = st_code,
subs = st_subs,
lines = st_lines,
source = st_source,
env = env,
upvals = upvals,
stack = stack,
pc = 1,
}
ok, err, vals = pcall(exec_lua_func, exst, ...)
if ok then
return unpack(vals, 1, err)
else
on_lua_error(exst, err)
end
return -- explicit "return nothing"
end
return exec_wrap
end
return function(BCode, Env)
return wrap_lua_func(stm_lua_bytecode(BCode), Env or getfenv(0))
end
|
-- Modules
|
local ModuleScripts = ReplicatedStorage.ModuleScripts
local GameSettings = require(ModuleScripts:WaitForChild("GameSettings"))
local PlayerManagement = ServerScriptService.PlayerManagement
local PlayerManagementModules = PlayerManagement.ModuleScripts
local ParticleController = require(PlayerManagementModules.ParticleController)
local Data = ServerScriptService.Data
local DataStore = require(Data.Modules.DataStore)
local UpgradeManager = require(Data.Modules.UpgradeManager)
|
--Click to Equip Script
--Unless you know what you're doing, do not modify this script.
|
local tool = script.Parent.Parent --This indicates the tool for the handle.
script.Parent.Parent = tool.Parent --This removes the "Touch to Equip" function for the handle.
script.Parent.ClickDetector.MouseClick:Connect(function(plr) --This detects a click on the handle.
local character = plr.Character --This identifies the player's character.
local humanoid = character:FindFirstChild("Humanoid") --This identifies "Humanoid".
if humanoid ~= nil then --This ensures that "Humanoid" exists inside the player's character.
tool.Parent = character --This causes the character to equip the tool.
script.Parent.Parent = tool --This puts the handle inside the tool.
tool.AncestryChanged:Connect(function(item) --This detects a change in the tool's ancestry.
local parent = item.Parent --This identifies the parent of the tool.
if parent.Name ~= "Backpack" and parent ~= character and script.Parent.Parent == tool then
--The code above ensures the parent isn't the player's backpack or character, and the handle is inside the tool.
script.Parent.Parent = tool.Parent --This ensures that "Touch to Equip" is disabled.
end
end)
end
end)
|
-- main program
|
local nextTime = 0
local runService = game:service("RunService");
while Figure.Parent~=nil do
time = runService.Stepped:wait()
if time > nextTime then
move(time)
nextTime = time + 0.1
end
end
|
-- On Startup
-- Tell the server we've entered the game
|
PlayerEnteredGame:FireServer()
|
--[[
for i = 1, 5 do
IN.Belly.Mesh.Scale = IN.Belly.Mesh.Scale - Vector3.new(.1, .1, .1)
wait(.1)
end
]]
|
--
|
-- Catch any FX unloaded descendants
|
fxFolder.DescendantAdded:Connect(function(instance)
configureVisualEffect(instance, adPortal.Status == Enum.AdUnitStatus.Active)
end)
|
-- << SETUP >>
|
main:GetModule("PageAbout"):UpdateRankName()
main:GetModule("PageAbout"):UpdateProfileIcon()
main:GetModule("PageAbout"):CreateUpdates()
main:GetModule("PageAbout"):UpdateContributors()
main:GetModule("PageAbout"):CreateCredits()
main:GetModule("PageCommands"):CreateCommands()
main:GetModule("PageCommands"):CreateMorphs()
main:GetModule("PageCommands"):CreateDetails()
main:GetModule("PageSpecial"):SetupDonorCommands()
main:GetModule("PageAdmin"):SetupRanks()
main:GetModule("GUIs"):DisplayPagesAccordingToRank()
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "Bone nuke" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.