prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local u1 = require(game:GetService("ReplicatedStorage"):WaitForChild("Achievements"));
local u2 = script:FindFirstAncestor("MainUI");
local l__TweenService__3 = game:GetService("TweenService");
return function(p1, p2)
local v2 = u1[p2];
if v2 then
local v3 = u2.AchievementsHolder.Achievement:Clone();
v3.Size = UDim2.new(0, 0, 0, 0);
v3.Frame.Position = UDim2.new(1.1, 0, 0, 0);
v3.Name = "LiveAchievement";
v3.Visible = true;
for v4, v5 in pairs(v2) do
local v6 = v3.Frame.Details:FindFirstChild(v4);
if v6 then
v6.Text = v5;
end;
end;
if v2.Image then
v3.Frame.ImageLabel.Image = v2.Image;
elseif v2.BadgeId then
v3.Frame.ImageLabel.Image = "rbxassetid://" .. game.BadgeService:GetBadgeInfoAsync(v2.BadgeId).IconImageId;
end;
v3.Parent = u2.AchievementsHolder;
v3.Sound:Play();
v3:TweenSize(UDim2.new(1, 0, 0.2, 0), "In", "Quad", 0.8, true);
wait(0.8);
v3.Frame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 0.5, true);
l__TweenService__3:Create(v3.Frame.Glow, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
ImageTransparency = 1
}):Play();
wait(8);
v3.Frame:TweenPosition(UDim2.new(1.1, 0, 0, 0), "In", "Quad", 0.5, true);
wait(0.5);
v3:TweenSize(UDim2.new(1, 0, -0.1, 0), "InOut", "Quad", 0.5, true);
wait(0.5);
v3:Destroy();
end;
end;
|
---[[ Fade Out and In Settings ]]
|
module.ChatWindowBackgroundFadeOutTime = 3.5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 1 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 20.0
|
--[[
Deep compares a table for any changes. Returns false if tables are different.
Functions.CompareTable(
table, <-- |REQ| Table/dictionary
table2, <-- |REQ| Table/dictionary
)
--]]
| |
--Return the Register table to expose the methods
|
return Register
|
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
|
-------------------------
|
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "a" then
a = true
elseif key == "d" then
d = true
elseif key == "w" then
w = true
rwd.Throttle = 1
rwd.Torque = tq
lwd.Throttle = 1
lwd.Torque = ftq
rrwd.Throttle = 1
rrwd.Torque = ftq
rwd.MaxSpeed = 185
lwd.MaxSpeed = 185
rrwd.MaxSpeed = 185
carSeat.Throttle = 1
carSeat.Torque = 0
elseif key == "s" then
s = true
carSeat.Throttle = 0
carSeat.Torque = 0
rwd.Throttle = -1
rwd.Torque = brk
lwd.Throttle = -1
lwd.Torque = brk
rrwd.Throttle = -1
rrwd.Torque = brk
rwd.MaxSpeed = 25
lwd.MaxSpeed = 25
rrwd.MaxSpeed = 25
end
end)
mouse.KeyUp:connect(function (key)
key = string.lower(key)
if key == "a" then
print("a up")
if d == false then
m.DesiredAngle = 0
n.DesiredAngle = m.DesiredAngle
end
elseif key == "d" then
print("d up")
if a == false then
m.DesiredAngle = 0
n.DesiredAngle = m.DesiredAngle
end
end
a = false
d = false
end)
mouse.KeyUp:connect(function (key)
key = string.lower(key)
if key == "w" or key == "s" then
rwd.Throttle = 0
rwd.Torque = 0
lwd.Throttle = 0
lwd.Torque = 0
rrwd.Throttle = 0
rrwd.Torque = 0
carSeat.Throttle = 0
carSeat.Torque = cst
end
end)
limitButton.MouseButton1Click:connect(function()
|
--You dont need to delete this text.
--PUT INSIDE a BUTTON in StarterGui
--Make sure to make a frame for the menu to pop up then go to properties > Visible [Off]
|
script.Parent.MouseButton1Click:Connect (function()
script.Parent.Parent.Visible = false
end)
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.0318467021, -0.0621779114, -1.67288721, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.17)
objs[4]:WaitForChild("Click"):Play()
end;
-- Reload Anim
ReloadAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.5)
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621779114, -1.63076854, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.5)
wait(0.5)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[4].CFrame)
objs[4].Transparency = 1
objs[6]:WaitForChild("MagOut"):Play()
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621778965, -2.69811869, 0.787567914, -0.220087856, 0.575584888, -0.51537323, 0.276813388, 0.811026871, -0.337826759, -0.935379863, 0.104581922), function(X) return math.sin(math.rad(X)) end, 0.3)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.29060709, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
objs[6]:WaitForChild('MagIn'):Play()
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621779114, -1.63076854, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.4)
MagC:Destroy()
objs[4].Transparency = 0
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.518400908, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.492658436, -1.55705214, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.4)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.609481037, -1.02827215, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.230707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.175939053, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.3)
end;
BoltForwardAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.84623456, -0.900531948, -0.749261618, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.617181182, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.2)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.230707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.03)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
end
}
nadeReload = function(char, speed, objs)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.6)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(0.6)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
return Settings
|
--------------------
--| Script Logic |--
--------------------
|
BaseShot = Instance.new('Part')
BaseShot.Name = 'Effect'
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.BrickColor = BrickColor.new('Toothpaste')
SelectionBoxify(BaseShot)
Light(BaseShot)
HitFadeSound:Clone().Parent = BaseShot
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
Tool.Click.OnServerEvent:connect(function(client, hit)
if client.Character == Tool.Parent then
OnActivated(hit)
end
end)
|
--Code
|
if year == 2007 then
script.Parent.ClickToChat.TextColor3 = Color3.new(0, 0, 0)
script.Parent.ChatBar.BackgroundColor3 = Color3.new(255/255, 255/255, 255/255)
end
local Chat = {
ChatColors = {
BrickColor.new("Bright red"),
BrickColor.new("Bright blue"),
BrickColor.new("Earth green"),
BrickColor.new("Bright violet"),
BrickColor.new("Bright orange"),
BrickColor.new("Bright yellow"),
BrickColor.new("Light reddish violet"),
BrickColor.new("Brick yellow"),
};
Gui = nil,
Frame = nil,
RenderFrame = nil,
TapToChatLabel = nil,
ClickToChatButton = nil,
Templates = nil,
EventListener = nil,
MessageQueue = {},
Configuration = {
FontSize = Enum.FontSize.Size12,
NumFontSize = 12,
HistoryLength = 20,
Size = UDim2.new(0.38, 0, 0.20, 0),
MessageColor = Color3.new(1 , 1, 1),
AdminMessageColor = Color3.new(1, 215/255, 0),
XScale = 0.025,
LifeTime = 45,
Position = UDim2.new(0, 2, 0.05, 0),
DefaultTweenSpeed = 0.15,
};
CachedSpaceStrings_List = {},
Messages_List = {},
MessageThread = nil,
TempSpaceLabel = nil,
}
function GetNameValue(pName)
local value = 0
for index = 1, #pName do
local cValue = string.byte(string.sub(pName, index, index))
local reverseIndex = #pName - index + 1
if #pName%2 == 1 then
reverseIndex = reverseIndex - 1
end
if reverseIndex%4 >= 2 then
cValue = -cValue
end
value = value + cValue
end
return value%8
end
function Chat:ComputeChatColor(pName)
return self.ChatColors[GetNameValue(pName) + 1].Color
end
function Chat:UpdateQueue(field, diff)
for i = #self.MessageQueue, 1, -1 do
if self.MessageQueue[i] then
for _, label in pairs(self.MessageQueue[i]) do
if label and type(label) ~= "table" and type(label) ~= "number" then
if label:IsA("TextLabel") or label:IsA("TextButton") then
if diff then
label.Position = label.Position - UDim2.new(0, 0, diff, 0)
else
if field == self.MessageQueue[i] then
label.Position = UDim2.new(self.Configuration.XScale, 0, label.Position.Y.Scale - field["Message"].Size.Y.Scale , 0)
else
label.Position = UDim2.new(self.Configuration.XScale, 0, label.Position.Y.Scale - field["Message"].Size.Y.Scale, 0)
end
if label.Position.Y.Scale < -0.01 then
label.Visible = false
label:Destroy()
end
end
end
end
end
end
end
end
function Chat:ComputeSpaceString(pLabel)
local nString = " "
if not self.TempSpaceLabel then
self.TempSpaceLabel = self.Templates.SpaceButton
self.TempSpaceLabel.Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y);
end
self.TempSpaceLabel.Text = nString
while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do
nString = nString .. " "
self.TempSpaceLabel.Text = nString
end
nString = nString .. " "
self.CachedSpaceStrings_List[pLabel.Text] = nString
self.TempSpaceLabel.Text = ""
return nString
end
function Chat:UpdateChat(cPlayer, message)
local messageField = {["Player"] = cPlayer,["Message"] = message}
if coroutine.status(Chat.MessageThread) == "dead" then
table.insert(Chat.Messages_List, messageField)
Chat.MessageThread = coroutine.create(function ()
for i = 1, #Chat.Messages_List do
local field = Chat.Messages_List[i]
Chat:CreateMessage(field["Player"], field["Message"])
end
Chat.Messages_List = {}
end)
coroutine.resume(Chat.MessageThread)
else
table.insert(Chat.Messages_List, messageField)
end
end
function Chat:CreateMessage(cPlayer, message)
local pName = cPlayer ~= nil and cPlayer.Name or "GAME"
message = message:gsub("^%s*(.-)%s*$", "%1")
self.MessageQueue[#self.MessageQueue] = (#self.MessageQueue > self.Configuration.HistoryLength) and nil or self.MessageQueue[#self.MessageQueue]
local pLabel = self.Templates.pLabel:clone()
pLabel.Name = pName;
pLabel.Text = pName .. ";";
pLabel.Parent = self.RenderFrame;
pLabel.TextColor3 = (cPlayer.Neutral) and Chat:ComputeChatColor(pName) or cPlayer.TeamColor.Color
local nString = self.CachedSpaceStrings_List[pName] or Chat:ComputeSpaceString(pLabel)
local mLabel = self.Templates.mLabel:clone()
mLabel.Name = pName .. " - message";
mLabel.TextColor3 = Chat.Configuration.MessageColor;
mLabel.Text = nString .. message;
mLabel.Parent = self.RenderFrame;
local heightField = mLabel.TextBounds.Y
mLabel.Size = UDim2.new(1, 0, heightField/self.RenderFrame.AbsoluteSize.Y, 0)
pLabel.Size = mLabel.Size
local yPixels = self.RenderFrame.AbsoluteSize.Y
local yFieldSize = mLabel.TextBounds.Y
local queueField = {}
queueField["Player"] = pLabel
queueField["Message"] = mLabel
queueField["SpawnTime"] = tick()
table.insert(self.MessageQueue, 1, queueField)
Chat:UpdateQueue(queueField)
end
function Chat:CreateChatBar()
self.ClickToChatButton = self.Gui:WaitForChild("ClickToChat")
self.ChatBar = self.Gui:WaitForChild("ChatBar")
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function (key)
if key:byte() == 47 or key == "/" then
wait(0.00000001)
self.ClickToChatButton.Visible = false
if year > 2007 then
self.ChatBar.BackgroundColor3 = Color3.new(0/255, 0/255, 0/255)
end
self.ChatBar:CaptureFocus()
end
end)
self.ClickToChatButton.MouseButton1Click:connect(function ()
self.ClickToChatButton.Visible = false
if year > 2007 then
self.ChatBar.BackgroundColor3 = Color3.new(0/255, 0/255, 0/255)
end
self.ChatBar:CaptureFocus()
end)
end
function Chat:PlayerChat(message)
local m = Instance.new("StringValue")
m.Name = "NewMessage"
m.Value = message
m.Parent = game.Players.LocalPlayer
game:GetService("Debris"):AddItem(m, 2)
end
function Chat:CreateGui()
self.Gui = script.Parent
self.Frame = self.Gui:WaitForChild("ChatFrame")
self.RenderFrame = self.Frame:WaitForChild("ChatRenderFrame")
self.Templates = self.Gui:WaitForChild("Templates")
Chat:CreateChatBar()
self.ChatBar.FocusLost:connect(function(enterPressed)
if year > 2007 then
self.ChatBar.BackgroundColor3 = Color3.new(0/255, 0/255, 0/255)
end
if enterPressed and self.ChatBar.Text ~= "" then
local cText = self.ChatBar.Text
if string.sub(self.ChatBar.Text, 1, 1) == "%" then
cText = "(TEAM) " .. string.sub(cText, 2, #cText)
end
Chat:PlayerChat(cText)
if self.ClickToChatButton then
self.ClickToChatButton.Visible = true
end
self.ChatBar.Text = ""
self.ClickToChatButton.Visible = true
end
end)
end
function Chat:TrackPlayerChats()
local function chatRegister(p)
p.ChildAdded:connect(function (obj)
if obj:IsA("StringValue") and obj.Name == "NewMessage" then
if game.Players.LocalPlayer.Neutral or p.TeamColor == game.Players.LocalPlayer.TeamColor then
Chat:UpdateChat(p, obj.Value)
end
end
end)
end
for _,v in pairs(game.Players:GetPlayers()) do
chatRegister(v)
end
game.Players.PlayerAdded:connect(chatRegister)
end
function Chat:CullThread()
Spawn(function ()
while true do
if #self.MessageQueue > 0 then
for _, field in pairs(self.MessageQueue) do
if field["SpawnTime"] and field["Player"] and field["Message"] and tick() - field["SpawnTime"] > self.Configuration.LifeTime then
field["Player"].Visible = false
field["Message"].Visible = false
end
end
end
wait(5)
end
end)
end
function Chat:Initialize()
Chat:CreateGui()
Chat:TrackPlayerChats()
self.MessageThread = coroutine.create(function () end)
coroutine.resume(self.MessageThread)
Chat:CullThread()
end
Chat:Initialize()
|
-- Folder that contains the RemoteEvents
|
local RemoteFolder = Home:WaitForChild("RemoteEvents")
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Animations = {}
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
Rate = (1 / 60)
ToolEquipped = false
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
Spawn(function()
PlayerMouse = Mouse
Mouse.Button1Down:connect(function()
InvokeServer("Button1Click", {Down = true})
end)
Mouse.Button1Up:connect(function()
InvokeServer("Button1Click", {Down = false})
end)
end)
end
function Unequipped()
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
Animations = {}
ToolEquipped = false
end
function InvokeServer(mode, value)
local ServerReturn = nil
pcall(function()
ServerReturn = ServerControl:InvokeServer(mode, value)
end)
return ServerReturn
end
function OnClientInvoke(mode, value)
if mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return ((PlayerMouse and {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}) or nil)
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--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.DeliciousCake -- 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)
|
--[[
A function which gets the character given one part in that character.
--]]
|
return function(p)
while p and not p:FindFirstChild("Humanoid") do
p = p.Parent;
end
return p;
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 479 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--Thermostat.Parent.IsHeatMode.Changed:connect(Active)
| |
-- Placeholder texture can be any roblox asset link
|
local initialTexture = ""
local RowCount = 3 -- rows in one sprite
local ColCount = 4 -- columns in one sprite
local perImageSpriteCount = RowCount * ColCount
local width = 229 -- image rect size
local height = 341
local framesInTotal = 12
assert(numImages * RowCount * ColCount >= framesInTotal)
local animPeriod = 1 -- period for the whole animation, in seconds
assert(animPeriod > 0)
local curImageIdx = 0
local curSpriteIdx = 0
local fps = framesInTotal / animPeriod
local accumulatedTime = 0
local function AnimateImageSpriteSheet(dt)
accumulatedTime = math.fmod(accumulatedTime + dt, animPeriod)
curSpriteIdx = math.floor(accumulatedTime * fps)
local prevImageIndex = curImageIdx
curImageIdx = math.floor(curSpriteIdx / perImageSpriteCount)
if prevImageIndex ~= curImageIdx then
imageInstance.Image = imageAssetIDs[curImageIdx + 1]
end
local localSpriteIndex = curSpriteIdx - curImageIdx * perImageSpriteCount
local row = math.floor(localSpriteIndex / ColCount)
local col = localSpriteIndex - row * ColCount
imageInstance.ImageRectOffset = Vector2.new(col * width, row * height)
end
Animator.Connection = nil
Animator.Init = function()
Animator.Connection = game:GetService("RunService").RenderStepped:Connect(AnimateImageSpriteSheet)
end
Animator.Stop = function()
if Animator.Connection then
imageInstance.Image = initialTexture
Animator.Connection:Disconnect()
end
end
return Animator
|
-- Given a label, return a function which given a string,
-- right-aligns it preceding the colon in the label.
|
function getRightAlignedPrinter(label: string): PrintLabel
-- Assume that the label contains a colon.
local index = label:find(":")
local suffix = label:sub(index)
return function(string_: string, isExpectedCall: boolean)
local retval
if isExpectedCall then
retval = "->" .. string.rep(" ", math.max(0, index - 3 - #string_))
else
retval = string.rep(" ", math.max(0, index - 1 - #string_))
end
return retval .. string_ .. suffix
end
end
|
--[[Drivetrain]]
|
Tune.Config = "RWD" --"FWD" , "RWD" , "AWD"
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres = 15 -- 1 - 100%
Tune.RDiffLockThres = 50 -- 0 - 100%
Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--Traction Control Settings
Tune.TCSEnabled = true -- Implements TCS
Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
|
-- in the mainUI
|
infoButton.MouseButton1Down:Connect(function()
topbar_infoButton_p:Play()
darkenScreen()
showAboutWindow()
aboutWindow.Visible = true
end)
infoButton.MouseButton1Up:Connect(function()
topbar_infoButton_f:Cancel()
topbar_infobutton_r:Play()
topbar_infobutton_r.Completed:Wait()
topbar_infoButton_nf:Play()
end)
local aboutCloseButton = aboutWindow.Close
|
------------------------------------------------------------------------
-- parse a function name specification
-- * used in funcstat()
------------------------------------------------------------------------
|
function luaY:funcname(ls, v)
-- funcname -> NAME {field} [':' NAME]
local needself = false
self:singlevar(ls, v)
while ls.t.token == "." do
self:field(ls, v)
end
if ls.t.token == ":" then
needself = true
self:field(ls, v)
end
return needself
end
|
--Connect Mouse1Down/Up events to the button to register touch input
--Use MouseButton1Down instead of input start to ensure it only registers touches that originate on the button
|
EnterImageButton.MouseButton1Down:Connect(function()
if UserInputService:GetLastInputType() == Enum.UserInputType.Touch then
--Only register it when in touch mode so that PC users dont click on it by accident
EnterImageButton.ImageTransparency = 1
EnterImageButton.Pressed.ImageTransparency = 0
EnterKeyDown = true
enterStart()
end
end)
EnterImageButton.MouseButton1Up:Connect(function()
if UserInputService:GetLastInputType() == Enum.UserInputType.Touch then
EnterKeyDown = false
--Return button image to unpressed
EnterImageButton.ImageTransparency = 0
EnterImageButton.Pressed.ImageTransparency = 1
end
end)
EnterImageButton.InputEnded:Connect(function(Input)
--Use a third connection to prevent the button getting stuck in pressed mode
if Input.UserInputType == Enum.UserInputType.Touch then
--Return button image to unpressed, user has stopped touching the button
EnterImageButton.ImageTransparency = 0
EnterImageButton.Pressed.ImageTransparency = 1
end
end)
FlipImageButton.MouseButton1Down:Connect(function()
if UserInputService:GetLastInputType() == Enum.UserInputType.Touch then
FlipImageButton.ImageTransparency = 1
FlipImageButton.Pressed.ImageTransparency = 0
end
end)
FlipImageButton.MouseButton1Up:Connect(function()
if UserInputService:GetLastInputType() == Enum.UserInputType.Touch then
FlipImageButton.ImageTransparency = 0
FlipImageButton.Pressed.ImageTransparency = 1
if AdornedSeat then
if isFlipped(AdornedSeat) then
flipSeat()
end
end
end
end)
EnterImageButton.InputEnded:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.Touch then
FlipImageButton.ImageTransparency = 0
FlipImageButton.Pressed.ImageTransparency = 1
end
end)
|
----[INITIALIZE VARIABLES]----
|
function Initialize()
for i = 1, #ColorPickers do
table.insert(PreviewColor, ColorPickers[i].PreviewColor)
table.insert(RGBHolders, ColorPickers[i].RGBValues)
table.insert(Errors, ColorPickers[i].Parent.Parent.Error)
local Inputs = {
RGBHolders[i].Red.Value,
RGBHolders[i].Green.Value,
RGBHolders[i].Blue.Value
}
local Hitboxes = {
RGBHolders[i].Red.Slider.Hitbox,
RGBHolders[i].Green.Slider.Hitbox,
RGBHolders[i].Blue.Slider.Hitbox
}
local Sliders = {
RGBHolders[i].Red.Slider.Hitbox.Slider,
RGBHolders[i].Green.Slider.Hitbox.Slider,
RGBHolders[i].Blue.Slider.Hitbox.Slider
}
table.insert(RGBInputs, Inputs)
table.insert(RGBSliderHitboxes, Hitboxes)
table.insert(RGBSliders, Sliders)
UpdatePreviewColor(i)
UpdateRGBSliders(i)
end
end
Initialize()
|
------------------------------------------------------------------------
-- stuff
|
do
script.Parent.Equipped:Connect(function()
if player == nil then
player = game:GetService("Players"):GetPlayerFromCharacter(script.Parent.Parent)
end
if character == nil or character.Parent == nil then
character = script.Parent.Parent
humanoid = character.Humanoid
isR15 = humanoid.RigType == Enum.HumanoidRigType.R15
rightHand = isR15 and character:WaitForChild("RightHand") or character:WaitForChild("Right Arm")
end
local getWeld = rightHand:WaitForChild("RightGrip")
motor = Instance.new("Motor6D")
motor.Name = motorName
motor.Part0 = getWeld.Part0
motor.Part1 = getWeld.Part1
--motor.C0 = getWeld.C0
--motor.C1 = getWeld.C1
getWeld:Destroy()
motor.Parent = rightHand
end)
script.Parent.Unequipped:Connect(function()
motor:Destroy()
end)
end
|
-- Teleport failure handling
|
function Queue._onTeleportFailure(player, status, message)
Log.Error.Queue("Teleport Failed: %s (%s)", player.Name, message)
-- Add this player to the latest queue given that they failed out of the previous one
Queue._addToQueue(player)
end
function Queue._sendStatus(forcePlayer)
local waitTime = tick() - _lastTeleport
local playerCount = Queue._currentQueueCount()
local status = {
enabled = Queue._timeoutEnabled,
waiting_for = Conf.min_queue_players - playerCount,
max_players = Conf.max_queue_players,
current_players = playerCount,
time_remaining = math.max(0, Conf.queue_time_limit - (tick() - _lastTeleport)),
}
if forcePlayer then
Broadcast.fireRemoteClient(forcePlayer, "QUEUE_STATUS", status)
else
for player, time in pairs(_currentQueue) do
Broadcast.fireRemoteClient(player, "QUEUE_STATUS", status)
end
end
end
function Queue.new(gameStageHandler)
local self = setmetatable({
gameStageHandler = gameStageHandler,
}, Queue)
for _, weaponInstance in pairs(WeaponsFolder:GetChildren()) do
weaponInstance:Clone().Parent = StarterPack
end
return self
end
function Queue:playerAdded(player)
Log.Debug.Queue("Added player %s", player.Name)
Queue._addToQueue(player)
----
-- find the humanoid, and detect when it dies
player.CharacterAdded:Connect(function(character)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
local loading = nil
humanoid.Died:Connect(function()
if not loading then
loading = true
wait(3)
Util.loadCharacter(player)
end
end)
end
end)
--
Util.loadCharacter(player)
end
function Queue:playerRemoving(player)
Log.Debug.Queue("Removed player %s", player.Name)
Queue._removeFromQueue(player)
end
function Queue:initialize()
Log.Warn.Queue("STARTING")
self.requestConn = Broadcast.registerHandler("QUEUE_STATUS_REQUEST", function(player)
Queue._sendStatus(player)
end)
if not WeaponsSystem.doingSetup and not WeaponsSystem.didSetup then
WeaponsSystem.setup()
end
DamageHandler.setup()
for _, player in ipairs(Players:GetPlayers()) do
self:playerAdded(player)
end
TeleportService.TeleportInitFailed:Connect(Queue._onTeleportFailure)
if not Conf.disable_queue then
spawn(function()
while true do
local waitTime = tick() - _lastTeleport
local currentCount = Queue._currentQueueCount()
if not Queue._timeoutEnabled or waitTime < Conf.queue_time_limit or currentCount < Conf.min_queue_players then
wait(1)
else
Log.Debug.Queue("Queue is progressing. Buckle up for fun. *MAXIMUM* fun...")
Queue._teleportQueue()
end
end
end)
end
Log.Warn.Queue("STARTED")
end
function Queue:destroy()
Broadcast.unregisterHandler(self.requestConn)
end
|
-- Services
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
|
--[[**
Gets a dictionary of the given group's information.
@param [Integer] GroupID The group you are checking.
@returns [Dictionary] The group's information.
**--]]
|
function GroupService:GetGroupInfoAsync(GroupID)
local Success, GroupInfo = pcall(RbxGroupService.GetGroupInfoAsync, RbxGroupService, GroupID)
return Success and GroupInfo or {}
end
return GroupService
|
--[=[
Utility methods for promise
@class PromiseUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local Promise = require("Promise")
local PromiseUtils = {}
|
-- Factor of torque applied to change the wheel direction
-- Larger number generally means faster braking
|
local BRAKING_TORQUE = 1000
|
-- NEW v12.0.0: Casters now use a data packet which can be made like what follows.
-- Check the API for more information: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/fcbehavior
|
local CastBehavior = FastCast.newBehavior()
CastBehavior.RaycastParams = CastParams
CastBehavior.MaxDistance = BULLET_MAXDIST
CastBehavior.HighFidelityBehavior = FastCast.HighFidelityBehavior.Default
|
-- use a remote function for setup to avoid async
|
remotes.setup.OnServerEvent:Connect(function(player, isR15, weapon)
local weapon = weapon:Clone();
local character = player.Character;
local humanoid = character:WaitForChild("Humanoid");
local joint = Instance.new("Motor6D");
joint.Part0 = character:WaitForChild(isR15 and "RightHand" or "Right Arm");
joint.Part1 = weapon:WaitForChild("Handle");
joint.Parent = weapon.Handle;
weapon.Parent = character;
weapons[player] = require(weapon:WaitForChild("settings"))(isR15);
local tilt = spring.new(0, 0, 0, 10, 1);
local recoil = spring.new(Vector2.new(), Vector2.new(), Vector2.new(), 20, 1);
springs[player] = {};
springs[player].tilt = tilt;
springs[player].recoil = recoil;
-- update the character according to their rig type
local tiltFunc, recoilFunc;
if (isR15) then
local neck = character:WaitForChild("Head"):WaitForChild("Neck");
local waist = character:WaitForChild("UpperTorso"):WaitForChild("Waist");
local rShoulder = character:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder");
local lShoulder = character:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder");
local neckC0 = neck.C0;
local waistC0 = waist.C0;
local rShoulderC0 = rShoulder.C0;
local lShoulderC0 = lShoulder.C0;
function tiltFunc(theta)
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(theta, 0, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(theta, 0, 0);
rShoulder.C0 = rShoulderC0 * CFrame.fromEulerAnglesYXZ(theta, 0, 0);
lShoulder.C0 = lShoulderC0 * CFrame.fromEulerAnglesYXZ(theta, 0, 0);
end
function recoilFunc(x, y)
rShoulder.C0 = rShoulder.C0 * CFrame.new(0, 0, x);
lShoulder.C0 = lShoulder.C0 * CFrame.new(0, 0, y);
end
else
local torso = character:WaitForChild("Torso");
local hrp = character:WaitForChild("HumanoidRootPart");
local neck = torso:WaitForChild("Neck");
local root = hrp:WaitForChild("RootJoint");
local rShoulder = torso:WaitForChild("Right Shoulder");
local lShoulder = torso:WaitForChild("Left Shoulder");
local rHip = torso:WaitForChild("Right Hip");
local lHip = torso:WaitForChild("Left Hip");
local neckC0 = neck.C0;
local rootC0 = root.C0;
local rShoulderC0 = rShoulder.C0;
local lShoulderC0 = lShoulder.C0;
local rHipC0 = rHip.C0;
local lHipC0 = lHip.C0;
-- rotating the R6 joints is so arbitrary
function tiltFunc(theta)
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(-theta, 0, 0);
root.C0 = rootC0 * CFrame.new(0, 0, -1) * CFrame.fromEulerAnglesYXZ(-theta, 0, 0) * CFrame.new(0, 0, 1);
rShoulder.C0 = rShoulderC0 * CFrame.fromEulerAnglesYXZ(0, 0, theta);
lShoulder.C0 = lShoulderC0 * CFrame.fromEulerAnglesYXZ(0, 0, -theta);
rHip.C0 = rHipC0 * CFrame.fromEulerAnglesYXZ(0, 0, -theta);
lHip.C0 = lHipC0 * CFrame.fromEulerAnglesYXZ(0, 0, theta);
end
function recoilFunc(x, y)
rShoulder.C0 = rShoulder.C0 * CFrame.new(-x, 0, 0);
lShoulder.C0 = lShoulder.C0 * CFrame.new(y, 0, 0);
end
end
local heartBeat = runService.Heartbeat:Connect(function(dt)
tilt:update(dt);
recoil:update(dt);
tiltFunc(states[humanoid:GetState()] and 0 or tilt.p / 2);
recoilFunc(recoil.p.x, recoil.p.y);
end)
-- disconnect on death
local died; died = player.Character.Humanoid.Died:Connect(function()
heartBeat:Disconnect();
died:Disconnect();
end)
-- store this for later
cleanup[player] = {
tiltFunc;
heartBeat;
died;
weapon;
joint;
recoilFunc;
}
end)
remotes.cleanup.OnServerEvent:Connect(function(player)
local clean = cleanup[player];
if (clean) then
clean[2]:Disconnect();
clean[1](0);
clean[3]:Disconnect();
clean[4]:Destroy();
clean[5]:Destroy();
clean[6](0, 0);
end
end)
|
-- A state object whose value is derived from other objects using a callback.
|
export type ComputedPairs<K, VI, VO> = PubTypes.ComputedPairs<K, VO> & {
_oldDependencySet: Set<PubTypes.Dependency>,
_processor: (K, VI) -> VO,
_destructor: (VO) -> (),
_inputIsState: boolean,
_inputTable: PubTypes.CanBeState<{[K]: VI}>,
_oldInputTable: {[K]: VI},
_outputTable: {[K]: VO},
_oldOutputTable: {[K]: VO},
_keyData: {[K]: {
dependencySet: Set<PubTypes.Dependency>,
oldDependencySet: Set<PubTypes.Dependency>,
dependencyValues: {[PubTypes.Dependency]: any}
}}
}
|
--// Animations
|
local L_140_
function IdleAnim(L_282_arg1)
L_23_.IdleAnim(L_3_, L_140_, {
L_30_,
L_31_,
L_32_
});
end;
function EquipAnim(L_283_arg1)
L_23_.EquipAnim(L_3_, L_140_, {
L_30_
});
end;
function UnequipAnim(L_284_arg1)
L_23_.UnequipAnim(L_3_, L_140_, {
L_30_
});
end;
function FireModeAnim(L_285_arg1)
L_23_.FireModeAnim(L_3_, L_140_, {
L_30_,
L_32_,
L_31_,
L_40_
});
end
function ReloadAnim(L_286_arg1)
L_23_.ReloadAnim(L_3_, L_140_, {
L_30_,
L_31_,
L_32_,
L_43_,
L_3_:WaitForChild('Left Arm'),
L_40_,
L_34_,
L_3_:WaitForChild('Right Arm'),
L_28_
});
end;
function BoltingBackAnim(L_287_arg1)
L_23_.BoltingBackAnim(L_3_, L_140_, {
L_34_
});
end
function BoltingForwardAnim(L_288_arg1)
L_23_.BoltingForwardAnim(L_3_, L_140_, {
L_34_
});
end
function BoltingForwardAnim(L_289_arg1)
L_23_.BoltingForwardAnim(L_3_, L_140_, {
L_34_
});
end
function BoltBackAnim(L_290_arg1)
L_23_.BoltBackAnim(L_3_, L_140_, {
L_34_,
L_32_,
L_31_,
L_30_,
L_44_
});
end
function BoltForwardAnim(L_291_arg1)
L_23_.BoltForwardAnim(L_3_, L_140_, {
L_34_,
L_32_,
L_31_,
L_30_,
L_44_
});
end
function InspectAnim(L_292_arg1)
L_23_.InspectAnim(L_3_, L_140_, {
L_32_,
L_31_
});
end
function nadeReload(L_293_arg1)
L_23_.nadeReload(L_3_, L_140_, {
L_31_,
L_32_
});
end
|
--[[
Creates a function that invokes a callback with correct error handling and
resolution mechanisms.
]]
|
local function createAdvancer(callback, resolve, reject)
return function(...)
local resultLength, result = wpcallPacked(callback, ...)
local ok = result[1]
if ok then
resolve(unpack(result, 2, resultLength))
else
reject(unpack(result, 2, resultLength))
end
end
end
local function isEmpty(t)
return next(t) == nil
end
local function createSymbol(name)
assert(type(name) == "string", "createSymbol requires `name` to be a string.")
local symbol = newproxy(true)
getmetatable(symbol).__tostring = function()
return ("Symbol(%s)"):format(name)
end
return symbol
end
local PromiseMarker = createSymbol("PromiseMarker")
local Promise = {}
Promise.prototype = {}
Promise.__index = Promise.prototype
Promise.Status = {
Started = createSymbol("Started"),
Resolved = createSymbol("Resolved"),
Rejected = createSymbol("Rejected"),
Cancelled = createSymbol("Cancelled"),
}
|
---This function sets the position of the Plot
|
function module.SetCharVisibility(Char,Amount,Car)
---Getting the player meshparts and decals
for _,v in pairs(Char:GetDescendants()) do
if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("BasePart") then
if Amount > 0 then
v.CollisionGroupId = 3
else
v.CollisionGroupId = 0
end
end
---Checking what the model is
if v:IsA("MeshPart") or v:IsA("Decal") or v:IsA("Part") and v.Name ~= "HumanoidRootPart" then
v.Transparency = Amount
end
---Modifying name tag
-- local Nametag = Char.HumanoidRootPart.NameTag
local ExtendSize = nil
if Car ~= nil then
if Car:IsA("Model") then
ExtendSize = Car:GetExtentsSize()
elseif Car.Parent:IsA("Model") then
ExtendSize = Car.Parent:GetExtentsSize()
end
end
--if ExtendSize ~= nil then
-- if ExtendSize.Y > 8 then
-- Nametag.ExtentsOffsetWorldSpace = Vector3.new(0,4 + ExtendSize.Y - 8, 0)
-- Nametag.MaxDistance = 40
-- else
-- Nametag.ExtentsOffsetWorldSpace = Vector3.new(0,4,0)
-- Nametag.MaxDistance = 40
-- end
--else
-- Nametag.ExtentsOffsetWorldSpace = Vector3.new(0,4,0)
-- Nametag.MaxDistance = 85
--end
---Modifying camera zoom
if Amount > 0 then
game.Players:GetPlayerFromCharacter(Char).CameraMinZoomDistance = 10
else
game.Players:GetPlayerFromCharacter(Char).CameraMinZoomDistance = 0.5
end
end
end
return module
|
--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)
if plrData.Money.Gold.Value > 8 then
return true
end
return false
end
|
--// Handling Settings
|
Firerate = 60 / 450; -- 60 = 1 Minute, 450 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 1; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--- Color ---
|
button.MouseEnter:Connect(function()
local Color = Color3.fromRGB(60, 60, 60)
TweenService:Create(button, Info, {BackgroundColor3 = Color}):Play()
end)
button.MouseLeave:Connect(function()
local ColorColor = Color3.fromRGB(43, 43, 43)
TweenService:Create(button, Info, {BackgroundColor3 = ColorColor}):Play()
end)
|
-- Track the enabling of areas
|
Security.Areas = Workspace:FindFirstChild('[Private Building Areas]');
Workspace.ChildAdded:Connect(function (Child)
if not Security.Areas and Child.Name == '[Private Building Areas]' then
Security.Areas = Child;
end;
end);
Workspace.ChildRemoved:Connect(function (Child)
if Security.Areas and Child.Name == '[Private Building Areas]' then
Security.Areas = nil;
end;
end);
function Security.IsAreaAuthorizedForPlayer(Area, Player)
-- Returns whether `Player` has permission to manipulate parts in this area
-- Ensure area has permissions
local Permissions = Area:FindFirstChild '[Permissions]';
if not Permissions then
return;
else
Permissions = require(Permissions);
end;
-- Ensure permissions are set up
if not Permissions then
return;
end;
-- Search for authorizing permission
for _, Permission in pairs(Permissions) do
-- Check group permissions
if Permission.Type == 'Group' then
-- Check player's group membership
local PlayerInGroup = Player:IsInGroup(Permission.GroupId);
-- If no specific rank is required, authorize
if PlayerInGroup and not Permission.Ranks then
return true;
-- If specific rank is required, check player rank
elseif PlayerInGroup and Permission.Ranks then
local Symbol, RankNumber = tostring(Permission.Ranks):match('([<>]?=?)([0-9]+)');
local PlayerRank = Player:GetRankInGroup(Permission.GroupId);
RankNumber = tonumber(RankNumber);
-- Check the player rank
if not Symbol and (PlayerRank == RankNumber) then
return true;
elseif Symbol == '=' and (PlayerRank == RankNumber) then
return true;
elseif Symbol == '>' and (PlayerRank > RankNumber) then
return true;
elseif Symbol == '<' and (PlayerRank < RankNumber) then
return true;
elseif Symbol == '>=' and (PlayerRank >= RankNumber) then
return true;
elseif Symbol == '<=' and (PlayerRank <= RankNumber) then
return true;
end;
end;
-- Check player permissions
elseif Permission.Type == 'Player' then
if (Player.userId == Permission.PlayerId) or (Player.Name == Permission.PlayerName) then
return true;
end;
-- Check owner permissions
elseif Permission.Type == 'Owner' then
if (Player.userId == Permission.PlayerId) or (Player.Name == Permission.PlayerName) then
return true;
end;
-- Check auto-permissions
elseif Permission.Type == 'Anybody' then
return true;
-- Check friend permissions
elseif Permission.Type == 'Friends' then
if Player:IsFriendsWith(Permission.PlayerId) then
return true;
end;
-- Check asset permissions
elseif Permission.Type == 'Asset' then
if MarketplaceService:PlayerOwnsAsset(Player, Permission.AssetId) then
return true;
end;
-- Check team permissions
elseif Permission.Type == 'Team' then
if Permission.Team and Player.Team == Permission.Team then
return true;
elseif Permission.TeamColor and Player.Team and Player.Team.TeamColor == Permission.TeamColor then
return true;
elseif Permission.TeamName and Player.Team and Player.Team.Name == Permission.TeamName then
return true;
end;
-- Check BC permissions
elseif Permission.Type == 'NoBC' then
if Player.MembershipType == Enum.MembershipType.None then
return true;
end;
elseif Permission.Type == 'AnyBC' then
if Player.MembershipType ~= Enum.MembershipType.None then
return true;
end;
elseif Permission.Type == 'BC' then
if Player.MembershipType == Enum.MembershipType.BuildersClub then
return true;
end;
elseif Permission.Type == 'TBC' then
if Player.MembershipType == Enum.MembershipType.TurboBuildersClub then
return true;
end;
elseif Permission.Type == 'OBC' then
if Player.MembershipType == Enum.MembershipType.OutrageousBuildersClub then
return true;
end;
-- Check custom permissions
elseif Permission.Type == 'Callback' then
return Permission.Callback(Player);
end;
end;
-- If the player passes none of these conditions, deny access
return false;
end;
function Security.IsItemAllowed(Item, Player)
-- Returns whether instance `Item` can be accessed
-- Ensure `Item` is a part or a model
local IsItemClassAllowed = (Item:IsA 'BasePart' and not Item:IsA 'Terrain') or
(Item:IsA 'Model' and not Item:IsA 'Workspace') or
Item:IsA 'Folder' or
Item:IsA 'Smoke' or
Item:IsA 'Fire' or
Item:IsA 'Sparkles' or
Item:IsA 'DataModelMesh' or
Item:IsA 'Decal' or
Item:IsA 'Texture' or
Item:IsA 'Light'
if not IsItemClassAllowed then
return false
end
-- Check if `Item` descendants from any allowed location
for _, AllowedLocation in pairs(Security.AllowedLocations) do
if Item:IsDescendantOf(AllowedLocation) then
return true
end
end
-- Deny if `Item` is not a descendant of any allowed location
return true -- changed this
end
function Security.IsLocationAllowed(Location, Player)
-- Returns whether location `Location` can be accessed
-- Check if within allowed locations
for _, AllowedLocation in pairs(Security.AllowedLocations) do
if (AllowedLocation == Location) or Location:IsDescendantOf(AllowedLocation) then
return true
end
end
-- Deny if not within allowed locations
return false
end
function Security.AreAreasEnabled()
-- Returns whether areas are enabled
-- Base whether areas are enabled depending on area container presence and tool mode
if Security.Areas and (ToolMode == 'Tool') then
return true;
else
return false;
end;
end;
function Security.ArePartsViolatingAreas(Parts, Player, ExemptPartial, AreaPermissions)
-- Returns whether the given parts are inside any unauthorized areas
-- Make sure area security is being enforced
if not Security.AreAreasEnabled() then
return false;
end;
-- If no parts, no violations exist
if not next(Parts) then
return false
end
-- Make sure there is a permissions cache
AreaPermissions = AreaPermissions or {};
-- Check which areas the parts are in
local Areas, RegionMap = Security.GetSelectionAreas(Parts, true);
-- Check authorization for each relevant area
for _, Area in pairs(Areas) do
-- Determine authorization if not in given permissions cache
if AreaPermissions[Area] == nil then
AreaPermissions[Area] = Security.IsAreaAuthorizedForPlayer(Area, Player);
end;
-- If unauthorized and partial violations aren't exempt, declare violation
if not ExemptPartial and AreaPermissions[Area] == false then
return true;
end;
-- If authorized and partial violations are allowed, check if all parts match area
if ExemptPartial and AreaPermissions[Area] then
-- Get parts matched to this area
for Region, RegionParts in pairs(RegionMap) do
if Region.Area == Area then
-- If all parts are on this authorized area, call off any violation
if Support.CountKeys(Parts) == #RegionParts then
return false
end
end
end
end;
end;
-- If not in a private area, determine violation based on public building policy
if #Areas == 0 then
return not Security.AllowPublicBuilding;
-- If authorization for a partial violation-exempt check on an area failed, indicate a violation
elseif ExemptPartial then
return true;
-- If in authorized areas, determine violation based on public building policy compliance
elseif RegionMap and not Security.AllowPublicBuilding then
-- Check area residence of each part's corner
local PartCornerCompliance = {};
for AreaRegion, Parts in pairs(RegionMap) do
for _, Part in pairs(Parts) do
PartCornerCompliance[Part] = PartCornerCompliance[Part] or 0;
-- Track the number of corners that `Part` has in this region
for _, Corner in pairs(Support.GetPartCorners(Part)) do
if AreaRegion:CastPoint(Corner.p) then
PartCornerCompliance[Part] = PartCornerCompliance[Part] + 1;
end;
end;
end;
end;
-- Ensure all corners of the part are contained within areas
for _, CornersContained in pairs(PartCornerCompliance) do
if CornersContained ~= 8 then
return true;
end;
end;
end;
-- If no violations occur, indicate no violations
return false;
end;
function Security.GetSelectionAreas(Selection, ReturnMap)
-- Returns a list of areas that the selection of parts is in
-- Make sure areas are enabled
if not Security.AreAreasEnabled() then
return {};
end;
-- Start a map if requested
local Map = ReturnMap and {} or nil;
-- Check each area to find out if any of the parts are within
local Areas = {};
for _, Area in pairs(Security.Areas:GetChildren()) do
-- Get all parts from the selection within this area
local Region = RegionModule.new(
Area.CFrame * CFrame.new(0, Security.AreaHeight / 2 - Area.Size.Y / 2, 0),
Vector3.new(Area.Size.X, Security.AreaHeight + Area.Size.Y, Area.Size.Z)
);
Region.Area = Area
local ContainedParts = Region:CastParts(Selection);
-- If parts are in this area, remember the area
if #ContainedParts > 0 then
table.insert(Areas, Area);
-- Map out the parts for each area region
if Map then
Map[Region] = ContainedParts;
end;
end;
end;
-- Return the areas where any of the given parts exist
return Areas, Map;
end;
function Security.GetPermissions(Areas, Player)
-- Returns a cache of the current player's authorization to the given areas
-- Make sure security is enabled
if not Security.AreAreasEnabled() then
return;
end;
-- Build the cache of permissions for each area
local Cache = {};
for _, Area in pairs(Areas) do
Cache[Area] = Security.IsAreaAuthorizedForPlayer(Area, Player);
end;
-- Return the permissions cache
return Cache;
end;
return Security;
|
--[[Controls]]
|
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
--Input Handler
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and ((_TMode=="Auto" and _CGear<=1) or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 then _ClutchOn = true end
if (_CGear ~= 0 and (_CGear ~= ((#_Tune.Ratios-3)-(#_Tune.Ratios-2)))) and _TMode=="Semi" then
_GThrotShift = 0
wait(_Tune.ShiftTime/2)
_GThrotShift = 1
end
_CGear = math.max(_CGear-1,-1)
if not _TMode=="Manual" then _ClutchOn = true end
--Shift Up [Manual Transmission]
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and ((_TMode=="Auto" and _CGear<1) or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 then _ClutchOn = true end
if ((_CGear ~= 0) and (_CGear ~= #_Tune.Ratios-2)) and _TMode=="Semi" then
_GThrotShift = 0
wait(_Tune.ShiftTime)
_GThrotShift = 1
end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
if not _TMode=="Manual" then _ClutchOn = true end
--Toggle Clutch
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClutchOn = false
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClutchOn = true
_ClPressing = false
end
--Toggle PBrake
elseif _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then _PBrake = false end
end
--Toggle Transmission Mode
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
--Throttle
elseif (_IsOn and not car.DriveSeat.Tic.Value) and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle/100
end
--Brake
elseif car.DriveSeat.AI.Value == false and ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) and car.DriveSeat.AI.Value == false then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
--Steer Right
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) and car.DriveSeat.AI.Value == false then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] and car.DriveSeat.AI.Value == false then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle/100
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
--Toggle TCS
elseif _Tune.TCSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then _TCS = not _TCS end
--Toggle ABS
elseif _Tune.ABSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then _ABS = not _ABS end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") and car.DriveSeat.AI.Value == false then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone and car.DriveSeat.AI.Value == false then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone and car.DriveSeat.AI.Value == false then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif (_IsOn and not car.DriveSeat.Tic.Value) and input.KeyCode == _CTRL["ContlrThrottle"] and car.DriveSeat.AI.Value == false then
_GThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
elseif car.DriveSeat.AI.Value == false then
_GThrot = _Tune.IdleThrottle/100
_GSteerT = 0
_GBrake = 0
if _CGear~=0 then _ClutchOn = true end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
--This may seem odd, but it is necessary. If there are any _possible_ WeaponsSystem modules in the datamodel,
--we may have found them before they've been installed in ReplicatedStorage, so CollectionService's added signal
--won't run again for them. This means we should switch to waiting for Heartbeat instead of waiting for another
--weapons system to be added.
|
local anyPossible = searchForWeaponsSystem()
while not WeaponsSystemFolder do
if anyPossible then
RunService.Heartbeat:Wait()
else
CollectionService:GetInstanceAddedSignal(WEAPONS_SYSTEM_TAG):Wait()
end
anyPossible = searchForWeaponsSystem()
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 6000 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--------
|
function Handler:add(hitboxObject)
assert(typeof(hitboxObject) ~= "Instance", "Make sure you are initializing from the Raycast module, not from this handler.")
table.insert(ActiveHitboxes, hitboxObject)
end
function Handler:remove(object)
for i in ipairs(ActiveHitboxes) do
if ActiveHitboxes[i].object == object then
ActiveHitboxes[i]:Destroy()
setmetatable(ActiveHitboxes[i], nil)
table.remove(ActiveHitboxes, i)
end
end
end
function Handler:check(object)
for _, hitbox in ipairs(ActiveHitboxes) do
if hitbox.object == object then
return hitbox
end
end
end
function OnTagRemoved(object)
Handler:remove(object)
end
CollectionService:GetInstanceRemovedSignal("RaycastModuleManaged"):Connect(OnTagRemoved)
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 500 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 9000 -- Use sliders to manipulate values
Tune.Redline = 9000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v2 = setmetatable({}, v1);
v2.__index = v2;
function v2.new(p1)
local v3 = setmetatable(v1.new(), v2);
v3.CONTROL_ACTION_PRIORITY = p1;
v3.textFocusReleasedConn = nil;
v3.textFocusGainedConn = nil;
v3.windowFocusReleasedConn = nil;
v3.forwardValue = 0;
v3.backwardValue = 0;
v3.leftValue = 0;
v3.rightValue = 0;
v3.jumpEnabled = true;
return v3;
end;
local l__UserInputService__1 = game:GetService("UserInputService");
local u2 = Vector3.new(0, 0, 0);
function v2.Enable(p2, p3)
if not l__UserInputService__1.KeyboardEnabled then
return false;
end;
if p3 == p2.enabled then
return true;
end;
p2.forwardValue = 0;
p2.backwardValue = 0;
p2.leftValue = 0;
p2.rightValue = 0;
p2.moveVector = u2;
p2.jumpRequested = false;
p2:UpdateJump();
if p3 then
p2:BindContextActions();
p2:ConnectFocusEventListeners();
else
p2:UnbindContextActions();
p2:DisconnectFocusEventListeners();
end;
p2.enabled = p3;
return true;
end;
function v2.UpdateMovement(p4, p5)
if p5 == Enum.UserInputState.Cancel then
p4.moveVector = u2;
return;
end;
p4.moveVector = Vector3.new(p4.leftValue + p4.rightValue, 0, p4.forwardValue + p4.backwardValue);
end;
function v2.UpdateJump(p6)
p6.isJumping = p6.jumpRequested;
end;
local l__ContextActionService__3 = game:GetService("ContextActionService");
function v2.BindContextActions(p7)
l__ContextActionService__3:BindActionAtPriority("moveForwardAction", function(p8, p9, p10)
if p9 == Enum.UserInputState.Begin then
local v4 = -1;
else
v4 = 0;
end;
p7.forwardValue = v4;
p7:UpdateMovement(p9);
return Enum.ContextActionResult.Pass;
end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward);
l__ContextActionService__3:BindActionAtPriority("moveBackwardAction", function(p11, p12, p13)
if p12 == Enum.UserInputState.Begin then
local v5 = 1;
else
v5 = 0;
end;
p7.backwardValue = v5;
p7:UpdateMovement(p12);
return Enum.ContextActionResult.Pass;
end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward);
l__ContextActionService__3:BindActionAtPriority("moveLeftAction", function(p14, p15, p16)
if p15 == Enum.UserInputState.Begin then
local v6 = -1;
else
v6 = 0;
end;
p7.leftValue = v6;
p7:UpdateMovement(p15);
return Enum.ContextActionResult.Pass;
end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft);
l__ContextActionService__3:BindActionAtPriority("moveRightAction", function(p17, p18, p19)
if p18 == Enum.UserInputState.Begin then
local v7 = 1;
else
v7 = 0;
end;
p7.rightValue = v7;
p7:UpdateMovement(p18);
return Enum.ContextActionResult.Pass;
end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight);
l__ContextActionService__3:BindActionAtPriority("jumpAction", function(p20, p21, p22)
local v8 = p7.jumpEnabled and p21 == Enum.UserInputState.Begin;
p7.jumpRequested = v8;
p7:UpdateJump();
return Enum.ContextActionResult.Pass;
end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump);
end;
function v2.UnbindContextActions(p23)
l__ContextActionService__3:UnbindAction("moveForwardAction");
l__ContextActionService__3:UnbindAction("moveBackwardAction");
l__ContextActionService__3:UnbindAction("moveLeftAction");
l__ContextActionService__3:UnbindAction("moveRightAction");
l__ContextActionService__3:UnbindAction("jumpAction");
end;
function v2.ConnectFocusEventListeners(p24)
local function v9()
p24.moveVector = u2;
p24.forwardValue = 0;
p24.backwardValue = 0;
p24.leftValue = 0;
p24.rightValue = 0;
p24.jumpRequested = false;
p24:UpdateJump();
end;
p24.textFocusReleasedConn = l__UserInputService__1.TextBoxFocusReleased:Connect(v9);
p24.textFocusGainedConn = l__UserInputService__1.TextBoxFocused:Connect(function(p25)
p24.jumpRequested = false;
p24:UpdateJump();
end);
p24.windowFocusReleasedConn = l__UserInputService__1.WindowFocused:Connect(v9);
end;
function v2.DisconnectFocusEventListeners(p26)
if p26.textFocusReleasedConn then
p26.textFocusReleasedConn:Disconnect();
p26.textFocusReleasedConn = nil;
end;
if p26.textFocusGainedConn then
p26.textFocusGainedConn:Disconnect();
p26.textFocusGainedConn = nil;
end;
if p26.windowFocusReleasedConn then
p26.windowFocusReleasedConn:Disconnect();
p26.windowFocusReleasedConn = nil;
end;
end;
return v2;
|
--[=[
@within TableUtil
@function SwapRemove
@param tbl table -- Array
@param i number -- Index
Removes index `i` in the table by swapping the value at `i` with
the last value in the array, and then trimming off the last
value from the array.
This allows removal of the value at `i` in `O(1)` time, but does
not preserve array ordering. If a value needs to be removed from
an array, but ordering of the array does not matter, using
`SwapRemove` is always preferred over `table.remove`.
In the following example, we remove "B" at index 2. SwapRemove does
this by moving the last value "E" over top of "B", and then trimming
off "E" at the end of the array:
```lua
local t = {"A", "B", "C", "D", "E"}
TableUtil.SwapRemove(t, 2) -- Remove "B"
print(t) --> {"A", "E", "C", "D"}
```
:::note Arrays only
This function works on arrays, but not dictionaries.
]=]
|
local function SwapRemove(t: Table, i: number)
local n = #t
t[i] = t[n]
t[n] = nil
end
|
-- goro7
|
local plr = game.Players.LocalPlayer
game.ReplicatedStorage.Interactions.Client.WaitForMapLoad.OnClientInvoke = function(map, referenceCount)
-- Wait until complete
repeat
wait(0.25)
until referenceCount - #map:GetDescendants() <= 10
end
|
-- The maximum distance the can can shoot, this value should never go above 1000
|
local Range = 600
|
------------------------------------------------------------------------
-- subexpr -> (simpleexp | unop subexpr) { binop subexpr }
-- where 'binop' is any binary operator with a priority higher than 'limit'
-- * for priority lookups with self.priority[], 1=left and 2=right
-- * recursively called
-- * used in expr()
------------------------------------------------------------------------
|
function luaY:subexpr(ls, v, limit)
self:enterlevel(ls)
local uop = self:getunopr(ls.t.token)
if uop ~= "OPR_NOUNOPR" then
luaX:next(ls)
self:subexpr(ls, v, self.UNARY_PRIORITY)
luaK:prefix(ls.fs, uop, v)
else
self:simpleexp(ls, v)
end
-- expand while operators have priorities higher than 'limit'
local op = self:getbinopr(ls.t.token)
while op ~= "OPR_NOBINOPR" and self.priority[luaK.BinOpr[op] + 1][1] > limit do
local v2 = {} -- expdesc
luaX:next(ls)
luaK:infix(ls.fs, op, v)
-- read sub-expression with higher priority
local nextop = self:subexpr(ls, v2, self.priority[luaK.BinOpr[op] + 1][2])
luaK:posfix(ls.fs, op, v, v2)
op = nextop
end
self:leavelevel(ls)
return op -- return first untreated operator
end
|
-- Local private variables and constants
|
local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local tweenAcceleration = math.rad(220) -- Radians/Second^2
local tweenSpeed = math.rad(0) -- Radians/Second
local tweenMaxSpeed = math.rad(250) -- Radians/Second
local TIME_BEFORE_AUTO_ROTATE = 2 -- Seconds, used when auto-aligning camera with vehicles
local INITIAL_CAMERA_ANGLE = CFrame.fromOrientation(math.rad(-15), 0, 0)
local ZOOM_SENSITIVITY_CURVATURE = 0.5
local FIRST_PERSON_DISTANCE_MIN = 0.5
local cameraOffset = ZERO_VECTOR3
local CAMERA_OFFSET_SMOOTHNESS = 0.175
|
--!strict
--[[
A 'Symbol' is an opaque marker type.
Symbols have the type 'userdata', but when printed to the console, the name
of the symbol is shown.
]]
|
local Symbol = {}
|
--[[---------------- SERVICES -----------------]]
|
--
local contextActionService = game:GetService("ContextActionService")
local runService = game:GetService("RunService")
local repStoreService = game:GetService("ReplicatedStorage")
|
--------END CREW--------
|
game.Workspace.RRProjector.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--// States
|
local L_64_ = false
local L_65_ = false
local L_66_ = false
local L_67_ = false
local L_68_ = false
local L_69_ = true
local L_70_ = false
local L_71_ = false
local L_72_ = false
local L_73_ = false
local L_74_ = false
local L_75_ = false
local L_76_ = false
local L_77_ = false
local L_78_ = false
local L_79_ = false
local L_80_ = false
local L_81_ = false
local L_82_ = false
local L_83_ = false
local L_84_ = true
local L_85_ = true
local L_86_ = false
local L_87_
local L_88_
local L_89_
local L_90_
local L_91_
local L_92_ = L_24_.FireMode
local L_93_ = 0
local L_94_ = false
local L_95_ = true
local L_96_ = false
local L_97_ = 70
local L_98_ = L_2_.PlayerGui:FindFirstChild('AimSFX') or Instance.new('Sound')
L_98_.Parent = L_2_.PlayerGui
|
--[[Weight and CG]]
|
Tune.Weight = 2600 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- Join or leave a special feature such as a Dropdown or Menu
|
function Icon:join(parentIcon, featureName, dontUpdate)
if self._parentIcon then
self:leave()
end
local newFeatureName = (featureName and featureName:lower()) or "dropdown"
local beforeName = "before"..featureName:sub(1,1):upper()..featureName:sub(2)
local parentFrame = parentIcon.instances[featureName.."Frame"]
self.presentOnTopbar = false
self.joinedFeatureName = featureName
self._parentIcon = parentIcon
self.instances.iconContainer.Parent = parentFrame
for noticeId, noticeDetail in pairs(self.notices) do
parentIcon:notify(noticeDetail.clearNoticeEvent, noticeId)
--parentIcon:notify(noticeDetail.completeSignal, noticeId)
end
if featureName == "dropdown" then
local squareCorners = parentIcon:get("dropdownSquareCorners")
self:set("iconSize", UDim2.new(1, 0, 0, self:get("iconSize", "deselected").Y.Offset), "deselected", beforeName)
self:set("iconSize", UDim2.new(1, 0, 0, self:get("iconSize", "selected").Y.Offset), "selected", beforeName)
if squareCorners then
self:set("iconCornerRadius", UDim.new(0, 0), "deselected", beforeName)
self:set("iconCornerRadius", UDim.new(0, 0), "selected", beforeName)
end
self:set("captionBlockerTransparency", 0.4, nil, beforeName)
end
local array = parentIcon[newFeatureName.."Icons"]
table.insert(array, self)
if not dontUpdate then
parentIcon:_updateDropdown()
end
parentIcon.deselectWhenOtherIconSelected = false
--
IconController:_updateSelectionGroup()
self:_decideToCallSignal("dropdown")
self:_decideToCallSignal("menu")
--
return self
end
function Icon:leave()
if self._destroyed then return end
local settingsToReset = {"iconSize", "captionBlockerTransparency", "iconCornerRadius"}
local parentIcon = self._parentIcon
self.instances.iconContainer.Parent = topbarContainer
self.presentOnTopbar = true
self.joinedFeatureName = nil
local function scanFeature(t, prevReference, updateMethod)
for i, otherIcon in pairs(t) do
if otherIcon == self then
for _, settingName in pairs(settingsToReset) do
local states = {"deselected", "selected"}
for _, toggleState in pairs(states) do
local currentSetting, previousSetting = self:get(settingName, toggleState, prevReference)
if previousSetting then
self:set(settingName, previousSetting, toggleState)
end
end
end
table.remove(t, i)
updateMethod(parentIcon)
if #t == 0 then
self._parentIcon.deselectWhenOtherIconSelected = true
end
break
end
end
end
scanFeature(parentIcon.dropdownIcons, "beforeDropdown", parentIcon._updateDropdown)
scanFeature(parentIcon.menuIcons, "beforeMenu", parentIcon._updateMenu)
--
for noticeId, noticeDetail in pairs(self.notices) do
local parentIconNoticeDetail = parentIcon.notices[noticeId]
if parentIconNoticeDetail then
parentIconNoticeDetail.completeSignal:Fire()
end
end
--
self._parentIcon = nil
--
IconController:_updateSelectionGroup()
self:_decideToCallSignal("dropdown")
self:_decideToCallSignal("menu")
--
return self
end
function Icon:_decideToCallSignal(featureName)
local isOpen = self[featureName.."Open"]
local previousIsOpenName = "_previous"..string.sub(featureName, 1, 1):upper()..featureName:sub(2).."Open"
local previousIsOpen = self[previousIsOpenName]
local totalIcons = #self[featureName.."Icons"]
if isOpen and totalIcons > 0 and previousIsOpen == false then
self[previousIsOpenName] = true
self[featureName.."Opened"]:Fire()
elseif (not isOpen or totalIcons == 0) and previousIsOpen == true then
self[previousIsOpenName] = false
self[featureName.."Closed"]:Fire()
end
end
function Icon:_ignoreClipping(featureName)
local ignoreClipping = self:get(featureName.."IgnoreClipping")
if self._parentIcon then
local maid = self["_"..featureName.."ClippingMaid"]
local frame = self.instances[featureName.."Container"]
maid:clean()
if ignoreClipping then
local fakeFrame = Instance.new("Frame")
fakeFrame.Name = frame.Name.."FakeFrame"
fakeFrame.ClipsDescendants = true
fakeFrame.BackgroundTransparency = 1
fakeFrame.Size = frame.Size
fakeFrame.Position = frame.Position
fakeFrame.Parent = activeItems
--
for a,b in pairs(frame:GetChildren()) do
b.Parent = fakeFrame
end
--
local function updateSize()
local absoluteSize = frame.AbsoluteSize
fakeFrame.Size = UDim2.new(0, absoluteSize.X, 0, absoluteSize.Y)
end
maid:give(frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
updateSize()
end))
updateSize()
local function updatePos()
local absolutePosition = frame.absolutePosition
fakeFrame.Position = UDim2.new(0, absolutePosition.X, 0, absolutePosition.Y+36)
end
maid:give(frame:GetPropertyChangedSignal("AbsolutePosition"):Connect(function()
updatePos()
end))
updatePos()
maid:give(function()
for a,b in pairs(fakeFrame:GetChildren()) do
b.Parent = frame
end
fakeFrame.Name = "Destroying..."
fakeFrame:Destroy()
end)
end
end
self._ignoreClippingChanged:Fire(featureName, ignoreClipping)
end
|
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
input.InputBegan:connect(function(inputObject)
if inputObject.UserInputType == Enum.UserInputType.Keyboard then
if inputObject.KeyCode == CanToggleMouse.activationkey then
if CanToggleMouse.allowed and freemouse == false then
freemouse = true
else
freemouse = false
end
end
end
end)
|
--- Cleans up all tasks.
-- @alias Destroy
|
function Maid:DoCleaning()
local tasks = self._tasks
-- Disconnect all events first as we know this is safe
for index, job in pairs(tasks) do
if typeof(job) == "RBXScriptConnection" then
tasks[index] = nil
job:Disconnect()
end
end
-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
local index, job = next(tasks)
while job ~= nil do
tasks[index] = nil
if type(job) == "function" then
job()
elseif type(job) == "thread" then
local cancelled
if coroutine.running() ~= job then
cancelled = pcall(function()
task.cancel(job)
end)
end
if not cancelled then
local toCancel = job
task.defer(function()
task.cancel(toCancel)
end)
end
elseif typeof(job) == "RBXScriptConnection" then
job:Disconnect()
elseif job.Destroy then
job:Destroy()
end
index, job = next(tasks)
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(iconModule)
local controllerOptionIcon = Icon.new()
:setProperty("internalIcon", true)
:setName("_TopbarControllerOption")
:setOrder(100)
:setImage(11162828670)
:setRight()
:setEnabled(false)
:setTip("Controller mode")
:setProperty("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
userInputService:GetPropertyChangedSignal("MouseEnabled"):Connect(IconController._determineControllerDisplay)
userInputService.GamepadConnected:Connect(IconController._determineControllerDisplay)
userInputService.GamepadDisconnected:Connect(IconController._determineControllerDisplay)
IconController._determineControllerDisplay()
-- 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 checkTopbarEnabledAccountingForMimic() then
IconController.setTopbarEnabled(true,false)
end
elseif input.KeyCode == Enum.KeyCode.ButtonB and not IconController.disableButtonB then
if IconController.activeButtonBCallbacks == 1 and TopbarPlusGui.Indicator.Image == "rbxassetid://5278151556" then
IconController.activeButtonBCallbacks = 0
guiService.SelectedObject = nil
end
if IconController.activeButtonBCallbacks == 0 then
IconController._previousSelectedObject = guiService.SelectedObject
IconController._setControllerSelectedObject(nil)
IconController.setTopbarEnabled(false,false)
end
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()
:setProperty("internalIcon", true)
: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
-- This checks if voice chat is enabled
task.defer(function()
local success, enabledForUser
while true do
success, enabledForUser = pcall(function() return voiceChatService:IsVoiceEnabledForUserIdAsync(localPlayer.UserId) end)
if success then
break
end
task.wait(1)
end
local function checkVoiceChatManuallyEnabled()
if IconController.voiceChatEnabled then
if success and enabledForUser then
voiceChatIsEnabledForUserAndWithinExperience = true
IconController.updateTopbar()
end
end
end
checkVoiceChatManuallyEnabled()
--------------- FEEL FREE TO DELETE THIS IS YOU DO NOT USE VOICE CHAT WITHIN YOUR EXPERIENCE ---------------
localPlayer.PlayerGui:WaitForChild("TopbarPlus", 999)
task.delay(10, function()
checkVoiceChatManuallyEnabled()
if IconController.voiceChatEnabled == nil and success and enabledForUser and isStudio then
warn("⚠️TopbarPlus Action Required⚠️ If VoiceChat is enabled within your experience it's vital you set IconController.voiceChatEnabled to true ``require(game.ReplicatedStorage.Icon.IconController).voiceChatEnabled = true`` otherwise the BETA label will not be accounted for within your live servers. This warning will disappear after doing so. Feel free to delete this warning or to set to false if you don't have VoiceChat enabled within your experience.")
end
end)
------------------------------------------------------------------------------------------------------------
end)
if not isStudio then
local ownerId = game.CreatorId
local groupService = game:GetService("GroupService")
if game.CreatorType == Enum.CreatorType.Group then
local success, ownerInfo = pcall(function() return groupService:GetGroupInfoAsync(game.CreatorId).Owner end)
if success then
ownerId = ownerInfo.Id
end
end
local version = require(iconModule.VERSION)
if localPlayer.UserId ~= ownerId then
local marketplaceService = game:GetService("MarketplaceService")
local success, placeInfo = pcall(function() return marketplaceService:GetProductInfo(game.PlaceId) end)
end
end
end)()
|
-- Global update loop on heartbeat
-- (for performance / user-friendliness reasons, it is better to do a global loop over all
-- objects at Heartbeat rather than exposing an API method to update individual objects)
|
local function onHeartbeat()
-- Cache camera-related values and references
local camera = workspace.CurrentCamera
local camPos = camera.CFrame.p
local look = camera.CFrame.lookVector
local fov = Constants.FOV_FUDGE_FACTOR * rad(camera.FieldOfView * camera.ViewportSize.x / camera.ViewportSize.y) / 2.0
for v, _ in pairs(dynamicInstances) do
local source = v.source.WorldPosition
local axis = v.drain.WorldPosition - source
if axis.magnitude < 0.001 then
axis = Vector3.new(0, 0, -0.001)
end
v.length = axis.magnitude
v.cframe = Util.makeOrientation(source, axis)
v.part.CFrame = v.cframe
v.part.Emitter.CFrame = CFrame.new(v.length/2, 0, 0)
v.part.Emitter.PointLight.Range = v.length
end
-- Check if objects are on/off-screen
for v, _ in pairs(arcInstances) do
local camToSource = v.cframe.p - camPos
local camToDrain = v.cframe * vec3(v.length, 0, 0) - camPos
-- Check if on-screen:
if acos(dot(camToSource.unit, look)) > fov and acos(dot(camToDrain.unit, look)) > fov then
-- Else, make visible and reparent, if not already done
-- Not on-screen, turn invisible and unparent if not already
if v.visible then
v.visible = false
v.segmentsFolder.Parent = nil
end
elseif not v.visible then
v.visible = true
v.segmentsFolder.Parent = MainFolder
end
-- Set average distance to camera for throttling purposes
v.distance = (camToSource.magnitude + camToDrain.magnitude) / 2
end
-- Check if objects should be updated and do so
for v, _ in pairs(arcInstances) do
-- Only update enabled and visible objects
if v.visible then
-- Update CFrame/Size of instances if object values were changed
if v.changed then
v.part.CFrame = v.cframe
v.part.Emitter.CFrame = CFrame.new(v.length/2, 0, 0)
v.part.Emitter.PointLight.Range = v.length
v.changed = false
end
-- Update amount of arcs that can be rendered in this step (can be real, not just integer)
if v.distance < Constants.MAX_DISTANCE then
v.arcRenderAmount = v.arcRenderAmount + min(
v.numArcs / 3,
Constants.ARCS_PER_UPDATE * min(1, throttleDistanceModifier / v.distance)
)
updateArc(v)
end
end
end
-- Increase frame count
frameCount = frameCount + 1
-- Calculate time since last throttling check
local deltaTime = tick() - frameTick
-- Check if auto-throttling window has passed
if deltaTime > Constants.AUTO_THROTTLE_FRAME_INTERVAL then
-- Update auto-throttling ratio based on observed FPS w.r.t. target FPS
autoThrottleRatio = max(0, min(1, autoThrottleRatio + Constants.AUTO_THROTTLE_INCREMENT
* (frameCount / deltaTime - Constants.AUTO_THROTTLE_TARGET)))
-- Update variables dependent on auto-throttling rate
segmentPerArc = floor(Constants.SEGMENT_PER_ARC_MIN + (difSegmentsPerArc * autoThrottleRatio) + 0.5)
throttleDistanceModifier = Constants.THROTTLE_DISTANCE_MODIFIER_MIN
+ (difDistanceModifier * autoThrottleRatio)
-- Reset tracking variables
frameCount = 0
frameTick = tick()
end
end
local function updateConnection()
if numInstances <= 0 then
if heartbeatConnection then
heartbeatConnection:Disconnect()
heartbeatConnection = nil
end
else
if not heartbeatConnection then
heartbeatConnection = RunService.Heartbeat:Connect(onHeartbeat)
end
end
end
|
-- Basic settings
|
local ROTATION_SPEED = 0.1
local tweenService = game:GetService("TweenService")
while true do
-- Wait
local waitTime = wait()
-- Tween to rotate
local goal = {
CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, ROTATION_SPEED)
}
tweenService:Create(script.Parent, TweenInfo.new(waitTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()
end
|
-- update bruv
|
wait(1)
RunService.RenderStepped:Connect(function()
for i,v in pairs(workspace.Map:GetChildren()) do
local CamPos = workspace.CurrentCamera.CFrame.Position
local vPos = v:GetPivot().Position
CamPos = Vector3.new(CamPos.X, 0, CamPos.Z)
vPos = Vector3.new(vPos.X, 0, vPos.Z)
local dist = (CamPos - vPos).Magnitude
dist = dist - 3000
if dist < 0 then
dist = 0
end
dist = dist*dist/3000
local currentPos = CFrame.new(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist/50, 0)).Position
--[[
local refinedPosHeight
if v:isA("BasePart") then
refinedPosHeight = Vector3.new(0, currentPos.Y + v.Size.Y/2, 0)
else
local cframe, size = v:GetBoundingBox()
refinedPosHeight = Vector3.new(0, currentPos.Y + size.Y/2, 0)
end
if refinedPosHeight.Y < CamPos.Y - 200 then
dist = 1000000
end
]]
if not isPositionOnScreen(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist/50, 0)) then
dist = 100000000
v:PivotTo(CFrame.new(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist/50, 0)) * v:GetPivot().Rotation)
elseif isPositionOnScreen(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist/50, 0)) then
v:PivotTo(CFrame.new(v:GetAttribute("OriginalPosition") - Vector3.new(0, dist/50, 0)) * v:GetPivot().Rotation)
end
end
end)
|
-- Public Constructors
|
function DropdownClass.new(button, listFrame)
local self = setmetatable({}, DropdownClass)
self._Maid = Lazy.Utilities.Maid.new()
self._ChangedBind = Instance.new("BindableEvent")
self._Options = {}
self._Selected = nil
self.Button = button
self.ListFrame = listFrame
self.Changed = self._ChangedBind.Event
init(self)
self:Set(self._Options[1])
return self
end
function DropdownClass.Create(list, max)
max = max or #list
local button = DROP_BUTTON:Clone()
local listFrame = Lazy.Constructors.List.Create(list, max)
listFrame.Position = UDim2.new(0, 0, 1, 0)
listFrame.Size = UDim2.new(1, 0, max, 0)
listFrame.Visible = false
listFrame.Parent = button
return DropdownClass.new(button, listFrame)
end
|
--[=[
The value of the ValueObject
@prop Value T
@within ValueObject
]=]
|
function ValueObject:__index(index)
if index == "Value" then
return self._value
elseif ValueObject[index] then
return ValueObject[index]
elseif index == "_value" then
return nil -- Edge case
else
error(("%q is not a member of ValueObject"):format(tostring(index)))
end
end
function ValueObject:__newindex(index, value)
if index == "Value" then
local previous = rawget(self, "_value")
if previous ~= value then
rawset(self, "_value", value)
local maid = Maid.new()
self.Changed:Fire(value, previous, maid)
self._maid._valueMaid = maid
end
else
error(("%q is not a member of ValueObject"):format(tostring(index)))
end
end
|
-- << MESSAGING SERVICE >>
|
spawn(function()
--testSub:Disconnect()
for _, topicName in pairs(topics) do
main.messagingService:SubscribeAsync(topicName, function(message)
local data = message.Data
if topicName == "BeginPoll" then
local newData, scores = main:GetModule("cf"):BeginPoll(data)
main.messagingService:PublishAsync(data.UniquePollTopic, scores)
elseif topicName == "DisplayPollResultsToServer" then
for i, plr in pairs(main.players:GetChildren()) do
main:GetModule("cf"):DisplayPollResults(plr, data)
end
elseif topicName == "GetAmountOfServers" then
local topicName = data
main.messagingService:PublishAsync(topicName)
elseif topicName == "GlobalAlert" then
for i,plr in pairs(main.players:GetChildren()) do
main.signals.CreateAlert:FireClient(plr, {data.Title, data.Message})
end
elseif topicName == "GlobalCommands" then
local data = message.Data
-------------------------------------------
if data.Name == "globalPlace" then
local placeId = data.PlaceId
local placeName = data.PlaceName
for i, plr in pairs(main.players:GetChildren()) do
local notice = {
"Global Teleport",
"Click to teleport to "..placeName.." ["..placeId.."]",
{"Teleport", placeId},
}
main.signals.Notice:FireClient(plr, notice)
end
end
-------------------------------------------
if data.Name == "globalForcePlace" then
local placeId = data.PlaceId
local placeName = data.PlaceName
for i, plr in pairs(main.players:GetChildren()) do
main.teleportService:Teleport(placeId, plr)
end
end
-------------------------------------------
end--]]
end)
end
end)
return module
|
--Main
|
return require(ReplicatedStorage.Systems.EntitySystem.EntityServer.EntityComponent)
|
-- Connection class
|
local Connection = {}
Connection.__index = Connection
function Connection.new(signal, fn)
return setmetatable({
_connected = true,
_signal = signal,
_fn = fn,
_next = false,
}, Connection)
end
function Connection:Disconnect()
assert(self._connected, "Connection already disconnected.")
self._connected = false
if self._signal._handlerListHead == self then
self._signal._handlerListHead = self._next
else
local prev = self._signal._handlerListHead
while prev and prev._next ~= self do
prev = prev._next
end
if prev then
prev._next = self._next
end
end
end
|
-- EVENTS --
|
local ResizeEvent = ParentContainer.Attribs.ResizeEvent
local RowCt = 5
local CellSize = 0.25
local Padding = 10
local ContainerPadding_Bottom = 32
function getNewCellSize()
CellSize = (Container.AbsoluteSize.X / RowCt) - Padding
end
function updateLayout()
--[[
if #Container.Cells:GetChildren() < 1 then
Container.Parent.HeaderFrame.Visible = false
else
Container.Parent.HeaderFrame.Visible = true
end
]]
getNewCellSize()
local cells = Container.Cells:GetChildren()
for i, cell in pairs(cells) do
local index = i - 1
local posX = ((index % RowCt) * (CellSize + Padding)) + (Padding / 2)
local posY = (math.floor(index / RowCt) * (CellSize + Padding)) + (Padding / 2)
cell.Size = UDim2.fromOffset(CellSize, CellSize)
cell.Position = UDim2.fromOffset(posX, posY)
end
local rows = math.ceil((#cells / RowCt))
local newSize = UDim2.new(1, -24, 0, (rows * CellSize + Padding) + ContainerPadding_Bottom)
Container.Size = newSize
ResizeEvent:Fire(ParentContainer.Name)
end
Container.Cells.ChildAdded:Connect(updateLayout)
Container.Cells.ChildRemoved:Connect(updateLayout)
Container:GetPropertyChangedSignal("AbsoluteSize"):Connect(updateLayout)
|
--//Handling//--
|
local SteeringAngle = 40 --{Steering angle in degrees}
local SteerSpeed = 0.05 --{.01 being slow, 1 being almost instantly}
local TiresFront = 2 --{1 = eco, 2 = road, 3 = sport}
local TiresRear = 2 --{1 = eco, 2 = road, 3 = sport}
local DownforceF = 0 --{[0-5] Provides downforce to the front at the cost of drag}
local DownforceR = 0 --{[0-5] Provides downforce to the rear at the cost of drag}
local BrakeBias = 72 --{100 = all on front || 0 = all on rear}
local BrakePower = 80 --{100 = strong brakes 0 = close to no brakes}
local TC = false
local ABS = true
|
-- References
|
Support.ImportServices();
SyncAPI = Tool.SyncAPI;
Player = Players.LocalPlayer;
|
--[=[
@within TableUtil
@function Reduce
@param tbl table
@param predicate (accumulator: any, value: any, index: any, tbl: table) -> result: any
@return table
Performs a reduce operation against the given table, which can be used to
reduce the table into a single value. This could be used to sum up a table
or transform all the values into a compound value of any kind.
For example:
```lua
local t = {10, 20, 30, 40}
local result = TableUtil.Reduce(t, function(accum, value)
return accum + value
end)
print(result) --> 100
```
]=]
|
local function Reduce(t: Table, f: ReducePredicate, init: any?): any
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local result = init
if #t > 0 then
local start = 1
if init == nil then
result = t[1]
start = 2
end
for i = start,#t do
result = f(result, t[i], i, t)
end
else
local start = nil
if init == nil then
result = next(t)
start = result
end
for k,v in next,t,start do
result = f(result, v, k, t)
end
end
return result
end
|
--// Handling Settings
|
Firerate = 60 / 875; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--------------------------------------------------------------------------------
|
while true do
while Humanoid.Health < Humanoid.MaxHealth do
local dt = wait(REGEN_STEP)
local dh = dt*REGEN_RATE*Humanoid.MaxHealth
Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
end
Humanoid.HealthChanged:Wait()
end
|
--[[
Function called when the client is notified of a player state update.
]]
|
function UIController.onClientStateUpdated(currentState, currentTick)
if currentState == "pregame" then
UIController.setView("mainMenu")
elseif currentState == "warmup" then
UIController.setView("warmup")
elseif currentState == "game" then
UIController.setView("game", currentTick)
elseif currentState == "spectating" then
UIController.setView("spectating")
elseif currentState == "finished" then
UIController.setView("finished")
elseif currentState == "dead" then
UIController.setView("dead")
elseif currentState == "postgame" then
UIController.setView("postGame")
end
end
|
--[[
Server Module
--]]
|
local Settings = { --, not ; ? | server module!!
BulletHoleTexture = 'http://www.roblox.com/asset/?id=64291961'
,Damage = {20, 29}
,OneHanded = false --DONT USE YET
,FakeArms = true
,FakeArmTransparency = 0
,RightPos = CFrame.new(-1,0.7,0.45) * CFrame.Angles(math.rad(-90), 0, 0)
,LeftPos = CFrame.new(0.8,0.8,0.3) * CFrame.Angles(math.rad(-90), math.rad(45), 0)
}
return Settings
|
--[[--------------------------------------------------------------------
-- struct ConsControl:
-- v -- last list item read (table: struct expdesc)
-- t -- table descriptor (table: struct expdesc)
-- nh -- total number of 'record' elements
-- na -- total number of array elements
-- tostore -- number of array elements pending to be stored
----------------------------------------------------------------------]]
| |
-- / Cutscene Gui's Objects / --
|
local CameraPart = CutsceneGui.CameraPart
|
-- TOGGLEABLE METHODS
|
function Icon:setLabel(text, iconState)
text = text or ""
self:set("iconText", text, iconState)
return self
end
function Icon:setCornerRadius(scale, offset, iconState)
local oldCornerRadius = self.instances.iconCorner.CornerRadius
local newCornerRadius = UDim.new(scale or oldCornerRadius.Scale, offset or oldCornerRadius.Offset)
self:set("iconCornerRadius", newCornerRadius, iconState)
return self
end
function Icon:setImage(imageId, iconState)
local textureId = (tonumber(imageId) and "http://www.roblox.com/asset/?id="..imageId) or imageId or ""
return self:set("iconImage", textureId, iconState)
end
function Icon:setOrder(order, iconState)
local newOrder = tonumber(order) or 1
return self:set("order", newOrder, iconState)
end
function Icon:setLeft(iconState)
return self:set("alignment", "left", iconState)
end
function Icon:setMid(iconState)
return self:set("alignment", "mid", iconState)
end
function Icon:setRight(iconState)
if not self.internalIcon then
IconController.setupHealthbar()
end
return self:set("alignment", "right", iconState)
end
function Icon:setImageYScale(YScale, iconState)
local newYScale = tonumber(YScale) or 0.63
return self:set("iconImageYScale", newYScale, iconState)
end
function Icon:setImageRatio(ratio, iconState)
local newRatio = tonumber(ratio) or 1
return self:set("iconImageRatio", newRatio, iconState)
end
function Icon:setLabelYScale(YScale, iconState)
local newYScale = tonumber(YScale) or 0.45
return self:set("iconLabelYScale", newYScale, iconState)
end
function Icon:setBaseZIndex(ZIndex, iconState)
local newBaseZIndex = tonumber(ZIndex) or 1
return self:set("baseZIndex", newBaseZIndex, iconState)
end
function Icon:_updateBaseZIndex(baseValue)
local container = self.instances.iconContainer
local newBaseValue = tonumber(baseValue) or container.ZIndex
local difference = newBaseValue - container.ZIndex
if difference == 0 then return "The baseValue is the same" end
for _, object in pairs(self.instances) do
if object:IsA("GuiObject") then
object.ZIndex = object.ZIndex + difference
end
end
return true
end
function Icon:setSize(XOffset, YOffset, iconState)
if tonumber(XOffset) then
self.forcefullyAppliedXSize = true
self:set("forcedIconSizeX", tonumber(XOffset), iconState)
else
self.forcefullyAppliedXSize = false
self:set("forcedIconSizeX", 32, iconState)
end
if tonumber(YOffset) then
self.forcefullyAppliedYSize = true
self:set("forcedIconSizeY", tonumber(YOffset), iconState)
else
self.forcefullyAppliedYSize = false
self:set("forcedIconSizeY", 32, iconState)
end
local newXOffset = tonumber(XOffset) or 32
local newYOffset = tonumber(YOffset) or (YOffset ~= "_NIL" and newXOffset) or 32
self:set("iconSize", UDim2.new(0, newXOffset, 0, newYOffset), iconState)
return self
end
function Icon:setXSize(XOffset, iconState)
self:setSize(XOffset, "_NIL", iconState)
return self
end
function Icon:setYSize(YOffset, iconState)
self:setSize("_NIL", YOffset, iconState)
return self
end
function Icon:_getContentText(text)
-- This converts richtext (e.g. "<b>Shop</b>") to normal text (e.g. "Shop")
-- This also converts richtext/normaltext into its localized (translated) version
-- This is important when calculating the size of the label/box for instance
self.instances.iconButton.Text = text
self.instances.iconButton.Text = self.instances.iconButton.LocalizedText
return self.instances.iconButton.ContentText
end
function Icon:_updateIconSize(_, iconState)
if self._destroyed then return end
-- This is responsible for handling the appearance and size of the icons label and image, in additon to its own size
local X_MARGIN = 12
local X_GAP = 8
local values = {
iconImage = self:get("iconImage", iconState) or "_NIL",
iconText = self:get("iconText", iconState) or "_NIL",
iconFont = self:get("iconFont", iconState) or "_NIL",
iconSize = self:get("iconSize", iconState) or "_NIL",
forcedIconSizeX = self:get("forcedIconSizeX", iconState) or "_NIL",
iconImageYScale = self:get("iconImageYScale", iconState) or "_NIL",
iconImageRatio = self:get("iconImageRatio", iconState) or "_NIL",
iconLabelYScale = self:get("iconLabelYScale", iconState) or "_NIL",
}
for k,v in pairs(values) do
if v == "_NIL" then
return
end
end
local iconContainer = self.instances.iconContainer
if not iconContainer.Parent then return end
-- We calculate the cells dimensions as apposed to reading because there's a possibility the cells dimensions were changed at the exact time and have not yet updated
-- this essentially saves us from waiting a heartbeat which causes additonal complications
local cellSizeXOffset = values.iconSize.X.Offset
local cellSizeXScale = values.iconSize.X.Scale
local cellWidth = cellSizeXOffset + (cellSizeXScale * iconContainer.Parent.AbsoluteSize.X)
local minCellWidth = values.forcedIconSizeX--cellWidth
local maxCellWidth = (cellSizeXScale > 0 and cellWidth) or (self.forcefullyAppliedXSize and minCellWidth) or 9999
local cellSizeYOffset = values.iconSize.Y.Offset
local cellSizeYScale = values.iconSize.Y.Scale
local cellHeight = cellSizeYOffset + (cellSizeYScale * iconContainer.Parent.AbsoluteSize.Y)
local labelHeight = cellHeight * values.iconLabelYScale
local iconContentText = self:_getContentText(values.iconText)
local labelWidth = textService:GetTextSize(iconContentText, labelHeight, values.iconFont, Vector2.new(10000, labelHeight)).X
local imageWidth = cellHeight * values.iconImageYScale * values.iconImageRatio
local usingImage = values.iconImage ~= ""
local usingText = values.iconText ~= ""
local notifPosYScale = 0.5
local desiredCellWidth
local preventClippingOffset = labelHeight/2
if usingImage and not usingText then
notifPosYScale = 0.45
self:set("iconImageVisible", true, iconState)
self:set("iconImageAnchorPoint", Vector2.new(0.5, 0.5), iconState)
self:set("iconImagePosition", UDim2.new(0.5, 0, 0.5, 0), iconState)
self:set("iconImageSize", UDim2.new(values.iconImageYScale*values.iconImageRatio, 0, values.iconImageYScale, 0), iconState)
self:set("iconLabelVisible", false, iconState)
elseif not usingImage and usingText then
desiredCellWidth = labelWidth+(X_MARGIN*2)
self:set("iconLabelVisible", true, iconState)
self:set("iconLabelAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconLabelPosition", UDim2.new(0, X_MARGIN, 0.5, 0), iconState)
self:set("iconLabelSize", UDim2.new(1, -X_MARGIN*2, values.iconLabelYScale, preventClippingOffset), iconState)
self:set("iconLabelTextXAlignment", Enum.TextXAlignment.Center, iconState)
self:set("iconImageVisible", false, iconState)
elseif usingImage and usingText then
local labelGap = X_MARGIN + imageWidth + X_GAP
desiredCellWidth = labelGap + labelWidth + X_MARGIN
self:set("iconImageVisible", true, iconState)
self:set("iconImageAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconImagePosition", UDim2.new(0, X_MARGIN, 0.5, 0), iconState)
self:set("iconImageSize", UDim2.new(0, imageWidth, values.iconImageYScale, 0), iconState)
----
self:set("iconLabelVisible", true, iconState)
self:set("iconLabelAnchorPoint", Vector2.new(0, 0.5), iconState)
self:set("iconLabelPosition", UDim2.new(0, labelGap, 0.5, 0), iconState)
self:set("iconLabelSize", UDim2.new(1, -labelGap-X_MARGIN, values.iconLabelYScale, preventClippingOffset), iconState)
self:set("iconLabelTextXAlignment", Enum.TextXAlignment.Left, iconState)
end
if desiredCellWidth then
if not self._updatingIconSize then
self._updatingIconSize = true
local widthScale = (cellSizeXScale > 0 and cellSizeXScale) or 0
local widthOffset = (cellSizeXScale > 0 and 0) or math.clamp(desiredCellWidth, minCellWidth, maxCellWidth)
self:set("iconSize", UDim2.new(widthScale, widthOffset, values.iconSize.Y.Scale, values.iconSize.Y.Offset), iconState, "_ignorePrevious")
-- This ensures that if an icon is within a dropdown or menu, its container adapts accordingly with this new iconSize value
local parentIcon = self._parentIcon
if parentIcon then
local originalIconSize = UDim2.new(0, desiredCellWidth, 0, values.iconSize.Y.Offset)
if #parentIcon.dropdownIcons > 0 then
self:setAdditionalValue("iconSize", "beforeDropdown", originalIconSize, iconState)
parentIcon:_updateDropdown()
end
if #parentIcon.menuIcons > 0 then
self:setAdditionalValue("iconSize", "beforeMenu", originalIconSize, iconState)
parentIcon:_updateMenu()
end
end
self._updatingIconSize = false
end
end
self:set("iconLabelTextSize", labelHeight, iconState)
self:set("noticeFramePosition", UDim2.new(notifPosYScale, 0, 0, -2), iconState)
self._updatingIconSize = false
end
|
------
|
H = false
UIS.InputBegan:connect(function(i,GP) if not GP then if i.KeyCode == Enum.KeyCode.X then
if H == false then
script.Parent.HLight.ImageColor3 = Color3.fromRGB(255, 224, 67)
H = true
else
script.Parent.HLight.ImageColor3 = Color3.fromRGB(255,255,255)
H = false
end
end end end)
function PBrake()
if script.Parent.Parent.Values.PBrake.Value == true then
script.Parent.PBrake.ImageColor3 = Color3.fromRGB(255,38,38)
else
script.Parent.PBrake.ImageColor3 = Color3.fromRGB(255,255,255)
end
end
script.Parent.Parent.Values.PBrake.Changed:connect(PBrake)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =90 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
script.Parent.Speed.MouseButton1Click:connect(function()
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
wait(.1)
PBrake()
|
--What happens with DepositBox1--
|
depositpr1.Triggered:Connect(function()
driLL1.Transparency = 0
drilling1.Playing = true
drillingeffect1.Enabled = true
driLL1.CanCollide = true
wait(timetodrill)
driLL1.CanCollide = false
drilling1.Playing = false
drillingeffect1.Enabled = false
driLL1.Transparency = 1
explosionvault1.Enabled = true
explosionvaultsfx1.Playing = true
wait(1)
explosionvault1.Enabled = false
depositpr1.Parent.Parent.Transparency = 1
depositpr1.Parent.Parent.CanCollide = false
depositpr1.Enabled = false
wait(resetcooldown)
depositpr1.Parent.Parent.Transparency = 0
depositpr1.Parent.Parent.CanCollide = true
depositpr1.Enabled = true
end)
|
--Made by Luckymaxer
|
Players = game:GetService("Players")
Player = Players.LocalPlayer
Character = Player.Character
Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Changed:connect(function(Property)
if Property == "Jump" then
Humanoid.Jump = false
end
end)
|
--("added")
|
end
end
end
end
end
end)
script.Parent.ChildRemoved:connect(function(w)
|
--- Invoked
|
Signal.Invoked = function(funcName)
funcName = string.lower(funcName)
local func = GetFunc(funcName)
--
return func
end
|
--------END SIDE SQUARES--------
|
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[=[
Observes the children with a specific name.
@param parent Instance
@param className string
@param name string
@return Observable<Brio<Instance>>
]=]
|
function RxInstanceUtils.observeChildrenOfNameBrio(parent, className, name)
assert(typeof(parent) == "Instance", "Bad parent")
assert(type(className) == "string", "Bad className")
assert(type(name) == "string", "Bad name")
return Observable.new(function(sub)
local topMaid = Maid.new()
local function handleChild(child)
if not child:IsA(className) then
return
end
local maid = Maid.new()
local function handleNameChanged()
if child.Name == name then
local brio = Brio.new(child)
maid._brio = brio
sub:Fire(brio)
else
maid._brio = nil
end
end
topMaid[child] = maid
maid:GiveTask(child:GetPropertyChangedSignal("Name"):Connect(handleNameChanged))
handleNameChanged()
end
topMaid:GiveTask(parent.ChildAdded:Connect(handleChild))
topMaid:GiveTask(parent.ChildRemoved:Connect(function(child)
topMaid[child] = nil
end))
for _, child in pairs(parent:GetChildren()) do
handleChild(child)
end
return topMaid
end)
end
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RemovalMonitor = script:WaitForChild("RemovalMonitor")
CarpetPieces = {
{MeshId = 223079795, Angle = 160},
{MeshId = 223079835, Angle = 100},
{MeshId = 223079888, Angle = 100},
{MeshId = 223079981, Angle = 160},
}
CarpetSize = Vector3.new(3, 0.5, 6.5)
BaseUrl = "http://www.roblox.com/asset/?id="
Rate = (1 / 10)
BasePart = Instance.new("Part")
BasePart.Material = Enum.Material.Plastic
BasePart.Shape = Enum.PartType.Block
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
ColorPart = BasePart:Clone()
ColorPart.Name = "ColorPart"
ColorPart.Reflectance = 0.25
ColorPart.Transparency = 0.1
ColorPart.Material = Enum.Material.SmoothPlastic
ColorPart.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.BackSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.TopSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.RightSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.Size = Vector3.new(1, 1, 1)
ColorPart.Anchored = true
ColorPart.CanCollide = false
ColorMesh = Instance.new("SpecialMesh")
ColorMesh.Name = "Mesh"
ColorMesh.MeshType = Enum.MeshType.FileMesh
ColorMesh.MeshId = (BaseUrl .. "9856898")
ColorMesh.TextureId = (BaseUrl .. "1361097")
ColorMesh.Scale = (ColorPart.Size * 2) --Default mesh scale is 1/2 the size of a 1x1x1 brick.
ColorMesh.Offset = Vector3.new(0, 0, 0)
ColorMesh.VertexColor = Vector3.new(1, 1, 1)
ColorMesh.Parent = ColorPart
ColorLight = Instance.new("PointLight")
ColorLight.Name = "Light"
ColorLight.Brightness = 50
ColorLight.Range = 8
ColorLight.Shadows = false
ColorLight.Enabled = true
ColorLight.Parent = ColorPart
RainbowColors = {
Vector3.new(1, 0, 0),
Vector3.new(1, 0.5, 0),
Vector3.new(1, 1, 0),
Vector3.new(0, 1, 0),
Vector3.new(0, 1, 1),
Vector3.new(0, 0, 1),
Vector3.new(0.5, 0, 1)
}
Animations = {
Sit = {Animation = Tool:WaitForChild("Sit"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
}
Grips = {
Normal = CFrame.new(-1.5, 0, 0, 0, 0, -1, -1, 8.90154915e-005, 0, 8.90154915e-005, 1, 0),
Flying = CFrame.new(-1.5, 0.5, -0.75, -1, 0, -8.99756625e-009, -8.99756625e-009, 8.10000031e-008, 1, 7.28802977e-016, 0.99999994, -8.10000103e-008)
}
Flying = false
ToolEquipped = false
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
Handle.Transparency = 0
Tool.Grip = Grips.Normal
Tool.Enabled = true
function Clamp(Number, Min, Max)
return math.max(math.min(Max, Number), Min)
end
function TransformModel(Objects, Center, NewCFrame, Recurse)
local Objects = ((type(Objects) ~= "table" and {Objects}) or Objects)
for i, v in pairs(Objects) do
if v:IsA("BasePart") then
v.CFrame = NewCFrame:toWorldSpace(Center:toObjectSpace(v.CFrame))
end
if Recurse then
TransformModel(v:GetChildren(), Center, NewCFrame, true)
end
end
end
function Weld(Parent, PrimaryPart)
local Parts = {}
local Welds = {}
local function WeldModel(Parent, PrimaryPart)
for i, v in pairs(Parent:GetChildren()) do
if v:IsA("BasePart") then
if v ~= PrimaryPart then
local Weld = Instance.new("Weld")
Weld.Name = "Weld"
Weld.Part0 = PrimaryPart
Weld.Part1 = v
Weld.C0 = PrimaryPart.CFrame:inverse()
Weld.C1 = v.CFrame:inverse()
Weld.Parent = PrimaryPart
table.insert(Welds, Weld)
end
table.insert(Parts, v)
end
WeldModel(v, PrimaryPart)
end
end
WeldModel(Parent, PrimaryPart)
return Parts, Welds
end
function CleanUp()
for i, v in pairs(Tool:GetChildren()) do
if v:IsA("BasePart") and v ~= Handle then
v:Destroy()
end
end
end
function CreateRainbow(Length)
local RainbowModel = Instance.new("Model")
RainbowModel.Name = "RainbowPart"
for i, v in pairs(RainbowColors) do
local Part = ColorPart:Clone()
Part.Name = "Part"
Part.Size = Vector3.new(0.5, 0.5, Length)
Part.CFrame = Part.CFrame * CFrame.new((Part.Size.X * (i - 1)), 0, 0)
Part.Mesh.Scale = (Part.Size * 2)
Part.Mesh.VertexColor = v
Part.Light.Color = Color3.new(v.X, v.Y, v.Z)
Part.Parent = RainbowModel
end
local RainbowBoundingBox = BasePart:Clone()
RainbowBoundingBox.Name = "BoundingBox"
RainbowBoundingBox.Transparency = 1
RainbowBoundingBox.Size = RainbowModel:GetModelSize()
RainbowBoundingBox.Anchored = true
RainbowBoundingBox.CanCollide = false
RainbowBoundingBox.CFrame = RainbowModel:GetModelCFrame()
RainbowBoundingBox.Parent = RainbowModel
return RainbowModel
end
function GetRainbowModel()
local ModelName = (Player.Name .. "'s Rainbow")
local Model = game:GetService("Workspace"):FindFirstChild(ModelName)
if not Model then
Model = Instance.new("Model")
Model.Name = ModelName
local RemovalMonitorClone = RemovalMonitor:Clone()
RemovalMonitorClone.Disabled = false
RemovalMonitorClone.Parent = Model
end
return Model
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Activated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
Flying = not Flying
if Flying then
Handle.Transparency = 1
CleanUp()
local CarpetParts = {}
for i, v in pairs(CarpetPieces) do
local CarpetPart = BasePart:Clone()
CarpetPart.Size = Vector3.new(CarpetSize.X, CarpetSize.Y, (CarpetSize.Z / #CarpetPieces))
local Mesh = Instance.new("SpecialMesh")
Mesh.MeshType = Enum.MeshType.FileMesh
Mesh.MeshId = (BaseUrl .. v.MeshId)
Mesh.TextureId = (BaseUrl .. "223080038")
Mesh.Scale = Vector3.new(1.125, 1.125, 1.125)
Mesh.VertexColor = Vector3.new(1, 1, 1)
Mesh.Offset = Vector3.new(0, 0, 0)
Mesh.Parent = CarpetPart
local Weld = Instance.new("Weld")
Weld.Part0 = Handle
Weld.Part1 = CarpetPart
local XOffset = (((i == 1 or i == #CarpetPieces) and -0.005) or 0)
local YOffset = ((-((Handle.Size.Z / 2) - (CarpetPart.Size.Z / 2))) + ((CarpetPart.Size.Z * (i - 1))) + ((i == 2 and 0.245) or (i == 3 and 0.04) or (i == #CarpetPieces and 0.28) or 0))
Weld.C1 = CFrame.new(0, XOffset, YOffset)
Weld.Parent = CarpetPart
table.insert(CarpetParts, {Part = CarpetPart, Weld = Weld, InitialCFrame = Weld.C0, Angle = v.Angle})
CarpetPart.Parent = Tool
end
Spawn(function()
InvokeClient("PlayAnimation", Animations.Sit)
Tool.Grip = Grips.Flying
end)
FlightSpin = Instance.new("BodyGyro")
FlightSpin.Name = "FlightSpin"
FlightSpin.P = 1000000
FlightSpin.maxTorque = Vector3.new(FlightSpin.P, FlightSpin.P, FlightSpin.P)
FlightSpin.cframe = Torso.CFrame
FlightPower = Instance.new("BodyVelocity")
FlightPower.Name = "FlightPower"
FlightPower.velocity = Vector3.new(0, 0, 0)
FlightPower.P = 1000000
FlightPower.maxForce = Vector3.new(FlightPower.P, FlightPower.P, FlightPower.P)
FlightPower.P = 10000
FlightHold = Instance.new("BodyPosition")
FlightHold.Name = "FlightHold"
FlightHold.P = 100000
FlightHold.maxForce = Vector3.new(0, 0, 0)
FlightHold.position = Torso.Position
FlightSpin.Parent = Torso
FlightPower.Parent = Torso
FlightHold.Parent = Torso
Spawn(function()
local LastPlace = nil
while Flying and ToolEquipped and CheckIfAlive() do
local CurrentPlace = Handle.Position
local Velocity = Torso.Velocity
Velocity = Vector3.new(Velocity.X, 0, Velocity.Z).magnitude
if LastPlace and Velocity > 10 then
Spawn(function()
local Model = GetRainbowModel()
local Distance = (LastPlace - CurrentPlace).magnitude
local Length = Distance + 3.5
local RainbowModel = CreateRainbow(Length)
--Thanks so much to ArceusInator for helping solve this part!
local RainbowCFrame = CFrame.new((LastPlace + (CurrentPlace - LastPlace).unit * (Distance / 2)), CurrentPlace)
TransformModel(RainbowModel, RainbowModel:GetModelCFrame(), RainbowCFrame, true)
Debris:AddItem(RainbowModel, 1)
RainbowModel.Parent = Model
if Model and not Model.Parent then
Model.Parent = game:GetService("Workspace")
end
LastPlace = CurrentPlace
end)
elseif not LastPlace then
LastPlace = CurrentPlace
end
wait(Rate)
end
end)
elseif not Flying then
Torso.Velocity = Vector3.new(0, 0, 0)
Torso.RotVelocity = Vector3.new(0, 0, 0)
for i, v in pairs({FlightSpin, FlightPower, FlightHold}) do
if v and v.Parent then
v:Destroy()
end
end
Spawn(function()
Tool.Grip = Grips.Normal
InvokeClient("StopAnimation", Animations.Sit)
end)
end
wait(2)
Tool.Enabled = true
end
function Equipped(Mouse)
Character = Tool.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso")
Player = Players:GetPlayerFromCharacter(Character)
if not CheckIfAlive() then
return
end
Tool.Grip = Grips.Normal
ToolEquipped = true
end
function Unequipped()
Flying = false
for i, v in pairs({FlightSpin, FlightPower, FlightHold}) do
if v and v.Parent then
v:Destroy()
end
end
CleanUp()
Handle.Transparency = 0
ToolEquipped = false
end
function OnServerInvoke(player, mode, value)
if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
return
end
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
CleanUp()
ServerControl.OnServerInvoke = OnServerInvoke
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--[[
Returns an iterator over the children of an element.
`elementOrElements` may be one of:
* a boolean
* nil
* a single element
* a fragment
* a table of elements
If `elementOrElements` is a boolean or nil, this will return an iterator with
zero elements.
If `elementOrElements` is a single element, this will return an iterator with
one element: a tuple where the first value is ElementUtils.UseParentKey, and
the second is the value of `elementOrElements`.
If `elementOrElements` is a fragment or a table, this will return an iterator
over all the elements of the array.
If `elementOrElements` is none of the above, this function will throw.
]]
|
function ElementUtils.iterateElements<K>(elementOrElements): (Iterator<K, Element>, any, nil)
local richType = Type.of(elementOrElements)
-- Single child
if richType == Type.Element then
local called = false
return function(_, _)
if called then
return nil
else
called = true
return ElementUtils.UseParentKey, elementOrElements
end
end
end
local regularType = typeof(elementOrElements)
if elementOrElements == nil or regularType == "boolean" then
return (noop :: any) :: Iterator<K, Element>
end
if regularType == "table" then
return pairs(elementOrElements)
end
error("Invalid elements")
end
|
-- setings
|
local SearchDistance = 80 -- How far a player can be before it detects you
local ZombieDamage = 5 -- How much damage the Zombie inficts towards the player
local DamageWait = 2 -- How many seconds to wait before it can damage the player again
local WanderX, WanderZ = 30, 30
|
-------- OMG HAX
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
DamageValues = {
BaseDamage = 10,
SlashDamage = 11,
LungeDamage = 22
}
Damage = DamageValues.BaseDamage
Sounds = {
Slash = Handle:WaitForChild("SwordSlash"),
Lunge = Handle:WaitForChild("SwordLunge"),
Unsheath = Handle:WaitForChild("Unsheath")
}
Animations = {
Slash = Tool:WaitForChild("Slash")
}
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
function InvokeClient(Mode, Value)
pcall(function()
ClientControl:InvokeClient(Player, Mode, Value)
end)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Blow(Hit)
if not Hit or not Hit.Parent or not Character or not Humanoid or Humanoid.Health == 0 then
return
end
local humanoid = Hit.Parent:FindFirstChild("Humanoid")
if humanoid and humanoid ~= Humanoid and humanoid.Health > 0 then
local RightArm = Character:FindFirstChild("Right Arm")
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if (RightGrip and (RightGrip.Part0 == Handle or RightGrip.Part1 == Handle)) then
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
end
end
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
InvokeClient("PlayAnimation", {Animation = Animations.Slash, Speed = 1.5})
end
function Lunge()
Damage = DamageValues.LungeDamage
Sounds.Lunge:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
local Force = Instance.new("BodyVelocity")
if Torso and Torso.Parent then
Force.velocity = Vector3.new(0, 80, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.75)
Force.Parent = Torso
end
wait(0.25)
if Torso and Torso.Parent then
Force.velocity = (Torso.CFrame.lookVector * 120) + Vector3.new(0, 60, 0)
end
wait(0.5)
if Force and Force.Parent then
Force:Destroy()
end
wait(0.5)
Damage = DamageValues.SlashDamage
end
Tool.Enabled = true
LastAttack = 0
function Activated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
Tick = RunService.Stepped:wait()
if (Tick - LastAttack < 0.2) then
Lunge()
else
Attack()
end
LastAttack = Tick
--wait(0.5)
Tool.Enabled = true
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso")
if not Player or not Humanoid or Humanoid.Health == 0 or not Torso then
return
end
Sounds.Unsheath:Play()
end
function Unequipped()
end
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Connection = Handle.Touched:connect(Blow)
|
----- hot tap handler
|
for i, v in pairs(hotTap:GetChildren()) do
if v:FindFirstChild("ClickDetector") then
v.ClickDetector.MouseClick:Connect(function()
if hotOn.Value == false then
hotOn.Value = true
faucet.ParticleEmitter.Enabled = true
waterSound:Play()
hotTap:SetPrimaryPartCFrame(hotTap.PrimaryPart.CFrame * CFrame.Angles(math.rad(45),0,0))
else
hotOn.Value = false
if coldOn.Value == false then
faucet.ParticleEmitter.Enabled = false
waterSound:Stop()
end
hotTap:SetPrimaryPartCFrame(hotTap.PrimaryPart.CFrame * CFrame.Angles(math.rad(-45),0,0))
end
end)
end
end
|
-- Disconnect all handlers. Since we use a linked list it suffices to clear the
-- reference to the head handler.
|
function Signal:DisconnectAll()
self._handlerListHead = false
end
|
--[[
]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local AvatarEditor = ReplicatedStorage.AvatarEditor
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Promise = require(AvatarEditor.Shared.Util.Promise)
local Signal = require(AvatarEditor.Shared.Util.Signal)
local Settings = require(AvatarEditor.Shared.Settings)
local Theme = require(AvatarEditor.Client.Theme)
local player = Players.LocalPlayer
local Class = {}
Class.__index = Class
local function createButton()
local button = AvatarEditor.CostumeTemplate:Clone()
return button
end
function Class.new(frame)
local self = setmetatable({}, Class)
self.Maid = Maid.new()
self.Listeners = Maid.new()
self.ScrollingFrame = frame.ScrollingFrame
self.GridLayout = self.ScrollingFrame.UIGridLayout
self.Wear = Signal.new()
self.Delete = Signal.new()
self.Children = {}
self.Pool = {}
for i = 1, 50 do
self.Pool[i] = createButton()
end
self.Maid:GiveTask(Theme.Changed:Connect(function()
self:Render()
end))
self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame, "ScrollBarImageColor3", "Scrollbar"))
Promise.new(function(resolve, reject)
local folder = player:WaitForChild("AE_Costumes")
resolve(folder)
end)
:andThen(function(folder)
self.Folder = folder
self.Maid:GiveTask(folder.ChildAdded:Connect(function()
self:Render()
end))
self.Maid:GiveTask(folder.ChildRemoved:Connect(function()
self:Render()
end))
self:Render()
end)
:catch(warn)
return self
end
function Class:GetItem()
local pool = self.Pool
local button = table.remove(pool, #pool)
if not button then
button = createButton()
end
return button
end
function Class:Render()
if not self.Folder then
return
end
local folder = self.Folder
local maid = self.Listeners
local children = self.Children
local scrollingFrame = self.ScrollingFrame
local uiGridLayout = self.GridLayout
local pool = self.Pool
local list = folder:GetChildren()
local newChildren = {}
maid:DoCleaning()
for i, v in ipairs(list) do
local button = children[i] or self:GetItem()
newChildren[i] = button
button.ItemLabel.Text = v.Name
button.More.Visible = false
maid:GiveTask(Theme:Bind(button, "BackgroundColor3", "Button"))
maid:GiveTask(Theme:Bind(button.ItemLabel, "TextColor3", "Text"))
maid:GiveTask(Theme:Bind(button.ItemLabel, "TextStrokeColor3", "TextStroke"))
maid:GiveTask(Theme:Bind(button.More, "BackgroundColor3", "Delete"))
maid:GiveTask(Theme:Bind(button.More, "TextColor3", "Text"))
Promise.new(function(resolve, reject)
local success, result = pcall(function()
return Players:CreateHumanoidModelFromDescription(v, Enum.HumanoidRigType.R15, Enum.AssetTypeVerification.ClientOnly)
end)
if success then
resolve(result)
else
reject(result)
end
end)
:andThen(function(result)
maid:GiveTask(result)
result:SetPrimaryPartCFrame(CFrame.new())
local humanoid = result.Humanoid
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
humanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
result.Animate:Destroy()
local viewport = button.ViewportFrame
local camera = Instance.new("Camera")
maid:GiveTask(camera)
camera.CFrame = CFrame.lookAt(Vector3.new(-2, 2, -5), result.PrimaryPart.Position)
camera.Parent = button
viewport.CurrentCamera = camera
result.Parent = viewport.WorldModel
maid:GiveTask(function()
viewport.CurrentCamera = nil
end)
end)
:catch(warn)
maid:GiveTask(button.More.Activated:Connect(function(inputObject)
self.Delete:Fire(v)
end))
maid:GiveTask(button.TouchLongPress:Connect(function(touchPositions, inputState)
button.ItemLabel.Visible = false
button.More.Visible = false
self.Delete:Fire(v)
end))
maid:GiveTask(button.InputBegan:Connect(function(inputObject)
if not Settings.HOVER_INPUTS[inputObject.UserInputType] then
return
end
button.ItemLabel.Visible = true
if inputObject.UserInputType == Enum.UserInputType.MouseMovement then
button.More.Visible = true
end
end))
maid:GiveTask(button.InputEnded:Connect(function(inputObject)
if not Settings.HOVER_INPUTS[inputObject.UserInputType] then
return
end
button.ItemLabel.Visible = false
button.More.Visible = false
end))
maid:GiveTask(button.Activated:Connect(function(inputObject)
self.Wear:Fire(v)
end))
button.Parent = scrollingFrame
end
for i = #list + 1, #children do
local button = children[i]
button.Parent = nil
table.insert(pool, button)
end
self.Children = newChildren
scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, uiGridLayout.AbsoluteContentSize.Y)
end
function Class:Destroy()
self.Maid:DoCleaning()
self.Maid = nil
self.Listeners:DoCleaning()
self.Listeners = nil
for i, v in ipairs(self.Children) do
v:Destroy()
end
table.clear(self.Children)
for i, v in ipairs(self.Pool) do
v:Destroy()
end
table.clear(self.Pool)
setmetatable(self, nil)
end
return Class
|
end
|
function blow()
note:stop()
connection:disconnect()
|
--------END RIGHT DOOR --------
|
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- Events
|
local Events = ReplicatedStorage.Events
local UpdatePointsEvent = Events.UpdatePoints
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 1 -- cooldown for use of the tool again
ZoneModelName = "Star" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Load Roblox Occlusion Modules
|
local Invisicam = require(script:WaitForChild("Invisicam"))
local Poppercam do
local success, useNewPoppercam = pcall(UserSettings().IsUserFeatureEnabled, UserSettings(), "UserNewPoppercam4")
if success and useNewPoppercam then
Poppercam = require(script:WaitForChild("Poppercam"))
else
Poppercam = require(script:WaitForChild("Poppercam_Classic"))
end
end
|
--Character.Parent = Services.ServerStorage
|
for Angle = 0, 360,(360/(Light_Segments-1)) do --Create LightBall
local LightClone = LightBall:Clone()
LightClone.CFrame = (Center.CFrame * CFrame.Angles(math.rad(90),math.rad(Angle),0)) * CFrame.new(0,0,1)
LightBallAnimations[#LightBallAnimations+1] = {Start = Center.CFrame, Control = Center.CFrame:lerp((CFrame.new(TargetLocation)*(Center.CFrame-Center.CFrame.p)),.5)*CFrame.new(Seed:NextNumber(-Properties.OrbSpread,Properties.OrbSpread),Seed:NextNumber(-Properties.OrbSpread,Properties.OrbSpread),Seed:NextNumber(-Properties.OrbSpread,Properties.OrbSpread)), End = CFrame.new(TargetLocation)*(Center.CFrame-Center.CFrame.p), Object = LightClone}
LightClone.Parent = workspace
end
local TrackedOrb = Create("ObjectValue"){
Name = "TrackedOrb",
Value = LightBallAnimations[1].Object,
Parent = TrackOrb
}
|
--[=[
https://rxjs.dev/api/operators/mapTo
@param ... any -- The value to map each source value to.
@return (source: Observable<T>) -> Observable<T>
]=]
|
function Rx.mapTo(...)
local args = table.pack(...)
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
return source:Subscribe(function()
sub:Fire(table.unpack(args, 1, args.n))
end, sub:GetFailComplete())
end)
end
end
|
---------------------
|
colorchangingpart.Transparency = 0
colorchangingpart.Material = Enum.Material.Neon -- set this to the material you want the part to be
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.