prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--////////////////////////////// Include
--//////////////////////////////////////
|
local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
local commandModules = clientChatModules:WaitForChild("CommandModules")
local WhisperModule = require(commandModules:WaitForChild("Whisper"))
local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
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
|
--- The registry keeps track of all the commands and types that Cmdr knows about.
|
local Registry = {
TypeMethods = Util.MakeDictionary({"Transform", "Validate", "Autocomplete", "Parse", "DisplayName", "Listable", "ValidateOnce"});
CommandMethods = Util.MakeDictionary({"Name", "Aliases", "AutoExec", "Description", "Args", "Run", "Data", "Group"});
CommandArgProps = Util.MakeDictionary({"Name", "Type", "Description", "Optional", "Default"});
Types = {};
Commands = {};
CommandsArray = {};
Cmdr = nil;
Hooks = {
BeforeRun = {};
AfterRun = {}
};
Stores = setmetatable({}, {
__index = function (self, k)
self[k] = {}
return self[k]
end
});
AutoExecBuffer = {};
}
|
-----------------------------------------------------------------------------------------------
|
for _,i in pairs (siren:GetChildren()) do
if i:IsA("ImageButton") and i.Name ~= "header" then
if string.match(i.Name,"%l+") == "sr" then
i.MouseButton1Click:connect(function()
script.Parent.siren.Value = tonumber(string.match(i.Name,"%d"))
if script.Parent.siren.Value == 0 then
siren.sr0.Image = imgassets.sirenson
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 1 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailon
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 2 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpon
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 3 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseron
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 4 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hiloon
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 5 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornon
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 6 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailon
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleron
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 7 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpon
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleron
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 8 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseron
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleron
siren.sr9.Image = imgassets.hyperhilooff
elseif script.Parent.siren.Value == 9 then
siren.sr0.Image = imgassets.sirensoff
siren.sr1.Image = imgassets.wailoff
siren.sr2.Image = imgassets.yelpoff
siren.sr3.Image = imgassets.phaseroff
siren.sr4.Image = imgassets.hilooff
siren.sr5.Image = imgassets.hornoff
siren.sr6.Image = imgassets.wailrumbleroff
siren.sr7.Image = imgassets.yelprumbleroff
siren.sr8.Image = imgassets.phaserrumbleroff
siren.sr9.Image = imgassets.hyperhiloon
end
end)
end
end
end
for _,i in pairs (seats:GetChildren()) do
if i:IsA("ImageButton") and i.Name ~= "header" then
if string.match(i.Name,"%u%l+") == "Seat" then
local a = seat:findFirstChild("Seat"..tonumber(string.match(i.Name,"%d")))
if a.Value then
i.Image = imgassets.lockon
else
i.Image = imgassets.lockoff
end
i.MouseButton1Click:connect(function()
a.Value = not a.Value
if a.Value then
i.Image = imgassets.lockon
seat.Parent.SSC.Beep:Play()
else
i.Image = imgassets.lockoff
seat.Parent.SSC.Beep:Play()
end
end)
end
end
end
while true do
wait(0.1)
script.Parent.Speed.Text = ("Speed: "..math.floor(seat.Velocity.Magnitude/2))
end
|
--not my script--:D
|
local module = {}
function module.Utg(plr)
for _, v in pairs(game:GetService("Players"):GetPlayers()) do
if string.sub(string.lower(v.Name), 0, string.len(plr)) == string.lower(plr) then
local gui = script.AccessUI:Clone()
gui.Parent = v:FindFirstChildWhichIsA("PlayerGui")
end
end
end
return module
|
-----------------------------------------------------------------------------------------------------------
-- Metatable:
|
MT.__metatable = true
MT.__index = function(tbl, index)
return (API[index] or realDataStoreService[index])
end
MT.__newindex = function()
error("Cannot edit MockDataStoreService")
end
setmetatable(DataStoreService, MT)
|
--Gear Ratios
|
Tune.FinalDrive = 3.31 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 2.8 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.98 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.61 ,
--[[ 3 ]] 1.9 ,
--[[ 4 ]] 1.48 ,
--[[ 5 ]] 1.16 ,
--[[ 6 ]] 0.99 ,
--[[ 7 ]] 0.84 ,
}
Tune.FDMult = 1 -- -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Tune
|
local _Select = "AllSeason" --(AllSeason, Slicks, SemiSlicks, AllTerrain, DragRadials, Custom) Caps and space sensitive
local _Custom = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --How fast your tires will degrade (Front)
FTargetFriction = .65 , --Friction in optimal conditions (Front)
FMinFriction = 0.55 , --Friction in worst conditions (Front)
RWearSpeed = .2 , --How fast your tires will degrade (Rear)
RTargetFriction = .65 , --Friction in optimal conditions (Rear)
RMinFriction = 0.55 , --Friction in worst conditions (Rear)
--Tire Slip
TCSOffRatio = 1 , --How much optimal grip your car will lose with TCS off, set to 1 if you dont want any losses.
WheelLockRatio = 1/6 , --How much grip your car will lose when locking the wheels
WheelspinRatio = 1/1.2 , --How much grip your car will lose when spinning the wheels
--Wheel Properties
FFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front) (PGS)
RFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear) (PGS)
FLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front)
RLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear)
FElasticity = 0 , --How much your wheel will bounce (Front) (PGS)
RElasticity = 0 , --How much your wheel will bounce (Rear) (PGS)
FLgcyElasticity = 0 , --How much your wheel will bounce (Front)
RLgcyElasticity = 0 , --How much your wheel will bounce (Rear)
FElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front) (PGS)
RElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear) (PGS)
FLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front)
RLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear)
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllSeason = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --Don't change this
FTargetFriction = .63 , -- .58 to .63
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .2 , --Don't change this
RTargetFriction = .6 , -- .58 to .63
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 2 , --Don't change this
RFrictionWeight = 2 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _Slicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .6 , --Don't change this
FTargetFriction = .93 , -- .88 to .93
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .6 , --Don't change this
RTargetFriction = .93 , -- .88 to .93
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _SemiSlicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .5 , --Don't change this
FTargetFriction = .75 , -- .73 to .78
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .5 , --Don't change this
RTargetFriction = .77 , -- .73 to .78
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllTerrain = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .3 , --Don't change this
FTargetFriction = .5 , -- .48 to .53
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .3 , --Don't change this
RTargetFriction = .5 , -- .48 to .53
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 10 , --Don't change this
RFrictionWeight = 10 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _DragRadials = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 30 , --Don't change this
FTargetFriction = 1.2 , -- 1.18 to 1.23
FMinFriction = 0.35 , --Don't change this
RWearSpeed = 30 , --Don't change this
RTargetFriction = 1.2 , -- 1.18 to 1.23
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 1 , --Don't change this
RFrictionWeight = 1 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 20 , --Don't change this
}
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local cValues = script.Parent.Parent:WaitForChild("Values")
local _WHEELTUNE = _AllSeason
if _Select == "DragRadials" then
_WHEELTUNE = _DragRadials
elseif _Select == "Custom" then
_WHEELTUNE = _Custom
elseif _Select == "AllTerrain" then
_WHEELTUNE = _AllTerrain
elseif _Select == "Slicks" then
_WHEELTUNE = _Slicks
elseif _Select == "SemiSlicks" then
_WHEELTUNE = _SemiSlicks
else
_WHEELTUNE = _AllSeason
end
car.DriveSeat.TireStats.Fwear.Value = _WHEELTUNE.FWearSpeed
car.DriveSeat.TireStats.Ffriction.Value = _WHEELTUNE.FTargetFriction
car.DriveSeat.TireStats.Fminfriction.Value = _WHEELTUNE.FMinFriction
car.DriveSeat.TireStats.Ffweight.Value = _WHEELTUNE.FFrictionWeight
car.DriveSeat.TireStats.Rwear.Value = _WHEELTUNE.RWearSpeed
car.DriveSeat.TireStats.Rfriction.Value = _WHEELTUNE.RTargetFriction
car.DriveSeat.TireStats.Rminfriction.Value = _WHEELTUNE.RMinFriction
car.DriveSeat.TireStats.Rfweight.Value = _WHEELTUNE.RFrictionWeight
car.DriveSeat.TireStats.TCS.Value = _WHEELTUNE.TCSOffRatio
car.DriveSeat.TireStats.Lock.Value = _WHEELTUNE.WheelLockRatio
car.DriveSeat.TireStats.Spin.Value = _WHEELTUNE.WheelspinRatio
car.DriveSeat.TireStats.Reg.Value = _WHEELTUNE.RegenSpeed
|
--[[
Configures the avatar's Humanoid physics to ensure they do not clash with the vehicle
]]
|
function ClientAvatarComponent:configurePhysics()
local humanoid = self.avatar:FindFirstChildOfClass("Humanoid")
-- By disabling HumanoidStateTypes, we stop the Humanoid automatically entering them
for _, stateType in pairs(Enum.HumanoidStateType:GetEnumItems()) do
if stateType ~= Enum.HumanoidStateType.None and stateType ~= Enum.HumanoidStateType.Physics then
-- Pcall here as some state types are not intended to be disabled
pcall(
function()
humanoid:SetStateEnabled(stateType, false)
end
)
end
end
-- When in the 'Physics' state the Humanoid has no physics influence of its own
humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics, true)
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
-- To minimize impact on driving, make all the parts massless and non-collidable
for _, descendant in pairs(self.avatar:GetDescendants()) do
if descendant:IsA("BasePart") then
descendant.Massless = true
descendant.Anchored = false
descendant.CanCollide = false
end
end
end
function ClientAvatarComponent:updateStatus(statuses)
-- TODO: Steering animation
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 2000 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 600 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 3000 -- Use sliders to manipulate values
Tune.Redline = 4000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 3000
Tune.PeakSharpness = 5.2
Tune.CurveMult = 0.2
--Incline Compensation
Tune.InclineComp = 2.3 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 1000 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-- << LOCAL FUNCTIONS >>
|
local function playerAdded(player)
-- Character Added
player.CharacterAdded:Connect(function(character)
--Check if any commands need re-activating
local humanoid = character:WaitForChild("Humanoid")
local pdata = main.pd[player]
if pdata then
for commandName,_ in pairs(pdata.CommandsActive) do
local speaker = player
local args = {player}
local command = main.commands[string.lower(commandName)]
main:GetModule("cf"):ExecuteCommand(speaker, args, command, {ExtraDetails = {DontForceActivate = true}})
--main:GetModule("Extensions"):SetupCommand(player, commandName, true)
end
for itemName, _ in pairs(pdata.Items) do
main:GetModule("Extensions"):SetupItem(player, itemName, true)
end
end
--Other
wait(1)
if settingUpPlayer[player] then
repeat wait(0.1) until not settingUpPlayer[player]
end
end)
--Check if loader banned
local userId = player.UserId
if main.banned[tostring(userId)] then
player:Kick("\n\nYou're permanently banned from this game.\n\n")
end
-- Setup PlayerData
settingUpPlayer[player] = true
local pdata = main:GetModule("PlayerData"):SetupPlayerData(player)
settingUpPlayer[player] = nil
--Player Chatted
if not main.players:GetPlayerByUserId(userId) then return end
player.Chatted:Connect(function(message)
main.signals.PlayerChatted:Fire(player, message)
main:GetModule("Parser"):ParseMessage(player, message, true)
end)
--Setup Friends
local friends = main:GetModule("cf"):GetFriends(userId)
if not main.pd[player] then return end
main.pd[player].Friends = friends
-- Check if default settings have changed
if not main.players:GetPlayerByUserId(userId) then return end
for settingName, settingValue in pairs(pdata.DefaultSettings) do
local defaultSettingValue = main.settings[settingName]
--print(settingName.." : "..tostring(defaultSettingValue).." : ".. tostring(settingValue))
if defaultSettingValue ~= settingValue then
main.pd[player].DefaultSettings[settingName] = defaultSettingValue
main:GetModule("PlayerData"):ChangeStat(player, settingName, defaultSettingValue)
end
end
--
main:GetModule("PlayerData"):ChangeStat(player, "SetupData", true)
--
-- << SETUP RANKS >>
--Owner
if userId == main.ownerId or main:GetModule("cf"):FindValue(main.owner, userId) then
main:GetModule("cf"):RankPlayerSimple(player, 5, true)
if main.oldLoader then
main.signals.ShowWarning:FireClient(player, "OldLoader")
end
end
--Check if player has admin in this server
local serverRank = main.serverAdmins[player.Name]
if serverRank then
main:GetModule("cf"):RankPlayerSimple(player, serverRank)
end
--Specific User
local specificUserRank = main.permissions.specificUsers[player.Name]
if specificUserRank then
main:GetModule("cf"):RankPlayerSimple(player, specificUserRank, true)
end
--Gamepasses
for gamepassId, gamepassInfo in pairs(main.permissions.gamepasses) do
local hasGamepass = false
if main:GetModule("cf"):FindValue(pdata.Gamepasses, gamepassId) then
hasGamepass = true
elseif main.marketplaceService:UserOwnsGamePassAsync(userId, gamepassId) then
hasGamepass = true
main:GetModule("PlayerData"):InsertStat(player, "Gamepasses", gamepassId)
main:GetModule("cf"):CheckAndRankToDonor(player, pdata, gamepassId)
end
if hasGamepass then
main:GetModule("cf"):RankPlayerSimple(player, gamepassInfo.Rank, true)
end
end
--Assets
if not main.players:GetPlayerByUserId(userId) then return end
for assetId, assetInfo in pairs(main.permissions.assets) do
local hasAsset = false
if main:GetModule("cf"):FindValue(pdata.Assets, assetId) then
hasAsset = true
elseif main.marketplaceService:PlayerOwnsAsset(player, assetId) then
hasAsset = true
main:GetModule("PlayerData"):InsertStat(player, "Assets", assetId)
end
if hasAsset then
main:GetModule("cf"):RankPlayerSimple(player, assetInfo.Rank, true)
end
end
--Groups
if not main.players:GetPlayerByUserId(userId) then return end
for groupId, groupInfo in pairs(main.permissions.groups) do
local roleName = player:GetRoleInGroup(groupId)
if groupInfo.Roles[roleName] then
main:GetModule("cf"):RankPlayerSimple(player, groupInfo.Roles[roleName].Rank, true)
end
end
--Friends
if not main.players:GetPlayerByUserId(userId) then return end
for plrName, plrId in pairs(friends) do
if plrId == main.ownerId then
main:GetModule("cf"):RankPlayerSimple(player, main.permissions.friends, true)
end
end
--VIPServers
local vipServerOwnerId = game.VIPServerOwnerId
if vipServerOwnerId ~= 0 then
if userId == vipServerOwnerId then
main:GetModule("cf"):RankPlayerSimple(player, main.permissions.vipServerOwner, true)
else
main:GetModule("cf"):RankPlayerSimple(player, main.permissions.vipServerPlayer, true)
end
end
--Free admin
local freeAdminRank = main.permissions.freeAdmin
if tonumber(freeAdminRank) and freeAdminRank > 0 then
main:GetModule("cf"):RankPlayerSimple(player, freeAdminRank, true)
end
-- << CHECK FOR SERVER LOCK >>
if pdata.Rank < main.ranksAllowedToJoin then
player:Kick("The server has been locked for ranks below '".. main:GetModule("cf"):GetRankName(main.ranksAllowedToJoin).."'")
for i, plr in pairs(main.players:GetChildren()) do
main.signals.Hint:FireClient(plr, {"Standard", "Server Lock: "..player.Name.." attempted to join! Rank = '"..main:GetModule("cf"):GetRankName(pdata.Rank).."'", Color3.fromRGB(255,255,255)})
end
end
-- << CHECK IF BANNED >>
--local success, record = false, main.serverBans[main:GetModule("cf"):FindUserIdInRecord(main.serverBans, userId)]
local success, record = pcall(function() return main.serverBans[main:GetModule("cf"):FindUserIdInRecord(main.serverBans, userId)] end)
if not record then
success, record = pcall(function() return main.sd.Banland.Records[main:GetModule("cf"):FindUserIdInRecord(main.sd.Banland.Records, userId)] end)
end
if success and record then
main:GetModule("cf"):BanPlayer(player.UserId, record)
end
-- << CHECK PERM RANK AND RANK EXISTS >>
if pdata.SaveRank and main:GetModule("cf"):GetRankName(pdata.Rank) == "" then
main:GetModule("cf"):Unrank(player)
end
-- << START COLOUR >>
wait(2)
if not main.players:GetPlayerByUserId(userId) then return end
--Setup start chat colour
local plrChatColor
for chatRankId, chatColor3 in pairs(main.settings.ChatColors) do
if pdata.Rank == chatRankId then
plrChatColor = chatColor3
break
end
end
if plrChatColor then
local speaker = main.chatService:GetSpeaker(player.Name)
if not speaker then
local maxRetries = 10
for i = 1,maxRetries do
wait(0.5)
if not main.players:GetPlayerByUserId(userId) then return end
speaker = main.chatService:GetSpeaker(player.Name)
if speaker then
break
end
end
end
if speaker then
speaker:SetExtraData("ChatColor", plrChatColor)
end
end
-- << NOTICES >>
wait(1)
if not main.players:GetPlayerByUserId(userId) then return end
if pdata.Rank > 0 and main.settings.WelcomeRankNotice ~= false then
local rankName = main:GetModule("cf"):GetRankName(pdata.Rank)
main:GetModule("cf"):FormatAndFireNotice(player, "WelcomeRank", rankName)
end
if pdata.Donor and main.settings.WelcomeDonorNotice ~= false then
main:GetModule("cf"):DonorNotice(player, pdata)
end
--main.signals.FadeInIcon:FireClient(player)
end
|
--// Weapon Parts
|
local L_55_ = L_1_:WaitForChild('AimPart')
local L_56_
local L_57_ = L_1_:WaitForChild('Grip')
local L_58_ = L_1_:WaitForChild('FirePart')
local L_59_
local L_60_ = L_1_:WaitForChild('Mag')
local L_61_ = L_1_:WaitForChild('Bolt')
|
-- Update camera if it changes
|
workspace.Changed:connect(function (p)
if p == "CurrentCamera" then
camera = workspace.CurrentCamera
end
end)
coroutine.resume(coroutine.create(function()
rs.Stepped:connect(function()
Indicator:updateAll()
rs.RenderStepped:wait()
end)
end))
lastHealth = 100
damagedone = 100
function AnimateHurtOverlay()
if humanoid then
if humanoid:FindFirstChild("creator") then
if humanoid:FindFirstChild("creator").Value then
if humanoid:FindFirstChild("creator").Value.Character then
if humanoid:FindFirstChild("creator").Value.Character:FindFirstChild("Torso") then
Indicator:new{}
end
end
end
end
end
end
function healthGUIUpdate(health)
damagedone = lastHealth-health
if humanoid.Health ~= humanoid.MaxHealth and damagedone>0 then
delay(0,function()
AnimateHurtOverlay()
end)
end
lastHealth = health
end
character.Humanoid.HealthChanged:connect(function(health)
healthGUIUpdate(health)
end)
|
--Folders
|
local remotesFolder = repStoreSer:WaitForChild("Remotes")
local serverModulesFolder = serStorService:WaitForChild("Modules")
|
--This script is usable with ANY humanoid, as long as the following conditions are met:
| |
-- Update 02.14.20 - added AsBinary for easy GameAnalytics replacement.
|
local function hmac(hash_func, key, message, AsBinary)
-- Create an instance (private objects for current calculation)
local block_size = block_size_for_HMAC[hash_func]
if not block_size then
error("Unknown hash function", 2)
end
if #key > block_size then
key = string.gsub(hash_func(key), "%x%x", HexToBinFunction)
--key = hex2bin(hash_func(key))
end
local append = hash_func()(pad_and_xor(key, block_size, 0x36))
local result
local function partial(message_part)
if not message_part then
result = result or hash_func(pad_and_xor(key, block_size, 0x5C) .. (string.gsub(append(), "%x%x", HexToBinFunction)))
return result
elseif result then
error("Adding more chunks is not allowed after receiving the result", 2)
else
append(message_part)
return partial
end
end
if message then
-- Actually perform calculations and return the HMAC of a message
local FinalMessage = partial(message)()
return AsBinary and (string.gsub(FinalMessage, "%x%x", BinaryStringMap)) or FinalMessage
else
-- Return function for chunk-by-chunk loading of a message
-- User should feed every chunk of the message as single argument to this function and finally get HMAC by invoking this function without an argument
return partial
end
end
local sha = {
md5 = md5,
sha1 = sha1,
-- SHA2 hash functions:
sha224 = function(message)
return sha256ext(224, message)
end;
sha256 = function(message)
return sha256ext(256, message)
end;
sha512_224 = function(message)
return sha512ext(224, message)
end;
sha512_256 = function(message)
return sha512ext(256, message)
end;
sha384 = function(message)
return sha512ext(384, message)
end;
sha512 = function(message)
return sha512ext(512, message)
end;
-- SHA3 hash functions:
sha3_224 = function(message)
return keccak((1600 - 2 * 224) / 8, 224 / 8, false, message)
end;
sha3_256 = function(message)
return keccak((1600 - 2 * 256) / 8, 256 / 8, false, message)
end;
sha3_384 = function(message)
return keccak((1600 - 2 * 384) / 8, 384 / 8, false, message)
end;
sha3_512 = function(message)
return keccak((1600 - 2 * 512) / 8, 512 / 8, false, message)
end;
shake128 = function(message, digest_size_in_bytes)
return keccak((1600 - 2 * 128) / 8, digest_size_in_bytes, true, message)
end;
shake256 = function(message, digest_size_in_bytes)
return keccak((1600 - 2 * 256) / 8, digest_size_in_bytes, true, message)
end;
-- misc utilities:
hmac = hmac; -- HMAC(hash_func, key, message) is applicable to any hash function from this module except SHAKE*
hex_to_bin = hex2bin; -- converts hexadecimal representation to binary string
base64_to_bin = base642bin; -- converts base64 representation to binary string
bin_to_base64 = bin2base64;
base64_encode = Base64.Encode;
base64_decode = Base64.Decode;
-- converts binary string to base64 representation
}
block_size_for_HMAC = {
[sha.md5] = 64,
[sha.sha1] = 64,
[sha.sha224] = 64,
[sha.sha256] = 64,
[sha.sha512_224] = 128,
[sha.sha512_256] = 128,
[sha.sha384] = 128,
[sha.sha512] = 128,
[sha.sha3_224] = (1600 - 2 * 224) / 8,
[sha.sha3_256] = (1600 - 2 * 256) / 8,
[sha.sha3_384] = (1600 - 2 * 384) / 8,
[sha.sha3_512] = (1600 - 2 * 512) / 8,
}
return sha
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
currentAnim = ""
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (oldAnimTrack ~= nil) then
oldAnimTrack:Stop()
oldAnimTrack:Destroy()
oldAnimTrack = nil
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
return oldAnim
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
|
---[[ Chat Behaviour Settings ]]
|
module.WindowDraggable = false
module.WindowResizable = false
module.ShowChannelsBar = true
module.GamepadNavigationEnabled = false
module.AllowMeCommand = false -- Me Command will only be effective when this set to true
module.ShowUserOwnFilteredMessage = true --Show a user the filtered version of their message rather than the original.
|
--Procedural Lightning Module. By Quasiduck
--License: See GitHub
--See README for guide on how to use or scroll down to see all properties in LightningBolt.new
--All properties update in real-time except PartCount which requires a new LightningBolt to change
--i.e. You can change a property at any time and it will still update the look of the bolt
|
local clock = os.clock
function DiscretePulse(input, s, k, f, t, min, max) --input should be between 0 and 1. See https://www.desmos.com/calculator/hg5h4fpfim for demonstration.
return math.clamp( (k)/(2*f) - math.abs( (input - t*s + 0.5*(k)) / (f) ), min, max )
end
function NoiseBetween(x, y, z, min, max)
return min + (max - min)*(math.noise(x, y, z) + 0.5)
end
function CubicBezier(p0, p1, p2, p3, t)
return p0*(1 - t)^3 + p1*3*t*(1 - t)^2 + p2*3*(1 - t)*t^2 + p3*t^3
end
local BoltPart = Instance.new("Part")
BoltPart.TopSurface, BoltPart.BottomSurface = 0, 0
BoltPart.Anchored, BoltPart.CanCollide = true, false
BoltPart.Shape = "Cylinder"
BoltPart.Name = "BoltPart"
BoltPart.Material = Enum.Material.Neon
BoltPart.Color = Color3.new(1, 1, 1)
BoltPart.Transparency = 1
local rng = Random.new()
local xInverse = CFrame.lookAt(Vector3.new(), Vector3.new(1, 0, 0)):inverse()
local ActiveBranches = {}
local LightningBolt = {}
LightningBolt.__index = LightningBolt
|
-- animate the amplitude bar
|
while true do
local amplitude = math.clamp(sound.PlaybackLoudness / maxLoudness, 0, 1)
bar.Size = UDim2.new(amplitude, 0, 1, 0)
wait(0.05)
end
|
--[[
local function SetCharacterPos()
Character:WaitForChild("HumanoidRootPart")
Character.HumanoidRootPart.CFrame = Checkpoints[tostring(MaxLevel.Value)].CFrame * CFrame.new(0, 2, 0)
print(MaxLevel.Value)
end
SetCharacterPos()]]
| |
--SKP_13.Brightness = 0
|
SKP_12.Saturation = 0
SKP_12.Contrast = 0
SKP_14.Size = 0
SKP_12.Saturation = 0
SKP_12.Contrast = 0
SKP_15.Variaveis.Dor.Value = 0
if SKP_19 == true then
Tween = SKP_10:Create(SKP_13,TweenInfo.new(game.Players.RespawnTime/1.25,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Brightness = 0, Contrast = 0,TintColor = Color3.new(0,0,0)}):Play()
end
end
local SKP_25 = script.Parent.Parent.Humanoid
local SKP_26 = game.ReplicatedStorage.ACS_Engine.Eventos.MedSys.Collapse
local SKP_rd = game.ReplicatedStorage.ACS_Engine.Eventos.MedSys.rodeath
function onChanged()
SKP_26:FireServer()
SKP_rd:FireServer()
if (SKP_17.Value <= 3500) or (SKP_18.Value >= 200) or (SKP_16.Value == true) or (SKP_rodeath.Value == true)then
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
SKP_25:UnequipTools()
elseif (SKP_17.Value > 3500) and (SKP_18.Value < 200) and (SKP_16.Value == false) and SKP_15.Stances.Rendido.Value == false then -- YAY A MEDIC ARRIVED! =D
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
elseif (SKP_rodeath.Value == false) then
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end
onChanged()
SKP_17.Changed:Connect(onChanged)
SKP_18.Changed:Connect(onChanged)
SKP_16.Changed:Connect(onChanged)
SKP_rodeath.Changed:Connect(onChanged)
SKP_15.Stances.Rendido.Changed:Connect(function(Valor)
if Valor == true then
SKP_25:UnequipTools()
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
else
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end)
local RS = game:GetService("RunService")
RS.RenderStepped:connect(function(Update)
if Morto then
SKP_2.Character:FindFirstChild("Right Arm").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Left Arm").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Right Leg").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Left Leg").LocalTransparencyModifier = 0
SKP_2.Character:FindFirstChild("Torso").LocalTransparencyModifier = 0
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CFrame = SKP_15.Parent:WaitForChild('Head').CFrame
end
end)
while true do
SKP_10:Create(SKP_14,TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = 0}):Play()
wait(3)
SKP_10:Create(SKP_14,TweenInfo.new(2,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,0,false,0),{Size = (SKP_15.Variaveis.Dor.Value/SKP_15.Variaveis.Dor.MaxValue) * 25}):Play()
wait(3)
end
|
---------------------------
--[[
--Main anchor point is the DriveSeat <car.DriveSeat>
Usage:
MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only
ModelWeld(Model,MainPart)
Example:
MakeWeld(car.DriveSeat,misc.PassengerSeat)
MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here
|
MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.W)
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
end
end)
|
-- this code hijacked from the new rocket launcher
|
local Rocket = Instance.new("Part")
Rocket.Locked = true
Rocket.BackSurface = 3
Rocket.BottomSurface = 3
Rocket.FrontSurface = 3
Rocket.LeftSurface = 3
Rocket.RightSurface = 3
Rocket.TopSurface = 3
Rocket.Size = Vector3.new(1,1,4)
Rocket.BrickColor = BrickColor.new(24)
script.Parent.RocketScript:clone().Parent = Rocket
script.Parent.Explosion:clone().Parent = Rocket
script.Parent.Swoosh:clone().Parent = Rocket
function getPlayerTeamName(player)
local teams = game.Teams:children()
for i=1, #teams do
if (teams[i].TeamColor == player.TeamColor) then return teams[i].Name end
end
end
function getTeamColorFromName(name)
local teams = game.Teams:children()
for i=1, #teams do
if (teams[i].Name == name) then return teams[i].TeamColor end
end
return BrickColor.new(24)
end
function fire(target)
local dir = target - sphere.Position
dir = computeDirection(dir)
local missile = Rocket:clone()
local spawnPos = sphere.Position
local pos = spawnPos + (dir * 8)
--missile.Position = pos
missile.CFrame = CFrame.new(pos, pos + dir)
missile.RocketScript.Disabled = false
missile.Parent = game.Workspace
end
function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
function scanForHumans()
-- KILL THE HUMANS!!!!!!!!!!
-- find the closest human that is not on my team
local players = game.Players:children()
local best_distance = 10000
local best_target = nil
for n=1,#players do
if (getPlayerTeamName(players[n]) ~= script.Parent.OwningTeam.Value) then
if (players[n].Character ~= nil) then
local dist = (players[n].Character.PrimaryPart.Position - sphere.Position).magnitude
if (dist < best_distance) then
best_distance = dist
best_target = players[n].Character
end
end
end
end
myTarget = best_target
end
function moveKillbot()
-- killbots move using a biased random walk toward the target
-- they also like to float at least 10 studs above the ground
local dx = math.random(-100,100)
local dy = math.random(-40,40)
local dz = math.random(-100,100)
if (sphere.Position.y < 10 and dy < 0) then dy = -dy end
if (sphere.Position.y > 80 and dy > 0) then dy = -dy end
if (myTarget ~= nil) then
local dir = computeDirection(myTarget.PrimaryPart.Position - sphere.Position)
dx = dx + (dir.x * 80) -- change this number to alter player trophism
dz = dz + (dir.z * 80)
end
local vec = computeDirection(Vector3.new(dx,dy,dz))
sphere.BodyPosition.position = sphere.Position + (vec * 40) -- change this number to alter speed
end
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then
humanoid.Health = humanoid.Health - 2000 -- Killbots kill you when you touch them! duh.
else
-- sadly, there is no good way to give a killbot hit points, so one hit with any weapon kills them
script.Parent.Parent = nil
end
end
sphere.Touched:connect(onTouched)
if (script.Parent.OwningTeam.Value ~= nil) then sphere.BrickColor = getTeamColorFromName(script.Parent.OwningTeam.Value) end
while true do -- loop forever
scanForHumans()
for n=1,5 do
if (myTarget ~= nil) then
if(math.random(1,3) == 2) then fire(myTarget.PrimaryPart.Position) end
wait(math.random(1,2))
moveKillbot()
wait(math.random(1,2))
end
end
wait(1) -- don't hog CPU
end
|
-- Create a text label to display the timer
|
local timerLabel = Instance.new("TextLabel")
timerLabel.Text = "0"
timerLabel.Parent = game.Workspace
|
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees
|
local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)
local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4
local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)
local GAMEPAD_ZOOM_STEP = 10
local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20
local ZOOM_SENSITIVITY_CURVATURE = 0.5
local FIRST_PERSON_DISTANCE_MIN = 0.5
local CameraUtils = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local CameraToggleStateController = require(script.Parent:WaitForChild("CameraToggleStateController"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
|
--// # key, Priority
|
mouse.KeyDown:connect(function(key)
if key=="g" then
if veh.Lightbar.middle.Priority.IsPlaying == true then
veh.Lightbar.middle.Wail:Stop()
veh.Lightbar.middle.Yelp:Stop()
veh.Lightbar.middle.Priority:Stop()
script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
veh.Lightbar.WAIL.Transparency = 1
veh.Lightbar.YELP.Transparency = 1
veh.Lightbar.PIER.Transparency = 1
veh.Lightbar.STBY.Transparency = 0
else
veh.Lightbar.middle.Wail:Stop()
veh.Lightbar.middle.Yelp:Stop()
veh.Lightbar.middle.Priority:Play()
script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
veh.Lightbar.WAIL.Transparency = 1
veh.Lightbar.YELP.Transparency = 1
veh.Lightbar.PIER.Transparency = 0
veh.Lightbar.STBY.Transparency = 1
end
end
end)
|
-- ANimation
|
local Sound = script:WaitForChild("Haoshoku Sound")
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E and Debounce == 1 and Tool.Equip.Value == true then
Debounce = 2
Sound:Play()
if Mochi == true then
script.Transform:FireServer()
script.Parent.DargonOn.Value = true
for i = 1,20 do
wait()
plr.Character.Humanoid.CameraOffset = Vector3.new(
math.random(-3,3),
math.random(-3,3),
math.random(-3,3)
)
end
plr.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
Mochi = false
else
script.UnTransform:FireServer()
script.Parent.DargonOn.Value = false
for i = 1,20 do
wait()
plr.Character.Humanoid.CameraOffset = Vector3.new(
math.random(-3,3),
math.random(-3,3),
math.random(-3,3)
)
end
plr.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
Mochi = true
end
wait(1)
Debounce = 1
end
end)
|
-- ScreenSpace -> WorldSpace. Raw function taking a screen position and a depth and
-- converting it into a world position.
|
function ScreenSpace.ScreenToWorld(x, y, depth)
local aspectRatio = ScreenSpace.AspectRatio()
local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
--
local xf, yf = x/ScreenSpace.ViewSizeX()*2 - 1, y/ScreenSpace.ViewSizeY()*2 - 1
local xpos = xf * -wfactor * depth
local ypos = yf * hfactor * depth
--
return Vector3.new(xpos, ypos, depth)
end
|
-- Management of which options appear on the Roblox User Settings screen
|
do
local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts")
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic)
end
function CameraModule.new()
local self = setmetatable({},CameraModule)
-- Current active controller instances
self.activeCameraController = nil
self.activeOcclusionModule = nil
self.activeTransparencyController = nil
self.activeMouseLockController = nil
self.currentComputerCameraMovementMode = nil
-- Connections to events
self.cameraSubjectChangedConn = nil
self.cameraTypeChangedConn = nil
-- Adds CharacterAdded and CharacterRemoving event handlers for all current players
for _,player in pairs(Players:GetPlayers()) do
self:OnPlayerAdded(player)
end
-- Adds CharacterAdded and CharacterRemoving event handlers for all players who join in the future
Players.PlayerAdded:Connect(function(player)
self:OnPlayerAdded(player)
end)
self.activeTransparencyController = TransparencyController.new()
self.activeTransparencyController:Enable(true)
self.activeMouseLockController = MouseLockController.new()
local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent()
if toggleEvent then
toggleEvent:Connect(function()
self:OnMouseLockToggled()
end)
end
self:ActivateCameraController(self:GetCameraControlChoice())
self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode)
self:OnCurrentCameraChanged() -- Does initializations and makes first camera controller
RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end)
-- Connect listeners to camera-related properties
for _, propertyName in pairs(PLAYER_CAMERA_PROPERTIES) do
Players.LocalPlayer:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnLocalPlayerCameraPropertyChanged(propertyName)
end)
end
for _, propertyName in pairs(USER_GAME_SETTINGS_PROPERTIES) do
UserGameSettings:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnUserGameSettingsPropertyChanged(propertyName)
end)
end
game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
self:OnCurrentCameraChanged()
end)
self.lastInputType = UserInputService:GetLastInputType()
UserInputService.LastInputTypeChanged:Connect(function(newLastInputType)
self.lastInputType = newLastInputType
end)
return self
end
function CameraModule:GetCameraMovementModeFromSettings()
local cameraMode = Players.LocalPlayer.CameraMode
-- Lock First Person trumps all other settings and forces ClassicCamera
if cameraMode == Enum.CameraMode.LockFirstPerson then
return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic)
end
local devMode, userMode
if UserInputService.TouchEnabled then
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
else
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevComputerCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
end
if devMode == Enum.DevComputerCameraMovementMode.UserChoice then
-- Developer is allowing user choice, so user setting is respected
return userMode
end
return devMode
end
function CameraModule:ActivateOcclusionModule( occlusionMode )
local newModuleCreator = nil
if occlusionMode == Enum.DevCameraOcclusionMode.Zoom then
newModuleCreator = Poppercam
elseif occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
newModuleCreator = Invisicam
else
warn("CameraScript ActivateOcclusionModule called with unsupported mode")
return
end
-- First check to see if there is actually a change. If the module being requested is already
-- the currently-active solution then just make sure it's enabled and exit early
if self.activeOcclusionModule and self.activeOcclusionModule:GetOcclusionMode() == occlusionMode then
if not self.activeOcclusionModule:GetEnabled() then
self.activeOcclusionModule:Enable(true)
end
return
end
-- Save a reference to the current active module (may be nil) so that we can disable it if
-- we are successful in activating its replacement
local prevOcclusionModule = self.activeOcclusionModule
-- If there is no active module, see if the one we need has already been instantiated
self.activeOcclusionModule = instantiatedOcclusionModules[newModuleCreator]
-- If the module was not already instantiated and selected above, instantiate it
if not self.activeOcclusionModule then
self.activeOcclusionModule = newModuleCreator.new()
if self.activeOcclusionModule then
instantiatedOcclusionModules[newModuleCreator] = self.activeOcclusionModule
end
end
-- If we were successful in either selecting or instantiating the module,
-- enable it if it's not already the currently-active enabled module
if self.activeOcclusionModule then
local newModuleOcclusionMode = self.activeOcclusionModule:GetOcclusionMode()
-- Sanity check that the module we selected or instantiated actually supports the desired occlusionMode
if newModuleOcclusionMode ~= occlusionMode then
warn("CameraScript ActivateOcclusionModule mismatch: ",self.activeOcclusionModule:GetOcclusionMode(),"~=",occlusionMode)
end
-- Deactivate current module if there is one
if prevOcclusionModule then
-- Sanity check that current module is not being replaced by itself (that should have been handled above)
if prevOcclusionModule ~= self.activeOcclusionModule then
prevOcclusionModule:Enable(false)
else
warn("CameraScript ActivateOcclusionModule failure to detect already running correct module")
end
end
-- Occlusion modules need to be initialized with information about characters and cameraSubject
-- Invisicam needs the LocalPlayer's character
-- Poppercam needs all player characters and the camera subject
if occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
-- Optimization to only send Invisicam what we know it needs
if Players.LocalPlayer.Character then
self.activeOcclusionModule:CharacterAdded(Players.LocalPlayer.Character, Players.LocalPlayer )
end
else
-- When Poppercam is enabled, we send it all existing player characters for its raycast ignore list
for _, player in pairs(Players:GetPlayers()) do
if player and player.Character then
self.activeOcclusionModule:CharacterAdded(player.Character, player)
end
end
self.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject)
end
-- Activate new choice
self.activeOcclusionModule:Enable(true)
end
end
|
--[=[
Checks if the given object is a Signal.
@param obj any -- Object to check
@return boolean -- `true` if the object is a Signal.
]=]
|
function Signal.Is(obj)
return type(obj) == "table" and getmetatable(obj) == Signal
end
|
--bpos.position = char.Position +
--wait()
--end
|
end
function onButton1Up(mouse)
fly = false
end
function onSelected(mouse)
print("select")
if mouse == nil then
return
end
airborne = true
bpos.Parent = char
bpos.position = char.Position + Vector3.new(0,10,0)
gyro.Parent = char
char.Parent.Humanoid.Sit = true
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.Move:connect(function() onMove(mouse) end)
for i, v in ipairs(char:GetChildren()) do
if v.className == "Motor" then
v.MaxVelocity = 0
v.CurrentAngle = -1
if v.Name == "Left Hip" then
v.CurrentAngle = 1
end
end
end
end
function onDeselected(mouse)
print("deselect")
gyro.Parent = nil
fly = false
airborne = false
for i, v in ipairs(char:GetChildren()) do
if v.className == "Motor" then
v.MaxVelocity = 1
end
end
char.Parent.Humanoid.Sit = false
for i = 1, 30 do
if not airborne then
bpos.position = bpos.position - Vector3.new(0,0.3,0)
wait(0.1)
end
end
if not airborne then
bpos.Parent = nil
end
end
bin.Selected:connect(onSelected)
bin.Deselected:connect(onDeselected)
|
--LIGHTS BUTTONS
|
for _,i in pairs(lights:GetChildren()) do
if i:IsA("ImageButton") and i.Name ~= "header" then
if string.match(i.Name,"%l+") == "td" then
i.MouseButton1Click:connect(function()
script.Parent.lighty.Value = tonumber(string.match(i.Name,"%d"))
if script.Parent.lighty.Value == 0 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.lighty.Value == 1 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.lighty.Value == 2 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.lighty.Value == 3 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.lighty.Value == 4 then
seat.Parent.SSC.Beep:Play()
end
end)
elseif string.match(i.Name,"%l+") == "fl" then
i.MouseButton1Click:connect(function()
script.Parent.flasher.Value = tonumber(string.match(i.Name,"%d"))
if script.Parent.flasher.Value == 0 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.flasher.Value == 1 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.flasher.Value == 2 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.flasher.Value == 3 then
seat.Parent.SSC.Beep:Play()
elseif script.Parent.flasher.Value == 4 then
seat.Parent.SSC.Beep:Play()
end
end)
end
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local u2 = false;
return function(p1)
local l__Loading__1 = u1.GUI.Loading;
if p1 == "Trading Plaza" and not u1.Shared.IsTradingPlaza then
p1 = "Spawn";
elseif u1.Shared.IsTradingPlaza then
p1 = "Trading Plaza";
end;
while u2 do
u1.RenderStepped();
end;
u2 = true;
local v2 = u1.GFX.CacheProperty(l__Loading__1.Circle, "Position");
local v3 = v2 + UDim2.new(0, 0, 0.05, 0);
local v4 = u1.GFX.CacheProperty(l__Loading__1.Info, "Position");
local v5 = v4 + UDim2.new(0, 0, 0.05, 0);
l__Loading__1.Circle.Position = v3;
l__Loading__1.Circle.Transparency = 1;
l__Loading__1.Info.Position = v5;
l__Loading__1.Label.TextTransparency = 1;
l__Loading__1.Location.TextTransparency = 1;
l__Loading__1.Location.Text = u1.Directory.Worlds[p1].display_name;
(function()
u1.Functions.Tween(l__Loading__1.Circle, { 0.8, 1, 1 }, {
Position = v2,
ImageTransparency = 0
});
u1.Functions.Tween(l__Loading__1.Circle.Circle, { 0.8, 1, 1 }, {
Position = v2,
ImageTransparency = 0
});
u1.Functions.Tween(l__Loading__1.Info, { 0.8, 1, 1 }, {
Position = v4
});
u1.Functions.Tween(l__Loading__1.Label, { 0.7, 1, 1 }, {
TextTransparency = 0
});
u1.Functions.Tween(l__Loading__1.Label.UIStroke, { 0.9, 1, 1 }, {
Transparency = 0
});
u1.Functions.Tween(l__Loading__1.Location, { 0.9, 1, 1 }, {
TextTransparency = 0
});
u1.Functions.Tween(l__Loading__1.Location.UIStroke, { 0.9, 1, 1 }, {
Transparency = 0
});
u1.Functions.Tween(l__Loading__1.Frame, { 0.9, 1, 1 }, {
Transparency = 0
});
u1.Functions.Tween(l__Loading__1.Texture.ImageLabel, { 0.9, 1, 1 }, {
ImageTransparency = 0
});
l__Loading__1.Gui.Enabled = true;
end)();
local function u3()
u1.Functions.Tween(l__Loading__1.Circle, { 0.5, 1, 1 }, {
Position = v3,
ImageTransparency = 1
});
u1.Functions.Tween(l__Loading__1.Circle.Circle, { 0.5, 1, 1 }, {
Position = v3,
ImageTransparency = 1
});
u1.Functions.Tween(l__Loading__1.Info, { 0.5, 1, 1 }, {
Position = v5
});
u1.Functions.Tween(l__Loading__1.Label, { 0.4, 1, 1 }, {
TextTransparency = 1
});
u1.Functions.Tween(l__Loading__1.Label.UIStroke, { 0.9, 1, 1 }, {
Transparency = 1
});
u1.Functions.Tween(l__Loading__1.Location, { 0.4, 1, 1 }, {
TextTransparency = 1
});
u1.Functions.Tween(l__Loading__1.Location.UIStroke, { 0.9, 1, 1 }, {
Transparency = 1
});
u1.Functions.Tween(l__Loading__1.Frame, { 0.9, 1, 1 }, {
Transparency = 1
});
u1.Functions.Tween(l__Loading__1.Texture.ImageLabel, { 0.9, 1, 1 }, {
ImageTransparency = 1
});
u1.Functions.Wait(1);
l__Loading__1.Gui.Enabled = false;
end;
return function()
u3();
u2 = false;
end;
end;
|
--Char.Humanoid.BreakJointsOnDeath = false
|
if configuracao.EnableRagdoll == true and Char:FindFirstChild("Humanoid") then
Char.Humanoid.Died:Connect(function()
Ragdoll(Char)
end)
end
local leghp = script.Parent.Parent:WaitForChild("Left Leg"):WaitForChild("HP")
local leghp2 = script.Parent.Parent:WaitForChild("Right Leg"):WaitForChild("HP")
local torsohp = script.Parent.Parent:WaitForChild("Torso"):WaitForChild("HP")
local headhp = script.Parent.Parent:WaitForChild("Head"):WaitForChild("HP")
local armhp = script.Parent.Parent:WaitForChild("Left Arm"):WaitForChild("HP")
local armhp2 = script.Parent.Parent:WaitForChild("Right Arm"):WaitForChild("HP")
local lleghp = script.Parent.Parent:WaitForChild("Left Leg"):WaitForChild("HP").MaxValue
local lleghp2 = script.Parent.Parent:WaitForChild("Right Leg"):WaitForChild("HP").MaxValue
local ltorsohp = script.Parent.Parent:WaitForChild("Torso"):WaitForChild("HP").MaxValue
local lheadhp = script.Parent.Parent:WaitForChild("Head"):WaitForChild("HP").MaxValue
local larmhp = script.Parent.Parent:WaitForChild("Left Arm"):WaitForChild("HP").MaxValue
local larmhp2 = script.Parent.Parent:WaitForChild("Right Arm"):WaitForChild("HP").MaxValue
while configuracao.EnableMedSys do
wait()
if Character.Humanoid.Health > 0 and Character:WaitForChild("Head"):WaitForChild("HP").Value > 0 and Character:WaitForChild("Torso"):WaitForChild("HP").Value > 0 then
Character.Humanoid.Health = (Character:WaitForChild("Head"):WaitForChild("HP").Value + Character:WaitForChild("Torso"):WaitForChild("HP").Value + Character:WaitForChild("Left Arm"):WaitForChild("HP").Value + Character:WaitForChild("Right Arm"):WaitForChild("HP").Value + Character:WaitForChild("Left Leg"):WaitForChild("HP").Value + Character:WaitForChild("Right Leg"):WaitForChild("HP").Value)
elseif Character:FindFirstChild("Head") ~= nil and Character:WaitForChild("Head"):WaitForChild("HP").Value <= 0 or Character:FindFirstChild("Torso") ~= nil and Character:WaitForChild("Torso"):WaitForChild("HP").Value <= 0 then
Character.Humanoid.Health = 0
end
if Character.Humanoid.Health > 0 and armhp.Value > 0 and armhp2.Value > 0 or PK.Value == true then
Steady.Value = 1
end
if Character.Humanoid.Health > 0 and armhp.Value <= 0 and Steady.Value > 0 and armhp2.Value > 0 and PK.Value == false then
Steady.Value = 0.75
Dor.Value = Dor.Value + 1
end
if Character.Humanoid.Health > 0 and armhp2.Value <= 0 and Steady.Value > 0 and PK.Value == false then
Steady.Value = 0.5
end
if Sangrando.Value == true then
if PastasStan.Tourniquet.Value == false then
if script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.BleedDamage*2.25) then
PastaVar.HeavyBleed.Value = true
end
--[[if leghp.Value < lleghp -(configuracao.BleedDamage) then
wait(math.random(1,10))
leghp.Value = (leghp.Value - 1)
end
if leghp2.Value < lleghp2 -(configuracao.BleedDamage) then
wait(math.random(1,10))
leghp2.Value = (leghp2.Value - 1)
end
if armhp.Value < larmhp -(configuracao.BleedDamage) then
wait(math.random(1,10))
armhp.Value = (armhp.Value - 1)
end
if armhp2.Value < larmhp2 -(configuracao.BleedDamage) then
wait(math.random(1,10))
armhp2.Value = (armhp2.Value - 1)
end
if headhp.Value < lheadhp -(configuracao.BleedDamage) then
wait(math.random(1,10))
headhp.Value = (headhp.Value - 1)
end
if torsohp.Value < ltorsohp -(configuracao.BleedDamage) then
wait(math.random(1,10))
torsohp.Value = (torsohp.Value - 1)
end]]--
if torsohp.Value > 0 then
Sang.Value = (Sang.Value - (MLs.Value/60))
UltimoSang = Sang.Value
MLs.Value = MLs.Value + 1
elseif torsohp.Value <= 0 then
Sang.Value = (Sang.Value - (MLs.Value/60*4))
UltimoSang = Sang.Value
MLs.Value = MLs.Value + 4
end
end
end
if PastasStan.Tourniquet.Value == true then
Dor.Value = Dor.Value + 0.1
end
if (human.Health - ultimavida < 0) then
Sang.Value = Sang.Value + (human.Health - ultimavida)*((configuracao.BloodMult)*(configuracao.BloodMult)*(configuracao.BloodMult))
UltimoSang = Sang.Value
end
if (human.Health - ultimavida < 0) then
Dor.Value = math.ceil(Dor.Value + (human.Health - ultimavida)*(-configuracao.PainMult))
--Energia.Value = math.ceil(Energia.Value + (human.Health - ultimavida)*(5))
end
if (human.Health - ultimavida < 0) --[[and (Sangrando.Value == true)]] then
MLs.Value = MLs.Value + ((ultimavida - human.Health)* (configuracao.BloodMult))
end
if leghp.Value > (leghp.MaxValue*.75) and leghp2.Value > (leghp.MaxValue*.75) then
--old one = script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.InjuredDamage)
wait(math.random(50,100)/100)
Ferido.Value = false
end
if script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.BleedDamage) then
Sangrando.Value = true
if script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.BleedDamage*2.25) then
PastaVar.HeavyBleed.Value = true
end
if leghp.Value <= (leghp.MaxValue*.25) or leghp2.Value <= (leghp.MaxValue*.25) then
--old one = script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.InjuredDamage)
Ferido.Value = true
if armhp.Value <= (armhp.Value/2) and armhp2.Value <= (armhp.Value/2) and torsohp.Value <= (torsohp.Value/2) and leghp.Value <= (leghp.Value/2) and leghp2.Value <= (leghp.Value/2) or headhp.Value <= (headhp.Value/2) then
--old one = script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.KODamage)
Caido.Value = true
end
end
end
if human.Health >= ultimavida and Sangrando.Value == false then
Sang.Value = Sang.Value + 10
MLs.Value = MLs.Value - 10
end
if Sang.Value <= 0 then
--human.Health = 0
end
ultimavida = script.Parent.Parent.Humanoid.Health
if script.Parent.Parent:FindFirstChild("Left Leg") ~= nil then
lleghp = script.Parent.Parent:WaitForChild("Left Leg"):WaitForChild("HP").Value
lleghp2 = script.Parent.Parent:WaitForChild("Right Leg"):WaitForChild("HP").Value
ltorsohp = script.Parent.Parent:WaitForChild("Torso"):WaitForChild("HP").Value
lheadhp = script.Parent.Parent:WaitForChild("Head"):WaitForChild("HP").Value
larmhp = script.Parent.Parent:WaitForChild("Left Arm"):WaitForChild("HP").Value
larmhp2 = script.Parent.Parent:WaitForChild("Right Arm"):WaitForChild("HP").Value
end
spawn(function(timer)
if Sang.Value >= 3500 and Dor.Value < 200 and debounce == false and Caido.Value == true then
debounce = true
wait(60)
Caido.Value = false
debounce = false
end
end)
end
-- Quero um pouco de credito,plox :P --
-- FEITO 100% POR SCORPION --
-- Oficial Release 1.5 --
|
--Rescripted by Luckymaxer
--Made by Stickmasterluke
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Sparkles = Handle:WaitForChild("Sparkles")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
WeaponHud = Tool:WaitForChild("WeaponHud")
WeaponNameTag = WeaponHud:WaitForChild("WeaponName")
GuiBar = WeaponHud:WaitForChild("Bar")
GuiBarFill = GuiBar:WaitForChild("Fill")
WeaponNameTag.Text = Tool:WaitForChild("ToolName").Value
BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false
Animations = {
Equip = {Animation = Tool:WaitForChild("Equip"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = nil},
Hold = {Animation = Tool:WaitForChild("Hold"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
LeftSlash = {Animation = Tool:WaitForChild("LeftSlash"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
RightSlash = {Animation = Tool:WaitForChild("RightSlash"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
Stab1 = {Animation = Tool:WaitForChild("Stab1"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
Stab2 = {Animation = Tool:WaitForChild("Stab2"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
}
Sounds = {
Swoosh1 = Handle:WaitForChild("Swoosh1"),
Swoosh2 = Handle:WaitForChild("Swoosh2"),
Hit1 = Handle:WaitForChild("Hit1"),
Hit2 = Handle:WaitForChild("Hit2"),
Hit3 = Handle:WaitForChild("Hit3"),
Clash1 = Handle:WaitForChild("Clash1"),
Clash2 = Handle:WaitForChild("Clash2"),
Clash3 = Handle:WaitForChild("Clash3"),
Clash4 = Handle:WaitForChild("Clash4"),
Clash5 = Handle:WaitForChild("Clash5"),
}
Damage = 95 -- +/- 10%
DamageWindow = 1 --How long the player has to hit opponent to deal damage after click
SwingRate = 0.55
BloodEffects = true
Ready = false
ToolEquipped = false
Rate = (1 / 30)
LastSwing = 0
MouseDown = false
CurrentAnimation = nil
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
Tool.Enabled = true
ServerControl.OnServerInvoke = (function(player, Mode, Value)
if player == Player then
if Mode == "MouseClick" then
MouseDown = Value.Down
if MouseDown then
Activated()
end
elseif Mode == "KeyPress" then
local Key = Value.Key
local Down = Value.Down
end
end
end)
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Billboard(Pos, Text, Time, Color)
local Pos = (Pos or Vector3.new(0, 0, 0))
local Text = (Text or "Hello World!")
local Time = (Time or 2)
local Color = (Color or Color3.new(1, 0, 0))
local Pos = (Pos + Vector3.new(0, 5, 0))
local EffectPart = BasePart:Clone()
EffectPart.Name = "Effect"
EffectPart.Size = Vector3.new(0, 0, 0)
EffectPart.CFrame=CFrame.new(Pos)
EffectPart.Anchored = true
EffectPart.CanCollide = false
EffectPart.Transparency = 1
local BillboardGui = Instance.new("BillboardGui")
BillboardGui.Size = UDim2.new(3, 0, 3, 0)
BillboardGui.Adornee = EffectPart
local TextLabel = Instance.new("TextLabel")
TextLabel.BackgroundTransparency = 1
TextLabel.Size = UDim2.new(1, 0, 1, 0)
TextLabel.Text = Text
TextLabel.TextColor3 = Color
TextLabel.TextScaled = true
TextLabel.Font = Enum.Font.ArialBold
TextLabel.Parent = BillboardGui
BillboardGui.Parent = EffectPart
Debris:AddItem(EffectPart, (Time + 0.1))
EffectPart.Parent = game:GetService("Workspace")
Delay(0, function()
local Frames = (Time / Rate)
for Frame = 1, Frames do
wait(Rate)
local Percent = (Frame / Frames)
EffectPart.CFrame=CFrame.new(Pos) + Vector3.new(0, (5 * Percent), 0)
TextLabel.TextTransparency = Percent
end
if EffectPart and EffectPart.Parent then
EffectPart:Destroy()
end
end)
end
function MakeBlood(Part)
if not Part then
return
end
local Blood = BasePart:Clone()
Blood.BrickColor = BrickColor.new("Bright red")
Blood.Transparency = (math.random(0, 1) * 0.5)
Blood.CanCollide = ((math.random() < 0.5 and false) or true)
Blood.Size = Vector3.new((0.2 * math.random(1, 5)), (0.2 * math.random(1, 5)), (0.2 * math.random(1, 5)))
Blood.Velocity= Part.Velocity + (Vector3.new((math.random() - 0.5), (math.random() - 0.5), (math.random() - 0.5)) * 30)
Blood.RotVelocity = Part.RotVelocity + (Vector3.new((math.random() - 0.5), (math.random() - 0.5), (math.random() - 0.5)) * 20)
Blood.CFrame= Part.CFrame * CFrame.new(((math.random() - 0.5) * 3), ((math.random() - 0.5) * 3), ((math.random() - 0.5) * 3)) * CFrame.Angles((math.pi * 2 * math.random()), (math.pi * 2 * math.random()), (math.pi * 2 * math.random()))
Debris:AddItem(Blood, (math.random() * 4))
Blood.Parent = game:GetService("Workspace")
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() or not Ready or not ToolEquipped or (tick() - LastSwing) > DamageWindow then
return
end
local character = Hit.Parent
if character == Character then
return
end
if Hit:FindFirstChild("CanBlock") and Handle:FindFirstChild("Blockable") then
local Ready = false
local PossibleSounds = {Sounds.Clash1, Sounds.Clash2, Sounds.Clash3, Sounds.Clash4, Sounds.Clash5}
local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
Sound:Play()
Sparkles.Enabled = true
Delay(0.2, function()
Sparkles.Enabled = false
end)
Billboard(Handle.Position, "Block", 2, Color3.new(1, 1, 0))
end
local humanoid = character:FindFirstChild("Humanoid")
local player = Players:GetPlayerFromCharacter(character)
local RightArm = Character:FindFirstChild("Right Arm")
if humanoid and humanoid.Health > 0 and humanoid ~= Humanoid and RightArm then
local RightGrip = RightArm:FindFirstChild("RightGrip")
if RightGrip and (RightGrip.Part0 == Handle or RightGrip.Part1 == Handle) then
if player and player ~= Player and not Player.Neutral and not player.Neutral and Player.TeamColor == player.TeamColor then
return --No team killing
end
Ready = false
UntagHumanoid(humanoid)
TagHumanoid(humanoid)
local LocalDamage= math.floor(Damage * (0.9 + (math.random() * 0.2)) + 0.5)
humanoid:TakeDamage(LocalDamage)
Billboard(Hit.Position, ("-" .. tostring(LocalDamage)))
local PossibleSounds = {Sounds.Hit1, Sounds.Hit2, Sounds.Hit3}
local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
Sound:Play()
if BloodEffects then
local NumBloodEffects = math.ceil(LocalDamage / 10)
for i = 1, math.random((NumBloodEffects - 1), (NumBloodEffects + 1)) do
MakeBlood(Hit)
end
end
end
end
end
function Activated()
if ToolEquipped and (tick() - LastSwing) >= SwingRate then
Tool.Enabled = false
Ready = true
local PossibleSounds = {Sounds.Swoosh1, Sounds.Swoosh2}
local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
Sound:Play()
local AttackAnimations = {Animations.LeftSlash, Animations.RightSlash, Animations.Stab1, Animations.Stab2}
local NewAnimation = AttackAnimations[math.random(1, #AttackAnimations)]
while NewAnimation == CurrentAnimation do
NewAnimation = AttackAnimations[math.random(1, #AttackAnimations)]
end
CurrentAnimation = NewAnimation
InvokeClient("PlayAnimation", CurrentAnimation)
LastSwing = tick()
wait(SwingRate)
if MouseDown then
Activated()
end
Tool.Enabled = true
end
end
function UpdateGui()
local SwingPercent = math.min(((tick() - LastSwing) / SwingRate), 1)
if SwingPercent < 0.5 then --fade from red to yellow then to green
GuiBarFill.BackgroundColor3 = Color3.new(1, (SwingPercent * 2), 0)
else
GuiBarFill.BackgroundColor3 = Color3.new((1 - ((SwingPercent - 0.5 ) / 0.5)), 1, 0)
end
GuiBarFill.Size = UDim2.new(SwingPercent, 0, 1, 0)
end
function CheckIfAlive()
return (Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
PlayerGui = Player:FindFirstChild("PlayerGui")
Humanoid = Character:FindFirstChild("Humanoid")
if not CheckIfAlive() then
return
end
if PlayerGui then
WeaponHud.Parent = PlayerGui
end
InvokeClient("PlayAnimation", Animations.Equip)
LastSwing = tick()
Ready = false
ToolEquipped = true
for i, v in pairs(Animations) do
if v and v.Animation then
InvokeClient("Preload", v.Animation.AnimationId)
end
end
ToolEquipped = true
end
function Unequipped()
for i, v in pairs(Animations) do
InvokeClient("StopAnimation", v)
end
WeaponHud.Parent = Tool
ToolEquipped = false
Ready = false
end
Handle.Touched:connect(Blow)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Spawn(function()
while true do
UpdateGui()
wait(Rate)
end
end)
|
--[=[
@class Timer
The Timer class allows for code to run periodically at specified intervals.
```lua
local timer = Timer.new(2)
timer.Tick:Connect(function()
print("Tock")
end)
timer:Start()
```
]=]
|
local Timer = {}
Timer.__index = Timer
|
------)
|
local TweenService = game:GetService("TweenService")
local parts = {centerWeld,leftWeld,rightWeld}
local part = centerWeld
|
--[[Weight and CG]]
|
Tune.Weight = 2014 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 4 ,
--[[Length]] 15 }
Tune.WeightDist = 51 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = MORE STABLE / carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- Reload animation
|
function reload()
if not reloading then
reloading=true;
updateAmmo()
local reloadTime = tankStats.ReloadTime.Value;
local Timer = 0
for i = 7, 1, -1 do
wait(reloadTime/8);
Timer = Timer + 1
if Timer >= 2 and Loaded == false then
GUI.ReloadSound:Play()
Loaded = true
end
end
wait(reloadTime/8);
if Timer >= 7 then
GUI.Loaded.Visible = true
Timer = 0
reloading = false;
end
end
end
function fire()
if reloading then return end;
local APAmmo = tankStats.APAmmo;
local HEAmmo = tankStats.HEAmmo;
if currRound.Value == "AP" and APAmmo.Value <= 0 then return end
if currRound.Value == "HE" and HEAmmo.Value <= 0 then return end
GUI.Loaded.Visible = false
TFE:FireServer('Fire',parts,currRound,APAmmo,HEAmmo,tankStats)
reload(GUI);
end
|
--[=[
Cleans up all tasks and removes them as entries from the Maid.
:::note
Signals that are already connected are always disconnected first. After that
any signals added during a cleaning phase will be disconnected at random times.
:::
:::tip
DoCleaning() may be recursively invoked. This allows the you to ensure that
tasks or other tasks. Each task will be executed once.
However, adding tasks while cleaning is not generally a good idea, as if you add a
function that adds itself, this will loop indefinitely.
:::
]=]
|
function Maid:DoCleaning()
local tasks = self._tasks
-- Disconnect all events first as we know this is safe
for index, job in pairs(tasks) do
if typeof(job) == "RBXScriptConnection" then
tasks[index] = nil
job:Disconnect()
end
end
-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
local index, job = next(tasks)
while job ~= nil do
tasks[index] = nil
if type(job) == "function" then
job()
elseif typeof(job) == "RBXScriptConnection" then
job:Disconnect()
elseif job.Destroy then
job:Destroy()
end
index, job = next(tasks)
end
end
|
--[=[
@param interval number
@param callback () -> nil
@param startNow boolean?
@param updateSignal RBXScriptSignal? | Signal?
@param timeFunc () -> number
@return RBXScriptConnection
Creates a simplified timer which just fires off a callback function at the given interval.
]=]
|
function Timer.Simple(interval: number, callback: CallbackFunc, startNow: boolean?, updateSignal: RBXScriptSignal?, timeFunc: TimeFunc?)
local update = updateSignal or RunService.Heartbeat
local t = timeFunc or time
local nextTick = t() + interval
if startNow then
task.defer(callback)
end
return update:Connect(function()
local now = t()
if now >= nextTick then
nextTick = now + interval
task.defer(callback)
end
end)
end
|
-- declarations
|
local head = script.Parent
local sound = head:findFirstChild("Victory")
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
sound:play()
if part.Parent:findFirstChild("Head"):findFirstChild("face").Texture == nil then return end
part.Parent:findFirstChild("Head"):findFirstChild("face").Transparency = 1
end
end
script.Parent.Touched:connect(onTouched)
|
-- declarations
|
local sGettingUp = newSound("GettingUp", "rbxasset://sounds/action_get_up.mp3")
local sDied = newSound("Died", "rbxasset://sounds/uuhhh.mp3")
local sFreeFalling = newSound("FreeFalling", "rbxasset://sounds/action_falling.mp3")
local sJumping = newSound("Jumping", "rbxasset://sounds/action_jump.mp3")
local sLanding = newSound("Landing", "rbxasset://sounds/action_jump_land.mp3")
local sSplash = newSound("Splash", "rbxasset://sounds/impact_water.mp3")
local sRunning = newSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3")
sRunning.Looped = true
local sSwimming = newSound("Swimming", "rbxasset://sounds/action_swim.mp3")
sSwimming.Looped = true
local sClimbing = newSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3")
sClimbing.Looped = true
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid;
for _,Child in pairs(Figure:GetChildren())do
if Child and Child.ClassName=="Humanoid"then
Humanoid=Child;
end;
end;
local hasPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
local filteringEnabled = game.Workspace.FilteringEnabled
local prevState = "None"
|
-------------------------
|
function onClicked()
R.Function1.Disabled = false
R.loop.Disabled = true
R.BrickColor = BrickColor.new("Neon orange")
R.Function2.Disabled = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[[
Create a new expectation
]]
|
function Expectation.new(value)
local self = {
value = value,
successCondition = true,
condition = false
}
setmetatable(self, Expectation)
self.a = bindSelf(self, self.a)
self.an = self.a
self.ok = bindSelf(self, self.ok)
self.equal = bindSelf(self, self.equal)
self.throw = bindSelf(self, self.throw)
self.near = bindSelf(self, self.near)
return self
end
function Expectation.__index(self, key)
-- Keys that don't do anything except improve readability
if SELF_KEYS[key] then
return self
end
-- Invert your assertion
if NEGATION_KEYS[key] then
local newExpectation = Expectation.new(self.value)
newExpectation.successCondition = not self.successCondition
return newExpectation
end
-- Fall back to methods provided by Expectation
return Expectation[key]
end
|
-- initial script made by who knows, anti jump added by ColonelGraff! thanks for using
|
AJ = false
on = 0
Tool = script.Parent
welds = {}
sh = {}
arms = nil
torso = nil
f = nil
function Crouch(ison)
Tool.Parent:findFirstChild("Humanoid").WalkSpeed = 9
if arms == nil and torso == nil then
arms = {Tool.Parent:FindFirstChild("Left Leg"), Tool.Parent:FindFirstChild("Right Leg")}
torso = Tool.Parent:FindFirstChild("Torso")
end
if arms ~= nil and torso ~= nil then
sh = {torso:FindFirstChild("Left Hip"), torso:FindFirstChild("Right Hip")}
if sh ~= nil then
local yes = true
if yes then
yes = false
if ison == 1 then
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(-0.5, 0.75, 1)
arms[1].Name = "LDave"
arms[1].CanCollide = true
welds[1] = weld1
|
-- local sound = SM.FetchSound(soundName)
-- local speed = sound.TimeLength
|
if (Rep.Constants.RelativeTime.Value - _G.SD[player.UserId].Data.tempData.lastAction) >= 0.25 then
_G.SD[player.UserId].Data.tempData.lastAction = Rep.Constants.RelativeTime.Value
SM.PlaySoundInObject(soundName, char.Head, equippedToolData.noteWaver, 6)
end
end)
Rep.Relay.Tool.StopMusicTool.OnServerEvent:connect(function(player, musicName)
local char
if player.Character and player.Character.Humanoid and player.Character.Humanoid.Health > 0 and _G.SD[player.UserId].Data.stats.health > 0 then
char = player.Character
else
return
end
if not musicName then
local equippedToolName = _G.SD[player.UserId].Data.equipment.toolbar[_G.SD[player.UserId].Data.tempData.equippedSlot].name
local equippedToolData = EntityData["Tool"][equippedToolName]
musicName = equippedToolData.noteName
end
SM.StopSoundInObject(musicName, char.Head)
end)
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 650 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 950 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 9400 -- Use sliders to manipulate values
Tune.Redline = 9800
Tune.EqPoint = 7250
Tune.PeakSharpness = 9.5
Tune.CurveMult = 0.15
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-----------------------------------------------
-- Target Computer script written by Rolleol --
-----------------------------------------------
--This script works with the gatling gun
--
--
--
--
|
local switch = script.Parent
local base = script.Parent.Parent.Base
local target = nil
local targetposition1 = Vector3.new(0,0,0) -- Stores target's position, you can add more if you like
local targetposition2 = Vector3.new(0,0,0)
local targetposition3 = Vector3.new(0,0,0)
local targetposition4 = Vector3.new(0,0,0)
local targetposition5 = Vector3.new(0,0,0)
local targetposition6 = Vector3.new(0,0,0)
local targetvelocity1 = Vector3.new(0,0,0) -- Stores target's velocity, you can add more if you like
local targetvelocity2 = Vector3.new(0,0,0)
local targetvelocity3 = Vector3.new(0,0,0)
local targetvelocity4 = Vector3.new(0,0,0)
local targetvelocity5 = Vector3.new(0,0,0)
local targetvelocity6 = Vector3.new(0,0,0)
local targetavgposition = Vector3.new(0,0,0) -- Stores target's average position and velocity, might be useful
local targetavgvelocity = Vector3.new(0,0,0)
local targetnextposition = Vector3.new(0,0,0) -- This is what the script thinks the target's next position/velocity will be based on
local targetnextvelocity = Vector3.new(0,0,0) -- the values above
local targetpredictedposition = Vector3.new(0,0,0) -- This is what it returns to the other scripts and used for aiming and fuses
local timeuntilrerollvelocitymultiplier = 0 -- used for rerolling velocity multiplier
local velocitymultiplier = 1 -- literal multiplier, 1x is normal
while true do
target = script.Parent.Target.Value
targetposition6=targetposition5
targetposition5=targetposition4
targetposition4=targetposition3
targetposition3=targetposition2
targetposition2=targetposition1
targetposition1=switch.TargetPosition.Value -- current value
if targetposition2==Vector3.new(0,0,0) then -- if target position 2 is still empty, make all others copy current position
targetposition6=targetposition1
targetposition5=targetposition1
targetposition4=targetposition1
targetposition3=targetposition1
targetposition2=targetposition1
end
targetvelocity6=targetvelocity5
targetvelocity5=targetvelocity4
targetvelocity4=targetvelocity3
targetvelocity3=targetvelocity2
targetvelocity2=targetvelocity1
targetvelocity1=switch.TargetVelocity.Value -- current value
targetavgposition=(targetposition1+targetposition2+targetposition3+targetposition4+targetposition5+targetposition6)/6
targetavgvelocity=(targetvelocity1+targetvelocity2+targetvelocity3+targetvelocity4+targetvelocity5+targetvelocity6)/6
-- Simplest equation, but lacks any sense of tracking
--targetnextposition=targetposition1
--targetnextvelocity=targetvelocity1
-- Worst equation, easily fooled by constantly turning
--targetnextposition=(targetposition1+targetavgposition)/2 -- Worst equation, easily fooled by constantly turning
--targetnextvelocity=(targetvelocity1+targetavgvelocity)/2
-- This one is kinda meh, it can only reliably engage targets at 400 velocity
--targetnextposition=targetavgposition
--targetnextvelocity=targetavgvelocity
-- Okay equation, can reliably shoot at targets up to 750+ velocity
--targetnextposition=targetposition1+(targetposition2-targetposition1)
--targetnextvelocity=targetvelocity1+(targetvelocity2-targetvelocity1)
-- Very good equation, can reliably get direct hits on targets up to 150 velocity and with fuses can shoot at targets up to 800+ velocity
targetnextposition=(targetposition1+(targetposition2-targetposition1)+(targetposition3-targetposition2)+(targetposition4-targetposition3)+(targetposition5-targetposition4)+(targetposition6-targetposition5)/6)
targetnextvelocity=(targetvelocity1+(targetvelocity2-targetvelocity1)+(targetvelocity3-targetvelocity2)+(targetvelocity4-targetvelocity3)+(targetvelocity5-targetvelocity4)+(targetvelocity6-targetvelocity5)/6)
targetnextvelocity=targetnextvelocity*velocitymultiplier -- place random multiplier on velocity so it isn't too predictable
if timeuntilrerollvelocitymultiplier < 1 then
timeuntilrerollvelocitymultiplier=10 -- 1 second between rerolls
velocitymultiplier=(math.random(75,125)/100)
else
timeuntilrerollvelocitymultiplier=timeuntilrerollvelocitymultiplier-1
end
targetpredictedposition=targetnextposition+(targetnextvelocity*(1+((switch.Position-targetpredictedposition).Magnitude)/3000))
switch.TargetPredictedPosition.Value=targetpredictedposition -- Sets the TargetPredictedPosition so that other scripts can use it
switch.TargetingError.Value=targetpredictedposition-(switch.TargetPosition.Value+switch.TargetVelocity.Value) -- just for debug purposes
wait(0.1) -- I would advise not setting this too high or too low because then it either becomes unresponsive to
-- evasive maneuvers or won't have enough data to predict where the target is going
-- I think a value of (Delay between shots/2) secs works well enough
end
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local MoneyModule = require(game.ReplicatedStorage.Source.SystemModules.Money)
MoneyModule.BuyWeaponFromDialogueFolder(player,dialogueFolder)
end
|
--[[
LOWGames Studios
Date: 27 October 2022
by Elder
]]
|
--
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1, p2)
for v1 = #p1, 1, -1 do
if p1[v1] == p2 then
table.remove(p1, v1);
end;
end;
return p1;
end;
|
--
|
if Health_Bar == true then
game.StarterGui:SetCoreGuiEnabled(1,true)
elseif Health_Bar == false then
game.StarterGui:SetCoreGuiEnabled(1,false)
end
if Player_List == true then
game.StarterGui:SetCoreGuiEnabled(0,true)
elseif Player_List == false then
game.StarterGui:SetCoreGuiEnabled(0,false)
end
if Tool_Bar == true then
game.StarterGui:SetCoreGuiEnabled(2,true)
elseif Tool_Bar == false then
game.StarterGui:SetCoreGuiEnabled(2,false)
end
if Chat == true then
game.StarterGui:SetCoreGuiEnabled(3,true)
elseif Chat == false then
game.StarterGui:SetCoreGuiEnabled(3,false)
end
|
--\\ Only Edit Above //--
|
local UserInputService = game:GetService('UserInputService')
local plr = game.Players.LocalPlayer
local Jumped = false --Debounce
UserInputService.JumpRequest:Connect(function()
local char = plr.Character -- some may place this script in StarterPlayer...
if not Jumped then
if char.Humanoid.FloorMaterial == Enum.Material.Air then return end -- Prevent mid air jumps
Jumped = true --Making it true do it does not loop twice
char.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) --Making the character jump
task.wait(jumpCooldown) -- yield x
Jumped = false --Make it false so we can repeat it again
else
char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
end
end)
|
--// F key, Horn
|
mouse.KeyUp:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 4
veh.Lightbar.middle.Yelp.Volume = 4
veh.Lightbar.middle.Priority.Volume = 4
veh.Lightbar.middle.Manual.Volume = 4
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)
|
-- Basic settings
|
local COOLDOWN = 0.25
local tool = script.Parent
local toolPlr
local debounce = false
script.ClientActivate.OnServerEvent:connect(function(plr)
-- Check if tool is equipped and correct player
if plr == toolPlr and not debounce then
debounce = true
-- Toggle
tool.Handle.MoneyEmitter:Emit(10)
game.ReplicatedStorage.Interactions.Client.PlaySound:FireClient(plr, tool.Handle:FindFirstChild("Sound" .. math.random(1, 3)))
-- Cooldown
wait(COOLDOWN)
debounce = false
end
end)
tool.Equipped:connect(function()
-- Set tool player
toolPlr = game.Players:GetPlayerFromCharacter(tool.Parent)
end)
|
--d.DidLoop:Connect(function()
-- print("loop animation")
--end)
|
function Zombie:Initialize()
Shetchik = 1
for k, v in pairs(self.Obj:GetChildren()) do
if v:IsA("BasePart") then
v.CollisionGroupId = 1
end
end
spawn(function()
d:Play()
self.Obj:SetPrimaryPartCFrame(CFrame.new(workspace.Real_Spawn.Position))
self:moveTo()
end)
end
|
-- right mouse button up & down events
|
local rmbDown, rmbUp do
local rmbDownBindable = Instance.new("BindableEvent")
local rmbUpBindable = Instance.new("BindableEvent")
rmbDown = rmbDownBindable.Event
rmbUp = rmbUpBindable.Event
UserInputService.InputBegan:Connect(function(input, gpe)
if not gpe and input.UserInputType == Enum.UserInputType.MouseButton2 then
rmbDownBindable:Fire()
end
end)
UserInputService.InputEnded:Connect(function(input, gpe)
if input.UserInputType == Enum.UserInputType.MouseButton2 then
rmbUpBindable:Fire()
end
end)
end
local thumbstickCurve do
local K_CURVATURE = 2 -- amount of upwards curvature (0 is flat)
local K_DEADZONE = 0.1 -- deadzone
function thumbstickCurve(x)
-- remove sign, apply linear deadzone
local fDeadzone = (math.abs(x) - K_DEADZONE)/(1 - K_DEADZONE)
-- apply exponential curve and scale to fit in [0, 1]
local fCurve = (math.exp(K_CURVATURE*fDeadzone) - 1)/(math.exp(K_CURVATURE) - 1)
-- reapply sign and clamp
return math.sign(x)*math.clamp(fCurve, 0, 1)
end
end
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadRight ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadUp ,
}
|
--print("found humanoid")
|
humanoid.HealthChanged:Connect(function(health)
--print(health)
script.Parent.PlaybackSpeed = health <= 30 and 2 or 1
end)
|
---Controls UI
|
script.Parent.Parent:WaitForChild("Controls")
script.Parent.Parent:WaitForChild("ControlsOpen")
script.Parent:WaitForChild("Window")
script.Parent:WaitForChild("Toggle")
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local UserInputService = game:GetService("UserInputService")
local cPanel = script.Parent
local Controls = script.Parent.Parent.Controls
local ver = require(car["A-Chassis Tune"].README)
cPanel.Window["//INSPARE"].Text = "A-Chassis "..ver.." by //INSPARE"
local controlsOpen = false
local cInputB = nil
local cInputT = nil
local cInput = false
for i,v in pairs(_Tune.Peripherals) do
script.Parent.Parent.Controls:WaitForChild(i)
local slider = cPanel.Window.Content[i]
slider.Text = v.."%"
slider.S.CanvasPosition=Vector2.new(v*(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset)/100,0)
slider.S.Changed:connect(function(property)
if property=="CanvasPosition" then
Controls[i].Value = math.floor(100*slider.S.CanvasPosition.x/(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset))
slider.Text = Controls[i].Value.."%"
end
end)
end
for i,v in pairs(_Tune.Controls) do
script.Parent.Parent.Controls:WaitForChild(i)
local button = cPanel.Window.Content[i]
button.Text = v.Name
button.MouseButton1Click:connect(function()
script.Parent.Parent.ControlsOpen.Value = true
cPanel.Window.Overlay.Visible = true
cInput = true
repeat wait() until cInputB~=nil
if cInputB == Enum.KeyCode.Return or cInputB == Enum.KeyCode.KeypadEnter then
--do nothing
elseif string.find(i,"Contlr")~=nil then
if cInputT.Name:find("Gamepad") then
Controls[i].Value = cInputB.Name
button.Text = cInputB.Name
else
cPanel.Window.Error.Visible = true
end
elseif i=="MouseThrottle" or i=="MouseBrake" then
if cInputT == Enum.UserInputType.MouseButton1 or cInputT == Enum.UserInputType.MouseButton2 then
Controls[i].Value = cInputT.Name
button.Text = cInputT.Name
else
cPanel.Window.Error.Visible = true
end
else
if cInputT == Enum.UserInputType.Keyboard then
Controls[i].Value = cInputB.Name
button.Text = cInputB.Name
else
cPanel.Window.Error.Visible = true
end
end
cInputB = nil
cInputT = nil
cInput = false
wait(.2)
cPanel.Window.Overlay.Visible = false
script.Parent.Parent.ControlsOpen.Value = false
end)
end
cPanel.Window.Error.Changed:connect(function(property)
if property == "Visible" then
wait(3)
cPanel.Window.Error.Visible = false
end
end)
UserInputService.InputBegan:connect(function(input) if cInput then cInputB = input.KeyCode cInputT = input.UserInputType end end)
UserInputService.InputChanged:connect(function(input) if cInput and (input.KeyCode==Enum.KeyCode.Thumbstick1 or input.KeyCode==Enum.KeyCode.Thumbstick2) then cInputB = input.KeyCode cInputT = input.UserInputType end end)
cPanel.Toggle.MouseButton1Click:connect(function()
controlsOpen = not controlsOpen
if controlsOpen then
cPanel.Toggle.BackgroundColor3 = Color3.new(1,85/255,.5)
cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0.5, -250),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true)
else
cPanel.Toggle.BackgroundColor3 = Color3.new(1,170/255,0)
cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0, -500),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true)
end
end)
cPanel.Window.Tabs.Keyboard.MouseButton1Click:connect(function()
cPanel.Window.Content:TweenPosition(UDim2.new(0, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)
cPanel.Window.Tabs.Mouse.MouseButton1Click:connect(function()
cPanel.Window.Content:TweenPosition(UDim2.new(-1, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)
cPanel.Window.Tabs.Controller.MouseButton1Click:connect(function()
cPanel.Window.Content:TweenPosition(UDim2.new(-2, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)
wait(.5)
cPanel.Toggle:TweenPosition(UDim2.new(0, 50, 1, -30),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,false)
for i=1,6 do
cPanel.Toggle.BackgroundColor3 = Color3.new(100/255,100/255,100/255)
wait(.2)
if controlsOpen then
cPanel.Toggle.BackgroundColor3 = Color3.new(1,85/255,.5)
else
cPanel.Toggle.BackgroundColor3 = Color3.new(1,170/255,0)
end
wait(.2)
end
|
--[[Drivetrain]]
|
Tune.Config = "RWD" --"FWD" , "RWD" , "AWD"
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres = 50 -- 1 - 100%
Tune.RDiffLockThres = 50 -- 0 - 100%
Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--Traction Control Settings
Tune.TCSEnabled = true -- Implements TCS
Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
|
--// Above was taken directly from Util.GetStringTextBounds() in the old chat corescripts.
|
function methods:GetMessageHeight(BaseMessage, BaseFrame, xSize)
local function removeTags(str)
str = str:gsub("<br%s*/>", "\n")
return (str:gsub("<[^<>]->", ""))
end
xSize = xSize or BaseFrame.AbsoluteSize.X
local textBoundsSize = self:GetStringTextBounds(removeTags(BaseMessage.Text), BaseMessage.Font, BaseMessage.TextSize, Vector2.new(xSize, 1000))
if textBoundsSize.Y ~= math.floor(textBoundsSize.Y) then
-- HACK Alert. TODO: Remove this when we switch UDim2 to use float Offsets
-- This is nessary due to rounding issues on mobile devices when translating between screen pixels and native pixels
return textBoundsSize.Y + 1
end
return textBoundsSize.Y
end
function methods:GetNumberOfSpaces(str, font, textSize)
local strSize = self:GetStringTextBounds(str, font, textSize)
local singleSpaceSize = self:GetStringTextBounds(" ", font, textSize)
return math.ceil(strSize.X / singleSpaceSize.X)
end
function methods:CreateBaseMessage(message, font, textSize, chatColor)
local BaseFrame = self:GetFromObjectPool("Frame")
BaseFrame.Selectable = false
BaseFrame.Size = UDim2.new(1, 0, 0, 18)
BaseFrame.Visible = true
BaseFrame.BackgroundTransparency = 1
local messageBorder = 8
local BaseMessage = self:GetFromObjectPool("TextLabel")
BaseMessage.Selectable = false
BaseMessage.Size = UDim2.new(1, -(messageBorder + 6), 1, 0)
BaseMessage.Position = UDim2.new(0, messageBorder, 0, 0)
BaseMessage.BackgroundTransparency = 1
BaseMessage.Font = font
BaseMessage.TextSize = textSize
BaseMessage.TextXAlignment = Enum.TextXAlignment.Left
BaseMessage.TextYAlignment = Enum.TextYAlignment.Top
BaseMessage.TextTransparency = 0
BaseMessage.TextStrokeTransparency = 0.75
BaseMessage.TextColor3 = chatColor
BaseMessage.TextWrapped = true
BaseMessage.ClipsDescendants = true
BaseMessage.Text = message
BaseMessage.Visible = true
BaseMessage.Parent = BaseFrame
BaseMessage.RichText = true
return BaseFrame, BaseMessage
end
function methods:AddNameButtonToBaseMessage(BaseMessage, nameColor, formatName, playerName)
local speakerNameSize = self:GetStringTextBounds(formatName, BaseMessage.Font, BaseMessage.TextSize)
local NameButton = self:GetFromObjectPool("TextButton")
NameButton.Selectable = false
NameButton.Size = UDim2.new(0, speakerNameSize.X, 0, speakerNameSize.Y)
NameButton.Position = UDim2.new(0, 0, 0, 0)
NameButton.BackgroundTransparency = 1
NameButton.Font = BaseMessage.Font
NameButton.TextSize = BaseMessage.TextSize
NameButton.TextXAlignment = BaseMessage.TextXAlignment
NameButton.TextYAlignment = BaseMessage.TextYAlignment
NameButton.TextTransparency = BaseMessage.TextTransparency
NameButton.TextStrokeTransparency = BaseMessage.TextStrokeTransparency
NameButton.TextColor3 = nameColor
NameButton.Text = formatName
NameButton.Visible = true
NameButton.Parent = BaseMessage
local clickedConn = NameButton.MouseButton1Click:connect(function()
self:NameButtonClicked(NameButton, playerName)
end)
local changedConn = nil
changedConn = NameButton.Changed:connect(function(prop)
if prop == "Parent" then
clickedConn:Disconnect()
changedConn:Disconnect()
end
end)
return NameButton
end
function methods:AddChannelButtonToBaseMessage(BaseMessage, channelColor, formatChannelName, channelName)
local channelNameSize = self:GetStringTextBounds(formatChannelName, BaseMessage.Font, BaseMessage.TextSize)
local ChannelButton = self:GetFromObjectPool("TextButton")
ChannelButton.Selectable = false
ChannelButton.Size = UDim2.new(0, channelNameSize.X, 0, channelNameSize.Y)
ChannelButton.Position = UDim2.new(0, 0, 0, 0)
ChannelButton.BackgroundTransparency = 1
ChannelButton.Font = BaseMessage.Font
ChannelButton.TextSize = BaseMessage.TextSize
ChannelButton.TextXAlignment = BaseMessage.TextXAlignment
ChannelButton.TextYAlignment = BaseMessage.TextYAlignment
ChannelButton.TextTransparency = BaseMessage.TextTransparency
ChannelButton.TextStrokeTransparency = BaseMessage.TextStrokeTransparency
ChannelButton.TextColor3 = channelColor
ChannelButton.Text = formatChannelName
ChannelButton.Visible = true
ChannelButton.Parent = BaseMessage
local clickedConn = ChannelButton.MouseButton1Click:connect(function()
self:ChannelButtonClicked(ChannelButton, channelName)
end)
local changedConn = nil
changedConn = ChannelButton.Changed:connect(function(prop)
if prop == "Parent" then
clickedConn:Disconnect()
changedConn:Disconnect()
end
end)
return ChannelButton
end
function methods:AddTagLabelToBaseMessage(BaseMessage, tagColor, formatTagText)
local tagNameSize = self:GetStringTextBounds(formatTagText, BaseMessage.Font, BaseMessage.TextSize)
local TagLabel = self:GetFromObjectPool("TextLabel")
TagLabel.Selectable = false
TagLabel.Size = UDim2.new(0, tagNameSize.X, 0, tagNameSize.Y)
TagLabel.Position = UDim2.new(0, 0, 0, 0)
TagLabel.BackgroundTransparency = 1
TagLabel.Font = BaseMessage.Font
TagLabel.TextSize = BaseMessage.TextSize
TagLabel.TextXAlignment = BaseMessage.TextXAlignment
TagLabel.TextYAlignment = BaseMessage.TextYAlignment
TagLabel.TextTransparency = BaseMessage.TextTransparency
TagLabel.TextStrokeTransparency = BaseMessage.TextStrokeTransparency
TagLabel.TextColor3 = tagColor
TagLabel.Text = formatTagText
TagLabel.Visible = true
TagLabel.Parent = BaseMessage
return TagLabel
end
function GetWhisperChannelPrefix()
if ChatConstants.WhisperChannelPrefix then
return ChatConstants.WhisperChannelPrefix
end
return "To "
end
function methods:NameButtonClicked(nameButton, playerName)
if not self.ChatWindow then
return
end
if ChatSettings.ClickOnPlayerNameToWhisper then
local player = Players:FindFirstChild(playerName)
if player and player ~= LocalPlayer then
local whisperChannel = GetWhisperChannelPrefix() ..playerName
if self.ChatWindow:GetChannel(whisperChannel) then
self.ChatBar:ResetCustomState()
local targetChannelName = self.ChatWindow:GetTargetMessageChannel()
if targetChannelName ~= whisperChannel then
self.ChatWindow:SwitchCurrentChannel(whisperChannel)
end
local whisperMessage = "/w " ..playerName
self.ChatBar:SetText(whisperMessage)
self.ChatBar:CaptureFocus()
elseif not self.ChatBar:IsInCustomState() then
local whisperMessage = "/w " ..playerName
self.ChatBar:SetText(whisperMessage)
self.ChatBar:CaptureFocus()
end
end
end
end
function methods:ChannelButtonClicked(channelButton, channelName)
if not self.ChatWindow then
return
end
if ChatSettings.ClickOnChannelNameToSetMainChannel then
if self.ChatWindow:GetChannel(channelName) then
self.ChatBar:ResetCustomState()
local targetChannelName = self.ChatWindow:GetTargetMessageChannel()
if targetChannelName ~= channelName then
self.ChatWindow:SwitchCurrentChannel(channelName)
end
self.ChatBar:ResetText()
self.ChatBar:CaptureFocus()
end
end
end
function methods:RegisterChatWindow(chatWindow)
self.ChatWindow = chatWindow
self.ChatBar = chatWindow:GetChatBar()
end
function methods:GetFromObjectPool(className)
if self.ObjectPool == nil then
return Instance.new(className)
end
return self.ObjectPool:GetInstance(className)
end
function methods:RegisterObjectPool(objectPool)
self.ObjectPool = objectPool
end
|
-- Torso
|
character.RagdollRig.ConstraintUpperTorso.Attachment0 = UTJointB
character.RagdollRig.ConstraintUpperTorso.Attachment1 = LTJointB
|
--- Registers a command definition and its server equivalent.
-- Handles replicating the definition to the client.
|
function Registry:RegisterCommand (commandScript, commandServerScript, filter)
local commandObject = require(commandScript)
assert(
typeof(commandObject) == "table",
`Invalid return value from command script "{commandScript.Name}" (CommandDefinition expected, got {typeof(commandObject)})`
)
if commandServerScript then
commandObject.Run = require(commandServerScript)
end
if filter and not filter(commandObject) then
return
end
self:RegisterCommandObject(commandObject)
commandScript.Parent = self.Cmdr.ReplicatedRoot.Commands
end
|
-- goro7
|
local playerGuiBlacklist = {
"Intro"
}
local plr = game.Players.LocalPlayer
function kick()
plr:Kick("You have been kicked for cheating.")
end
|
-- NOTE: this needs to be weakly held so gc isn't inhibited
|
local overrideParents: {[Instance]: Types.StateOrValue<Instance>} = setmetatable({}, WEAK_KEYS_METATABLE)
local function New(className: string)
return function(propertyTable: {[string | Types.Symbol]: any})
-- things to clean up when the instance is destroyed or gc'd
local cleanupTasks = {}
-- event handlers to connect
local toConnect: {[RBXScriptSignal]: () -> ()} = {}
--[[
STEP 1: Create a reference to a new instance
]]
local refMetatable = {__mode = ""}
local ref = setmetatable({}, refMetatable)
local conn
do
local createOK, instance = pcall(Instance.new, className)
if not createOK then
logError("cannotCreateClass", nil, className)
end
local defaultClassProps = defaultProps[className]
if defaultClassProps ~= nil then
for property, value in pairs(defaultClassProps) do
instance[property] = value
end
end
ref.instance = instance
conn = instance.Changed:Connect(function() end)
instance = nil
end
--[[
STEP 2: Apply properties and event handlers
]]
for key, value in pairs(propertyTable) do
-- ignore some keys which will be processed later
if key == Children or key == "Parent" then
continue
--[[
STEP 2.1: Property (string) keys
]]
elseif typeof(key) == "string" then
-- Properties bound to state
if typeof(value) == "table" and value.type == "State" then
local assignOK = pcall(function()
ref.instance[key] = value:get(false)
end)
if not assignOK then
logError("cannotAssignProperty", nil, className, key)
end
table.insert(cleanupTasks,
Compat(value):onChange(function()
if ref.instance == nil then
if ENABLE_EXPERIMENTAL_GC_MODE then
if conn.Connected then
warn("ref is nil and instance is around!!!")
else
print("ref is nil, but instance was destroyed")
end
end
return
end
Scheduler.enqueueProperty(ref.instance, key, value:get(false))
end)
)
-- Properties with constant values
else
local assignOK = pcall(function()
ref.instance[key] = value
end)
if not assignOK then
logError("cannotAssignProperty", nil, className, key)
end
end
--[[
STEP 2.2: Symbol keys
]]
elseif typeof(key) == "table" and key.type == "Symbol" then
-- Event handler
if key.name == "OnEvent" then
local event
if
not pcall(function()
event = ref.instance[key.key]
end) or
typeof(event) ~= "RBXScriptSignal"
then
logError("cannotConnectChange", nil, className, key.key)
end
toConnect[event] = value
-- Property change handler
elseif key.name == "OnChange" then
local event
if
not pcall(function()
event = ref.instance:GetPropertyChangedSignal(key.key)
end)
then
logError("cannotConnectChange", nil, className, key.key)
end
toConnect[event] = function()
if ref.instance == nil then
if ENABLE_EXPERIMENTAL_GC_MODE then
if conn.Connected then
warn("ref is nil and instance is around!!!")
else
print("ref is nil, but instance was destroyed")
end
end
return
end
value(ref.instance[key.key])
end
-- Unknown symbol key
else
logError("unrecognisedPropertyKey", nil, key.name)
end
-- Unknown key of arbitrary type
else
logError("unrecognisedPropertyKey", nil, typeof(key))
end
end
--[[
STEP 3: If provided, parent [Children] to instance
]]
local children = propertyTable[Children]
if children ~= nil then
local currentChildren = {}
local prevChildren = {}
local currentConnections = {}
local prevConnections = {}
local function updateCurrentlyParented()
if ref.instance == nil then
if ENABLE_EXPERIMENTAL_GC_MODE then
if conn.Connected then
warn("ref is nil and instance is around!!!")
else
print("ref is nil, but instance was destroyed")
end
end
return
end
prevChildren, currentChildren = currentChildren, prevChildren
prevConnections, currentConnections = currentConnections, prevConnections
local function recursiveAddChild(child)
local childType = typeof(child)
if childType == "Instance" then
-- single instance child
currentChildren[child] = true
-- reused or newly parented logic
if prevChildren[child] == nil then
if overrideParents[child] == nil then
child.Parent = ref.instance
end
else
prevChildren[child] = nil
end
elseif childType == "table" then
-- could either be an array or state object
if child.type == "State" then
-- state object
recursiveAddChild(child:get(false))
-- reuse old connection change handler if possible
local prevDisconnect = prevConnections[child]
if prevDisconnect ~= nil then
currentConnections[child] = prevDisconnect
prevConnections[child] = nil
else
-- FUTURE: does this need to be cleaned up when
-- the instance is destroyed at any point?
-- If so, how?
currentConnections[child] = Compat(child):onChange(function()
Scheduler.enqueueCallback(updateCurrentlyParented)
end)
end
else
-- array of children
for _, subChild in pairs(child) do
recursiveAddChild(subChild)
end
end
-- explicitly allow nils (probably inside a state object)
elseif childType ~= "nil" then
logWarn("unrecognisedChildType", childType)
end
end
recursiveAddChild(children)
-- clean up previous children which weren't reused
for prevChild in pairs(prevChildren) do
if overrideParents[prevChild] == nil then
prevChild.Parent = nil
end
end
-- clean up previous connection handlers which weren't reused
for prevState, disconnect in pairs(prevConnections) do
disconnect()
end
table.clear(prevChildren)
table.clear(prevConnections)
end
updateCurrentlyParented()
end
--[[
STEP 4: If provided, override the Parent of this instance
]]
local parent = propertyTable.Parent
if parent ~= nil then
overrideParents[ref.instance] = parent
if typeof(parent) == "table" and parent.type == "State" then
-- bind parent to state object
local assignOK = pcall(function()
ref.instance.Parent = parent:get(false)
end)
if not assignOK then
logError("cannotAssignProperty", nil, className, "Parent")
end
table.insert(cleanupTasks,
Compat(parent):onChange(function()
if ref.instance == nil then
if ENABLE_EXPERIMENTAL_GC_MODE then
if conn.Connected then
warn("ref is nil and instance is around!!!")
else
print("ref is nil, but instance was destroyed")
end
end
return
end
Scheduler.enqueueProperty(ref.instance, "Parent", parent:get(false))
end)
)
else
-- constant parent assignment
local assignOK = pcall(function()
ref.instance.Parent = parent
end)
if not assignOK then
logError("cannotAssignProperty", nil, className, "Parent")
end
end
end
--[[
STEP 5: Connect event handlers
]]
for event, callback in pairs(toConnect) do
table.insert(cleanupTasks, event:Connect(callback))
end
--[[
STEP 6: Register cleanup tasks if needed
]]
if cleanupTasks[1] ~= nil then
if ENABLE_EXPERIMENTAL_GC_MODE then
-- TODO: enabling this code sometimes leads to unexpected nil references appearing
-- it remains to be determined whether this is a bug with the instance being gc'd
-- too early, or whether this is a by-product of cleanupOnDestroy() taking some time
-- before detecting gc'd instances.
-- when the instance changes ancestor, check if it's still in the
-- data model - if not, we switch to a weak reference to allow for
-- gc to occur, otherwise hold the reference strongly
local function updateRefStrength()
if game:IsAncestorOf(ref.instance) then
setmetatable(ref, {})
else
setmetatable(ref, {__mode = "v"})
end
end
task.defer(updateRefStrength)
table.insert(cleanupTasks, ref.instance.AncestryChanged:Connect(updateRefStrength))
end
cleanupOnDestroy(ref.instance, cleanupTasks)
end
return ref.instance
end
end
return New
|
-- Replace common spaces with middle dot at the end of any line
|
function replaceTrailingSpaces(text: string): string
return text:gsub("%s+$", function(spaces)
return string.rep(SPACE_SYMBOL, #spaces)
end)
end
local function printReceived(object: any): string
return RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)))
end
local function printExpected(value: any): string
return EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)))
end
local function printWithType(
name: string, -- 'Expected' or 'Received'
value: any,
print_: (any) -> string -- printExpected or printReceived
): string
local type_ = getType(value)
local hasType
if type_ ~= "nil" then
hasType = string.format("%s has type: %s\n", name, type_)
else
hasType = ""
end
local hasValue = string.format("%s has value: %s", name, print_(value))
return hasType .. hasValue
end
local function ensureNoExpected(expected: any, matcherName: string, options: MatcherHintOptions?): ()
if typeof(expected) ~= "nil" then
-- Prepend maybe not only for backward compatibility
local matcherString = matcherName
if not options then
matcherString = "[.never]" .. matcherString
end
error(
Error(
matcherErrorMessage(
matcherHint(matcherString, nil, "", options),
"this matcher must not have an expected argument",
printWithType("Expected", expected, printExpected)
)
)
)
end
end
|
--Made by Repressed_Memories
-- Edited by Truenus
|
local component = script.Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local leftsignal = "z"
local rightsignal = "c"
local hazards = "x"
local hazardson = false
local lefton = false
local righton = false
local leftlight = car.Body.Lights.Left.RLTS.TSL
local rightlight = car.Body.Lights.Right.RRTS.TSL
local leftfront = car.Body.Lights.Left.RLTS
local rightfront = car.Body.Lights.Right.RRTS
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.LTS
local neonright = car.Body.Lights.Right.RTS
local leftgui = script.Parent.Parent.Parent.Parent:WaitForChild("AC6_Stock_Gauges").Left
local rightgui = script.Parent.Parent.Parent.Parent:WaitForChild("AC6_Stock_Gauges").Right
local off = BrickColor.New("Mid gray")
local on = BrickColor.New("Bright orange")
mouse.KeyDown:connect(function(lkey)
local key = string.lower(lkey)
if key == leftsignal then
if lefton == false then
lefton = true
script.Parent.Parent.StartSignal:play()
repeat
neonleft.BrickColor=on
leftlight.Enabled = true
neonleft.Material = "Neon"
neonleft.Transparency=0
leftgui.ImageTransparency=0
leftfront.Material = "Neon"
component.TurnSignal:play()
wait(signalblinktime)
neonleft.Transparency=1
neonleft.BrickColor=off
leftgui.ImageTransparency=1
component.TurnSignal:play()
neonleft.Material = "Sand"
leftfront.Material = "Sand"
leftlight.Enabled = false
wait(signalblinktime)
until
lefton == false or righton == true
elseif lefton == true or righton == true then
lefton = false
component.TurnSignal:stop()
leftlight.Enabled = false
wait(0.05)
script.Parent.Parent.StopSignal:play()
end
elseif key == rightsignal then
if righton == false then
righton = true
script.Parent.Parent.StartSignal:play()
repeat
rightlight.Enabled = true
neonright.Material = "Neon"
rightfront.Material = "Neon"
component.TurnSignal:play()
neonright.BrickColor=on
neonright.Transparency=0
rightgui.ImageTransparency=0
wait(signalblinktime)
neonright.Transparency=1
neonright.BrickColor=off
rightgui.ImageTransparency=1
component.TurnSignal:play()
neonright.Material = "Sand"
rightfront.Material = "Sand"
rightlight.Enabled = false
wait(signalblinktime)
until
righton == false or lefton == true
elseif righton == true or lefton == true then
righton = false
component.TurnSignal:stop()
wait(0.05)
script.Parent.Parent.StopSignal:play()
rightlight.Enabled = false
end
elseif key == hazards then
if hazardson == false then
script.Parent.Parent.StartSignal:play()
hazardson = true
repeat
neonright.BrickColor=on
neonleft.BrickColor=on
neonright.Material = "Neon"
rightfront.Material = "Neon"
neonleft.Material = "Neon"
neonleft.Transparency=0
neonright.Transparency=0
leftfront.Material = "Neon"
component.TurnSignal:play()
rightlight.Enabled = true
leftlight.Enabled = true
leftgui.ImageTransparency=0
rightgui.ImageTransparency=0
wait(signalblinktime)
neonleft.Transparency=1
neonright.Transparency=1
neonright.BrickColor=off
neonleft.BrickColor=off
leftgui.ImageTransparency=1
rightgui.ImageTransparency=1
component.TurnSignal:play()
neonright.Material = "Sand"
rightfront.Material = "Sand"
neonleft.Material = "Sand"
leftfront.Material = "Sand"
rightlight.Enabled = false
leftlight.Enabled = false
wait(signalblinktime)
until
hazardson == false
elseif hazardson == true then
hazardson = false
component.TurnSignal:stop()
rightlight.Enabled = false
leftlight.Enabled = false
wait(0.05)
script.Parent.Parent.StopSignal:play()
end
end
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
game:GetService("Players").LocalPlayer.CharacterAdded:connect(function(p1)
p1:WaitForChild("Humanoid").Seated:connect(function(p2, p3)
if p3 and p3:IsA("VehicleSeat") then
workspace.CurrentCamera.CameraSubject = p1.Humanoid;
end;
end);
end);
|
-- (Hat Giver Script - Loaded.)
|
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Red ruby crown"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(2, 1, 1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0, -0.9, 0)
wait(5)
debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
-- Player specific convenience variables
|
local MyPlayer = nil
local MyCharacter = nil
local MyHumanoid = nil
local MyTorso = nil
local DebrisService = game:GetService('Debris')
local FireSound
local OnFireConnection = nil
local OnReloadConnection = nil
|
-- This module is based on the script found on this tutorial: https://www.youtube.com/watch?v=XfedvejJBGY
-- Please watch the video for a better understanding!
| |
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if emoteNames[oldAnim] and emoteNames[oldAnim] == false then
oldAnim = "idle"
end
currentAnim = ""
if currentAnimKeyframeHandler then
currentAnimKeyframeHandler:disconnect()
end
if currentAnimTrack then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
return oldAnim
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
function keyFrameReachedFunc(frameName)
if frameName == "End" then
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v2 = setmetatable({}, v1);
v2.__index = v2;
function v2.new()
local v3 = setmetatable(v1.new(), v2);
v3.textFocusReleasedConn = nil;
v3.textFocusGainedConn = nil;
v3.windowFocusReleasedConn = nil;
v3.forwardValue = 0;
v3.backwardValue = 0;
v3.leftValue = 0;
v3.rightValue = 0;
return v3;
end;
local l__UserInputService__1 = game:GetService("UserInputService");
local u2 = Vector3.new(0, 0, 0);
function v2.Enable(p1, p2)
if not l__UserInputService__1.KeyboardEnabled then
return false;
end;
if p2 == p1.enabled then
return true;
end;
p1.forwardValue = 0;
p1.backwardValue = 0;
p1.leftValue = 0;
p1.rightValue = 0;
p1.moveVector = u2;
p1.isJumping = false;
if p2 then
p1:BindContextActions();
p1:ConnectFocusEventListeners();
else
p1:UnbindContextActions();
p1:DisconnectFocusEventListeners();
end;
p1.enabled = p2;
return true;
end;
function v2.UpdateMovement(p3, p4)
if p4 == Enum.UserInputState.Cancel then
p3.moveVector = u2;
return;
end;
p3.moveVector = Vector3.new(p3.leftValue + p3.rightValue, 0, p3.forwardValue + p3.backwardValue);
end;
local l__ContextActionService__3 = game:GetService("ContextActionService");
function v2.BindContextActions(p5)
l__ContextActionService__3:BindAction("moveForwardAction", function(p6, p7, p8)
if p7 == Enum.UserInputState.Begin then
local v4 = -1;
else
v4 = 0;
end;
p5.forwardValue = v4;
p5:UpdateMovement(p7);
end, false, Enum.PlayerActions.CharacterForward);
l__ContextActionService__3:BindAction("moveBackwardAction", function(p9, p10, p11)
if p10 == Enum.UserInputState.Begin then
local v5 = 1;
else
v5 = 0;
end;
p5.backwardValue = v5;
p5:UpdateMovement(p10);
end, false, Enum.PlayerActions.CharacterBackward);
l__ContextActionService__3:BindAction("moveLeftAction", function(p12, p13, p14)
if p13 == Enum.UserInputState.Begin then
local v6 = -1;
else
v6 = 0;
end;
p5.leftValue = v6;
p5:UpdateMovement(p13);
end, false, Enum.PlayerActions.CharacterLeft);
l__ContextActionService__3:BindAction("moveRightAction", function(p15, p16, p17)
if p16 == Enum.UserInputState.Begin then
local v7 = 1;
else
v7 = 0;
end;
p5.rightValue = v7;
p5:UpdateMovement(p16);
end, false, Enum.PlayerActions.CharacterRight);
l__ContextActionService__3:BindAction("jumpAction", function(p18, p19, p20)
p5.isJumping = p19 == Enum.UserInputState.Begin;
end, false, Enum.PlayerActions.CharacterJump);
end;
function v2.UnbindContextActions(p21)
l__ContextActionService__3:UnbindAction("moveForwardAction");
l__ContextActionService__3:UnbindAction("moveBackwardAction");
l__ContextActionService__3:UnbindAction("moveLeftAction");
l__ContextActionService__3:UnbindAction("moveRightAction");
l__ContextActionService__3:UnbindAction("jumpAction");
end;
function v2.ConnectFocusEventListeners(p22)
local function v8()
p22.moveVector = u2;
p22.forwardValue = 0;
p22.backwardValue = 0;
p22.leftValue = 0;
p22.rightValue = 0;
p22.isJumping = false;
end;
p22.textFocusReleasedConn = l__UserInputService__1.TextBoxFocusReleased:Connect(v8);
p22.textFocusGainedConn = l__UserInputService__1.TextBoxFocused:Connect(function(p23)
p22.isJumping = false;
end);
p22.windowFocusReleasedConn = l__UserInputService__1.WindowFocused:Connect(v8);
end;
function v2.DisconnectFocusEventListeners(p24)
if p24.textFocusReleasedCon then
p24.textFocusReleasedCon:Disconnect();
p24.textFocusReleasedCon = nil;
end;
if p24.textFocusGainedConn then
p24.textFocusGainedConn:Disconnect();
p24.textFocusGainedConn = nil;
end;
if p24.windowFocusReleasedConn then
p24.windowFocusReleasedConn:Disconnect();
p24.windowFocusReleasedConn = nil;
end;
end;
return v2;
|
-- ROBLOX MOVED: expect/utils.lua
|
local function hasPropertyInObject(object: any, key: string): boolean
-- We don't have to deal with the complexities around prototype chains in
-- javascript since a simple key access will look up the
-- metatable chain for us
local shouldBeFalse = not toJSBoolean(object) or typeof(object) ~= "table"
if shouldBeFalse then
return false
end
return object[key] ~= nil
end
|
-- Create the path object
|
local path = PathfindingService:CreatePath(agentParams)
path:ComputeAsync(humanoid.Position, destination.Position)
|
-- functions
|
function onRunning(speed)
if isSeated then return end
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
isSeated = false
pose = "Jumping"
end
function onClimbing()
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
isSeated = true
pose = "Seated"
print("Seated")
end
function moveJump()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1
LeftShoulder.DesiredAngle = -1
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveClimb()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = 3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveSit()
print("Move Sit")
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = 3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end
function getTool()
kidTable = Figure:children()
if (kidTable ~= nil) then
numKids = #kidTable
for i=1,numKids do
if (kidTable[i].className == "Tool") then return kidTable[i] end
end
end
return nil
end
function getToolAnim(tool)
c = tool:children()
for i=1,#c do
if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
return c[i]
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
RightShoulder.DesiredAngle = 1.57
return
end
if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
return
end
if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Climbing") then
moveClimb()
return
end
if (pose == "Seated") then
moveSit()
return
end
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
if (pose == "Running") then
amplitude = 1
frequency = 9
else
amplitude = 0.1
frequency = 1
end
desiredAngle = amplitude * math.sin(time*frequency)
RightShoulder.DesiredAngle = desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle/4
LeftHip.DesiredAngle = -desiredAngle/4
local tool = getTool()
if tool ~= nil then
animStringValueObject = getToolAnim(tool)
if animStringValueObject ~= nil then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
--[=[
@within TableUtil
@function IsEmpty
@param tbl table
@return boolean
Returns `true` if the given table is empty. This is
simply performed by checking if `next(tbl)` is `nil`
and works for both arrays and dictionaries. This is
useful when needing to check if a table is empty but
not knowing if it is an array or dictionary.
```lua
TableUtil.IsEmpty({}) -- true
TableUtil.IsEmpty({"abc"}) -- false
TableUtil.IsEmpty({abc = 32}) -- false
```
]=]
|
local function IsEmpty(tbl: { any }): boolean
return not next(tbl)
end
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 1500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50000 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2.00 -- Suspension length (in studs)
Tune.FPreCompress = .2 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = 0 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 1500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50000 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2.00 -- Suspension length (in studs)
Tune.RPreCompress = -0.3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = 0 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--A simple function to check if the car is grounded
|
local function IsGrounded()
local hit, position = Raycast.new((car.Chassis.CFrame * CFrame.new(0, 0, (car.Chassis.Size.Z / 2) - 1)).p, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * (stats.Height.Value + 0.2))
if hit and hit.CanCollide then
return(true)
end
return(false)
end
local oldCameraType = camera.CameraType
camera.CameraType = cameraType
spawn(function()
while character.Humanoid.SeatPart == car.DriveSeat do
game:GetService("RunService").RenderStepped:wait()
--Broken gyro input
--[[if userInputService.GyroscopeEnabled then
local inputObject, cframe = userInputService:GetDeviceRotation()
local up = cframe:vectorToWorldSpace(Vector3.new(0, 1, 0))
local angle = (1 - up.Y) * (math.abs(up.X) / up.X)
movement = Vector2.new(angle, movement.Y)
end]]
if IsGrounded() then
if movement.Y ~= 0 then
local velocity = car.Chassis.CFrame.lookVector * movement.Y * stats.Speed.Value
car.Chassis.Velocity = car.Chassis.Velocity:Lerp(velocity, 0.1)
bodyVelocity.maxForce = Vector3.new(0, 0, 0)
else
bodyVelocity.maxForce = Vector3.new(mass / 2, mass / 4, mass / 2)
end
local rotVelocity = car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(movement.Y * stats.Speed.Value / 50, 0, -car.Chassis.RotVelocity.Y * 5 * movement.Y))
local speed = -car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity).unit.Z
rotation = rotation + math.rad((-stats.Speed.Value / 5) * movement.Y)
if math.abs(speed) > 0.1 then
rotVelocity = rotVelocity + car.Chassis.CFrame:vectorToWorldSpace((Vector3.new(0, -movement.X * speed * stats.TurnSpeed.Value, 0)))
bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
else
bodyAngularVelocity.maxTorque = Vector3.new(mass / 4, mass / 2, mass / 4)
end
car.Chassis.RotVelocity = car.Chassis.RotVelocity:Lerp(rotVelocity, 0.1)
--bodyVelocity.maxForce = Vector3.new(mass / 3, mass / 6, mass / 3)
--bodyAngularVelocity.maxTorque = Vector3.new(mass / 6, mass / 3, mass / 6)
else
bodyVelocity.maxForce = Vector3.new(0, 0, 0)
bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
end
for i, part in pairs(car:GetChildren()) do
if part.Name == "Thruster" then
UpdateThruster(part)
end
end
end
for i, v in pairs(car:GetChildren()) do
if v:FindFirstChild("BodyThrust") then
v.BodyThrust:Destroy()
end
end
bodyVelocity:Destroy()
bodyAngularVelocity:Destroy()
camera.CameraType = oldCameraType
userInputService.ModalEnabled = false
script:Destroy()
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)
print("Walking sounds successfully loaded!")
|
-- if (pose == "Standing" and emoteNames[emote] ~= nil) then
-- playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
-- end
--end)
| |
--Stickmasterluke
|
sp=script.Parent
function Equipped(mouse)
if mouse~=nil then
mouse.Icon="rbxasset://textures\\GunCursor.png"
end
end
sp.Equipped:connect(Equipped)
|
--////////////////////////////////////////////////////////////////////////////////////////////
--///////////////////////////////////////////////// Code to hook client UI up to server events
--////////////////////////////////////////////////////////////////////////////////////////////
|
function DoChatBarFocus()
if (not ChatWindow:GetCoreGuiEnabled()) then return end
if (not ChatBar:GetEnabled()) then return end
if (not ChatBar:IsFocused() and ChatBar:GetVisible()) then
moduleApiTable:SetVisible(true)
InstantFadeIn()
ChatBar:CaptureFocus()
moduleApiTable.ChatBarFocusChanged:fire(true)
end
end
chatBarFocusChanged.Event:connect(function(focused)
moduleApiTable.ChatBarFocusChanged:fire(focused)
end)
function DoSwitchCurrentChannel(targetChannel)
if (ChatWindow:GetChannel(targetChannel)) then
ChatWindow:SwitchCurrentChannel(targetChannel)
end
end
function SendMessageToSelfInTargetChannel(message, channelName, extraData)
local channelObj = ChatWindow:GetChannel(channelName)
if (channelObj) then
local messageData = {
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = channelName,
IsFiltered = true,
MessageLength = string.len(message),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(message)),
Message = trimTrailingSpaces(message),
MessageType = ChatConstants.MessageTypeSystem,
Time = os.time(),
ExtraData = extraData,
}
channelObj:AddMessageToChannel(messageData)
end
end
function chatBarFocused()
if (not mouseIsInWindow) then
DoBackgroundFadeIn()
if (textIsFaded) then
DoTextFadeIn()
end
end
chatBarFocusChanged:Fire(true)
end
|
--//Unloading\\--
--[[
Always have these if you intend to have a script unload,
It removes all unwanted storage to improve performance instead of maintaining it, lagging it behind.
Under no circumstance should you try to stop the script by deleting it,
Simply delete Zombie or Spawner.
It is safe to remove spawner,
Simply delete this script.
If you plan to have this script work later,
Simply delete the spawner and maintain this script,
as for it will stay on standby until useable.
]]
|
if Zombie then Zombie:Destroy() end
if Spawner then Spawner:Destroy() end
script:Destroy()
|
-----------------
--| Constants |--
-----------------
|
local SPAWN_RADIUS = 8 -- Studs
local SUMMON_COOLDOWN = 16
local SKELETON_ASSET_ID = 132805224
local SKELETON_DURATION = 60
|
-- / Functions / --
|
FadeModule.Fade = function(FadeObject: Instance, TweenValue: NumberValue, TweenTime: number?, DelayTime: number?)
if FadeObject:IsA("Frame") then
local FadeTween = TweenService:Create(
FadeObject,
TweenInfo.new(TweenTime),
{
BackgroundTransparency = TweenValue
}
)
FadeTween:Play()
elseif FadeObject:IsA("BlurEffect") then
local FadeTween = TweenService:Create(
FadeObject,
TweenInfo.new(TweenTime),
{
Size = TweenValue
}
)
FadeTween:Play()
end
if DelayTime then
task.wait(DelayTime)
end
end
|
-- if userPlayEmoteByIdAnimTrackReturn then
-- return true, currentAnimTrack
-- else
-- return true
-- end
-- end
| |
--[[Transmission]]
|
Tune.TransModes = {"Semi"}--"Auto", "Semi", or "Manual". Can have more than one; order from first to last
--Automatic Settings
Tune.AutoShiftMode = "Speed" --"Speed" or "RPM"
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 2000 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.84
-- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.42 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 4.37 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.76 ,
--[[ 3 ]] 1.94 ,
--[[ 4 ]] 1.45 ,
--[[ 5 ]] 1.05 ,
--[[ 6 ]] .85 ,
--[[ 7 ]] .69 ,
}
Tune.FDMult = 1 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--// Aim|Zoom|Sensitivity Customization
|
ZoomSpeed = 0.25; -- The lower the number the slower and smoother the tween
AimZoom = 45; -- Default zoom
AimSpeed = 0.45;
UnaimSpeed = 0.35;
CycleAimZoom = 4; -- Cycled zoom
MouseSensitivity = 0.5; -- Number between 0.1 and 1
SensitivityIncrement = 0.05; -- No touchy
|
--[=[
@param fn ConnectionFn
@return SignalConnection
Connects a function to the signal, which will be called the next time the signal fires. Once
the connection is triggered, it will disconnect itself.
```lua
signal:ConnectOnce(function(msg, num)
print(msg, num)
end)
signal:Fire("Hello", 25)
signal:Fire("This message will not go through", 10)
```
]=]
|
function Signal:ConnectOnce(fn)
local connection
local done = false
connection = self:Connect(function(...)
if done then
return
end
done = true
connection:Disconnect()
fn(...)
end)
return connection
end
function Signal:GetConnections()
local items = {}
local item = self._handlerListHead
while item do
table.insert(items, item)
item = item._next
end
return items
end
|
-- Basic Settings
|
AdminCredit=false; -- Enables the credit GUI for that appears in the bottom right
AutoClean=false; -- Enables automatic cleaning of hats & tools in the Workspace
AutoCleanDelay=60; -- The delay between each AutoClean routine
CommandBar=true; -- Enables the Command Bar | GLOBAL KEYBIND: \
FunCommands=true; -- Enables fun yet unnecessary commands
FreeAdmin=false; -- Set to 1-5 to grant admin powers to all, otherwise set to false
PublicLogs=false; -- Allows all users to see the command & chat logs
Prefix=':'; -- Character to begin a command
--[[
Admin Powers
0 Player
1 VIP Can use nonabusive commands only on self
2 Moderator Can kick, mute, & use most commands
3 Administrator Can ban, crash, & set Moderators/VIP
4 SuperAdmin Can grant permanent powers, & shutdown the game
5 Owner Can set SuperAdmins, & use all the commands
6 Game Creator Can set owners & use all the commands
Group & VIP Admin
You can set multiple Groups & Ranks to grant users admin powers:
GroupAdmin={
[12345]={[254]=4,[253]=3};
[GROUPID]={[RANK]=ADMINPOWER}
};
You can set multiple Assets to grant users admin powers:
VIPAdmin={
[12345]=3;
[54321]=4;
[ITEMID]=ADMINPOWER;
}; ]]
GroupAdmin={
};
VIPAdmin={
};
|
-- When Tool UnEqiopped
|
tool.Unequipped:Connect(function()
if track and track1 then
track:Stop()
track1:Stop()
end
end)
|
--//Configs
|
local REAPPEAR_TIME = 2 --//Once the part becomes invisible, after this amount of seconds it'll appear again
local FADE_TIME = 1 --//How long it takes for the part to become fully visible/invisible
local function Animate()
if isAnimating then return end
isAnimating = true
local targetProperties = {}
targetProperties.Transparency = 1
local disappearFade = tweenService:Create(script.Parent, TweenInfo.new(FADE_TIME), targetProperties)
disappearFade:Play()
disappearFade.Completed:Wait()
wait(REAPPEAR_TIME)
targetProperties.Transparency = 0
local appearFade = tweenService:Create(script.Parent, TweenInfo.new(FADE_TIME), targetProperties)
appearFade:Play()
appearFade.Completed:Wait()
isAnimating = false
end
script.Parent.Touched:Connect(Animate)
|
--[[
Server Init
]]
|
local RunServ = game:GetService("RunService")
local ServStore = game:GetService("ServerStorage")
local ServerScripts = ServStore.Modules:GetChildren()
local modules, priority = {}, {}
for _, module: ModuleScript in ipairs(ServerScripts) do
if module:IsA("ModuleScript") and not module.Name:find("IGNORE") then
local mod = require(module)
priority[mod.InitPriority] = mod
modules[module.Name] = mod
end
end
local function call_loop(dt: number)
for _, module in modules do
module:Loop(dt)
end
end
for _, module in ipairs(priority) do
module:Init()
end
RunServ.Heartbeat:Connect(call_loop)
|
--Flingi2's Lap
--This script is free to use for anyone
|
local ting = 0 --debouncer
function onTouched(hit)
if ting == 0 then --debounce check
ting = 1 --activate debounce
check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button
if check ~= nil then --If a human is found, then
local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
local stats = user:findFirstChild("leaderstats") --Find moneyholder
if stats ~= nil then --If moneyholder exists then
local cash = stats:findFirstChild("Laps") --Change Cash To The Money In The Leaderboard
cash.Value = cash.Value +1 --increase amount of money by the number displayed here (1)
wait(0.1) --wait-time before button works again
end
end
ting = 0 --remove debounce
end
end
script.Parent.Touched:connect(onTouched)
|
--[[Flip]]
|
function Flip()
--Detect Orientation
if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
FlipWait=tick()
--Apply Flip
else
if tick()-FlipWait>=3 then
FlipDB=true
local gyro = car.DriveSeat.Flip
gyro.maxTorque = Vector3.new(10000,0,10000)
gyro.P=3000
gyro.D=500
wait(1)
gyro.maxTorque = Vector3.new(0,0,0)
gyro.P=0
gyro.D=0
FlipDB=false
end
end
end
game:GetService("RunService").RenderStepped:connect(function()
if script.Parent.AssistantBrake.Value == true and _CGear ~= -1 and _SteerL == false and _SteerR == false then
RBrakeForce = _Tune.RBrakeForce
FBrakeForce = _Tune.FBrakeForce
_GBrake = 1
script.Parent.Lights.Value:FireServer({["EnableBrakes"]=true})
if script.Parent.AssistantAlarm.IsPlaying == false then
script.Parent.AssistantAlarm:Play()
end
script.Parent["AC6_Stock_Gauges"].EBrake.Visible = true
script.Parent.FEAssistantBrake.DisableAssistantBrake:FireServer()
wait(3.5)
script.Parent["AC6_Stock_Gauges"].EBrake.Visible = false
_GBrake = 0
script.Parent.Lights.Value:FireServer({["DisableBrakes"]=true})
elseif _CGear == -1 and script.Parent.AssistantBrake.Value == true then
script.Parent.FEAssistantBrake.DisableAssistantBrake:FireServer()
elseif (_SteerL == true or _SteerR == true) and script.Parent.AssistantBrake.Value == true then
script.Parent.FEAssistantBrake.DisableAssistantBrake:FireServer()
end
end)
|
-- For me: In hell dont forget to fix the structuring way fix when options are published!
| |
--- Replace with true/false to force the chat type. Otherwise this will default to the setting on the website.
|
module.BubbleChatEnabled = true ---PlayersService.BubbleChat
module.ClassicChatEnabled = PlayersService.ClassicChat
|
--[[
Recursively iterates through the object to construct strings and add it to the localization table
@param localizationTable LocalizationTable
@param localeId string -- The localizationid to add
@param baseKey string -- the key to add
@param object any -- The value to iterate over
]]
|
local function recurseAdd(localizationTable, localeId, baseKey, object, tableName)
if baseKey ~= "" then
baseKey = baseKey .. "."
end
for index, value in pairs(object) do
local key = baseKey .. index
if type(value) == "table" then
recurseAdd(localizationTable, localeId, key, value, tableName)
elseif type(value) == "string" then
local source = ""
-- Guarantee the context is unique. This is important because Roblox will not
-- allow something with the same source without a differing context value.
local context = tableName .. "." .. key
if localeId == "en" then
source = value
end
localizationTable:SetEntryValue(key, source, context, localeId, value)
else
error("Bad type for value in '" .. key .. "'.")
end
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.