prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- True ...... Synchronized
-- False ..... Free Run
|
val = script.Parent.Parent.Parent.Parent.AudibleCircuit
val2 = script.Parent.Parent.Parent.Parent.VisualCircuit
horn = script.Parent.horn
strobe = script.Parent.Parent.Strobe
alarm = false
salarm = false
horn.Pitch = math.random(80,107)/100
if candela == 0 then
strobe.Flasher.Size = UDim2.new(3,0,3,0)
elseif candela == 1 then
strobe.Flasher.Size = UDim2.new(4,0,4,0)
elseif candela == 2 then
strobe.Flasher.Size = UDim2.new(5,0,5,0)
elseif candela == 3 then
strobe.Flasher.Size = UDim2.new(6.5,0,6.5,0)
end
function Sound()
if val.Value == 1 then
horn:Play()
else
wait(0.03)
horn:Stop()
end
end
val.Changed:connect(Sound)
function Flash()
strobe.BrickColor = BrickColor.new(1001)
strobe.Flasher.Strobe.Visible = true
strobe.Light.Enabled = true
wait(0.06)
strobe.BrickColor = BrickColor.new(194)
strobe.Flasher.Strobe.Visible = false
strobe.Light.Enabled = false
end
sval = math.random(85,95)/100
function PowerStrobe()
if salarm then return end
salarm = true
wait(sval)
while val2.Value == 1 do
Flash()
wait(sval)
end
salarm = false
end
if strobesync then
val2.Changed:connect(function() if val2.Value == 1 then Flash() end end)
else
val2.Changed:connect(function() if val2.Value == 1 then PowerStrobe() end end)
end
|
-- The Bawby Special
--if (car.DriveSeat.Orientation.Z <= 0) then
-- script.Parent.TEST.Visible = true
--end
| |
-- Decompiled with the Synapse X Luau decompiler.
|
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1, p2)
p1 = math.clamp(p1, 0, 1);
if math.clamp(p2 and p1, 0, 1) <= 0.0002 and p1 <= 0.001 then
return u1.Functions.FormatOdds(p1);
end;
return u1.Functions.FormatPercent(p1);
end;
|
--%%Functions%%--
|
script.Parent.FlushSoon.Touched:connect(whileTouching)
script.Parent.FlushSoon.TouchEnded:connect(letGo)
|
--[=[
Sort of equivalent of promise.then()
This takes a stream of observables
@param project (value: T) -> Observable<U>
@param resultSelector ((initialValue: T, outputValue: U) -> U)?
@return (source: Observable<T>) -> Observable<U>
]=]
|
function Rx.flatMap(project, resultSelector)
assert(type(project) == "function", "Bad project")
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local maid = Maid.new()
local pendingCount = 0
local topComplete = false
maid:GiveTask(source:Subscribe(
function(...)
local outerValue = ...
local observable = project(...)
assert(Observable.isObservable(observable), "Bad observable from project")
pendingCount = pendingCount + 1
local innerMaid = Maid.new()
innerMaid:GiveTask(observable:Subscribe(
function(...)
-- Merge each inner observable
if resultSelector then
sub:Fire(resultSelector(outerValue, ...))
else
sub:Fire(...)
end
end,
function(...)
sub:Fail(...)
end, -- Emit failure automatically
function()
innerMaid:DoCleaning()
pendingCount = pendingCount - 1
if pendingCount == 0 and topComplete then
sub:Complete()
maid:DoCleaning()
end
end))
local key = maid:GiveTask(innerMaid)
-- Cleanup
innerMaid:GiveTask(function()
maid[key] = nil
end)
end,
function(...)
sub:Fail(...) -- Also reflect failures up to the top!
maid:DoCleaning()
end,
function()
topComplete = true
if pendingCount == 0 then
sub:Complete()
maid:DoCleaning()
end
end))
return maid
end)
end
end
function Rx.switchMap(project)
return Rx.pipe({
Rx.map(project);
Rx.switchAll();
})
end
function Rx.takeUntil(notifier)
assert(Observable.isObservable(notifier))
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local maid = Maid.new()
local cancelled = false
local function cancel()
maid:DoCleaning()
cancelled = true
end
-- Any value emitted will cancel (complete without any values allows all values to pass)
maid:GiveTask(notifier:Subscribe(cancel, cancel, nil))
-- Cancelled immediately? Oh boy.
if cancelled then
maid:DoCleaning()
return nil
end
-- Subscribe!
maid:GiveTask(source:Subscribe(sub:GetFireFailComplete()))
return maid
end)
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local v1 = {};
local l__Message__2 = u1.GUI.Message;
local u3 = {};
local u4 = false;
function v1.New(p1, ...)
local v2 = { ... };
if u1.Variables.MessageOpen == true then
while true do
u1.RunService.RenderStepped:Wait();
if u1.Variables.MessageOpen == false then
break;
end;
end;
end;
local v3 = false;
if v2[1] == nil then
v3 = v2[2] == nil;
end;
local v4 = false;
if type(v2[1]) == "boolean" then
v4 = v2[2] == nil;
end;
if v2[1] then
local v5 = v2[2];
end;
l__Message__2.No.Visible = false;
l__Message__2.Ok.Visible = false;
l__Message__2.Yes.Visible = false;
l__Message__2.Cancel.Visible = false;
l__Message__2.Option1.Visible = false;
l__Message__2.Option2.Visible = false;
l__Message__2.Desc.Text = p1;
if not v3 then
if v4 then
l__Message__2.No.Visible = true;
l__Message__2.Yes.Visible = true;
elseif v2[1] and v2[2] then
l__Message__2.Option1.Title.Text = v2[1];
l__Message__2.Option2.Title.Text = v2[2];
l__Message__2.Cancel.Visible = true;
l__Message__2.Option1.Visible = true;
l__Message__2.Option2.Visible = true;
end;
else
l__Message__2.Ok.Visible = true;
end;
local v6 = Instance.new("BindableEvent");
if l__Message__2.No.Visible then
local function u5()
Close();
v6:Fire(false);
end;
u3[#u3 + 1] = l__Message__2.No.Activated:Connect(function()
if u4 == false then
u4 = true;
u5();
u4 = false;
end;
end);
end;
if l__Message__2.Yes.Visible then
local function u6()
Close();
v6:Fire(true);
end;
u3[#u3 + 1] = l__Message__2.Yes.Activated:Connect(function()
if u4 == false then
u4 = true;
u6();
u4 = false;
end;
end);
end;
if l__Message__2.Ok.Visible then
local function u7()
Close();
v6:Fire(true);
end;
u3[#u3 + 1] = l__Message__2.Ok.Activated:Connect(function()
if u4 == false then
u4 = true;
u7();
u4 = false;
end;
end);
end;
if l__Message__2.Option1.Visible then
local function u8()
Close();
v6:Fire(1);
end;
u3[#u3 + 1] = l__Message__2.Option1.Activated:Connect(function()
if u4 == false then
u4 = true;
u8();
u4 = false;
end;
end);
end;
if l__Message__2.Option2.Visible then
local function u9()
Close();
v6:Fire(2);
end;
u3[#u3 + 1] = l__Message__2.Option2.Activated:Connect(function()
if u4 == false then
u4 = true;
u9();
u4 = false;
end;
end);
end;
if l__Message__2.Cancel.Visible then
local function u10()
Close();
v6:Fire(false);
end;
u3[#u3 + 1] = l__Message__2.Cancel.Activated:Connect(function()
if u4 == false then
u4 = true;
u10();
u4 = false;
end;
end);
end;
if u1.Variables.Console then
if l__Message__2.Ok.Visible then
u1.GuiService.SelectedObject = l__Message__2.Ok;
elseif l__Message__2.Yes.Visible then
u1.GuiService.SelectedObject = l__Message__2.Yes;
elseif l__Message__2.Option1.Visible then
u1.GuiService.SelectedObject = l__Message__2.Option1;
end;
local u11 = false;
u3[#u3 + 1] = u1.UserInputService.InputEnded:Connect(function(p2, p3)
if not u11 then
u11 = true;
if p2.KeyCode == Enum.KeyCode.ButtonB then
Close();
end;
u11 = false;
end;
end);
end;
Open();
local v7 = v6.Event:Wait();
v6:Destroy();
return v7;
end;
function v1.IsOpen()
return l__Message__2.Gui.Enabled;
end;
function Close()
for v8, v9 in ipairs(u3) do
v9:Disconnect();
end;
u3 = {};
l__Message__2.Gui.Enabled = false;
u1.Variables.MessageOpen = false;
end;
function Open()
l__Message__2.Gui.Enabled = true;
u1.Variables.MessageOpen = true;
end;
local l__next__11 = next;
local v12, v13 = l__Message__2.Frame:GetChildren();
while true do
local v14, v15 = l__next__11(v12, v13);
if not v14 then
break;
end;
v13 = v14;
if v15.ClassName == "ImageButton" then
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
currentAnim = ""
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
return oldAnim
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local methods = {}
methods.__index = methods
function methods:SendSystemMessage(message, extraData)
local messageObj = self:InternalCreateMessageObject(message, nil, true, extraData)
local success, err = pcall(function() self.eMessagePosted:Fire(messageObj) end)
if not success and err then
print("Error posting message: " ..err)
end
self:InternalAddMessageToHistoryLog(messageObj)
for i, speaker in pairs(self.Speakers) do
speaker:InternalSendSystemMessage(messageObj, self.Name)
end
return messageObj
end
function methods:SendSystemMessageToSpeaker(message, speakerName, extraData)
local speaker = self.Speakers[speakerName]
if (speaker) then
local messageObj = self:InternalCreateMessageObject(message, nil, true, extraData)
speaker:InternalSendSystemMessage(messageObj, self.Name)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot be sent a system message", speakerName, self.Name))
end
end
function methods:SendMessageObjToFilters(message, messageObj, fromSpeaker)
local oldMessage = messageObj.Message
messageObj.Message = message
self:InternalDoMessageFilter(fromSpeaker.Name, messageObj, self.Name)
self.ChatService:InternalDoMessageFilter(fromSpeaker.Name, messageObj, self.Name)
local newMessage = messageObj.Message
messageObj.Message = oldMessage
return newMessage
end
function methods:CanCommunicateByUserId(userId1, userId2)
if RunService:IsStudio() then
return true
end
-- UserId is set as 0 for non player speakers.
if userId1 == 0 or userId2 == 0 then
return true
end
local success, canCommunicate = pcall(function()
return Chat:CanUsersChatAsync(userId1, userId2)
end)
return success and canCommunicate
end
function methods:CanCommunicate(speakerObj1, speakerObj2)
local player1 = speakerObj1:GetPlayer()
local player2 = speakerObj2:GetPlayer()
if player1 and player2 then
return self:CanCommunicateByUserId(player1.UserId, player2.UserId)
end
return true
end
function methods:SendMessageToSpeaker(message, speakerName, fromSpeakerName, extraData)
local speakerTo = self.Speakers[speakerName]
local speakerFrom = self.ChatService:GetSpeaker(fromSpeakerName)
if speakerTo and speakerFrom then
local isMuted = speakerTo:IsSpeakerMuted(fromSpeakerName)
if isMuted then
return
end
if not self:CanCommunicate(speakerTo, speakerFrom) then
return
end
-- We need to claim the message is filtered even if it not in this case for compatibility with legacy client side code.
local isFiltered = speakerName == fromSpeakerName
local messageObj = self:InternalCreateMessageObject(message, fromSpeakerName, isFiltered, extraData)
message = self:SendMessageObjToFilters(message, messageObj, fromSpeakerName)
speakerTo:InternalSendMessage(messageObj, self.Name)
--// START FFLAG
if (not IN_GAME_CHAT_USE_NEW_FILTER_API) then --// USES FFLAG
--// OLD BEHAVIOR
local filteredMessage = self.ChatService:InternalApplyRobloxFilter(messageObj.FromSpeaker, message, speakerName)
if filteredMessage then
messageObj.Message = filteredMessage
messageObj.IsFiltered = true
speakerTo:InternalSendFilteredMessage(messageObj, self.Name)
end
--// OLD BEHAVIOR
else
--// NEW BEHAVIOR
local filterSuccess, isFilterResult, filteredMessage = self.ChatService:InternalApplyRobloxFilterNewAPI(messageObj.FromSpeaker, message)
if (filterSuccess) then
messageObj.FilterResult = filteredMessage
messageObj.IsFilterResult = isFilterResult
messageObj.IsFiltered = true
speakerTo:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
end
--// NEW BEHAVIOR
end
--// END FFLAG
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot be sent a message", speakerName, self.Name))
end
end
function methods:KickSpeaker(speakerName, reason)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
local messageToSpeaker = ""
local messageToChannel = ""
if (reason) then
messageToSpeaker = string.format("You were kicked from '%s' for the following reason(s): %s", self.Name, reason)
messageToChannel = string.format("%s was kicked for the following reason(s): %s", speakerName, reason)
else
messageToSpeaker = string.format("You were kicked from '%s'", self.Name)
messageToChannel = string.format("%s was kicked", speakerName)
end
self:SendSystemMessageToSpeaker(messageToSpeaker, speakerName)
speaker:LeaveChannel(self.Name)
self:SendSystemMessage(messageToChannel)
end
function methods:MuteSpeaker(speakerName, reason, length)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
self.Mutes[speakerName:lower()] = (length == 0 or length == nil) and 0 or (os.time() + length)
if (reason) then
self:SendSystemMessage(string.format("%s was muted for the following reason(s): %s", speakerName, reason))
end
local success, err = pcall(function() self.eSpeakerMuted:Fire(speakerName, reason, length) end)
if not success and err then
print("Error mutting speaker: " ..err)
end
local spkr = self.ChatService:GetSpeaker(speakerName)
if (spkr) then
local success, err = pcall(function() spkr.eMuted:Fire(self.Name, reason, length) end)
if not success and err then
print("Error mutting speaker: " ..err)
end
end
end
function methods:UnmuteSpeaker(speakerName)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
self.Mutes[speakerName:lower()] = nil
local success, err = pcall(function() self.eSpeakerUnmuted:Fire(speakerName) end)
if not success and err then
print("Error unmuting speaker: " ..err)
end
local spkr = self.ChatService:GetSpeaker(speakerName)
if (spkr) then
local success, err = pcall(function() spkr.eUnmuted:Fire(self.Name) end)
if not success and err then
print("Error unmuting speaker: " ..err)
end
end
end
function methods:IsSpeakerMuted(speakerName)
return (self.Mutes[speakerName:lower()] ~= nil)
end
function methods:GetSpeakerList()
local list = {}
for i, speaker in pairs(self.Speakers) do
table.insert(list, speaker.Name)
end
return list
end
function methods:RegisterFilterMessageFunction(funcId, func, priority)
if self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' already exists", funcId))
end
self.FilterMessageFunctions:AddFunction(funcId, func, priority)
end
function methods:FilterMessageFunctionExists(funcId)
return self.FilterMessageFunctions:HasFunction(funcId)
end
function methods:UnregisterFilterMessageFunction(funcId)
if not self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' does not exists", funcId))
end
self.FilterMessageFunctions:RemoveFunction(funcId)
end
function methods:RegisterProcessCommandsFunction(funcId, func, priority)
if self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' already exists", funcId))
end
self.ProcessCommandsFunctions:AddFunction(funcId, func, priority)
end
function methods:ProcessCommandsFunctionExists(funcId)
return self.ProcessCommandsFunctions:HasFunction(funcId)
end
function methods:UnregisterProcessCommandsFunction(funcId)
if not self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' does not exist", funcId))
end
self.ProcessCommandsFunctions:RemoveFunction(funcId)
end
local function ShallowCopy(table)
local copy = {}
for i, v in pairs(table) do
copy[i] = v
end
return copy
end
function methods:GetHistoryLog()
return ShallowCopy(self.ChatHistory)
end
function methods:GetHistoryLogForSpeaker(speaker)
local userId = -1
local player = speaker:GetPlayer()
if player then
userId = player.UserId
end
local chatlog = {}
--// START FFLAG
if (not IN_GAME_CHAT_USE_NEW_FILTER_API) then --// USES FFLAG
--// OLD BEHAVIOR
for i = 1, #self.ChatHistory do
local logUserId = self.ChatHistory[i].SpeakerUserId
if self:CanCommunicateByUserId(userId, logUserId) then
table.insert(chatlog, ShallowCopy(self.ChatHistory[i]))
end
end
--// OLD BEHAVIOR
else
--// NEW BEHAVIOR
for i = 1, #self.ChatHistory do
local logUserId = self.ChatHistory[i].SpeakerUserId
if self:CanCommunicateByUserId(userId, logUserId) then
local messageObj = ShallowCopy(self.ChatHistory[i])
--// Since we're using the new filter API, we need to convert the stored filter result
--// into an actual string message to send to players for their chat history.
--// System messages aren't filtered the same way, so they just have a regular
--// text value in the Message field.
if (messageObj.MessageType == ChatConstants.MessageTypeDefault) then
local filterResult = messageObj.FilterResult
if (messageObj.IsFilterResult) then
if (player) then
messageObj.Message = filterResult:GetChatForUserAsync(player.UserId)
else
messageObj.Message = filterResult:GetNonChatStringForBroadcastAsync()
end
else
messageObj.Message = filterResult
end
end
table.insert(chatlog, messageObj)
end
end
--// NEW BEHAVIOR
end
--// END FFLAG
return chatlog
end
|
-----------------
--| Variables |--
-----------------
|
local PlayersService = game:GetService('Players')
local Camera = nil
local CameraChangeConn = nil
local SubjectPart = nil
local PlayerCharacters = {} -- For ignoring in raycasts
local VehicleParts = {} -- Also just for ignoring
local LastPopAmount = 0
local LastZoomLevel = 0
local PopperEnabled = false
local CFrame_new = CFrame.new
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 448 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local methods = {}
methods.__index = methods
function methods:AddChannel(channelName, autoJoin)
if (self.ChatChannels[channelName:lower()]) then
error(string.format("Channel %q alrady exists.", channelName))
end
local function DefaultChannelCommands(fromSpeaker, message)
if (message:lower() == "/leave") then
local channel = self:GetChannel(channelName)
local speaker = self:GetSpeaker(fromSpeaker)
if (channel and speaker) then
if (channel.Leavable) then
speaker:LeaveChannel(channelName)
speaker:SendSystemMessage(
string.gsub(
ChatLocalization:Get(
"GameChat_ChatService_YouHaveLeftChannel",
string.format("You have left channel '%s'", channelName)
),
"{RBX_NAME}",channelName),
"System"
)
else
speaker:SendSystemMessage(ChatLocalization:Get("GameChat_ChatService_CannotLeaveChannel","You cannot leave this channel."), channelName)
end
end
return true
end
return false
end
local channel = ChatChannel.new(self, channelName)
self.ChatChannels[channelName:lower()] = channel
channel:RegisterProcessCommandsFunction("default_commands", DefaultChannelCommands, ChatConstants.HighPriority)
local success, err = pcall(function() self.eChannelAdded:Fire(channelName) end)
if not success and err then
print("Error addding channel: " ..err)
end
if autoJoin ~= nil then
channel.AutoJoin = autoJoin
if autoJoin then
for _, speaker in pairs(self.Speakers) do
speaker:JoinChannel(channelName)
end
end
end
return channel
end
function methods:RemoveChannel(channelName)
if (self.ChatChannels[channelName:lower()]) then
local n = self.ChatChannels[channelName:lower()].Name
self.ChatChannels[channelName:lower()]:InternalDestroy()
self.ChatChannels[channelName:lower()] = nil
local success, err = pcall(function() self.eChannelRemoved:Fire(n) end)
if not success and err then
print("Error removing channel: " ..err)
end
else
warn(string.format("Channel %q does not exist.", channelName))
end
end
function methods:GetChannel(channelName)
return self.ChatChannels[channelName:lower()]
end
function methods:AddSpeaker(speakerName)
if (self.Speakers[speakerName:lower()]) then
error("Speaker \"" .. speakerName .. "\" already exists!")
end
local speaker = Speaker.new(self, speakerName)
self.Speakers[speakerName:lower()] = speaker
local success, err = pcall(function() self.eSpeakerAdded:Fire(speakerName) end)
if not success and err then
print("Error adding speaker: " ..err)
end
return speaker
end
function methods:InternalUnmuteSpeaker(speakerName)
for channelName, channel in pairs(self.ChatChannels) do
if channel:IsSpeakerMuted(speakerName) then
channel:UnmuteSpeaker(speakerName)
end
end
end
function methods:RemoveSpeaker(speakerName)
if (self.Speakers[speakerName:lower()]) then
local n = self.Speakers[speakerName:lower()].Name
self:InternalUnmuteSpeaker(n)
self.Speakers[speakerName:lower()]:InternalDestroy()
self.Speakers[speakerName:lower()] = nil
local success, err = pcall(function() self.eSpeakerRemoved:Fire(n) end)
if not success and err then
print("Error removing speaker: " ..err)
end
else
warn("Speaker \"" .. speakerName .. "\" does not exist!")
end
end
function methods:GetSpeaker(speakerName)
return self.Speakers[speakerName:lower()]
end
function methods:GetChannelList()
local list = {}
for i, channel in pairs(self.ChatChannels) do
if (not channel.Private) then
table.insert(list, channel.Name)
end
end
return list
end
function methods:GetAutoJoinChannelList()
local list = {}
for i, channel in pairs(self.ChatChannels) do
if channel.AutoJoin then
table.insert(list, channel)
end
end
return list
end
function methods:GetSpeakerList()
local list = {}
for i, speaker in pairs(self.Speakers) do
table.insert(list, speaker.Name)
end
return list
end
function methods:SendGlobalSystemMessage(message)
for i, speaker in pairs(self.Speakers) do
speaker:SendSystemMessage(message, nil)
end
end
function methods:RegisterFilterMessageFunction(funcId, func, priority)
if self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' already exists", funcId))
end
self.FilterMessageFunctions:AddFunction(funcId, func, priority)
end
function methods:FilterMessageFunctionExists(funcId)
return self.FilterMessageFunctions:HasFunction(funcId)
end
function methods:UnregisterFilterMessageFunction(funcId)
if not self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' does not exists", funcId))
end
self.FilterMessageFunctions:RemoveFunction(funcId)
end
function methods:RegisterProcessCommandsFunction(funcId, func, priority)
if self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' already exists", funcId))
end
self.ProcessCommandsFunctions:AddFunction(funcId, func, priority)
end
function methods:ProcessCommandsFunctionExists(funcId)
return self.ProcessCommandsFunctions:HasFunction(funcId)
end
function methods:UnregisterProcessCommandsFunction(funcId)
if not self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' does not exist", funcId))
end
self.ProcessCommandsFunctions:RemoveFunction(funcId)
end
local LastFilterNoficationTime = 0
local LastFilterIssueTime = 0
local FilterIssueCount = 0
function methods:InternalNotifyFilterIssue()
if (tick() - LastFilterIssueTime) > FILTER_THRESHOLD_TIME then
FilterIssueCount = 0
end
FilterIssueCount = FilterIssueCount + 1
LastFilterIssueTime = tick()
if FilterIssueCount >= FILTER_NOTIFCATION_THRESHOLD then
if (tick() - LastFilterNoficationTime) > FILTER_NOTIFCATION_INTERVAL then
LastFilterNoficationTime = tick()
local systemChannel = self:GetChannel("System")
if systemChannel then
systemChannel:SendSystemMessage(
ChatLocalization:Get(
"GameChat_ChatService_ChatFilterIssues",
"The chat filter is currently experiencing issues and messages may be slow to appear."
),
errorExtraData
)
end
end
end
end
local StudioMessageFilteredCache = {}
|
-- Controller script
|
local SegwayController = script:WaitForChild("SegwayController")
|
-- Captions
|
DEFAULT_FORCED_GROUP_VALUES["caption"] = 1
function Icon:setCaption(text)
assert(typeof(text) == "string" or text == nil, "Expected string, got "..typeof(text))
local realText = text or ""
local isVisible = realText ~= ""
self.captionText = text
self.instances.captionLabel.Text = realText
self.instances.captionContainer.Parent = (isVisible and activeItems) or self.instances.iconContainer
self._maid.captionContainer = self.instances.captionContainer
self:_updateIconSize(nil, self:getIconState())
local captionMaid = Maid.new()
self._maid.captionMaid = captionMaid
if isVisible then
captionMaid:give(self.hoverStarted:Connect(function()
if not self.isSelected then
self:displayCaption(true)
end
end))
captionMaid:give(self.hoverEnded:Connect(function()
self:displayCaption(false)
end))
captionMaid:give(self.selected:Connect(function()
if self.hovering then
self:displayCaption(false)
end
end))
local iconContainer = self.instances.iconContainer
captionMaid:give(iconContainer:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
if self.hovering then
self:displayCaption()
end
end))
captionMaid:give(iconContainer:GetPropertyChangedSignal("AbsolutePosition"):Connect(function()
if self.hovering then
self:displayCaption()
end
end))
end
self:_updateCaptionSize()
self:displayCaption(self.hovering and isVisible)
return self
end
function Icon:_updateCaptionSize()
-- This adapts the caption size
local CAPTION_X_MARGIN = 6
local CAPTION_CONTAINER_Y_SIZE_SCALE = 0.8
local CAPTION_LABEL_Y_SCALE = 0.58
local iconSize = self:get("iconSize")
local labelFont = self:get("captionFont")
if iconSize and labelFont then
local cellSizeYOffset = iconSize.Y.Offset
local cellSizeYScale = iconSize.Y.Scale
local iconContainer = self.instances.iconContainer
local captionContainer = self.instances.captionContainer
local realText = self.captionText or ""
local isVisible = realText ~= ""
if isVisible then
local cellHeight = cellSizeYOffset + (cellSizeYScale * iconContainer.Parent.AbsoluteSize.Y)
local captionLabel = self.instances.captionLabel
local captionContainerHeight = cellHeight * CAPTION_CONTAINER_Y_SIZE_SCALE
local captionLabelHeight = captionContainerHeight * CAPTION_LABEL_Y_SCALE
local iconContentText = self:_getContentText(self.captionText)
local textWidth = textService:GetTextSize(iconContentText, captionLabelHeight, labelFont, Vector2.new(10000, captionLabelHeight)).X
captionLabel.TextSize = captionLabelHeight
captionLabel.Size = UDim2.new(0, textWidth, CAPTION_LABEL_Y_SCALE, 0)
captionContainer.Size = UDim2.new(0, textWidth + CAPTION_X_MARGIN*2, 0, cellHeight*CAPTION_CONTAINER_Y_SIZE_SCALE)
else
captionContainer.Size = UDim2.new(0, 0, 0, 0)
end
end
end
function Icon:displayCaption(bool)
if userInputService.TouchEnabled and not self._draggingFinger then return end
local yOffset = 8
-- Determine caption position
if self._draggingFinger then
yOffset = yOffset + THUMB_OFFSET
end
local iconContainer = self.instances.iconContainer
local captionContainer = self.instances.captionContainer
local newPos = UDim2.new(0, iconContainer.AbsolutePosition.X+iconContainer.AbsoluteSize.X/2-captionContainer.AbsoluteSize.X/2, 0, iconContainer.AbsolutePosition.Y+(iconContainer.AbsoluteSize.Y*2)+yOffset)
captionContainer.Position = newPos
-- Determine caption visibility
local isVisible = self.captionVisible or false
if typeof(bool) == "boolean" then
isVisible = bool
end
self.captionVisible = isVisible
-- Change transparency of relavent caption instances
local captionFadeInfo = self:get("captionFadeInfo")
for _, settingName in pairs(self._groupSettings.caption) do
local settingDetail = self._settingsDictionary[settingName]
settingDetail.useForcedGroupValue = not isVisible
self:_update(settingName)
end
end
|
--// UI Tween Info
|
local L_163_ = TweenInfo.new(
1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local L_164_ = {
TextTransparency = 1
}
|
--Made by Stickmasterluke
|
sp = script.Parent
speedboost = 0 --100% speed bonus
speedforsmoke = math.huge --smoke apears when character running >= 10 studs/second.
local tooltag = script:WaitForChild("ToolTag",2)
if tooltag~=nil then
local tool=tooltag.Value
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16+16*speedboost
local hrp = sp:FindFirstChild("HumanoidRootPart")
if hrp ~= nil then
smokepart=Instance.new("Part")
smokepart.FormFactor="Custom"
smokepart.Size=Vector3.new(0,0,0)
smokepart.TopSurface="Smooth"
smokepart.BottomSurface="Smooth"
smokepart.CanCollide=false
smokepart.Transparency=1
local weld=Instance.new("Weld")
weld.Name="SmokePartWeld"
weld.Part0 = hrp
weld.Part1=smokepart
weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
weld.Parent=smokepart
smokepart.Parent=sp
smoke=Instance.new("Smoke")
smoke.Enabled = hrp.Velocity.magnitude>speedforsmoke
smoke.RiseVelocity=2
smoke.Opacity=.25
smoke.Size=.5
smoke.Parent=smokepart
h.Running:connect(function(speed)
if smoke and smoke~=nil then
smoke.Enabled=speed>speedforsmoke
end
end)
end
end
while tool~=nil and tool.Parent==sp and h~=nil do
sp.ChildRemoved:wait()
end
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16
end
end
if smokepart~=nil then
smokepart:Destroy()
end
script:Destroy()
|
-- for offset calc
|
local A1 = cloth:FindFirstChild("A1", true)
local A1P = physicsParts:WaitForChild("A1")
local offset = A1P.Position - A1.WorldPosition
local parts = {}
local function indexParts()
for iterator, part : BasePart in physicsParts:GetChildren() do
parts[part.Name] = part
if iterator%50 == 0 then
task.wait()
end
end
end
local function boneUpdate()
for _, bone in bones do
local part = parts[bone.Name]
bone.WorldCFrame = part.CFrame+offset
end
end
indexParts()
RunService.RenderStepped:Connect(boneUpdate)
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 5
local slash_damage = 16
local lunge_damage = 25
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.7
Tool.Parent.Torso["Right Shoulder"].DesiredAngle = 3.6
wait(.1)
Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 1
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
--swordOut()
wait(.25)
force.Parent = nil
wait(.5)
--swordUp()
damage = slash_damage
end
function clawOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(1,0,0)
end
function clawUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
-- regeneration
|
function regenHealth()
if regening then return end
regening = true
while Humanoid.Health < Humanoid.MaxHealth do
local s = wait(1)
local health = Humanoid.Health
if health~=0 and health < Humanoid.MaxHealth then
local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
health = health + newHealthDelta
Humanoid.Health = math.min(health,Humanoid.MaxHealth)
end
end
if Humanoid.Health > Humanoid.MaxHealth then
Humanoid.Health = Humanoid.MaxHealth
end
regening = false
end
Humanoid.HealthChanged:connect(regenHealth)
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
game:GetService("TeleportService"):Teleport(4641921091,player) --replace the numbers with your place id
end
end
script.Parent.Torso.Touched:connect(onTouched)
|
-- TableWatcher
-- Stephen Leitnick
-- April 29, 2022
|
type AnyTable = { [any]: any }
type Watcher = {
Changes: AnyTable,
Tbl: AnyTable,
}
local Util = require(script.Parent.Util)
local watchers: { [TableWatcher]: Watcher } = {}
setmetatable(watchers, { __mode = "k" })
local WatcherMt = {}
function WatcherMt:__index(index)
local w = watchers[self]
local c = w.Changes[index]
if c ~= nil then
if c == Util.None then
return nil
else
return c
end
end
return w.Tbl[index]
end
function WatcherMt:__newindex(index, value)
local w = watchers[self]
if w.Tbl[index] == value then
return
end
if value == nil then
w.Changes[index] = Util.None
else
w.Changes[index] = value
end
end
function WatcherMt:__call()
local w = watchers[self]
if next(w.Changes) == nil then
return w.Tbl
end
return Util.Extend(w.Tbl, w.Changes)
end
local function TableWatcher(t: AnyTable): TableWatcher
local watcher = setmetatable({}, WatcherMt)
watchers[watcher] = {
Changes = {},
Tbl = t,
}
return watcher
end
type TableWatcher = typeof(setmetatable({}, WatcherMt))
return TableWatcher
|
--why did we make a duplicate????
--[[game.ReplicatedStorage.RemoteFunctions.PurchasePermanentItem.OnServerInvoke = function(plr,itemid)
local data = game.ReplicatedStorage.PlayerData:FindFirstChild(plr.userId)
local obj = game.ServerStorage.RemoteFunctions.GetObjectFromID:Invoke(itemid)
if data and obj then
for _,v in pairs(data.Objects:GetChildren()) do
if v.Name == obj.Name then
return false,"You already own this item! Please choose another one."
end
end
local costdiff = obj.ItemCost.Value - data.cash.Value --how much more they need
if costdiff > 0 then
return "cash",costdiff
end
game.ServerStorage.RemoteFunctions.ChangeCash:Fire(plr,-obj.ItemCost.Value)
game.ServerStorage.RemoteFunctions.AwardItem:Fire(plr,obj.ItemID.Value)
return true
end
end
game.ReplicatedStorage.RemoteFunctions.PurchaseTemporaryItem.OnServerInvoke = function(plr,shopname,itemname)
local shop = game.ServerStorage:FindFirstChild(shopname)
local data = game.ReplicatedStorage.PlayerData:FindFirstChild(plr.userId)
if shop and data then
local item = shop:FindFirstChild(itemname)
if item then
local costdiff = item.ItemCost.Value - data.cash.Value
if costdiff > 0 then
return "cash",getCashNeeded(costdiff)
end
local backpack = plr:FindFirstChild("Backpack")
if backpack and #backpack:GetChildren() < 10 then --backpack items later!!
game.ServerStorage.RemoteFunctions.ChangeCash:Fire(plr,-item.ItemCost.Value)
local tool = item.Tool:clone()
tool.Name = item.Name
tool.Parent = backpack
return true
else
return false,"You can't hold any more items! Press Backspace to drop items, or purchase a Backpack which can hold more items."
end
end
end
end]]
| |
--[[
Intended for use in tests.
Similar to await(), but instead of yielding if the promise is unresolved,
_unwrap will throw. This indicates an assumption that a promise has
resolved.
]]
|
function Promise.prototype:_unwrap()
if self._status == Promise.Status.Started then
error("Promise has not resolved or rejected.", 2)
end
local success = self._status == Promise.Status.Resolved
return success, unpack(self._values, 1, self._valuesLength)
end
function Promise.prototype:_resolve(...)
if self._status ~= Promise.Status.Started then
if Promise.is((...)) then
(...):_consumerCancelled(self)
end
return
end
-- If the resolved value was a Promise, we chain onto it!
if Promise.is((...)) then
-- Without this warning, arguments sometimes mysteriously disappear
if select("#", ...) > 1 then
local message = string.format(
"When returning a Promise from andThen, extra arguments are " ..
"discarded! See:\n\n%s",
self._source
)
warn(message)
end
local chainedPromise = ...
local promise = chainedPromise:andThen(
function(...)
self:_resolve(...)
end,
function(...)
local maybeRuntimeError = chainedPromise._values[1]
-- Backwards compatibility < v2
if chainedPromise._error then
maybeRuntimeError = Error.new({
error = chainedPromise._error,
kind = Error.Kind.ExecutionError,
context = "[No stack trace available as this Promise originated from an older version of the Promise library (< v2)]",
})
end
if Error.isKind(maybeRuntimeError, Error.Kind.ExecutionError) then
return self:_reject(maybeRuntimeError:extend({
error = "This Promise was chained to a Promise that errored.",
trace = "",
context = string.format(
"The Promise at:\n\n%s\n...Rejected because it was chained to the following Promise, which encountered an error:\n",
self._source
),
}))
end
self:_reject(...)
end
)
if promise._status == Promise.Status.Cancelled then
self:cancel()
elseif promise._status == Promise.Status.Started then
-- Adopt ourselves into promise for cancellation propagation.
self._parent = promise
promise._consumers[self] = true
end
return
end
self._status = Promise.Status.Resolved
self._valuesLength, self._values = pack(...)
-- We assume that these callbacks will not throw errors.
for _, callback in ipairs(self._queuedResolve) do
coroutine.wrap(callback)(...)
end
self:_finalize()
end
function Promise.prototype:_reject(...)
if self._status ~= Promise.Status.Started then
return
end
self._status = Promise.Status.Rejected
self._valuesLength, self._values = pack(...)
-- If there are any rejection handlers, call those!
if not isEmpty(self._queuedReject) then
-- We assume that these callbacks will not throw errors.
for _, callback in ipairs(self._queuedReject) do
coroutine.wrap(callback)(...)
end
else
-- At this point, no one was able to observe the error.
-- An error handler might still be attached if the error occurred
-- synchronously. We'll wait one tick, and if there are still no
-- observers, then we should put a message in the console.
local err = tostring((...))
coroutine.wrap(function()
Promise._timeEvent:Wait()
-- Someone observed the error, hooray!
if not self._unhandledRejection then
return
end
-- Build a reasonable message
local message = string.format(
"Unhandled Promise rejection:\n\n%s\n\n%s",
err,
self._source
)
for _, callback in ipairs(Promise._unhandledRejectionCallbacks) do
task.spawn(callback, self, unpack(self._values, 1, self._valuesLength))
end
if Promise.TEST then
-- Don't spam output when we're running tests.
return
end
warn(message)
end)()
end
self:_finalize()
end
|
-- Right Arms
|
character.Constraint.ConstraintRightUpperArm.Attachment0 = RUA
character.Constraint.ConstraintRightUpperArm.Attachment1 = RUARig
character.Constraint.ConstraintRightLowerArm.Attachment0 = RLA
character.Constraint.ConstraintRightLowerArm.Attachment1 = RLARig
character.Constraint.ConstraintRightHand.Attachment0 = RH
character.Constraint.ConstraintRightHand.Attachment1 = RHRig
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 30 -- cooldown for use of the tool again
ZoneModelName = "DJ Disco" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--LINK THUNDERBOLT HEAD BELOW
|
SirenAddress = script.Parent.Parent.Parent["FederalSignalThunderbolt1003ASeriesC"]
|
-- initialize to idle
|
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
while Figure.Parent~=nil do
task.wait(0.1)
move(os.clock())
end
|
--// Events
|
local L_28_ = L_6_:WaitForChild('Equipped')
local L_29_ = L_6_:WaitForChild('ShootEvent')
local L_30_ = L_6_:WaitForChild('DamageEvent')
local L_31_ = L_6_:WaitForChild('CreateOwner')
local L_32_ = L_6_:WaitForChild('Stance')
local L_33_ = L_6_:WaitForChild('HitEvent')
|
--------------------------------------------------------------------------
|
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .4 ,
FTargetFriction = .7 ,
FMinFriction = .1 ,
RWearSpeed = .4 ,
RTargetFriction = .7 ,
RMinFriction = .1 ,
--Tire Slip
TCSOffRatio = 1/3 ,
WheelLockRatio = 1/2 , --SS6 Default = 1/4
WheelspinRatio = 1/1.1 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = .5 , --SS6 Default = .5
RElasticity = .5 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
|
--[[ Modules ]]
|
--
local CurrentControlModule = nil
local ClickToMoveTouchControls = nil
local ControlModules = {}
if IsTouchDevice then
ControlModules.Thumbstick = require(script:WaitForChild('Thumbstick'))
ControlModules.Thumbpad = require(script:WaitForChild('Thumbpad'))
ControlModules.DPad = require(script:WaitForChild('DPad'))
ControlModules.Default = ControlModules.Thumbstick
TouchJumpModule = require(script:WaitForChild('TouchJump'))
BindableEvent_OnFailStateChanged = script.Parent:WaitForChild('OnClickToMoveFailStateChange')
else
ControlModules.Keyboard = require(script:WaitForChild('KeyboardMovement'))
end
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "Outer Star" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Engine Sound Parameters
|
local RPM_CROSSOVER = 250 -- How much more engine power is needed to crossover to the next engine audio track
local ENGINE_GAIN_ACCEL = 0.1 -- Exponent that builds the engine RPM when accelerating (gives the engine sound more oomph the higher the value)
local ENGINE_GAIN_DECCEL = 0.5 -- Exponent that builds the engine RPM when decelerating (braking)
local BASE_RPM = Vehicle:GetAttribute("BaseEngineRPM") or 1500 -- Resting state for the engine
local MAX_RPM = Vehicle:GetAttribute("MaxEngineRPM") or 5000 -- The engine RPM correlating to the highest pitch for engine sounds
local MAX_IDEAL_RPM = MAX_RPM-(MAX_RPM-BASE_RPM)/4 -- engine RPM correlating to normal usage (not under stress)
local MAX_SPEED = 125 -- The rotational velocity a vehicle's wheels would be reaching for the highest pitched engine sounds
|
-- Play "ShotgunClipinAnimation" + Play "ShotgunClipin" Audio
-- >>>
-- Wait "ShellClipinSpeed" second
-- >>>
-- Repeat "AmmoPerClip" - "Current Ammo" times
-- >>>
-- Play "ReloadAnimation" + Play "ReloadSound"
-- Wait "ReloadTime"
| |
---[[ Message Settings ]]
|
module.MaximumMessageLength = 200
module.DisallowedWhiteSpace = {"\n", "\r", "\t", "\v", "\f"}
module.ClickOnPlayerNameToWhisper = true
module.ClickOnChannelNameToSetMainChannel = true
module.BubbleChatMessageTypes = {ChatConstants.MessageTypeDefault, ChatConstants.MessageTypeWhisper}
|
--[=[
@class ServerComm
@server
]=]
|
local ServerComm = {}
ServerComm.__index = ServerComm
|
--Tune--
|
local StockHP = 200 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve)
local TurboCount = 1 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos)
local TurboSize = 20 --bigger the turbo, the more lag it has (actually be realistic with it) no 20mm turbos
local WasteGatePressure = 15 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo)
local CompressionRatio = 9/1 --Compression of your car (look up the compression of the engine you are running)
local AntiLag = true --if true basically keeps the turbo spooled up so less lag
local BOV_Loudness = 0.5 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.5 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 0.65 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
|
--Running Script--
|
local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 30
local Anim = Instance.new('Animation')
Anim.AnimationId = "rbxassetid://"
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)
|
-- ROBLOX deviation START: adding default colors since we don't currently support colors
|
type Colors = typesModule.Colors
local DEFAULT_COLORS: Colors = {
comment = { close = "", open = "" },
content = { close = "", open = "" },
prop = { close = "", open = "" },
tag = { close = "", open = "" },
value = { close = "", open = "" },
}
|
-- Decompiled with the Synapse X Luau decompiler.
|
wait(0.1);
local l__Value__1 = script.Parent.Parent.Car.Value;
script.Parent:Play();
while wait() do
if l__Value__1.Body.Left.on.Value == true or l__Value__1.Body.Right.on.Value == true then
script.Parent.Volume = 1;
else
script.Parent.Volume = 0;
end;
end;
|
--// All global vars will be wiped/replaced except script
|
return function(data)
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local ping = script.Parent.Parent
local frame = ping.Frame
local ms = ping.Frame.Ms
local close = ping.Frame.Close
gTable:Ready()
ms.Text = "..."
close.MouseButton1Click:connect(function()
ping:Destroy()
end)
repeat
ms.Text = client.Remote.Ping().."ms"
wait(1.5)
until not ping
if ping then
ping:Destroy()
end
end
|
--Settings--
|
script.Parent.Activated:Connect(function()
if debounce == false then
debounce = true
RS.Events.SelfDestruct:FireServer()
task.wait(Cooldown)
debounce = false
end
end)
RS.Events.SelfDestruct.OnClientEvent:Connect(function(char)
local Shakes = script.ShakeScript:Clone()
Shakes.Parent = char
Shakes.Disabled = false
game.Debris:AddItem(Shakes,1)
for i,v in pairs(effect:GetDescendants()) do
if v:IsA("ParticleEmitter") then
v:Emit(10)
end
end
RocksModule.Ground(char.HumanoidRootPart.Position + Vector3.new(0, -1, 0), 40, Vector3.new(5, 3.5, 5), nil, 20, false, 5)
end)
|
-- ROBLOX deviation END
|
export type MutableSourceVersion = ReactTypes.MutableSourceVersion
export type MutableSourceGetSnapshotFn<Source, Snapshot> =
ReactTypes.MutableSourceGetSnapshotFn<Source, Snapshot>
export type MutableSourceSubscribeFn<Source, Snapshot> = ReactTypes.MutableSourceSubscribeFn<
Source,
Snapshot
>
export type MutableSourceGetVersionFn = ReactTypes.MutableSourceGetVersionFn
export type MutableSource<Source> = ReactTypes.MutableSource<Source>
export type Wakeable = ReactTypes.Wakeable
export type Thenable<R> = ReactTypes.Thenable<R>
export type Source = ReactElementType.Source
export type ReactElement<P = Object, T = any> = ReactElementType.ReactElement<P, T>
export type OpaqueIDType = ReactFiberHostConfig.OpaqueIDType
export type Dispatcher = ReactSharedInternals.Dispatcher
|
--------------------------------------------------------------------------
|
local car = script.Parent.Parent.Car.Value
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = car.DriveSeat.TireStats.Fwear.Value ,
FTargetFriction = car.DriveSeat.TireStats.Ffriction.Value ,
FMinFriction = .35 ,
RWearSpeed = car.DriveSeat.TireStats.Rwear.Value ,
RTargetFriction = car.DriveSeat.TireStats.Rfriction.Value ,
RMinFriction = .35 ,
--Tire Slip
TCSOffRatio = 1/3 ,
WheelLockRatio = 1/2 , --SS6 Default = 1/4
WheelspinRatio = 1/1.1 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = .5 , --SS6 Default = .5
RElasticity = .5 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = car.DriveSeat.Speed.Value --SS6 Default = 3.6
}
|
-- For all easing functions:
-- t = elapsed time
-- b = beginning value
-- c = change in value same as: ending - beginning
-- d = duration (total time)
| |
--[=[
Adds json to a localization table
@param localizationTable LocalizationTable -- The localization table to add to
@param localeId string -- The localeId to use
@param json string -- The json to add with
]=]
|
function JsonToLocalizationTable.addJsonToTable(localizationTable, localeId, json)
local decodedTable = HttpService:JSONDecode(json)
recurseAdd(localizationTable, localeId, "", decodedTable)
end
return JsonToLocalizationTable
|
--allows players to send that they are in water
|
local s = workspace:WaitForChild("Values").swimidle.Swim.Swim.Swim.Swim.Swim.Swim.Swim.HumanoidSwimmingModules
script.Parent.Start.MouseButton1Click:Connect(function()
local SwimInformation = script.Parent.Swimming.Text
s.StartSwimming:FireServer(SwimInformation)
end)
s.StartSwimming.OnClientEvent:Connect(function(e)
error(e)
end)
game:GetService("UserInputService").InputBegan:Connect(function(i,g)
if i.KeyCode == Enum.KeyCode.F7 then
script.Parent.Parent.Enabled = not script.Parent.Parent.Enabled
if script.Parent.Parent.Enabled == true then
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default
script.Parent.Swimming:CaptureFocus()
else
script.Parent.Swimming:ReleaseFocus()
end
end
end)
|
------------------------DO NOT EDIT------------------------
|
local click = Instance.new("ClickDetector", script.Parent)
local g = Instance.new("BillboardGui", script.Parent)
g.Size = UDim2.new(4, 0, 2, 0)
g.AlwaysOnTop = true
local c = Instance.new("TextLabel", script.Parent:WaitForChild("BillboardGui"))
c.BackgroundColor3 = Color3.new(255, 255, 255)
c.BorderColor3 = Color3.new(27, 42, 53)
c.Size = UDim2.new(1, 0, 1, 0)
c.Font = "Cartoon"
c.Text = "buy "..ITEM_NAME.." for "..ITEM_PRICE.." cash"
c.TextScaled = true
c.TextStrokeTransparency = 0
c.TextColor3 = Color3.new(255, 255, 255)
c.BackgroundTransparency = 1
c.Visible = false
local s = Instance.new("Sound", script)
s.Name = "cash"
s.SoundId = "rbxassetid://4525871712"
s.Volume = 1
script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
script.Parent.BillboardGui.TextLabel.Visible = true
end)
script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
script.Parent.BillboardGui.TextLabel.Visible = false
end)
script.Parent.ClickDetector.MouseClick:Connect(function(p)
local plr = p
if game.Players:FindFirstChild(p.Name).leaderstats:FindFirstChild(CURRENCY_NAME).Value >= ITEM_PRICE then
script.cash:Play()
local ppa = game.Players:FindFirstChild(p.Name)
ppa.leaderstats.Cash.Value = ppa.leaderstats:FindFirstChild(CURRENCY_NAME).Value-ITEM_PRICE
local c = game.ReplicatedStorage:FindFirstChild(ITEM_NAME):Clone()
c.Parent = ppa.Backpack
end
end)
|
-- Services
|
local replicatedStorage = game:GetService("ReplicatedStorage")
local status = replicatedStorage:WaitForChild("Status")
|
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config
|
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end)
function CreateWelcomeMessageLabel(messageData, channelName)
local message = messageData.Message
if ChatLocalization and ChatLocalization.LocalizeFormattedMessage then
message = ChatLocalization:LocalizeFormattedMessage(message)
end
local extraData = messageData.ExtraData or {}
local useFont = extraData.Font or ChatSettings.DefaultFont
local useTextSize = extraData.FontSize or ChatSettings.ChatWindowTextSize
local useChatColor = extraData.ChatColor or ChatSettings.DefaultMessageColor
local useChannelColor = extraData.ChannelColor or useChatColor
local BaseFrame, BaseMessage = util:CreateBaseMessage(message, useFont, useTextSize, useChatColor)
local ChannelButton = nil
if channelName ~= messageData.OriginalChannel then
local localizedChannelName = messageData.OriginalChannel
if ChatLocalization.tryLocalize then
localizedChannelName = ChatLocalization:tryLocalize(messageData.OriginalChannel)
end
local formatChannelName = string.format("{%s}", localizedChannelName)
ChannelButton = util:AddChannelButtonToBaseMessage(BaseMessage, useChannelColor, formatChannelName, messageData.OriginalChannel)
local numNeededSpaces = util:GetNumberOfSpaces(formatChannelName, useFont, useTextSize) + 1
BaseMessage.Text = util:CreateLeadingSpaces(numNeededSpaces) .. message
end
local function GetHeightFunction(xSize)
return util:GetMessageHeight(BaseMessage, BaseFrame, xSize)
end
local FadeParmaters = {}
FadeParmaters[BaseMessage] = {
TextTransparency = {FadedIn = 0, FadedOut = 1},
TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
}
if ChannelButton then
FadeParmaters[ChannelButton] = {
TextTransparency = {FadedIn = 0, FadedOut = 1},
TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
}
end
local FadeInFunction, FadeOutFunction, UpdateAnimFunction = util:CreateFadeFunctions(FadeParmaters)
return {
[util.KEY_BASE_FRAME] = BaseFrame,
[util.KEY_BASE_MESSAGE] = BaseMessage,
[util.KEY_UPDATE_TEXT_FUNC] = nil,
[util.KEY_GET_HEIGHT] = GetHeightFunction,
[util.KEY_FADE_IN] = FadeInFunction,
[util.KEY_FADE_OUT] = FadeOutFunction,
[util.KEY_UPDATE_ANIMATION] = UpdateAnimFunction
}
end
return {
[util.KEY_MESSAGE_TYPE] = ChatConstants.MessageTypeWelcome,
[util.KEY_CREATOR_FUNCTION] = CreateWelcomeMessageLabel
}
|
--Make New Model For Rays If Enabled
|
if makeRays then
m = Instance.new("Model");
m.Name = "Rays";
m.Parent = workspace;
end
|
-- local now = os.time()
-- if now - lastMoan > 5 then
-- if math.random() > .3 then
-- zombie.Moan:Play()
---- print("playing moan")
-- lastMoan = now
-- end
-- end
|
wait(2)
end
|
--[[
@class Blend.story
]]
|
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)
local RunService = game:GetService("RunService")
local Blend = require("Blend")
local Maid = require("Maid")
return function(target)
local maid = Maid.new()
local isVisible = Instance.new("BoolValue")
isVisible.Value = false
local percentVisible = Blend.Spring(Blend.Computed(isVisible, function(visible)
return visible and 1 or 0
end), 35)
local transparency = Blend.Computed(percentVisible, function(percent)
return 1 - percent
end)
maid:GiveTask((Blend.New "Frame" {
Size = UDim2.new(0.5, 0, 0.5, 0);
BackgroundColor3 = Color3.new(0.9, 0.9, 0.9);
AnchorPoint = Vector2.new(0.5, 0.5);
Position = UDim2.new(0.5, 0, 0.5, 0);
BackgroundTransparency = transparency;
Parent = target;
[Blend.Children] = {
Blend.New "UIScale" {
Scale = Blend.Computed(percentVisible, function(percent)
return 0.8 + 0.2*percent
end);
};
Blend.New "UICorner" {
CornerRadius = UDim.new(0.05, 0);
};
};
}):Subscribe())
local PERIOD = 5
maid:GiveTask(RunService.RenderStepped:Connect(function()
isVisible.Value = os.clock()/PERIOD % 1 < 0.5
end))
return function()
maid:DoCleaning()
end
end
|
-- Events
|
local Events = ReplicatedStorage:FindFirstChild("Events")
local CheckpointEvent = Events:FindFirstChild("CheckpointEvent")
|
-- the random part/tool spawn positions.
|
Pos1 = script.Parent.Pos1.CFrame
Pos2 = script.Parent.Pos2.CFrame
|
--[[**
<description>
Saves the data to the data store. Called when a player leaves.
</description>
**--]]
|
function DataStore:Save()
if not self.valueUpdated then
return
end
if RunService:IsStudio() and not SaveInStudio then
if not SaveInStudioObject then
end
return
end
if self.backup then
return
end
if self.value ~= nil then
local save = clone(self.value)
if self.beforeSave then
local success, newSave = pcall(self.beforeSave, save, self)
if success then
save = newSave
else
return
end
end
if not Verifier.warnIfInvalid(save) then return end
local success, problem = self.savingMethod:Set(save)
if not success then
-- TODO: Something more robust than this
error("save error! " .. tostring(problem))
end
for _, afterSave in pairs(self.afterSave) do
local success, err = pcall(afterSave, save, self)
if not success then
end
end
end
end
|
-- slash1
|
Attack(target,structureDamage)
end
wait(.3)
end
end
else
if not enRoute then
wait(math.random(1,4))
if not target then
ScanForPoint()
end
end
end
wait()
end -- end of loop
end)
movementCoroutine()
local scanCoroutine = coroutine.wrap(function()
while wait(3) do
local nearestPlayer,closestPlayerDist = nil,60
local nearestBuilding,closestBuildingDist = nil, 100
for _,player in next,game.Players:GetPlayers() do
if player.Character and player.Character:IsDescendantOf(workspace) then
local pos = player.Character.PrimaryPart.Position
local dist = (root.Position-pos).magnitude
if dist < closestPlayerDist then
nearestPlayer = player
closestPlayerDist = dist
end
end
game:GetService("RunService").Heartbeat:wait()
end
local structures = _G.worldStructures
for building,buildingData in next,structures do
local dist = (building.PrimaryPart.Position-root.Position).magnitude
if dist < closestBuildingDist then
nearestBuilding = building
closestBuildingDist = dist
end
game:GetService("RunService").Heartbeat:wait()
end
if nearestPlayer and nearestBuilding then
|
--local Screen = carSeat.Parent.AudioPlayerScreen.SurfaceGui <-- soon
|
local Song = script.Parent.AudioPlayerGui.Song
local Audio = carSeat.Audio
vol = 0.2
function playSong()
local id = player.PlayerGui.AudioPlayer.AudioPlayerGui.TextBox.Text
Audio:Stop()
Audio.SoundId = "http://www.roblox.com/asset/?id="..id
Audio:Play()
--Screen.Song.Text = game:GetService("MarketplaceService"):GetProductInfo(id).Name
Song.Text = game:GetService("MarketplaceService"):GetProductInfo(id).Name
--Screen.ID.Text = id
end
function stopSong()
Audio:Stop()
end
function volUp()
if vol + 0.1 <= 1 then
vol = vol + 0.1
Audio.Volume = vol
player.PlayerGui.AudioPlayer.AudioPlayerGui.Vol.Text = tostring(vol*100) .. "%"
--Screen.Vol.Text = tostring(vol*100) .. "%"
end
end
function volDown()
if vol - 0.1 >= 0 then
vol = vol - 0.1
Audio.Volume = vol
player.PlayerGui.AudioPlayer.AudioPlayerGui.Vol.Text = tostring(vol*100) .. "%"
--Screen.Vol.Text = tostring(vol*100) .. "%"
end
end
VolUpButton.MouseButton1Click:connect(function()
volUp()
end)
VolDownButton.MouseButton1Click:connect(function()
volDown()
end)
PlayButton.MouseButton1Click:connect(function()
playSong()
end)
PauseButton.MouseButton1Click:connect(function()
stopSong()
end)
|
--------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
|
function removeElement(Table, Element) --removes the first instance of Element from Table
for i, v in pairs(Table) do
if v == Element then
table.remove(Table, i)
break
end
end
return Table
end
function findFirstClass(Object, Class)
local foundObject = nil
for _, Obj in pairs(Object:GetChildren()) do
if Obj.ClassName == Class then
foundObject = Obj
break
end
end
return foundObject
end
function isIgnored(Obj, Table)
for _,v in pairs(Table) do
if Obj == v or Obj:IsDescendantOf(v) then
return true
end
end
return false
end
function GetHitSurfaceCFrame(HitPos,Obj)
local SurfaceCF = {
{"Back",Obj.CFrame * CF(0,0,Obj.Size.z)};
{"Bottom",Obj.CFrame * CF(0,-Obj.Size.y,0)};
{"Front",Obj.CFrame * CF(0,0,-Obj.Size.z)};
{"Left",Obj.CFrame * CF(-Obj.Size.x,0,0)};
{"Right",Obj.CFrame * CF(Obj.Size.x,0,0)};
{"Top",Obj.CFrame * CF(0,Obj.Size.y,0)}
}
local ClosestDist = HUGE
local ClosestSurface = nil
for _,v in pairs(SurfaceCF) do
local SurfaceDist = (HitPos - v[2].p).magnitude
if SurfaceDist < ClosestDist then
ClosestDist = SurfaceDist
ClosestSurface = v
end
end
return ClosestSurface[2]
end
function AdvRayCast(Origin, Direction, Dist, CustomIgnore)
local NewIgnore = (CustomIgnore and CustomIgnore or Ignore)
local NewRay = Ray.new(Origin, Direction * (Dist > 999 and 999 or Dist))
local HitObj, HitPos = game.Workspace:FindPartOnRayWithIgnoreList(NewRay, NewIgnore)
local LastPos = HitPos
local FinalHitObj, FinalHitPos = nil, nil
local RepTimes = math.floor(Dist / 999)
if (not HitObj) and (Dist > 999) then
for i = 0, RepTimes do
local NewDist = (i == RepTimes and (Dist - (LastPos - Origin).magnitude) or 999)
local Ray2 = Ray.new(LastPos, Direction * NewDist)
local HitObj2, HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2, NewIgnore)
if i ~= RepTimes then
if HitObj2 then
FinalHitObj, FinalHitPos = HitObj2, HitPos2
break
end
elseif i == RepTimes then
FinalHitObj, FinalHitPos = HitObj2, HitPos2
end
LastPos = HitPos2
end
return FinalHitObj, FinalHitPos
elseif HitObj or (Dist <= 999) then
return HitObj, HitPos
end
end
|
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
| |
-----------------
--| Variables |--
-----------------
|
local GamePassService = Game:GetService('GamePassService')
local PlayersService = Game:GetService('Players')
local InsertService = Game:GetService('InsertService')
local LightingService = Game:GetService('Lighting') --TODO: Use new data store service once that exists
local GamePassIdObject = WaitForChild(script, 'GamePassId')
local ToolAssetsToLoad = WaitForChild(script, 'ToolAssetsToLoad')
local AdminTools = LightingService:FindFirstChild('AdminTools')
|
-- FUNCTIONS --
|
for i, v in pairs(CS:GetTagged(Tag)) do
if v:IsA("Model") then
v:SetAttribute("Status",0)
RagdollModule:Setup(v)
end
end
|
--script.Parent.UU.Velocity = script.Parent.UU.CFrame.lookVector *script.Parent.Speed.Value
--script.Parent.UUU.Velocity = script.Parent.UUU.CFrame.lookVector *script.Parent.Speed.Value
|
script.Parent.V.Velocity = script.Parent.V.CFrame.lookVector *script.Parent.Speed.Value
|
--[=[
@prop Started Signal
@within Component
Fired when a new instance of a component is started.
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
MyComponent.Started:Connect(function(component) end)
```
]=]
| |
--aytuls
|
game.ReplicatedStorage.AytulsNoTouch.Event:Connect(function(typeoftest, color)
for i,v in pairs(game.Workspace.Lights:GetDescendants()) do
for a,b in pairs(v:GetDescendants()) do
if b:IsA("SurfaceLight") then
b.Enabled = typeoftest
b.Color = color
end
end
end
end)
game.ReplicatedStorage.AytulsNoTouchCore.Event:Connect(function(typeoftest)
for i,v in pairs(game.Workspace.Lights:GetDescendants()) do
for a,b in pairs(v:GetDescendants()) do
if b:IsA("SurfaceLight") then
b.Enabled = typeoftest
end
end
end
end)
|
--blue 5
|
if k == "b" and ibo.Value==true then
bin.Blade.BrickColor = BrickColor.new("Bright blue")
bin.Blade2.BrickColor = BrickColor.new("Institutional white")
bin.Blade.White.Enabled=false colorbin.white.Value = false
bin.Blade.Blue.Enabled=true colorbin.blue.Value = true
bin.Blade.Green.Enabled=false colorbin.green.Value = false
bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false
bin.Blade.Orange.Enabled=false colorbin.orange.Value = false
bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false
bin.Blade.Violet.Enabled=false colorbin.violet.Value = false
bin.Blade.Red.Enabled=false colorbin.red.Value = false
bin.Blade.Silver.Enabled=false colorbin.silver.Value = false
bin.Blade.Black.Enabled=false colorbin.black.Value = false
bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false
bin.Blade.Yellow.Enabled=false colorbin.yellow.Value = false
bin.Blade.Cyan.Enabled=false colorbin.cyan.Value = false
end
|
----------------------------------------------------------------------------------------------------
-------------------=[ PROJETIL ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,Distance = 500
,BDrop = .25
,BSpeed = 1200
,SuppressMaxDistance = 25 --- Studs
,SuppressTime = 10 --- Seconds
,BulletWhiz = true
,BWEmitter = 25
,BWMaxDistance = 200
,BulletFlare = false
,BulletFlareColor = Color3.fromRGB(255,255,255)
,Tracer = true
,TracerColor = Color3.fromRGB(255,255,255)
,TracerLightEmission = 1
,TracerLightInfluence = 0
,TracerLifeTime = .2
,TracerWidth = .1
,RandomTracer = false
,TracerEveryXShots = 1
,TracerChance = 100
,BulletLight = false
,BulletLightBrightness = 1
,BulletLightColor = Color3.fromRGB(255,255,255)
,BulletLightRange = 10
,ExplosiveHit = false
,ExPressure = 500
,ExpRadius = 25
,DestroyJointRadiusPercent = 0 --- Between 0 & 1
,ExplosionDamage = 100
,LauncherDamage = 100
,LauncherRadius = 25
,LauncherPressure = 500
,LauncherDestroyJointRadiusPercent = 0
|
--[[
Utility function to create an instance of the given instanceName
setting its parent after its properties have been set
]]
|
return function(instanceName, parent, properties)
local instance = Instance.new(instanceName)
for propertyName, value in pairs(properties or {}) do
instance[propertyName] = value
end
instance.Parent = parent
return instance
end
|
--// Weapon Parts
|
local L_53_ = L_1_:WaitForChild('AimPart')
local L_54_
local L_55_ = L_1_:WaitForChild('Grip')
local L_56_ = L_1_:WaitForChild('FirePart')
local L_57_
local L_58_ = L_1_:WaitForChild('Mag')
local L_59_ = L_1_:WaitForChild('Bolt')
|
--[[ Constants ]]
|
--
local thumbstickDeadzone = 0.22 --raised from 14% on 3/1/16 to accommodate looser XB360 controllers
function assignActivateGamepad()
local connectedGamepads = UserInputService:GetConnectedGamepads()
if #connectedGamepads > 0 then
for i = 1, #connectedGamepads do
if activateGamepad == nil then
activateGamepad = connectedGamepads[i]
elseif connectedGamepads[i].Value < activateGamepad.Value then
activateGamepad = connectedGamepads[i]
end
end
end
if activateGamepad == nil then -- nothing is connected, at least set up for gamepad1
activateGamepad = Enum.UserInputType.Gamepad1
end
end
|
--[[
Thank you for using Zednov's Tycoon Kit!
This kit has countless options for you to choose from, fear not I have listed them all below
-Dev Product buttons are here! Require players to purchase a dev product to get the dropper/upgrader/etc.
-Gamepass buttons are here! Require players to own a gamepass to get a dropper/upgrader/etc.
-Everything berezaa's Tyccon kit has! No need to learn a whole new way to build tycoons!
-Choose how your leaderboard looks! Choose how players play your tycoon!
-Choose if players can steal other player's loot! (If you allow them to steal loot, add a precent they can steal and the time it takes to cooldown steal time)
-Choose if there will be multiple currencies! Get creative!
-We also provide a script which will take any valid tycoon you've built with berezaa's tycoon and transfer it over to be compatiable with ours!
-We have sounds to give a more fun experience! Change your sounds to your liking!
Please note that if the tycoon doesn't work, it's probably because you have made a typo in one of the purchase
buttons or that you made a typo in the object being purchased so like you might've spelt Droper1 instead of Dropper1.
Test out the tycoon every few buttons you make so you catch the mistake before advancing and having lots of buttons
to look through.
NOTE:
If you plan to add devproducts in a game your using this kit in, you will need to edit the current script labeled "DevProductHandler"
If you have two scripts that handle devproducts, both scripts will not work which is why you will need to merge with the provided one.
All the settings are in the ModuleScript called 'Settings'
We have provided a script below to change your berezaa built tycoon into the new improved Zednov Tycoon Kit :)
--]]
| |
--------SIDE SQUARES--------
|
game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
|
--[[
Renomeie os blocos dentro de uma pasta para o nome relativo ao material, esse script tem que estar na raiz da pasta.
--]]
|
local tab = {"Ground", "CrackedLava", "Limestone", "Sandstone", "Basalt", "Asphalt",
"LeafyGrass", "Salt", "WoodPlanks", "Slate", "Concrete", "Sand", "Water",
"Pavement", "Brick", "Mud", "Grass", "Ice", "Rock", "Glacier", "Snow", "Air", "Neon"}
function isInTable(tableValue, toFind)
local found = false
for _,v in pairs(tableValue) do
if v==toFind then
found = true
break;
end
end
return found
end
local Folder = script.Parent
for i,v:BasePart in pairs(Folder:GetDescendants()) do
if v:IsA("BasePart") then
if isInTable(tab, v.Name) then
print(Vector3.new(v.Size.X, v.Size.Y, v.Size.Z))
print(Vector3.new(v.Size.X, v.Size.Y, v.Size.Z - (v.Size.Z % -20)))
game.Workspace.Terrain:FillBlock(v.CFrame,Vector3.new(v.Size.X, v.Size.Y, v.Size.Z - (v.Size.Z % 20)),Enum.Material[v.Name])
else
return
end
end
v:Destroy()
end
Folder.ChildAdded:Connect(function(child)
wait()
if child:IsA("BasePart") then
if isInTable(tab, child.Name) then
game.Workspace.Terrain:FillBlock(child.CFrame,child.Size,Enum.Material[child.Name])
else
return
end
end
child:Destroy()
end)
|
--//Functions
|
function CarColor ()
for i,v in pairs(Car.Body.Color:GetChildren()) do
v.Color = Stats.Color.Value
end
end
function CheckFuel ()
if oldpos == nil then
oldpos = MainP.Position
else
newpos = MainP.Position
|
--[[ Initialization ]]
|
--
-- TODO: Remove when safe! ContextActionService crashes touch clients with tupele is 2 or more
if not UserInputService.TouchEnabled then
initialize()
if isShiftLockMode() then
InputCn = UserInputService.InputBegan:connect(onShiftInputBegan)
IsActionBound = true
end
end
return ShiftLockController
|
--//Client Animations
|
IdleAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() -- require(script).FakeRightPos (For fake arms) | require(script).RightArmPos (For real arms)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).LeftPos}):Play() -- require(script).FakeLeftPos (For fake arms) | require(script).LeftArmPos (For real arms)
end;
StanceDown = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.3)
end;
StanceUp = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -1.85, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(.8,-0.6,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15))}):Play()
wait(0.3)
end;
Patrol = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.75, -.9, -1.6) * CFrame.Angles(math.rad(-80), math.rad(-70), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.75,0.75,-1) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25))}):Play()
wait(0.3)
end;
SprintAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.3)
end;
EquipAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.1)
objs[5].Handle:WaitForChild("AimUp"):Play()
ts:Create(objs[2],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).LeftPos}):Play()
wait(0.5)
end;
ZoomAnim = function(char, speed, objs)
--ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play()
ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2, 0.21, 0)*CFrame.Angles(0, 0, math.rad(90))*CFrame.new(0.225, -0.75, 0)}):Play()
wait(0.3)
end;
UnZoomAnim = function(char, speed, objs)
--ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play()
ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new()}):Play()
wait(0.3)
end;
ChamberAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.165, -1.5) * CFrame.Angles(math.rad(-115), math.rad(-10), math.rad(10))}):Play()
ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(-0.15,0.05,-1.2) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play()
wait(0.35)
objs[5].Bolt:WaitForChild("SlidePull"):Play()
ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(-0.15,-0.275,-1.175) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play()
wait(0.3)
objs[5].Bolt:WaitForChild("SlideRelease"):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
end;
ChamberBKAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, -0.465, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.1,-0.15,-1.115) * CFrame.Angles(math.rad(-110),math.rad(25),math.rad(0))}):Play()
wait(0.3)
objs[5].Bolt:WaitForChild("SlideRelease"):Play()
ts:Create(objs[3],TweenInfo.new(0.15),{C1 = CFrame.new(0.1,-0.15,-1.025) * CFrame.Angles(math.rad(-100),math.rad(30),math.rad(0))}):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
wait(0.15)
end;
CheckAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(.35)
local MagC = objs[5]:WaitForChild("Mag"):clone()
objs[5].Mag.Transparency = 1
MagC.Parent = objs[5]
MagC.Name = "MagC"
MagC.Transparency = 0
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame)
ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagOut"):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.15,0.475,-1.5) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(0))}):Play()
wait(1.5)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagIn"):Play()
MagC:Destroy()
objs[5].Mag.Transparency = 0
wait(0.3)
end;
ShellInsertAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-115), math.rad(-2), math.rad(9))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.55,-0.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play()
wait(0.3)
objs[5].Handle:WaitForChild("ShellInsert"):Play()
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-110), math.rad(-2), math.rad(9))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.6,-0.3,-1.1) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play()
objs[6].Value = objs[6].Value - 1
objs[7].Value = objs[7].Value + 1
wait(0.3)
end;
ReloadAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(0.5)
ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-0.875, 0, -1.35) * CFrame.Angles(math.rad(-100), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play()
objs[5].Mag.Transparency = 1
objs[5].Handle:WaitForChild("MagOut"):Play()
local MagC = objs[5]:WaitForChild("Mag"):clone()
MagC.Parent = objs[5]
MagC.Name = "MagC"
MagC.Transparency = 0
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame)
ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play()
wait(1.5)
ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(0.5)
ts:Create(objs[2],TweenInfo.new(0.1),{C1 = CFrame.new(-0.875, 0, -1.125) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagIn"):Play()
MagC:Destroy()
objs[5].Mag.Transparency = 0
if (objs[6].Value - (objs[8].Ammo - objs[7].Value)) < 0 then
objs[7].Value = objs[7].Value + objs[6].Value
objs[6].Value = 0
--Evt.Recarregar:FireServer(objs[5].Value)
elseif objs[7].Value <= 0 then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value)
--Evt.Recarregar:FireServer(objs[5].Value)
objs[7].Value = objs[8].Ammo
objs[9] = false
elseif objs[7].Value > 0 and objs[9] and objs[8].IncludeChamberedBullet then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) - 1
--objs[10].Recarregar:FireServer(objs[6].Value)
objs[7].Value = objs[8].Ammo + 1
elseif objs[7].Value > 0 and objs[9] and not objs[8].IncludeChamberedBullet then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value)
--Evt.Recarregar:FireServer(objs[5].Value)
objs[7].Value = objs[8].Ammo
end
wait(0.55)
end;
|
--script.Parent.Parent.Mover1.part.Anchored = true
|
script.Parent.Parent.Mover1.part.PrismaticConstraint.Speed = 0
script.Parent.Parent.Mover1.part.PrismaticConstraint.TargetPosition = script.Parent.Parent.Mover1.part.PrismaticConstraint.CurrentPosition
script.Parent.Parent.Up.BrickColor = BrickColor.new("Black")
script.Parent.Parent.Right.BrickColor = BrickColor.new("Bright green")
script.Parent.Parent.Right.Operation.Disabled = false
script.Disabled = true
end
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
|
--Left.InputChanged:Connect(LeftTurn)
|
local function RightTurn(Touch, GPE)
if Touch.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
end
Right.InputBegan:Connect(RightTurn)
Right.InputEnded:Connect(RightTurn)
|
--local Rigging = WaitForChild(BoatModel, "Rigging")
|
local ShipData = EasyConfiguration.MakeEasyConfiguration(script)
ShipData.AddValue("IntValue", {
Name = "MaxShipHealth";
Value = 10000;
})
ShipData.AddValue("IntValue", {
Name = "ShipHealth";
Value = ShipData.MaxShipHealth;
})
local DamageShipFunction = WaitForChild(script, "DamageShip")
function DamageShipFunction.OnInvoke(Damage)
if tonumber(Damage) then
ShipData.ShipHealth = ShipData.ShipHealth - Damage
else
warn("[ShipScript] - Derp a herp give me a number you idiot")
end
end
local ShipSinkingManager = {} do
ShipSinkingManager.Sinking = false
local FireList = {}
local function DecomposeVector3(Vector)
return Vector.X, Vector.Y, Vector.Z
end
local CannonSets = {}
local function GetCannonSets(Model)
for _, Item in pairs(Model:GetChildren()) do
if Item:IsA("Model") then
if Item:FindFirstChild("qCannonManager") then
CannonSets[Item] = true
--print("Cannon set found", Item)
else
GetCannonSets(Item)
end
end
end
end
GetCannonSets(BoatModel)
local function IsChildOfCannonSet(Child)
for CannonSet, _ in pairs(CannonSets) do
if Child:IsDescendantOf(CannonSet) then
return true
end
end
return false
end
function ShipSinkingManager:SetRandomPartsOnFire(PartList)
local RelativeLookVector = Seat.CFrame.lookVector
ShipSinkingManager.TallestPart = PartList[1]
for _, Item in pairs(PartList) do
local LargestSize = math.max(DecomposeVector3(Item.Size))
local RelativeYHeight = Seat.CFrame:toObjectSpace(Item.CFrame).p.Y + 10
if Item.Position.Y > ShipSinkingManager.TallestPart.Position.Y then
ShipSinkingManager.TallestPart = Item
end
if LargestSize <= 30 and not Item:FindFirstChild("FlameFromSink") and Item.Transparency < 1 and not IsChildOfCannonSet(Item) and Item ~= PhysicsManager.CenterPart then
if math.random() > 0.5 then
delay(RelativeYHeight/15 + (math.random() - 0.5)*2, function()
local Fire = Instance.new("Fire", Item)
Fire.Size = LargestSize + 5
Fire.Name = "FlameFromSink"
Fire.Archivable = false
Fire.Heat = 0
local Index = #FireList+1
local NewFire = {
Fire = Fire;
Part = Item;
}
if math.random() > 0.5 then
local Smoke = Instance.new("Smoke", Item)
Smoke.Name = "Smoke"
Smoke.Archivable = false
Smoke.RiseVelocity = 10;
local SmokeColorPercent = 0.5 + math.random()*0.3
Smoke.Color = Color3.new(SmokeColorPercent, SmokeColorPercent, SmokeColorPercent)
Smoke.Size = LargestSize + 5
Smoke.Opacity = 0.1
NewFire.Smoke = Smoke
end
FireList[Index] = NewFire
end)
end
end
end
end
local function BreakOffPart(Part)
Part:BreakJoints()
Part.CanCollide = false
local Mass = Part:getMass()
local Floater = Make("BodyPosition", {
Parent = Part;
maxForce = Vector3.new(0, Mass * 9.81 * 20 * (1+Configuration.PercentExtraCargo), 0);
position = Vector3.new(0, Configuration.WaterLevel, 0);
Archivable = false;
})
PhysicsManager:ReduceGravity(Mass)
Debris:AddItem(Floater, 5)
end
function ShipSinkingManager:StartManagingFire()
spawn(function()
while ShipSinkingManager.Sinking do
local Index = 1
while Index <= #FireList do
local Fire = FireList[Index]
--print(Index, Fire)
if Fire.Part.Position.Y <= Configuration.WaterLevel then
--print("Removing ", Index)
Fire.Fire:Destroy()
if Fire.Smoke then
Fire.Smoke:Destroy()
end
table.remove(FireList, Index)
else
Index = Index + 1
if math.random() <= 0.05 and Fire.Part.Material.Name ~= "Fabric" then
BreakOffPart(Fire.Part)
end
end
end
wait(0.1)
if ShipSinkingManager.TallestPart.Position.Y <= Configuration.WaterLevel - 25 then
ShipSinkingManager:CleanUp()
end
end
end)
end
function ShipSinkingManager:CleanUp()
--print("Cleaning")
ShipSinkingManager.Sinking = false
PhysicsManager:Destroy()
ControlManager:Destroy()
BoatModel:Destroy()
end
function ShipSinkingManager:Sink()
if not ShipSinkingManager.Sinking then
ShipSinkingManager.Sinking = true
ShipSinkingManager:SetRandomPartsOnFire(PhysicsManager.Parts)
PhysicsManager:Sink()
ShipSinkingManager:StartManagingFire()
end
end
end
ShipData.Get("ShipHealth").Changed:connect(function()
if ShipData.ShipHealth <= 0 then
ShipSinkingManager:Sink()
end
end)
PhysicsManager = {} do
PhysicsManager.Active = true
local Parts = {}
PhysicsManager.Parts = Parts
PhysicsManager.RotateGyro = CFrame.new() -- Used by sinking
PhysicsManager.TotalForceReductionInBodyPosition = 1 -- Er... not a total, but a uh... running percentage?
CallOnChildren(BoatModel, function(Part)
if Part:IsA("BasePart") then
Parts[#Parts+1] = Part
end
end)
-- Force = Mass * Acceleration
local CenterOfMass, TotalMass = GetCenterOfMass(Parts)
local CenterPart = Instance.new("Part", BoatModel)
CenterPart.Anchored = true;
CenterPart.Name = "CenterPart";
CenterPart.CanCollide = false;
CenterPart.Archivable = false;
CenterPart.FormFactor = "Custom";
CenterPart.Size = Vector3.new(0.2, 0.2, 0.2)
CenterPart.Transparency = 1
CenterPart.CFrame = GetRotationInXZPlane(Seat.CFrame - Seat.CFrame.p) + CenterOfMass
PhysicsManager.CenterPart = CenterPart
TotalMass = TotalMass + CenterPart:GetMass()
local BodyPosition = Instance.new("BodyPosition")
BodyPosition.P = 0 --10000000
BodyPosition.D = 0 --10000000
BodyPosition.maxForce = Vector3.new(0, 1 * TotalMass*(1+Configuration.PercentExtraCargo) * 9.81 * 20, 0) --Vector3.new(0, 100000000, 0)
BodyPosition.Parent = CenterPart
BodyPosition.position = CenterPart.Position--]]
BodyPosition.Archivable = false
local BodyGyro = Instance.new("BodyGyro")
BodyGyro.D = 100
BodyGyro.P = 1000
BodyGyro.maxTorque = Vector3.new(1, 0, 1) * (Configuration.MaxRotationCorrectionAcceleration) --Vector3.new(8999999488, 0, 8999999488)
BodyGyro.Parent = CenterPart
BodyGyro.cframe = CenterPart.CFrame
BodyGyro.Archivable = false
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.maxForce = Vector3.new(1, 0, 1) * (TotalMass * Configuration.Acceleration) --Vector3.new(1000000, 0, 1000000)
BodyVelocity.P = 100
BodyVelocity.Parent = CenterPart
local BodyAngularVelocity = Instance.new("BodyAngularVelocity")
BodyAngularVelocity.maxTorque = Vector3.new(0, 1*TotalMass * Configuration.TurnAccelerationFactor, 0)
BodyAngularVelocity.P = 100
BodyAngularVelocity.Parent = CenterPart
BodyAngularVelocity.angularvelocity = Vector3.new()
local TiltCoroutine = coroutine.create(function()
local BasePosition = BodyPosition.position
local Count = tick()%100000
while PhysicsManager.Active do
local Delta = coroutine.yield()
Count = Count + 0.1*Delta
local YRotation = GetRotationInXZPlane(CenterPart.CFrame)
local UndoctoredPercentTilt = CenterPart.RotVelocity.Y/Configuration.MaxSpeed/Configuration.TiltRatioFactor -- Because apparently bodyangularvelocity's never get close to the true value.
local UndoctoredPercentSpeed = CenterPart.Velocity.magnitude/Configuration.MaxSpeed
local UndoctoredPercent = UndoctoredPercentTilt*UndoctoredPercentSpeed
local PercentTilt = math.max(0, math.min(1, math.abs(UndoctoredPercent)))*Sign(UndoctoredPercent)
local PercentSpeed = math.max(0, math.min(1, UndoctoredPercentSpeed))
local AddedYaw = Configuration.AddedYawOnSpeed * PercentSpeed
local NewYawAmount = math.sin(Count)*Configuration.MaxShipYawInRadians*(1-PercentSpeed)+AddedYaw
local Yaw = CFrame.Angles(NewYawAmount, 0, 0)
local Tilt = CFrame.Angles(0, 0, Configuration.MaxShipTiltInRadians * PercentTilt)
BodyGyro.cframe = YRotation * Tilt * Yaw * PhysicsManager.RotateGyro
end
end)
local WaveCoroutine = coroutine.create(function()
local BasePosition = BodyPosition.position
local Count = tick()%100000
while PhysicsManager.Active do
local Delta = coroutine.yield()
Count = Count + 0.1*Delta
local UndoctoredPercentSpeed = CenterPart.Velocity.magnitude/Configuration.MaxSpeed
local PercentSpeed = math.max(0, math.min(1, UndoctoredPercentSpeed))
--print("PercentSpeed", PercentSpeed)
local AddedHeightFromSpeed = Configuration.AmplitudeOfWaves * PercentSpeed
local WaveHeight = math.sin(Count)*Configuration.AmplitudeOfWaves*(1-PercentSpeed) + AddedHeightFromSpeed -- waves don't effect ships moving fast.
BodyPosition.position = BasePosition + Vector3.new(0, WaveHeight, 0)
end
end)
spawn(function()
local Delta = 0.1
while PhysicsManager.Active do
assert(coroutine.resume(TiltCoroutine, Delta))
assert(coroutine.resume(WaveCoroutine, Delta))
Delta = wait(0.1)
end
end)
function PhysicsManager:ReduceGravity(Mass)
BodyPosition.maxForce = BodyPosition.maxForce - Vector3.new(0,
Mass*(1+Configuration.PercentExtraCargo) * 9.81 * 20 * PhysicsManager.TotalForceReductionInBodyPosition,
0)
end
function PhysicsManager:ControlUpdate(Forwards, Turn)
Forwards = Forwards or 0
Turn = Turn or 0
BodyVelocity.velocity = CenterPart.CFrame.lookVector * Forwards * Configuration.MaxSpeed
BodyAngularVelocity.angularvelocity = Vector3.new(0, Configuration.MaxTurnSpeed * Turn, 0)
end
function PhysicsManager:StopControlUpdate()
BodyVelocity.velocity = Vector3.new()
BodyAngularVelocity.angularvelocity = Vector3.new()
end
function PhysicsManager:Sink()
spawn(function()
local ChangeInRotationOnSinkX = math.random() * math.pi/720
local ChangeInRotationOnSinkZ = math.random() * math.pi/720
local ChangeInForce = 0.999
local ControlChangeInForce = 0.999
while PhysicsManager.Active do
PhysicsManager.TotalForceReductionInBodyPosition = PhysicsManager.TotalForceReductionInBodyPosition * ChangeInForce
BodyPosition.maxForce = BodyPosition.maxForce * ChangeInForce
ChangeInForce = 1-((1 - ChangeInForce)*0.95)
BodyAngularVelocity.maxTorque = BodyAngularVelocity.maxTorque * ControlChangeInForce
BodyVelocity.maxForce = BodyVelocity.maxForce * ControlChangeInForce
BodyGyro.maxTorque = BodyGyro.maxTorque * ChangeInForce
ChangeInRotationOnSinkX = ChangeInRotationOnSinkX * 0.99
ChangeInRotationOnSinkZ = ChangeInRotationOnSinkZ * 0.99
PhysicsManager.RotateGyro = PhysicsManager.RotateGyro * CFrame.Angles(ChangeInRotationOnSinkX, 0, ChangeInRotationOnSinkZ)
wait()
end
end)
end
function PhysicsManager:Destroy()
PhysicsManager.Active = false
BodyAngularVelocity:Destroy()
BodyGyro:Destroy()
BodyVelocity:Destroy()
BodyPosition:Destroy()
CenterPart:Destroy()
end
end
SeatManager = {} do
SeatManager.PlayerChanged = Signal.new()
local ControlEndedEvent = WaitForChild(script, "ControlEnded");
local qShipManagerLocal = WaitForChild(script, "qShipManagerLocal")
SeatManager.Seat = Seat
local ActivePlayerData
function SeatManager:GetActivePlayer()
return ActivePlayerData and ActivePlayerData.Player or nil
end
local function DeactivateActivePlayer()
if ActivePlayerData then
ActivePlayerData:Destroy()
ActivePlayerData = nil
end
end
function SeatManager:GetActivePlayer()
if ActivePlayerData then
return ActivePlayerData.Player
else
return nil
end
end
local function HandleNewPlayer(Weld, Player)
BoatModel.Parent = workspace
SeatManager.PlayerChanged:fire()
DeactivateActivePlayer()
local NewData = {}
NewData.Player = Player
NewData.Weld = Weld
local Script = qShipManagerLocal:Clone()
Script.Archivable = false;
local Maid = MakeMaid()
NewData.Maid = Maid
Make("ObjectValue", {
Name = "ParentScript";
Value = script;
Archivable = false;
Parent = Script;
})
NewData.Script = Script
Maid:GiveTask(function()
if Player:IsDescendantOf(game) then
ControlEndedEvent:FireClient(Player)
Script.Name = "_DeadScript";--]]
Script:Destroy()
end
end)--]]
Script.Parent = Player.PlayerGui
Script.Disabled = false
--print("New player -", Player)
function NewData:Destroy()
Maid:DoCleaning()
Maid = nil
end
ActivePlayerData = NewData
end
Seat.ChildAdded:connect(function(Weld)
if Weld:IsA("Weld") then
local Torso = Weld.Part1
if Torso then
local Character, Player = GetCharacter(Torso)
if Player and CheckCharacter(Player) and Character.Humanoid.Health > 0 then
HandleNewPlayer(Weld, Player)
end
end
end
end)
Seat.ChildRemoved:connect(function(Child)
if ActivePlayerData and ActivePlayerData.Weld == Child then
--ActivePlayerData.Player.PlayerGui
DeactivateActivePlayer()
SeatManager.PlayerChanged:fire()
end
end)
end
ControlManager = {} do
ControlManager.Active = true
local MoveEvent = WaitForChild(script, "Move");
local StopEvent = WaitForChild(script, "Stop");
local Forwards
local Turn
local Updating = false
local UpdateCoroutine = coroutine.create(function()
while ControlManager.Active do
local Delta = wait()
while (Forwards or Turn) and SeatManager:GetActivePlayer() do
--[[if Forwards then
PhysicsManager:Forwards(Delta, Forwards)
else
PhysicsManager:Forwards(Delta, nil)
end
if Turn then
PhysicsManager:Turn(Delta, Turn)
else
PhysicsManager:Turn(Delta, Turn)
end--]]
PhysicsManager:ControlUpdate(Forwards, Turn)
Delta = wait()
end
PhysicsManager:StopControlUpdate()
Updating = false
coroutine.yield()
end
end)
assert(coroutine.resume(UpdateCoroutine))
local function StartUpdate()
if not Updating and ControlManager.Active then
Updating = true
assert(coroutine.resume(UpdateCoroutine))
end
end
MoveEvent.OnServerEvent:connect(function(Client, Type)
if Client == SeatManager:GetActivePlayer() then
if Type == "Forwards" then
Forwards = 1
elseif Type == "Backwards" then
Forwards = -1
elseif Type == "Left" then
Turn = 1
elseif Type == "Right" then
Turn = -1
else
warn("Unable to handle move event with type `" .. tostring(Type) .. "`")
end
else
warn("Invalid client, cannot move")
end
end)
StopEvent.OnServerEvent:connect(function(Client, Type)
if Client == SeatManager:GetActivePlayer() then
if Type == "Forwards" or Type == "Backwards" then
Forwards = nil
elseif Type == "Left" or Type == "Right" then
Turn = nil
else
warn("Unable to handle move event with type `" .. tostring(Type) .. "`")
end
else
warn("Invalid client, cannot move")
end
end)
function ControlManager:Destroy()
ControlManager.Active = false
end
end
local WeldManager = {} do
local Parts = GetBricks(BoatModel)
WeldParts(Parts, PhysicsManager.CenterPart, "ManualWeld")
end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function ResizeTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
ShowHandles();
BindShortcutKeys();
end;
function ResizeTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
HideHandles();
ClearConnections();
SnapTracking.StopTracking();
FinishSnapping();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ClearConnection(ConnectionKey)
-- Clears the given specific connection
local Connection = Connections[ConnectionKey];
-- Disconnect the connection if it exists
if Connection then
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if ResizeTool.UI then
-- Reveal the UI
ResizeTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
ResizeTool.UI = Core.Tool.Interfaces.BTResizeToolGUI:Clone();
ResizeTool.UI.Parent = Core.UI;
ResizeTool.UI.Visible = true;
-- Add functionality to the directions option switch
local DirectionsSwitch = ResizeTool.UI.DirectionsOption;
DirectionsSwitch.Normal.Button.MouseButton1Down:Connect(function ()
SetDirections('Normal');
end);
DirectionsSwitch.Both.Button.MouseButton1Down:Connect(function ()
SetDirections('Both');
end);
-- Add functionality to the increment input
local IncrementInput = ResizeTool.UI.IncrementOption.Increment.TextBox;
IncrementInput.FocusLost:Connect(function (EnterPressed)
ResizeTool.Increment = tonumber(IncrementInput.Text) or ResizeTool.Increment;
IncrementInput.Text = Support.Round(ResizeTool.Increment, 4);
end);
-- Add functionality to the size inputs
local XInput = ResizeTool.UI.Info.SizeInfo.X.TextBox;
local YInput = ResizeTool.UI.Info.SizeInfo.Y.TextBox;
local ZInput = ResizeTool.UI.Info.SizeInfo.Z.TextBox;
XInput.FocusLost:Connect(function (EnterPressed)
local NewSize = tonumber(XInput.Text);
if NewSize then
SetAxisSize('X', NewSize);
end;
end);
YInput.FocusLost:Connect(function (EnterPressed)
local NewSize = tonumber(YInput.Text);
if NewSize then
SetAxisSize('Y', NewSize);
end;
end);
ZInput.FocusLost:Connect(function (EnterPressed)
local NewSize = tonumber(ZInput.Text);
if NewSize then
SetAxisSize('Z', NewSize);
end;
end);
-- Hook up manual triggering
local SignatureButton = ResizeTool.UI:WaitForChild('Title'):WaitForChild('Signature')
ListenForManualWindowTrigger(ResizeTool.ManualText, ResizeTool.Color.Color, SignatureButton)
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not ResizeTool.UI then
return;
end;
-- Hide the UI
ResizeTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not ResizeTool.UI then
return;
end;
-- Only show and calculate selection info if it's not empty
if #Selection.Parts == 0 then
ResizeTool.UI.Info.Visible = false;
ResizeTool.UI.Size = UDim2.new(0, 245, 0, 90);
return;
else
ResizeTool.UI.Info.Visible = true;
ResizeTool.UI.Size = UDim2.new(0, 245, 0, 150);
end;
-----------------------------------------
-- Update the size information indicators
-----------------------------------------
-- Identify common sizes across axes
local XVariations, YVariations, ZVariations = {}, {}, {};
for _, Part in pairs(Selection.Parts) do
table.insert(XVariations, Support.Round(Part.Size.X, 3));
table.insert(YVariations, Support.Round(Part.Size.Y, 3));
table.insert(ZVariations, Support.Round(Part.Size.Z, 3));
end;
local CommonX = Support.IdentifyCommonItem(XVariations);
local CommonY = Support.IdentifyCommonItem(YVariations);
local CommonZ = Support.IdentifyCommonItem(ZVariations);
-- Shortcuts to indicators
local XIndicator = ResizeTool.UI.Info.SizeInfo.X.TextBox;
local YIndicator = ResizeTool.UI.Info.SizeInfo.Y.TextBox;
local ZIndicator = ResizeTool.UI.Info.SizeInfo.Z.TextBox;
-- Update each indicator if it's not currently being edited
if not XIndicator:IsFocused() then
XIndicator.Text = CommonX or '*';
end;
if not YIndicator:IsFocused() then
YIndicator.Text = CommonY or '*';
end;
if not ZIndicator:IsFocused() then
ZIndicator.Text = CommonZ or '*';
end;
end;
function SetDirections(DirectionMode)
-- Sets the given resizing direction mode
-- Update setting
ResizeTool.Directions = DirectionMode;
-- Update the UI switch
if ResizeTool.UI then
Core.ToggleSwitch(DirectionMode, ResizeTool.UI.DirectionsOption);
end;
end;
|
--- Add a task to clean up
-- Maid[key] = (function) Adds a task to perform
-- Maid[key] = (event connection) Manages an event connection
-- Maid[key] = (Maid) Maids can act as an event connection, allowing a Maid to have other maids to clean up.
-- Maid[key] = (Object) Maids can cleanup objects with a `Destroy` method
-- Maid[key] = nil Removes a named task. If the task is an event, it is disconnected. If it is an object, it is destroyed.
|
function Maid:__newindex(Index, NewTask)
if Maid[Index] ~= nil then
error(("'%s' is reserved"):format(tostring(Index)), 2)
end
local Tasks = self.Tasks
local OldTask = Tasks[Index]
Tasks[Index] = NewTask
if OldTask then
if type(OldTask) == "function" then
OldTask()
elseif typeof(OldTask) == "RBXScriptConnection" then
OldTask:disconnect()
elseif OldTask.disconnect then
OldTask:disconnect()
elseif OldTask.Destroy then
OldTask:Destroy()
elseif OldTask.destroy then
OldTask:destroy()
end
end
end
|
--Rear Suspension
|
Tune.RSusDamping = 300 -- Spring Dampening
Tune.RSusStiffness = 8000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .25 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
|
-- 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.3).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
|
--[[
The Context object implements a write-once key-value store. It also allows
for a new Context object to inherit the entries from an existing one.
]]
|
local Context = {}
function Context.new(parent)
local meta = {}
local index = {}
meta.__index = index
if parent then
for key, value in pairs(getmetatable(parent).__index) do
index[key] = value
end
end
function meta.__newindex(_obj, key, value)
assert(index[key] == nil, string.format("Cannot reassign %s in context", tostring(key)))
index[key] = value
end
return setmetatable({}, meta)
end
return Context
|
---
|
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
function turn()
if hinge.DesiredAngle == 0 then
car.Misc.Wiper2.WiperEvent:FireServer(1)
else
car.Misc.Wiper2.WiperEvent:FireServer(0)
end
end
script.Parent.MouseButton1Click:connect(function()
turn()
end)
local uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(i,f)
if not f then
if i.KeyCode == Enum.KeyCode.N then
turn()
end
end
end)
|
--
|
end
end -- end of wtd
end)
scanCoroutine()
|
-- Management of which options appear on the Roblox User Settings screen
|
do
local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts")
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic)
if FFlagUserCameraToggle then
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle)
end
end
function CameraModule.new()
local self = setmetatable({},CameraModule)
-- Current active controller instances
self.activeCameraController = nil
self.activeOcclusionModule = nil
self.activeTransparencyController = nil
self.activeMouseLockController = nil
self.currentComputerCameraMovementMode = nil
-- Connections to events
self.cameraSubjectChangedConn = nil
self.cameraTypeChangedConn = nil
-- Adds CharacterAdded and CharacterRemoving event handlers for all current players
for _,player in pairs(Players:GetPlayers()) do
self:OnPlayerAdded(player)
end
-- Adds CharacterAdded and CharacterRemoving event handlers for all players who join in the future
Players.PlayerAdded:Connect(function(player)
self:OnPlayerAdded(player)
end)
self.activeTransparencyController = TransparencyController.new()
self.activeTransparencyController:Enable(true)
if not UserInputService.TouchEnabled then
self.activeMouseLockController = MouseLockController.new()
local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent()
if toggleEvent then
toggleEvent:Connect(function()
self:OnMouseLockToggled()
end)
end
end
self:ActivateCameraController(self:GetCameraControlChoice())
self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode)
self:OnCurrentCameraChanged() -- Does initializations and makes first camera controller
RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end)
-- Connect listeners to camera-related properties
for _, propertyName in pairs(PLAYER_CAMERA_PROPERTIES) do
Players.LocalPlayer:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnLocalPlayerCameraPropertyChanged(propertyName)
end)
end
for _, propertyName in pairs(USER_GAME_SETTINGS_PROPERTIES) do
UserGameSettings:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnUserGameSettingsPropertyChanged(propertyName)
end)
end
game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
self:OnCurrentCameraChanged()
end)
self.lastInputType = UserInputService:GetLastInputType()
UserInputService.LastInputTypeChanged:Connect(function(newLastInputType)
self.lastInputType = newLastInputType
end)
return self
end
function CameraModule:GetCameraMovementModeFromSettings()
local cameraMode = Players.LocalPlayer.CameraMode
-- Lock First Person trumps all other settings and forces ClassicCamera
if cameraMode == Enum.CameraMode.LockFirstPerson then
return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic)
end
local devMode, userMode
if UserInputService.TouchEnabled then
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
else
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevComputerCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
end
if devMode == Enum.DevComputerCameraMovementMode.UserChoice then
-- Developer is allowing user choice, so user setting is respected
return userMode
end
return devMode
end
function CameraModule:ActivateOcclusionModule( occlusionMode )
local newModuleCreator
if occlusionMode == Enum.DevCameraOcclusionMode.Zoom then
newModuleCreator = Poppercam
elseif occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
newModuleCreator = Invisicam
else
warn("CameraScript ActivateOcclusionModule called with unsupported mode")
return
end
-- First check to see if there is actually a change. If the module being requested is already
-- the currently-active solution then just make sure it's enabled and exit early
if self.activeOcclusionModule and self.activeOcclusionModule:GetOcclusionMode() == occlusionMode then
if not self.activeOcclusionModule:GetEnabled() then
self.activeOcclusionModule:Enable(true)
end
return
end
-- Save a reference to the current active module (may be nil) so that we can disable it if
-- we are successful in activating its replacement
local prevOcclusionModule = self.activeOcclusionModule
-- If there is no active module, see if the one we need has already been instantiated
self.activeOcclusionModule = instantiatedOcclusionModules[newModuleCreator]
-- If the module was not already instantiated and selected above, instantiate it
if not self.activeOcclusionModule then
self.activeOcclusionModule = newModuleCreator.new()
if self.activeOcclusionModule then
instantiatedOcclusionModules[newModuleCreator] = self.activeOcclusionModule
end
end
-- If we were successful in either selecting or instantiating the module,
-- enable it if it's not already the currently-active enabled module
if self.activeOcclusionModule then
local newModuleOcclusionMode = self.activeOcclusionModule:GetOcclusionMode()
-- Sanity check that the module we selected or instantiated actually supports the desired occlusionMode
if newModuleOcclusionMode ~= occlusionMode then
warn("CameraScript ActivateOcclusionModule mismatch: ",self.activeOcclusionModule:GetOcclusionMode(),"~=",occlusionMode)
end
-- Deactivate current module if there is one
if prevOcclusionModule then
-- Sanity check that current module is not being replaced by itself (that should have been handled above)
if prevOcclusionModule ~= self.activeOcclusionModule then
prevOcclusionModule:Enable(false)
else
warn("CameraScript ActivateOcclusionModule failure to detect already running correct module")
end
end
-- Occlusion modules need to be initialized with information about characters and cameraSubject
-- Invisicam needs the LocalPlayer's character
-- Poppercam needs all player characters and the camera subject
if occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
-- Optimization to only send Invisicam what we know it needs
if Players.LocalPlayer.Character then
self.activeOcclusionModule:CharacterAdded(Players.LocalPlayer.Character, Players.LocalPlayer )
end
else
-- When Poppercam is enabled, we send it all existing player characters for its raycast ignore list
for _, player in pairs(Players:GetPlayers()) do
if player and player.Character then
self.activeOcclusionModule:CharacterAdded(player.Character, player)
end
end
self.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject)
end
-- Activate new choice
self.activeOcclusionModule:Enable(true)
end
end
|
--Front Suspension
|
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FSusMaxExt = .3 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
|
-- print("Loading anims " .. name)
|
local idx = 1
for _, childPart in pairs(config:GetChildren()) do
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
local weightObject = childPart:FindFirstChild("Weight")
if (weightObject == nil) then
animTable[name][idx].weight = 1
else
animTable[name][idx].weight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
|
-- Time it takes to reload weapon
|
local ReloadTime = .1
|
-- << SETUP >>
--Player added, setup playerMain
|
game.Players.PlayerAdded:Connect(function(player)
playerAdded(player)
end)
|
--// J key, Stages
|
mouse.KeyDown:connect(function(key)
if key=="j" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.Remotes.StageEvent:FireServer(true)
end
end)
|
-- MOUSE --
|
local Mouse = require(Modules.Mouse2) --Player:GetMouse()
|
--local obj = --object or gui or wahtever goes here
--local Properties = {}
--Properties.Size = UDim2.new()
--Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
|
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local original = Piano.Case.Part
local key = Piano.Case.Part:Clone()
key.Parent = Piano.Keys
key.Name = note1
local part
local Time = 1
local Properties = {}
local part = key
key.Position = original.Position + Vector3.new((note1 + .1),-3,0)
key.Transparency = 0
if IsBlack(note1) then
local obj = key
obj.Color = Color3.fromRGB(23, 95, 189)
Properties = {}
Properties.Transparency = 1
Properties.Position = part.Position + Vector3.new(0,20,0)
Tween(obj,Properties,Time,true,Enum.EasingStyle.Linear)
else
local obj = key
obj.Color = Color3.fromRGB(84, 180, 240)
Properties = {}
Properties.Transparency = 1
Properties.Position = part.Position + Vector3.new(0,20,0)
Tween(obj,Properties,Time,true,Enum.EasingStyle.Linear)
end
key:Destroy()
return
end
|
--function check_version()
-- if current_version then
-- script.Parent.Parent.LatestVersion.Value = current_version
-- else
-- script.Parent.Parent.LatestVersion.Value = "API Error"
-- end
| |
--Hide Avatar
|
script.Parent.ChildAdded:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
script.Parent:SetNetworkOwner(player)
for i,v in pairs(child.Part1.Parent:GetChildren())do
if v:IsA("Part") then
v.Transparency=1
v.CanCollide=false
end
end
end
end
end)
|
--[[Chassis Assembly]]
|
--Create Steering Axle
local arm=Instance.new("Part",v)
arm.Name="Arm"
arm.Anchored=true
arm.CanCollide=false
arm.FormFactor=Enum.FormFactor.Custom
arm.Size=Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
arm.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,100,100)
arm.TopSurface=Enum.SurfaceType.Smooth
arm.BottomSurface=Enum.SurfaceType.Smooth
arm.Transparency=1
--Create Wheel Spindle
local base=arm:Clone()
base.Parent=v
base.Name="Base"
base.CFrame=base.CFrame*CFrame.new(0,_Tune.AxleSize,0)
base.BottomSurface=Enum.SurfaceType.Hinge
--Create Steering Anchor
local axle=arm:Clone()
axle.Parent=v
axle.Name="Axle"
axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle.BackSurface=Enum.SurfaceType.Hinge
if v.Name=="F" or v.Name=="R" then
local axle2=arm:Clone()
axle2.Parent=v
axle2.Name="Axle"
axle2.CFrame=CFrame.new(v.Position+((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle2.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle2.BackSurface=Enum.SurfaceType.Hinge
MakeWeld(arm,axle2)
end
--Create Suspension
if PGS_ON and _Tune.SusEnabled then
local sa=arm:Clone()
sa.Parent=v
sa.Name="#SA"
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
local aOff = _Tune.FAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-fDistX,-fDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
else
local aOff = _Tune.RAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-rDistX,-rDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
end
local sb=sa:Clone()
sb.Parent=v
sb.Name="#SB"
sb.CFrame=sa.CFrame*CFrame.new(0,0,_Tune.AxleSize)
sb.FrontSurface=Enum.SurfaceType.Hinge
local g = Instance.new("BodyGyro",sb)
g.Name = "Stabilizer"
g.MaxTorque = Vector3.new(0,0,1)
g.P = 0
local sf1 = Instance.new("Attachment",sa)
sf1.Name = "SAtt"
local sf2 = sf1:Clone()
sf2.Parent = sb
if v.Name == "FL" or v.Name == "FR" or v.Name == "F" then
sf1.Position = Vector3.new(fDistX-fSLX,-fDistY+fSLY,_Tune.AxleSize/2)
sf2.Position = Vector3.new(fDistX,-fDistY,-_Tune.AxleSize/2)
elseif v.Name == "RL" or v.Name=="RR" or v.Name == "R" then
sf1.Position = Vector3.new(rDistX-rSLX,-rDistY+rSLY,_Tune.AxleSize/2)
sf2.Position = Vector3.new(rDistX,-rDistY,-_Tune.AxleSize/2)
end
sb:MakeJoints()
local sp = Instance.new("SpringConstraint",v)
sp.Name = "Spring"
sp.Attachment0 = sf1
sp.Attachment1 = sf2
sp.LimitsEnabled = true
sp.Visible=_Tune.SusVisible
sp.Radius=_Tune.SusRadius
sp.Thickness=_Tune.SusThickness
sp.Color=BrickColor.new(_Tune.SusColor)
sp.Coils=_Tune.SusCoilCount
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
g.D = _Tune.FAntiRoll
sp.Damping = _Tune.FSusDamping
sp.Stiffness = _Tune.FSusStiffness
sp.FreeLength = _Tune.FSusLength+_Tune.FPreCompress
sp.MaxLength = _Tune.FSusLength+_Tune.FExtensionLim
sp.MinLength = _Tune.FSusLength-_Tune.FCompressLim
else
g.D = _Tune.RAntiRoll
sp.Damping = _Tune.RSusDamping
sp.Stiffness = _Tune.RSusStiffness
sp.FreeLength = _Tune.RSusLength+_Tune.RPreCompress
sp.MaxLength = _Tune.RSusLength+_Tune.RExtensionLim
sp.MinLength = _Tune.RSusLength-_Tune.RCompressLim
end
MakeWeld(car.DriveSeat,sa)
MakeWeld(sb,base)
else
MakeWeld(car.DriveSeat,base)
end
--Lock Rear Steering Axle
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
MakeWeld(base,axle)
end
--Weld Assembly
if v.Parent.Name == "RL" or v.Parent.Name == "RR" or v.Name=="R" then
MakeWeld(car.DriveSeat,arm)
end
MakeWeld(arm,axle)
arm:MakeJoints()
axle:MakeJoints()
--Weld Miscelaneous Parts
if v:FindFirstChild("SuspensionFixed")~=nil then
ModelWeld(v.SuspensionFixed,car.DriveSeat)
end
if v:FindFirstChild("WheelFixed")~=nil then
ModelWeld(v.WheelFixed,axle)
end
if v:FindFirstChild("Fixed")~=nil then
ModelWeld(v.Fixed,arm)
end
--Weld Wheel Parts
if v:FindFirstChild("Parts")~=nil then
ModelWeld(v.Parts,v)
end
--Add Steering Gyro
if v:FindFirstChild("Steer") then
v:FindFirstChild("Steer"):Destroy()
end
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
local steer=Instance.new("BodyGyro",arm)
steer.Name="Steer"
steer.P=_Tune.SteerP
steer.D=_Tune.SteerD
steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
end
--Add Stabilization Gyro
local gyro=Instance.new("BodyGyro",v)
gyro.Name="Stabilizer"
gyro.MaxTorque=Vector3.new(1,0,1)
gyro.P=0
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
gyro.D=_Tune.FGyroDamp
else
gyro.D=_Tune.RGyroDamp
end
--Add Rotational BodyMover
local AV=Instance.new("BodyAngularVelocity",v)
AV.Name="#AV"
AV.angularvelocity=Vector3.new(0,0,0)
AV.maxTorque=Vector3.new(_Tune.PBrakeForce,0,_Tune.PBrakeForce)
AV.P=1e9
end
|
-- Interpolates the current value of a rotator
-- state (pitch/yaw) towards its goal value.
|
function CharacterRealism:StepValue(state, delta)
local current = state.Current or 0
local goal = state.Goal
local pan = 5 / (delta * 60)
local rate = math.min(1, (delta * 20) / 3)
local step = math.min(rate, math.abs(goal - current) / pan)
state.Current = Util:StepTowards(current, goal, step)
return state.Current
end
|
--[ Setup ]--
-- Locations
|
local StealthLava = script.Parent
local Player = game.Players.LocalPlayer
local Avatar = Player.Character
local Mouse = Player:GetMouse()
|
-- re-export flowtypes from here. I wonder if this should be a separate 'package'?
|
export type React_Ref<ElementType> = flowtypes.React_Ref<ElementType>
export type React_Context<T> = flowtypes.React_Context<T>
export type React_AbstractComponent<Config, Instance> = flowtypes.React_AbstractComponent<
Config,
Instance
>
export type React_ComponentType<Config> = flowtypes.React_AbstractComponent<Config, any>
export type React_PureComponent<Props, State = nil> = flowtypes.React_Component<
Props,
State
>
export type React_Component<Props, State> = flowtypes.React_Component<Props, State>
export type React_ElementProps<ElementType> = flowtypes.React_ElementProps<ElementType>
export type React_StatelessFunctionalComponent<Props> =
flowtypes.React_StatelessFunctionalComponent<Props>
export type React_Node = flowtypes.React_Node
export type React_Element<ElementType> = flowtypes.React_Element<ElementType>
export type React_ElementType = flowtypes.React_ElementType
export type React_ElementConfig<C> = flowtypes.React_ElementConfig<C>
export type React_ElementRef<C> = flowtypes.React_ElementRef<C>
export type React_Portal = flowtypes.React_Portal
export type React_Key = flowtypes.React_Key
return {
checkPropTypes = require(script.checkPropTypes),
console = require(script.console),
ConsolePatchingDev = require(script["ConsolePatchingDev.roblox"]),
consoleWithStackDev = require(script.consoleWithStackDev),
enqueueTask = require(script["enqueueTask.roblox"]),
ExecutionEnvironment = require(script["ExecutionEnvironment.roblox"]),
formatProdErrorMessage = require(script.formatProdErrorMessage),
getComponentName = require(script.getComponentName),
invariant = require(script.invariant),
invokeGuardedCallbackImpl = require(script.invokeGuardedCallbackImpl),
isValidElementType = require(script.isValidElementType),
objectIs = require(script.objectIs),
ReactComponentStackFrame = require(script.ReactComponentStackFrame),
ReactElementType = require(script.ReactElementType),
ReactErrorUtils = require(script.ReactErrorUtils),
ReactFeatureFlags = require(script.ReactFeatureFlags),
ReactInstanceMap = require(script.ReactInstanceMap),
-- ROBLOX deviation: Instead of re-exporting from here, Shared actually owns
-- these files itself
ReactSharedInternals = ReactSharedInternals,
-- ROBLOX deviation: Instead of extracting these out of the reconciler and
-- then re-injecting the host config _into_ the reconciler, export these
-- from shared for easier reuse
ReactFiberHostConfig = ReactFiberHostConfig,
ReactSymbols = require(script.ReactSymbols),
ReactVersion = require(script.ReactVersion),
shallowEqual = require(script.shallowEqual),
UninitializedState = require(script["UninitializedState.roblox"]),
ReactTypes = ReactTypes,
-- ROBLOX DEVIATION: export error-stack-preserving utilities for use in
-- scheduler and reconciler, and parsing function for use in public API
describeError = ErrorHandling.describeError,
errorToString = ErrorHandling.errorToString,
parseReactError = ErrorHandling.parseReactError,
-- ROBLOX DEVIATION: export Symbol and Type from Shared
Symbol = require(script["Symbol.roblox"]),
Type = require(script["Type.roblox"]),
-- ROBLOX DEVIATION: export propmarkers from Shared
Change = require(script.PropMarkers.Change),
Event = require(script.PropMarkers.Event),
Tag = require(script.PropMarkers.Tag),
}
|
-- Applies a nonlinear transform to the thumbstick position to serve as the acceleration for camera rotation.
-- See https://www.desmos.com/calculator/xw2ytjpzco for a visual reference.
|
local function gamepadLinearToCurve(thumbstickPosition)
return Vector2.new(
math.clamp(math.sign(thumbstickPosition.X) * fromSCurveSpace(SCurveTransform(toSCurveSpace(math.abs(thumbstickPosition.X)))), -1, 1),
math.clamp(math.sign(thumbstickPosition.Y) * fromSCurveSpace(SCurveTransform(toSCurveSpace(math.abs(thumbstickPosition.Y)))), -1, 1))
end
|
-- REMOTE HANDLER --
|
Replicate.OnClientEvent:Connect(function(Action, Variable2, Variable3, Variable4)
if Action == "CamShake" then
require(script.CameraShake)(Variable2, Variable3, Variable4)
elseif Action == "Combat" then
require(script.VFX)(Variable2, Variable3, Variable4)
elseif Action == "Shock" then
require(script.Shockwave.Z)(Variable2, Variable3)
end
end)
Replicate.OnClientEvent:Connect(function(Action,Hotkey, ...) -- Using ... Allows you to send as many variables as you want
if script:FindFirstChild(Action) and script:FindFirstChild(Action):IsA("ModuleScript") then -- If the name of a ModuleScript inside this script fits the Action parameter,
require(script[Action])(Hotkey,...) -- it'll require it
elseif script:FindFirstChild(Action) and script:FindFirstChild(Action):IsA("Folder") then
require(script[Action][Hotkey])(...)
end
end)
|
--------------------------CHARACTER CONTROL-------------------------------
|
local function CreateController()
local this = {}
this.TorsoLookPoint = nil
function this:SetTorsoLookPoint(point)
local humanoid = findPlayerHumanoid(Player)
if humanoid then
humanoid.AutoRotate = false
end
this.TorsoLookPoint = point
self:UpdateTorso()
delay(2,
function()
-- this isnt technically correct for detecting if this is the last issue to the setTorso function
if this.TorsoLookPoint == point then
this.TorsoLookPoint = nil
if humanoid then
humanoid.AutoRotate = true
end
end
end)
end
function this:UpdateTorso(point)
if this.TorsoLookPoint then
point = this.TorsoLookPoint
else
return
end
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
if torso then
local lookVec = (point - torso.CFrame.p).unit
local squashedLookVec = Vector3_new(lookVec.X, 0, lookVec.Z).unit
torso.CFrame = CFrame.new(torso.CFrame.p, torso.CFrame.p + squashedLookVec)
end
end
return this
end
local CharacterControl = CreateController()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.