prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]
|
--
local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
local AdvancedRespawnScript=script;
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local JeffTheKiller=AdvancedRespawnScript.Parent;
if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then
JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();
end;
local GameDerbis=Game:GetService("Debris");
local JeffTheKillerHumanoid;
for _,Child in pairs(JeffTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JeffTheKillerHumanoid=Child;
end;
end;
local Respawndant=JeffTheKiller:Clone();
if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
coroutine.resume(coroutine.create(function()
if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=JeffTheKillerHumanoid.Status;
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch].className=="SpawnLocation"then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game:GetService("Workspace"));
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=JeffTheKiller;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if JeffTheKiller:FindFirstChild("SpawnForceField")then
JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
end;
JeffTheKiller:MoveTo(Vector3.new(0,115,0));
end;
end));
end;
function Respawn()
Wait(0);
Respawndant.Parent=JeffTheKiller.Parent;
Respawndant:makeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
JeffTheKiller:remove();
end;
if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.Died:connect(Respawn);
end;
|
-- << FUNCTIONS >>
|
function module:Message(args)
local containerFrame = messageContainer.Messages
local tweenTime = 0.4
local mSpeaker = args[1]
local mType = args[2]
local mTitle = args[3]
local mSubTitle = args[4]
local mDesc = args[5]
local mDescColor = args[6]
local message = main.templates.Message:Clone()
for i,v in pairs(message:GetChildren()) do
v[getTargetProp(v)] = 1
end
message.Visible = true
if mType == "Countdown" then
local items = {message.Bg, message.Title, message.Desc}
message.Title.Text = "Countdown"
message.Title.TextColor3 = Color3.fromRGB(200,200,200)
message.Desc.TextColor3 = mDescColor
message.Parent = containerFrame
spawn(function() displayMessages(items, 0, tweenTime) end)
for i = 1, mDesc do
message.Desc.Text = mDesc+1-i
wait(1)
end
displayMessages(items, 1, tweenTime)
else
message.Title.Text = mTitle
message.SubTitle.Text = mTitle
message.Desc.Text = mDesc
message.Desc.TextColor3 = mDescColor
if mType == "Server" or mSpeaker == nil then
message.Pic.Visible = false
message.SubTitle.Visible = false
else
local size = main.textService:GetTextSize(mTitle, message.Title.TextSize, message.Title.Font, Vector2.new(0,0))
message.Pic.Position = UDim2.new(0.5,-((size.X/2)+75))
message.Pic.Image = main:GetModule("cf"):GetUserImage(mSpeaker.UserId)
message.SubTitle.Text = mSubTitle
end
message.Parent = containerFrame
local messageAppearOrder = getMessageAppearOrder(message)
for i = 1, #messageAppearOrder do
displayMessages(messageAppearOrder[i], 0, tweenTime)
end
wait(main:GetModule("cf"):GetMessageTime(mDesc))
for i = 1, #messageAppearOrder do
local newI = #messageAppearOrder+1-i
displayMessages(messageAppearOrder[newI], 1, tweenTime)
end
end
message:Destroy()
end
function module:Hint(args)
local containerFrame = messageContainer.Hints
local tweenTime = 0.6
local hType = args[1]
local hDesc = args[2]
local hDescColor = args[3]
local items = {}
local hint = main.templates.Hint:Clone()
for i,v in pairs(hint:GetChildren()) do
v[getTargetProp(v)] = 1
table.insert(items, v)
end
hint.Desc.Text = hDesc
hint.Desc.TextColor3 = hDescColor
hint.Parent = containerFrame
hint.Visible = true
if hType == "Countdown" then
spawn(function() displayMessages(items, 0, tweenTime) end)
for i = 1, hDesc do
hint.Desc.Text = hDesc+1-i
wait(1)
end
displayMessages(items, 1, tweenTime)
else
hint.Desc.Text = hDesc
hint.Desc.TextColor3 = hDescColor
hint.Parent = containerFrame
displayMessages(items, 0, tweenTime)
wait(main:GetModule("cf"):GetMessageTime(hDesc))
displayMessages(items, 1, tweenTime)
end
hint:Destroy()
end
function module:GlobalAnnouncement(data)
local containerFrame = messageContainer.Messages
local tweenTime = 0.4
local message = main.templates.GlobalAnnouncement:Clone()
local displayFrom = data.DisplayFrom
for i,v in pairs(message:GetChildren()) do
v[getTargetProp(v)] = 1
end
message.Visible = true
message.Title.Text = data.Title
message.Pic.Visible = displayFrom
message.SubTitle.Visible = displayFrom
local size = main.textService:GetTextSize(message.SubTitle.Text, message.SubTitle.TextSize, message.SubTitle.Font, Vector2.new(0,0))
message.Pic.Position = UDim2.new(0.5, -((size.X/2)+30), 0, 60)
if displayFrom then
message.Pic.Image = main:GetModule("cf"):GetUserImage(data.SenderId)
message.SubTitle.Text = "From ".. data.SenderName
end
message.Desc.TextColor3 = Color3.new(data.Color[1], data.Color[2], data.Color[3])
message.Desc.Text = data.Message
message.Parent = containerFrame
local messageAppearOrder = getMessageAppearOrder(message)
for i = 1, #messageAppearOrder do
displayMessages(messageAppearOrder[i], 0, tweenTime)
end
wait(main:GetModule("cf"):GetMessageTime(data.Message)*1.5)
for i = 1, #messageAppearOrder do
local newI = #messageAppearOrder+1-i
displayMessages(messageAppearOrder[newI], 1, tweenTime)
end
message:Destroy()
end
function module:ClearMessageContainer()
for a,b in pairs(messageContainer:GetChildren()) do
for c,d in pairs(b:GetChildren()) do
if d:IsA("Frame") then
d.Visible = false
end
end
end
end
return module
|
-- list of account names allowed to go through the door.
|
permission = { "Februar92", "Lumpizerstoerer" } --Put your friends name's here. You can add more.
function checkOkToLetIn(name)
for i = 1,#permission do
-- convert strings to all upper case, otherwise we will let in,
-- "Telamon," but not, "tELAMON," or, "telamon."
-- Why? Because, "Telamon," is how it is spelled in the permissions.
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end
local Door = script.Parent
function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
-- a human has touched this door!
print("Human touched door")
-- test the human's name against the permission list
if (checkOkToLetIn(human.Parent.Name)) then
print("Human passed test")
Door.Transparency = 0.8
Door.CanCollide = false
wait(1.5) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
else human.Health= 0 -- delete this line of you want a non-killing VIP door
end
end
end
script.Parent.Touched:connect(onTouched)
|
-- Remove double quote marks and unescape double quotes and backslashes.
|
local function deserializeString(stringified: string): string
stringified = string.sub(stringified, 2, -2)
stringified = string.gsub(stringified, "\\\\", "\\")
stringified = string.gsub(stringified, '\\"', '"')
return stringified
end
|
--Services
|
local debrisService = game:GetService("Debris")
local runService = game:GetService("RunService")
local tweenService = game:GetService("TweenService")
|
--// F key, HornOff
|
mouse.KeyUp:connect(function(key)
if key=="h" then
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 10
veh.Lightbar.middle.Yelp.Volume = 10
veh.Lightbar.middle.Priority.Volume = 10
veh.Lightbar.HORN.Transparency = 1
end
end)
|
--[[
Poppercam - Occlusion module that brings the camera closer to the subject when objects are blocking the view.
--]]
|
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local TransformExtrapolator = {} do
TransformExtrapolator.__index = TransformExtrapolator
local CF_IDENTITY = CFrame.new()
local function cframeToAxis(cframe)
local axis, angle = cframe:toAxisAngle()
return axis*angle
end
local function axisToCFrame(axis)
local angle = axis.magnitude
if angle > 1e-5 then
return CFrame.fromAxisAngle(axis, angle)
end
return CF_IDENTITY
end
local function extractRotation(cf)
local _, _, _, xx, yx, zx, xy, yy, zy, xz, yz, zz = cf:components()
return CFrame.new(0, 0, 0, xx, yx, zx, xy, yy, zy, xz, yz, zz)
end
function TransformExtrapolator.new()
return setmetatable({
lastCFrame = nil,
}, TransformExtrapolator)
end
function TransformExtrapolator:Step(dt, currentCFrame)
local lastCFrame = self.lastCFrame or currentCFrame
self.lastCFrame = currentCFrame
local currentPos = currentCFrame.p
local currentRot = extractRotation(currentCFrame)
local lastPos = lastCFrame.p
local lastRot = extractRotation(lastCFrame)
-- Estimate velocities from the delta between now and the last frame
-- This estimation can be a little noisy.
local dp = (currentPos - lastPos)/dt
local dr = cframeToAxis(currentRot*lastRot:inverse())/dt
local function extrapolate(t)
local p = dp*t + currentPos
local r = axisToCFrame(dr*t)*currentRot
return r + p
end
return {
extrapolate = extrapolate,
posVelocity = dp,
rotVelocity = dr,
}
end
function TransformExtrapolator:Reset()
self.lastCFrame = nil
end
end
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["JestGetType"]["JestGetType"])
return Package
|
-- Event Bindings
|
Players.PlayerAdded:connect(OnPlayerAdded)
Players.PlayerRemoving:connect(OnPlayerRemoving)
return PlayerManager
|
-- Updates cached twitter codes every minute.
|
local autoFetchTimer = timer.new(60,twitterService.CacheCodes,true)
autoFetchTimer:Start()
|
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
|
script.Parent.Mode.Changed:Connect(function()
script.Parent.Parent.Scripts.Scripts.Off.Disabled = true
script.Parent.Parent.Scripts.Scripts.On.Disabled = true
if script.Parent.Mode.Value == 0 then
Cancel()
elseif script.Parent.Mode.Value == 1 then
Cancel()
Alert()
elseif script.Parent.Mode.Value == 2 then
Cancel()
Wail()
elseif script.Parent.Mode.Value == 3 then
Cancel()
Alert()
Alt(1)
elseif script.Parent.Mode.Value == 4 then
Cancel()
Wail()
Alt(1)
elseif script.Parent.Mode.Value == 5 then
Cancel()
Alert()
Alt(0)
elseif script.Parent.Mode.Value == 6 then
Cancel()
Wail()
Alt(0)
elseif script.Parent.Mode.Value == 7 then
Cancel()
bingbong = 1
script.Parent.Parent.Scripts.Scripts.Off.Disabled = true
script.Parent.Parent.Scripts.Scripts.On.Disabled = true
Aux()
script.Parent.Parent.Scripts.Scripts.Off.Disabled = true
script.Parent.Parent.Scripts.Scripts.On.Disabled = true
end
wait(math.random(500,2000)/1000)
end)
|
--- Initialize required modules
|
local CollectionService: CollectionService = game:GetService("CollectionService")
local HitboxData = require(script.HitboxCaster)
local Signal = require(script.GoodSignal)
local RaycastHitbox = {}
RaycastHitbox.__index = RaycastHitbox
RaycastHitbox.__type = "RaycastHitboxModule"
|
--------------------------------------------------------------------------------------------------
|
MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
local players = game.Players:GetPlayers()
for i=1,#players do
if players[i].userId == receiptInfo.PlayerId then
game.Workspace.Nuke.BerezaaGamesNuclearScript.Disabled = false
game.StarterGui["Skip Stage"]:Destroy()
script.Parent.Parent:Destroy()
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
|
--[[
Fired when state is left
]]
|
function Transitions.onLeavePostGame(stateMachine, event, from, to, playerComponent)
PlayerPostGame.leave(stateMachine, playerComponent)
end
return Transitions
|
--[[Engine]]
--Torque Curve
|
Tune.Horsepower = 5000 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 2000 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 11000 -- Use sliders to manipulate values
Tune.Redline = 12000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
|
--[[Drivetrain Initialize]]
|
local Drive={}
--Power Front Wheels
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then table.insert(Drive,v) end end end
--Power Rear Wheels
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then table.insert(Drive,v) end end end
--Determine Wheel Size
local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end
--Pre-Toggled PBrake
for i,v in pairs(car.Wheels:GetChildren()) do if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then _PBrake=true end end
|
--used by checkTeams
|
function sameTeam(otherHuman)
local player = getPlayer()
local otherPlayer = game:GetService("Players"):GetPlayerFromCharacter(otherHuman.Parent)
if player and otherPlayer then
return player.TeamColor == otherPlayer.TeamColor
end
return false
end
|
-- emote bindable hook
|
script:WaitForChild("PlayEmote").OnInvoke = function(emote)
-- Only play emotes when idling
if pose ~= "Standing" then
return
end
if emoteNames[emote] ~= nil then
-- Default emotes
playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
if userPlayEmoteByIdAnimTrackReturn then
return true, currentAnimTrack
else
return true
end
elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
-- Non-default emotes
playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)
if userPlayEmoteByIdAnimTrackReturn then
return true, currentAnimTrack
else
return true
end
end
-- Return false to indicate that the emote could not be played
return false
end
if Character.Parent ~= nil then
-- initialize to idle
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
|
-- ROBLOX DEVIATION: These are assigned in the constructor for testing
|
local npm_config_user_agent, npm_lifecycle_event, npm_lifecycle_script
export type SummaryReporter = {
onRunStart: (self: SummaryReporter, aggregatedResults: AggregatedResult, options: ReporterOnStartOptions) -> (),
onRunComplete: (self: SummaryReporter, contexts: Set<Context>, aggregatedResults: AggregatedResult) -> (),
}
type SummaryReporterPrivate = SummaryReporter & {
_globalConfig: Config_GlobalConfig,
_estimatedTime: number,
}
local SummaryReporter = setmetatable({}, { __index = BaseReporter }) :: any
SummaryReporter.__index = SummaryReporter
SummaryReporter.filename = "SummaryReporter"
function SummaryReporter.new(globalConfig: Config_GlobalConfig, _process: any?): SummaryReporter
local self = setmetatable((BaseReporter.new(_process) :: any) :: SummaryReporterPrivate, SummaryReporter)
-- ROBLOX deviation START: _process can be nil
if _process then
npm_lifecycle_script = _process.env.npm_lifecycle_script
npm_lifecycle_event = _process.env.npm_lifecycle_event
npm_config_user_agent = _process.env.npm_config_user_agent
end
-- ROBLOX deviation END
self._globalConfig = globalConfig
self._estimatedTime = 0
return (self :: any) :: SummaryReporter
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local l__Pets__2 = l__LocalPlayer__1:WaitForChild("Pets");
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function getLevel(p1)
local v3 = 0;
local l__Value__4 = l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value;
local v5 = 0 - 1;
while true do
if 100 * v5 + v3 <= p1 then
if v5 ~= l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value then
else
return v5;
end;
if p1 < 100 * v5 + v3 + (100 + 25 * v5) then
return v5;
end;
end;
v3 = v3 + v5 * 25;
if 0 <= 1 then
if v5 < l__Value__4 then
else
break;
end;
elseif l__Value__4 < v5 then
else
break;
end;
v5 = v5 + 1;
end;
end;
function GetFolderFromPetID(p2)
for v9, v10 in pairs(l__LocalPlayer__1.Pets:GetChildren()) do
if v10.PetID.Value == p2 then
return v10;
end;
end;
return nil;
end;
function getLayoutOrder(p3)
local v11 = GetFolderFromPetID(p3);
local l__Value__12 = l__ReplicatedStorage__1.Pets.Rarities:FindFirstChild(l__ReplicatedStorage__1.Pets.Models:FindFirstChild(v11.Name).Settings.Rarity.Value).Order.Value;
local l__Value__13 = l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value;
local v14 = getLevel(v11.TotalXP.Value);
local v15 = {};
local v16 = 0;
for v20, v21 in pairs(l__ReplicatedStorage__1.Pets.Models:GetChildren()) do
v15[#v15 + 1] = v21;
end;
table.sort(v15, function(p4, p5)
return p4:GetFullName() < p5:GetFullName();
end);
for v26, v25 in pairs(v15) do
if v11.Equipped.Value == true then
if v11.Name == v25.Name then
return l__Value__13 * #v15 * (#l__ReplicatedStorage__1.Pets.Rarities:GetChildren() - l__Value__12) + v16 * l__Value__13 + (l__Value__13 - v14);
end;
elseif v11.Name == v25.Name then
return #v15 * #l__ReplicatedStorage__1.Pets.Rarities:GetChildren() * l__Value__13 + l__Value__13 * #v15 * (#l__ReplicatedStorage__1.Pets.Rarities:GetChildren() - l__Value__12) + v16 * l__Value__13 + (l__Value__13 - v14);
end;
v16 = v16 + 1;
end;
end;
local l__UIelements__2 = l__LocalPlayer__1.PlayerGui:WaitForChild("UIelements");
local l__Inventory__3 = script.Parent.MainFrame.Inventory;
function newUI(p6)
local v27 = l__UIelements__2.PetTemplate:Clone();
local v28 = l__ReplicatedStorage__1.Pets.Models:FindFirstChild(p6.Name):FindFirstChild(p6:WaitForChild("Type").Value):Clone();
local v29 = Instance.new("Camera", v27.PetView);
local l__Position__30 = v28.PrimaryPart.Position;
v27.PetID.Value = p6:WaitForChild("PetID").Value;
v27.Name = p6.Name;
v27.LevelLabel.Text = "Lvl. " .. getLevel(p6:WaitForChild("TotalXP").Value);
v27.PetView.CurrentCamera = v29;
v28.Parent = v27.PetView;
v29.CFrame = CFrame.new(Vector3.new(l__Position__30.X + 2.25, l__Position__30.Y, l__Position__30.Z + 1), l__Position__30);
v27.Parent = l__Inventory__3;
l__Inventory__3.CanvasSize = UDim2.new(0, 0, 0, l__Inventory__3.UIGridLayout.AbsoluteContentSize.Y + 200);
if p6.Equipped.Value == true then
v27.EquipMarker.Visible = true;
else
v27.EquipMarker.Visible = false;
end;
p6:WaitForChild("TotalXP"):GetPropertyChangedSignal("Value"):Connect(function()
v27.LevelLabel.Text = "Lvl. " .. getLevel(p6:WaitForChild("TotalXP").Value);
end);
for v34, v35 in pairs(l__Inventory__3:GetChildren()) do
if not v35:IsA("UIGridLayout") then
v35.LayoutOrder = getLayoutOrder(v35.PetID.Value);
end;
end;
end;
for v36, v37 in pairs(l__Pets__2:GetChildren()) do
newUI(v37);
end;
local l__TextLabel__4 = script.Parent.MainFrame.StorageDisplay.TextLabel;
local l__Data__5 = l__LocalPlayer__1:WaitForChild("Data");
local l__TextLabel__6 = script.Parent.MainFrame.EquippedDisplay.TextLabel;
l__Pets__2.ChildAdded:Connect(function(p7)
local v38 = 0;
for v39, v40 in pairs(l__Pets__2:GetChildren()) do
if v40:WaitForChild("Equipped").Value == true then
v38 = v38 + 1;
end;
end;
l__TextLabel__4.Text = #l__Pets__2:GetChildren() .. "/" .. l__Data__5.MaxStorage.Value;
l__TextLabel__6.Text = v38 .. "/" .. l__Data__5.MaxEquip.Value;
newUI(p7);
end);
l__Pets__2.ChildRemoved:Connect(function(p8)
for v41, v42 in pairs(l__Inventory__3:GetChildren()) do
if not v42:IsA("UIGridLayout") and v42.PetID.Value == p8.PetID.Value then
v42:Destroy();
end;
end;
local v43 = 0;
for v44, v45 in pairs(l__Pets__2:GetChildren()) do
if v45.Equipped.Value == true then
v43 = v43 + 1;
end;
end;
l__TextLabel__4.Text = #l__Pets__2:GetChildren() .. "/" .. l__Data__5.MaxStorage.Value;
l__TextLabel__6.Text = v43 .. "/" .. l__Data__5.MaxEquip.Value;
end);
l__Inventory__3.ChildAdded:Connect(function()
l__Inventory__3.CanvasSize = UDim2.new(0, 0, 0, l__Inventory__3.UIGridLayout.AbsoluteContentSize.Y + 200);
end);
l__Inventory__3.ChildRemoved:Connect(function()
l__Inventory__3.CanvasSize = UDim2.new(0, 0, 0, l__Inventory__3.UIGridLayout.AbsoluteContentSize.Y + 200);
end);
local v46 = 0;
for v47, v48 in pairs(l__Pets__2:GetChildren()) do
if v48.Equipped.Value == true then
v46 = v46 + 1;
end;
end;
l__Data__5.MaxStorage:GetPropertyChangedSignal("Value"):Connect(function()
l__TextLabel__4.Text = #l__Pets__2:GetChildren() .. "/" .. l__Data__5.MaxStorage.Value;
end);
l__Data__5.MaxEquip:GetPropertyChangedSignal("Value"):Connect(function()
l__TextLabel__6.Text = v46 .. "/" .. l__Data__5.MaxEquip.Value;
end);
l__TextLabel__4.Text = #l__Pets__2:GetChildren() .. "/" .. l__Data__5.MaxStorage.Value;
l__TextLabel__6.Text = v46 .. "/" .. l__Data__5.MaxEquip.Value;
|
-- Animation
|
CEs.AnimateT.OnClientEvent:connect(function(Part,NCF,Time,O)
if Part:IsDescendantOf(plr.Character) then return end
if O then
TweenService:Create(Part,TweenInfo.new(Time),O):Play()
else
TweenService:Create(Part,TweenInfo.new(Time),{C1=NCF}):Play()
end
end)
CEs.AnimateFE.OnClientEvent:connect(function(w,Time,Ans,NAngle,NRotation,Rchr,HigV)
if Rchr == plr.Character then return end
TweenService:Create(Rchr.Torso.Neck,TweenInfo.new(Time),{C0=OriginalC0*CFrame.Angles(Ans,NAngle,NRotation)}):Play()
TweenService:Create(Rchr.Torso.Mweld1,TweenInfo.new(Time),
{C1=w[1]*CFrame.new(0,HigV,0)}):Play()
TweenService:Create(Rchr.Torso.Mweld2,TweenInfo.new(Time),
{C1=w[2]*CFrame.new(0,HigV,0)}):Play()
if w[3] then -- Check if there is an extra weld
TweenService:Create(Rchr["Right Arm"].Mweld3,TweenInfo.new(Time),
{C1=w[3]*CFrame.new(0,HigV,0)}):Play()
end
TweenService:Create(Rchr.HumanoidRootPart.Mtweld,TweenInfo.new(Time),
{C1=w[4]*CFrame.new(0,HigV,0)}):Play()
end)
|
--[[
AnimateKey(note1,px,py,pz,ox,oy,oz,Time)
--note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time
local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]]
|
local parts = Piano.Case:GetChildren()
local PartAmt = 0
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
if PartAmt < 20 then
PartAmt = PartAmt + 1
local part = parts[math.random(1,#parts)]:clone()
part.Parent = Piano.Keys.Parts
part.Name = note1
part.Color = Color3.fromRGB(math.random(70,255),math.random(70,255),math.random(70,255))
part.Material = Materials[math.random(1,#Materials)]
part.Position = Vector3.new(part.Position.x + math.random(-5,5),part.Position.y,part.Position.z + math.random(-5,5))
part.Transparency = 0
local lifelen = math.random(0.6,2.0)
local t = 0
while t <= lifelen do
wait(.05)
t = t + .05
if math.random(1,4) ~= 1 then
for i = 1,5 do
if math.random(1,2) == 1 then
if i == 1 then
part.Color = Color3.fromRGB(math.random(70,255),math.random(70,255),math.random(70,255))
elseif i == 2 then
part.Material = Materials[math.random(1,#Materials)]
elseif i == 3 then
part.Position = Vector3.new(part.Position.x + math.random(-8.0,8.0),part.Position.y,part.Position.z + math.random(-8.0,8.0))
elseif i == 4 then
part.Orientation = Vector3.new(part.Orientation.x + math.random(-80,80),part.Orientation.y + math.random(-80,80),part.Orientation.z + math.random(-80,80))
elseif i == 5 then
part.Size = Vector3.new(part.Size.x + math.random(-2.0,2.0),part.Size.y + math.random(-2.0,2.0),part.Size.z + math.random(-2.0,2.0))
end
end
end
end
end
PartAmt = PartAmt - 1
part:destroy()
end
return
end
|
-- Allow RaycastModule to write to the output
|
local SHOW_OUTPUT_MESSAGES: boolean = false
|
--
--
|
function Sword:Connect()
Handle.Touched:Connect(function(hit)
local myPlayer = GLib.GetPlayerFromPart(Tool)
local character, player, humanoid = GLib.GetCharacterFromPart(hit)
if myPlayer~=nil and character~=nil and humanoid~=nil and myPlayer~=player then
local isTeammate = GLib.IsTeammate(myPlayer, player)
local myCharacter = myPlayer.Character
local myHumanoid = myCharacter and myCharacter:FindFirstChild'Humanoid'
if (Config.CanTeamkill.Value==true or isTeammate~=true) and (myHumanoid and myHumanoid:IsA'Humanoid' and myHumanoid.Health > 0) and (Config.CanKillWithForceField.Value or myCharacter:FindFirstChild'ForceField'==nil) then
local doDamage = Config.IdleDamage.Value
if Sword.State == 'Slashing' then
doDamage = Config.SlashDamage.Value
elseif Sword.State == 'Lunging' then
doDamage = Config.LungeDamage.Value
end
GLib.TagHumanoid(humanoid, myPlayer, 1)
humanoid:TakeDamage(doDamage)
end
end
end)
end
function Sword:Attack()
local myCharacter, myPlayer, myHumanoid = GLib.GetCharacterFromPart(Tool)
if myHumanoid~=nil and myHumanoid.Health > 0 then
if Config.CanKillWithForceField.Value or myCharacter:FindFirstChild'ForceField'==nil then
local now = tick()
if Sword.State == 'Slashing' and now-Sword.SlashingStartedAt < Sword.DoubleClickMaxTime then
Sword.AttackTicket = Sword.AttackTicket+1
Sword:Lunge(Sword.AttackTicket)
elseif Sword.State == 'Idle' then
Sword.AttackTicket = Sword.AttackTicket+1
Sword.SlashingStartedAt = now
Sword:Slash(Sword.AttackTicket)
end
end
end
end
function Sword:LocalAttack()
local myCharacter, myPlayer, myHumanoid = GLib.GetCharacterFromPart(Tool)
if myHumanoid~=nil and myHumanoid.Health > 0 then
if Config.CanKillWithForceField.Value or myCharacter:FindFirstChild'ForceField'==nil then
local now = tick()
if Sword.LocalState == 'Slashing' and now-Sword.LocalSlashingStartedAt < Sword.LocalDoubleClickMaxTime then
Sword.LocalAttackTicket = Sword.LocalAttackTicket+1
Sword:LocalLunge(Sword.LocalAttackTicket)
elseif Sword.LocalState == 'Idle' then
Sword.LocalAttackTicket = Sword.LocalAttackTicket+1
Sword.LocalSlashingStartedAt = now
Sword:LocalSlash(Sword.LocalAttackTicket)
end
end
end
end
function Sword:Slash(ticket)
Sword.State = 'Slashing'
Handle.SlashSound:Play()
Sword:Animate'Slash'
wait(0.5)
if Sword.AttackTicket == ticket then
Sword.State = 'Idle'
end
end
function Sword:LocalSlash(ticket)
Sword.LocalState = 'Slashing'
wait(0.5)
if Sword.LocalAttackTicket == ticket then
Sword.LocalState = 'Idle'
end
end
function Sword:Lunge(ticket)
Sword.State = 'Lunging'
Handle.LungeSound:Play()
Sword:Animate'Lunge'
local force = Instance.new'BodyVelocity'
force.velocity = Vector3.new(0, 10, 0)
force.maxForce = Vector3.new(0, 0, 0)
force.Parent = Tool.Parent.Torso
Sword.DestroyOnUnequip[force] = true
wait(0.25)
Tool.Grip = CFrame.new(0, 0, -1.5, 0, -1, -0, -1, 0, -0, 0, 0, -1)
wait(0.25)
force:Destroy()
Sword.DestroyOnUnequip[force] = nil
wait(0.5)
Tool.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
Sword.State = 'Idle'
end
function Sword:LocalLunge(ticket)
Sword.LocalState = 'Lunging'
wait(0.25)
wait(0.25)
wait(0.5)
Sword.LocalState = 'Idle'
end
function Sword:Animate(name)
local tag = Instance.new'StringValue'
tag.Name = 'toolanim'
tag.Value = name
tag.Parent = Tool -- Tag gets removed by the animation script
end
function Sword:Unequip()
for obj in next, Sword.DestroyOnUnequip do
obj:Destroy()
end
Sword.DestroyOnUnequip = {}
Tool.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
Sword.State = 'Idle'
Sword.LocalState = 'Idle'
end
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["t"]["t"])
return Package
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return plrData.Money.Gold.Value < 50
end
|
-- Detect input stopped
|
UIS.InputEnded:Connect(function(input)
-- Detect input to run
if input.KeyCode==Enum.KeyCode.LeftShift then
-- Make sure is running and not crawling
if shiftDown==true and not cDown then
-- Stop running
shiftDown=false
hum.WalkSpeed=18
end
-- Detect input to stop crawling
else if input.KeyCode==Enum.KeyCode.C then
-- Make sure crawling and is not running
if cDown==false and not shiftDown then
cDown=false
hum.WalkSpeed=18
--crawlAnm:Stop()
end
end
end
end)
|
-- ================================================================================
-- VARIABLES
-- ================================================================================
-- Services
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local PhysicsService = game:GetService("PhysicsService")
local ContextActionService = game:GetService("ContextActionService")
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
|
--[[Susupension]]
|
Tune.SusEnabled = false -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--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
|
-- Variables (best not to touch these!)
|
local button = script.Parent .Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local sound = script.Parent.Parent.Start
local st = script.Parent.Parent.Stall
st.Parent = car.DriveSeat
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
if script.Parent.Parent.Parent.Text == "Engine: Off" then -- If the text says it's off then..
sound:Play() -- Startup sound plays..
wait(1) -- I don't know what to put for this
script.Parent.Parent.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
button.Text = "Engine: On" -- You don't really need this, but I would keep it.
else -- If it's on then when you click the button,
st:play()
script.Parent.Parent.Parent.Parent.IsOn.Value = false -- The car is turned off.
button.Text = "Engine: Off"
end -- Don't touch this.
end) -- And don't touch this either.
|
--METHOD 2 PARAMS
|
local PIXELS_PER_WAIT = 1000
local WAIT_PERIOD = 0
local LocalPlayer = game.Players.LocalPlayer
local LocalHumanoidRootPart = LocalPlayer.Character:WaitForChild("Head")
local terminate = false
local uis = game:GetService("UserInputService")
function RaycastSingular(i)
if i > GRID_HEIGHT * GRID_WIDTH or terminate then
return
end
local width = (GRID_WIDTH - ((i - 1) % GRID_WIDTH + 1) - (GRID_WIDTH / 2))
local height = (GRID_HEIGHT - (math.floor((i - 1) / GRID_WIDTH) + 1)) - (GRID_HEIGHT / 2)
--raycast ahead keeping RAYCAST_OFFSET in mind
local rayParam = RaycastParams.new()
rayParam.FilterDescendantsInstances = {LocalPlayer.Character}
rayParam.FilterType = Enum.RaycastFilterType.Exclude
local pos1 = workspace.CurrentCamera.CFrame
local pos2 = (pos1 * CFrame.Angles(math.rad(height * RAYCAST_OFFSET), math.rad(width * RAYCAST_OFFSET), 0)).lookVector
local raycastResult = workspace:Raycast(pos1.Position, pos2 * 1000, rayParam)
if raycastResult then
local colorValue
local hitPart = raycastResult.Instance
if hitPart and hitPart:IsA("BasePart") then
local fadeAway = math.clamp(raycastResult.Distance / FOG_MULTIPLIER, 1, FOG_MAX)
colorValue = Color3.new(hitPart.Color.r * fadeAway, hitPart.Color.g * fadeAway, hitPart.Color.b * fadeAway)
else
--make a color of black from 128,128,128 to 0,0,0 depending on the distance of hit
local distance = (raycastResult.Position - LocalHumanoidRootPart.Position).Magnitude
local colorValue = math.floor(128 * (1 - distance / 1000))
if colorValue < 0 then
colorValue = 0
end
colorValue = Color3.new(colorValue, colorValue, colorValue)
end
script.Parent.Container:WaitForChild(tostring(i)).BackgroundColor3 = colorValue
else
script.Parent.Container:WaitForChild(tostring(i)).BackgroundColor3=Color3.fromRGB(85, 170, 255)
end
i += 1
end
function RaycastAndApply()
--raycast from the HumanoidRootPart forwards GRID_WIDTH * GRID_HEIGHT, offsetting by RAYCAST_OFFSET studs
local i = 1
for height = math.round(GRID_HEIGHT / 2), -math.round(GRID_HEIGHT/2), -1 do
for width = math.round(GRID_WIDTH / 2) - 1, -math.round(GRID_WIDTH / 2), -1 do
if i > GRID_HEIGHT * GRID_WIDTH or terminate then
return
end
--raycast ahead keeping RAYCAST_OFFSET in mind
local rayParam = RaycastParams.new()
rayParam.FilterDescendantsInstances = {LocalPlayer.Character}
rayParam.FilterType = Enum.RaycastFilterType.Exclude
local pos1 = workspace.CurrentCamera.CFrame
local pos2 = (pos1 * CFrame.Angles(math.rad(height * RAYCAST_OFFSET), math.rad(width * RAYCAST_OFFSET), 0)).lookVector
local raycastResult = workspace:Raycast(pos1.Position, pos2 * 1000, rayParam)
if raycastResult then
local colorValue
local hitPart = raycastResult.Instance
if hitPart and hitPart:IsA("BasePart") then
local fadeAway = math.clamp(raycastResult.Distance / FOG_MULTIPLIER, 1, FOG_MAX)
colorValue = Color3.new(hitPart.Color.r * fadeAway, hitPart.Color.g * fadeAway, hitPart.Color.b * fadeAway)
else
--make a color of black from 128,128,128 to 0,0,0 depending on the distance of hit
local distance = (raycastResult.Position - LocalHumanoidRootPart.Position).Magnitude
local colorValue = math.floor(128 * (1 - distance / 1000))
if colorValue < 0 then
colorValue = 0
end
colorValue = Color3.new(colorValue, colorValue, colorValue)
end
script.Parent.Container:WaitForChild(tostring(i)).BackgroundColor3 = colorValue
else
script.Parent.Container:WaitForChild(tostring(i)).BackgroundColor3=Color3.fromRGB(85, 170, 255)
end
if CALMDOWN_RENDER then
wait(CALMDOWN_RENDER)
end
i += 1
end
end
end
game.Close:Connect(function()
terminate = true
end)
function notify(title, text)
local CoreGui = game:GetService("StarterGui")
CoreGui:SetCore("SendNotification", {
Title = title;
Text = text;
Duration = 5;
})
end
uis.InputBegan:Connect(function(input, processed)
if processed then
return
end
if input.KeyCode == Enum.KeyCode.Q then
FOG_MAX = math.max(FOG_MAX - 1, 1)
notify("Fog Level", "was changed to " .. FOG_MAX)
end
if input.KeyCode == Enum.KeyCode.E then
FOG_MAX += 1
notify("Fog Level", "was changed to " .. FOG_MAX)
end
end)
if RENDER_METHOD == 1 then
while true do
wait(CALMDOWN)
--clearAllTiles()
RaycastAndApply()
--wait(1)
if terminate then
break
end
end
else
while true do
wait(WAIT_PERIOD)
for pixels = 1, PIXELS_PER_WAIT do
RaycastSingular(math.random(1, GRID_HEIGHT*GRID_WIDTH))
end
if terminate then
break
end
end
end
|
--Automatic Gauge Scaling
|
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=false
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=false
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 0
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
script.Parent.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
else
if script.Parent.TCS.Visible then
script.Parent.TCS.Visible = false
end
end
end)
|
--//INSPARE'S TRACTION SIMULATOR//--
|
--//INSPARE 2017//--
script.Parent:WaitForChild("Storage")
script.Parent.Active:WaitForChild("CC")
wait(1)
carSeat = script.Parent.CarSeat.Value
rpmN = script.Parent.StockUI.Right.Needle
boostN = script.Parent.StockUI.Right.Turbo.Needle
inds = script.Parent.Storage.TurboSize
UI = script.Parent.StockUI
WL = UI.Right.WarningLights
WL.ABS.ImageTransparency = 0.7
WL.ASC.ImageTransparency = 0.7
WL.Engine.ImageTransparency = 0.7
WL.Handbrake.ImageTransparency = 0.7
WL.HiBeam.ImageTransparency = 0.7
WL.LoBeam.ImageTransparency = 0.7
WL.TC.ImageTransparency = 0.7
IC = UI.Right.WarningLights
while wait() do
redline = script.Parent.Storage.EngineRedline
rpm = script.Parent.Storage.RPM
cg = script.Parent.Storage.CurrentGear
GV = {"rbxassetid://741208036","rbxassetid://741207988","rbxassetid://741208003","rbxassetid://741208039","rbxassetid://741208079","rbxassetid://741207971","rbxassetid://741208034","rbxassetid://741207990","rbxassetid://741208025","rbxassetid://741208051","rbxassetid://741207986"}
FL = carSeat.Storage.HeatFL.Value/0.59999999999999998
FR = carSeat.Storage.HeatFR.Value/0.59999999999999998
RL = carSeat.Storage.HeatRL.Value/0.59999999999999998
RR = carSeat.Storage.HeatRR.Value/0.59999999999999998
UI.Left.Tires.FL.First.Position = UDim2.new(0,0,1-FL,0)
UI.Left.Tires.FL.First.Second.Position = UDim2.new(0,0,FL,0)
UI.Left.Tires.FR.First.Position = UDim2.new(0,0,1-FR,0)
UI.Left.Tires.FR.First.Second.Position = UDim2.new(0,0,FR,0)
UI.Left.Tires.RL.First.Position = UDim2.new(0,0,1-RL,0)
UI.Left.Tires.RL.First.Second.Position = UDim2.new(0,0,RL,0)
UI.Left.Tires.RR.First.Position = UDim2.new(0,0,1-RR,0)
UI.Left.Tires.RR.First.Second.Position = UDim2.new(0,0,RR,0)
UI.Right.Gear.Image = GV[cg.Value]
rpmN.Rotation = ((99/redline.Value)*rpm.Value)-120
UI.Right.Turbo.Needle.Rotation = (((241/inds.Value)*script.Parent.Storage.Boost.Value))-160
if inds.Value <= 0 then
UI.Right.Turbo.Visible = false
end
if script.Parent.Functions.Engine.Value == true then
script.Parent.StockUI.Start.ImageTransparency = 1
else
script.Parent.StockUI.Start.ImageTransparency = 0
end
--if script.Parent.Storage.Drivetrain.Value ~= "AWD" then
UI.Left.FrontTorque.Text = 100-carSeat.Storage.TorqueSplit.Value.."%"
UI.Left.RearTorque.Text = carSeat.Storage.TorqueSplit.Value.."%"
--end
UI.Left.Drivetrain.Text = script.Parent.Storage.Drivetrain.Value
if carSeat.Storage.Mode.Value == "City" then
UI.Right.Mode.Image = "rbxassetid://741350702"
elseif carSeat.Storage.Mode.Value == "Sport" then
UI.Right.Mode.Image = "rbxassetid://741350688"
elseif carSeat.Storage.Mode.Value == "Snow" then
UI.Right.Mode.Image = "rbxassetid://741350718"
end
if carSeat.Storage.Automatic.Value == true then
UI.Left.Transmission.Text = "A/T"
elseif script.Parent.Storage.TransmissionType.Value == "CVT" then
UI.Left.Transmission.Text = "CVT"
else
UI.Left.Transmission.Text = "M/T"
end
if script.Parent.Storage.TransmissionType ~= "HPattern" then
UI.Controls.Manual.Image = "rbxassetid://757628375"
else
UI.Controls.Manual.Image = "rbxassetid://757627510"
end
if carSeat.Storage.TC.Value == true then
IC.TC.ImageTransparency = 0
else
IC.TC.ImageTransparency = 0.7
end
if carSeat.Storage.Handbrake.Value == true then
IC.Handbrake.ImageTransparency = 0
else
IC.Handbrake.ImageTransparency = 0.7
end
if script.Parent.Functions.Stall.Value == true and script.Parent.Functions.Engine.Value == false then
IC.Engine.ImageTransparency = 0
else
IC.Engine.ImageTransparency = 0.7
end
if carSeat.Storage.ASC.Value == true then
IC.ASC.ImageTransparency = 0
else
IC.ASC.ImageTransparency = 0.7
end
if script.Parent.ABS.FL.Read.Value == true then
IC.ABS.ImageTransparency = 0
else
IC.ABS.ImageTransparency = 0.7
end
if script.Parent.Active.CC.Value == true then
IC.CC.ImageTransparency = 0
else
IC.CC.ImageTransparency = 0.7
end
if script.TY.Value == true then
UI.Right.Unit.Text = "km/h"
UI.Right.Speed.Text = math.floor((carSeat.Velocity.Magnitude)*1.07)
else
UI.Right.Unit.Text = "MPH"
UI.Right.Speed.Text = math.floor(((carSeat.Velocity.Magnitude)*1.07)*0.621371)
end
if script.Parent.Functions.ShiftDownRequested.Value == true or script.Parent.Functions.ShiftUpRequested.Value == true or script.Parent.Storage.Clutch.Clutch.Value ~= 1 then
UI.Right.Gear.ImageColor3 = Color3.new(255, 189, 57)
UI.Right.Gear.ImageTransparency = 0.7
else
UI.Right.Gear.ImageColor3 = Color3.new(150, 150, 150)
UI.Right.Gear.ImageTransparency = 0
end
--[[if carSeat.Throttle == -1 then
if script.Parent.ABS.FL.Read.Value == true then
WL.ABS.ImageTransparency = 0.7
else
WL.ABS.ImageTransparency = 0
end else WL.ABS.ImageTransparency = 0.7
end]]--
end
--//One more year, every year//--
|
-- Initialize texture tool
|
local TextureTool = require(CoreTools:WaitForChild 'Texture')
Core.AssignHotkey('G', Core.Support.Call(Core.EquipTool, TextureTool));
Core.Dock.AddToolButton(Core.Assets.TextureIcon, 'G', TextureTool, 'TextureInfo');
|
--
|
function ragdollkill(character)
local victimshumanoid = character:findFirstChildOfClass("Humanoid")
local checkragd = character:findFirstChild("ragded")
if not checkragd then
local boolvalue = Instance.new("BoolValue", character)
boolvalue.Name = "ragded"
if not character:findFirstChild("UpperTorso") then
character.Archivable = true
for i,v in pairs(character:GetChildren()) do
if v.ClassName == "Sound" then
v:remove()
end
for q,w in pairs(v:GetChildren()) do
if w.ClassName == "Sound" then
w:remove()
end
end
end
local ragdoll = character:Clone()
for i,v in pairs(ragdoll:GetDescendants()) do
if v.ClassName == "Motor" or v.ClassName == "Motor6D" then
v:destroy()
end
end
ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
ragdoll:findFirstChildOfClass("Humanoid").Health = 0
if ragdoll:findFirstChild("Health") then
if ragdoll:findFirstChild("Health").ClassName == "Script" then
ragdoll:findFirstChild("Health").Disabled = true
end
end
for i,v in pairs(character:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then
v:destroy()
end
end
for i,v in pairs(character:GetChildren()) do
if v.ClassName == "Accessory" then
local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
if attachment1 then
for q,w in pairs(character:GetChildren()) do
if w.ClassName == "Part" then
local attachment2 = w:findFirstChild(attachment1.Name)
if attachment2 then
local hinge = Instance.new("HingeConstraint", v.Handle)
hinge.Attachment0 = attachment1
hinge.Attachment1 = attachment2
hinge.LimitsEnabled = true
hinge.LowerAngle = 0
hinge.UpperAngle = 0
end
end
end
end
end
end
ragdoll.Parent = workspace
if ragdoll:findFirstChild("Right Arm") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Right Arm")
glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
limbcollider.Size = Vector3.new(1.4,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
limbcollider.Name = "LimbCollider"
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
end
if ragdoll:findFirstChild("Left Arm") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Left Arm")
glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
limbcollider.Size = Vector3.new(1.4,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Name = "LimbCollider"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
end
if ragdoll:findFirstChild("Left Leg") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Left Leg")
glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
limbcollider.Size = Vector3.new(1.4,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Name = "LimbCollider"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
end
if ragdoll:findFirstChild("Right Leg") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Right Leg")
glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
limbcollider.Size = Vector3.new(1.4,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Name = "LimbCollider"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
end
if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then
local HeadAttachment = Instance.new("Attachment", ragdoll["Head"])
HeadAttachment.Position = Vector3.new(0, -0.5, 0)
local connection = Instance.new('HingeConstraint', ragdoll["Head"])
connection.LimitsEnabled = true
connection.Attachment0 = ragdoll.Torso.NeckAttachment
connection.Attachment1 = HeadAttachment
connection.UpperAngle = 60
connection.LowerAngle = -60
elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then
local hedweld = Instance.new("Weld", ragdoll.Torso)
hedweld.Part0 = ragdoll.Torso
hedweld.Part1 = ragdoll.Head
hedweld.C0 = CFrame.new(0,1.5,0)
end
game.Debris:AddItem(ragdoll, 30)
local function aaaalol()
wait(0.2)
local function searchforvelocity(wot)
for i,v in pairs(wot:GetChildren()) do
searchforvelocity(v)
if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
v:destroy()
end
end
end
searchforvelocity(ragdoll)
wait(0.5)
if ragdoll:findFirstChildOfClass("Humanoid") then
ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
end
if ragdoll:findFirstChild("HumanoidRootPart") then
ragdoll:findFirstChild("HumanoidRootPart"):destroy()
end
end
spawn(aaaalol)
elseif character:findFirstChild("UpperTorso") then
character.Archivable = true
for i,v in pairs(character:GetChildren()) do
if v.ClassName == "Sound" then
v:remove()
end
for q,w in pairs(v:GetChildren()) do
if w.ClassName == "Sound" then
w:remove()
end
end
end
local ragdoll = character:Clone()
ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
for i,v in pairs(ragdoll:GetDescendants()) do
if v.ClassName == "Motor" or v.ClassName == "Motor6D" then
v:destroy()
end
end
ragdoll:BreakJoints()
ragdoll:findFirstChildOfClass("Humanoid").Health = 0
if ragdoll:findFirstChild("Health") then
if ragdoll:findFirstChild("Health").ClassName == "Script" then
ragdoll:findFirstChild("Health").Disabled = true
end
end
for i,v in pairs(character:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then
v:destroy()
end
end
for i,v in pairs(character:GetChildren()) do
if v.ClassName == "Accessory" then
local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
if attachment1 then
for q,w in pairs(character:GetChildren()) do
if w.ClassName == "Part" or w.ClassName == "MeshPart" then
local attachment2 = w:findFirstChild(attachment1.Name)
if attachment2 then
local hinge = Instance.new("HingeConstraint", v.Handle)
hinge.Attachment0 = attachment1
hinge.Attachment1 = attachment2
hinge.LimitsEnabled = true
hinge.LowerAngle = 0
hinge.UpperAngle = 0
end
end
end
end
end
end
ragdoll.Parent = workspace
local Humanoid = ragdoll:findFirstChildOfClass("Humanoid")
Humanoid.PlatformStand = true
local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper)
local connection = Instance.new('BallSocketConstraint', limb)
connection.LimitsEnabled = true
connection.Attachment0 = attachementone
connection.Attachment1 = attachmenttwo
connection.TwistLimitsEnabled = true
connection.TwistLowerAngle = twistlower
connection.TwistUpperAngle = twistupper
local limbcollider = Instance.new("Part", limb)
limbcollider.Size = Vector3.new(0.1,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
limbcollider:BreakJoints()
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = limb
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
end
local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper)
local connection = Instance.new('HingeConstraint', limb)
connection.LimitsEnabled = true
connection.Attachment0 = attachementone
connection.Attachment1 = attachmenttwo
connection.LimitsEnabled = true
connection.LowerAngle = lower
connection.UpperAngle = upper
local limbcollider = Instance.new("Part", limb)
limbcollider.Size = Vector3.new(0.1,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
limbcollider:BreakJoints()
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = limb
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
end
local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
HeadAttachment.Position = Vector3.new(0, -0.5, 0)
if ragdoll.UpperTorso:findFirstChild("NeckAttachment") then
makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50)
end
makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50)
makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180)
makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60)
makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20)
--
makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180)
makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60)
makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20)
--
makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80)
makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60)
makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20)
--
makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80)
makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60)
makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20)
for i,v in pairs(Humanoid.Parent:GetChildren()) do
if v.ClassName == "Accessory" then
local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
if attachment1 then
for q,w in pairs(Humanoid.Parent:GetChildren()) do
if w.ClassName == "Part" then
local attachment2 = w:findFirstChild(attachment1.Name)
if attachment2 then
local hinge = Instance.new("HingeConstraint", v.Handle)
hinge.Attachment0 = attachment1
hinge.Attachment1 = attachment2
hinge.LimitsEnabled = true
hinge.LowerAngle = 0
hinge.UpperAngle = 0
end
end
end
end
end
end
for i,v in pairs(ragdoll:GetChildren()) do
for q,w in pairs(v:GetChildren()) do
if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] and w.Name ~= "ouch_weld" then
w:destroy()
end
end
end
if ragdoll:findFirstChild("HumanoidRootPart") then
ragdoll.HumanoidRootPart:destroy()
end
if ragdoll:findFirstChildOfClass("Humanoid") then
ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
end
local function waitfordatmoment()
wait(0.2)
local function searchforvelocity(wot)
for i,v in pairs(wot:GetChildren()) do
searchforvelocity(v)
if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
v:destroy()
end
end
end
searchforvelocity(ragdoll)
end
spawn(waitfordatmoment)
game.Debris:AddItem(ragdoll, 30)
end
end
end
function damage(action, force, maxforce, t)
for i,v in pairs(workspace:GetDescendants()) do
if v.ClassName == "Model" then
local head = v:findFirstChild("Head")
local humanoid = v:findFirstChildOfClass("Humanoid")
local torso = v:findFirstChild("Torso")
local ragdolled = v:findFirstChild("ragdolledbat")
if humanoid and head then
if (head.Position - handle.Position).magnitude < 3 and v ~= character and humanoid.Health > 0 then
if action ~= "vibe check" then
if ragdolled then
return
end
end
local rightarmweld = character.Torso:findFirstChild("RightArmWeldbat")
local leftarmweld = character.Torso:findFirstChild("LeftArmWeldbat")
local headweld = character.Torso:findFirstChild("HeadWeldbat")
local rootweld = character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldbat")
hitsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
hitsound:Play()
hitsound2.PlaybackSpeed = 1+(math.random(-4,4)/20)
hitsound2:Play()
local velocity = Instance.new("BodyVelocity", head)
velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * math.random(force,maxforce)
if action == "normal" then
local dmg = math.random(30,80)
if humanoid.Health <= dmg then
humanoid.Health = 0
humanoid.Parent:BreakJoints()
ragdollkill(v)
else
humanoid.Health = humanoid.Health - dmg
end
elseif action == "critical" then
local dmg = math.random(70,90)
if humanoid.Health <= dmg then
humanoid.Health = 0
humanoid.Parent:BreakJoints()
ragdollkill(v)
else
humanoid.Health = humanoid.Health - dmg
end
elseif action == "vibe check" then
goresound.PlaybackSpeed = 1+(math.random(-4,4)/20)
goresound:Play()
goresound2.PlaybackSpeed = 1+(math.random(-4,4)/20)
goresound2:Play()
head.Transparency = 1
for i = 1,math.random(25,30) do
local hedd = Instance.new("Part", workspace)
hedd.Size = Vector3.new(0.25,0.25,0.25)
hedd.CFrame = head.CFrame * CFrame.new(math.random(-10,10)/20,math.random(-10,10)/20,math.random(-10,10)/20)
game.Debris:AddItem(hedd, 7)
if math.random(1,3) == 1 then
hedd.BrickColor = head.BrickColor
hedd.Material = head.Material
else
hedd.BrickColor = BrickColor.new("Maroon")
hedd.Material = "Granite"
end
end
for q,w in pairs(v:GetChildren()) do
if w.ClassName == "Accessory" or w.ClassName == "Hat" then
w:destroy()
end
end
for q,w in pairs(head:GetChildren()) do
if w.ClassName == "Weld" then
if w.Part1 ~= nil then
if w.Part1 ~= head then
w.Part1:destroy()
end
end
end
if w.ClassName == "Decal"then
w:destroy()
end
end
humanoid.Health = 0
humanoid.Parent:BreakJoints()
ragdollkill(v)
end
local ragdolledknife = Instance.new("BoolValue", v)
ragdolledknife.Name = "ragdolledbat"
humanoid.PlatformStand = true
coroutine.wrap(function()
wait(t)
humanoid.PlatformStand = false
end)()
game.Debris:AddItem(ragdolledknife, t)
game.Debris:AddItem(velocity, 0.2)
if torso then
coroutine.wrap(function()
humanoid = v:WaitForChild("Humanoid")
local ragdoll = v
if ragdoll:findFirstChild("Right Arm") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Right Arm")
glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
limbcollider.Size = Vector3.new(1.4,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
limbcollider.Name = "LimbCollider"
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
coroutine.wrap(function()
if ragdoll.Torso:findFirstChild("Right Shoulder") then
local limbclone = ragdoll.Torso:findFirstChild("Right Shoulder"):Clone()
ragdoll.Torso:findFirstChild("Right Shoulder"):destroy()
coroutine.wrap(function()
wait(t)
limbclone.Parent = ragdoll.Torso
limbclone.Part0 = ragdoll.Torso
limbclone.Part1 = ragdoll["Right Arm"]
end)()
end
wait(t)
glue:destroy()
limbcollider:destroy()
limbcolliderweld:destroy()
end)()
end
if ragdoll:findFirstChild("Left Arm") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Left Arm")
glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
limbcollider.Size = Vector3.new(1.4,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Name = "LimbCollider"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
coroutine.wrap(function()
if ragdoll.Torso:findFirstChild("Left Shoulder") then
local limbclone = ragdoll.Torso:findFirstChild("Left Shoulder"):Clone()
ragdoll.Torso:findFirstChild("Left Shoulder"):destroy()
coroutine.wrap(function()
wait(t)
limbclone.Parent = ragdoll.Torso
limbclone.Part0 = ragdoll.Torso
limbclone.Part1 = ragdoll["Left Arm"]
end)()
end
wait(t)
glue:destroy()
limbcollider:destroy()
limbcolliderweld:destroy()
end)()
end
if ragdoll:findFirstChild("Left Leg") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Left Leg")
glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
limbcollider.Size = Vector3.new(1.5,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Name = "LimbCollider"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
coroutine.wrap(function()
if ragdoll.Torso:findFirstChild("Left Hip") then
local limbclone = ragdoll.Torso:findFirstChild("Left Hip"):Clone()
ragdoll.Torso:findFirstChild("Left Hip"):destroy()
coroutine.wrap(function()
wait(t)
limbclone.Parent = ragdoll.Torso
limbclone.Part0 = ragdoll.Torso
limbclone.Part1 = ragdoll["Left Leg"]
end)()
end
wait(t)
glue:destroy()
limbcollider:destroy()
limbcolliderweld:destroy()
end)()
end
if ragdoll:findFirstChild("Right Leg") then
local glue = Instance.new("Glue", ragdoll.Torso)
glue.Part0 = ragdoll.Torso
glue.Part1 = ragdoll:findFirstChild("Right Leg")
glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
limbcollider.Size = Vector3.new(1.5,1,1)
limbcollider.Shape = "Cylinder"
limbcollider.Name = "LimbCollider"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
coroutine.wrap(function()
if ragdoll.Torso:findFirstChild("Right Hip") then
local limbclone = ragdoll.Torso:findFirstChild("Right Hip"):Clone()
ragdoll.Torso:findFirstChild("Right Hip"):destroy()
coroutine.wrap(function()
wait(t)
limbclone.Parent = ragdoll.Torso
limbclone.Part0 = ragdoll.Torso
limbclone.Part1 = ragdoll["Right Leg"]
end)()
end
wait(t)
glue:destroy()
limbcollider:destroy()
limbcolliderweld:destroy()
end)()
end
end)()
end
end
end
end
end
end
tool.Deactivated:connect(function()
if mouseclick and not cananimate then
if count < 30 then
cananimate = true
canattack = true
return
end
local rightarmweld = character.Torso:findFirstChild("RightArmWeldbat")
local leftarmweld = character.Torso:findFirstChild("LeftArmWeldbat")
local headweld = character.Torso:findFirstChild("HeadWeldbat")
local rootweld = character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldbat")
if attacknumber == 1 then
trail.Enabled = true
swishsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
swishsound:Play()
for i = 0,1 , 0.1 do
if attacktype == 0 then
damage("normal", 10,20, 2)
elseif attacktype == 1 then
damage("critical", 20,30, 2.5)
elseif attacktype == 2 then
damage("vibe check", 30,40, 1)
end
tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.pi/2,-(math.pi/3),0),0.1)
headweld.C0 = headweld.C0:lerp(CFrame.new(9.53674316e-07, 1.49999952, 9.53674316e-07, 0.499999791, -1.49011612e-08, -0.866025269, -3.14321369e-09, 0.999999881, -1.49011612e-08, 0.866025388, -7.4505806e-09, 0.499999821),i)
rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(0.27244854, 0.123777866, -0.741029739, 0.642787457, 0.719846129, 0.262002736, 1.49011612e-08, 0.342020303, -0.939692438, -0.766044378, 0.604022741, 0.219846398),i)
leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-0.993065834, 0.0928759575, -0.543260574, 0.981225848, -0.183488816, 0.0593911558, 0.116977744, 0.321393728, -0.939692438, 0.153335154, 0.928998232, 0.336824),i)
rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.492403746, 0.0868240669, 0.866025448, -0.173648179, 0.98480773, 0, -0.852868557, -0.150383741, 0.499999881),i)
runservice.Stepped:wait()
end
trail.Enabled = false
attacknumber = 2
elseif attacknumber == 2 then
trail.Enabled = true
swishsound.PlaybackSpeed = 1+(math.random(-4,4)/20)
swishsound:Play()
for i = 0,1 , 0.1 do
if attacktype == 0 then
damage("normal", 10,20, 2)
elseif attacktype == 1 then
damage("critical", 20,30, 2.5)
elseif attacktype == 2 then
damage("vibe check", 30,40, 1)
end
tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.pi/2,(math.pi/2),0),0.1)
headweld.C0 = headweld.C0:lerp(CFrame.new(0, 1.5, 1.90734863e-06, 0.642787576, 7.4505806e-09, 0.766044378, -1.0477379e-09, 0.99999994, 1.49011612e-08, -0.766044378, 0, 0.642787576),i)
rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.50000191, 0.328989983, -0.469844818, 0.99999994, 2.98023224e-08, -2.98023224e-08, 7.4505806e-09, 0.342020035, -0.939692438, 0, 0.939692378, 0.342020065),i)
leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(0.314659119, 0.191040754, -1.2273407, 0.344304681, -0.926735461, -0.150383726, 0.0301536545, 0.171010002, -0.984807611, 0.938373566, 0.334539324, 0.0868240297),i)
rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.633022368, -0.111618921, -0.766044259, 0.173648179, 0.98480773, 0, 0.754406333, -0.133022189, 0.642787755) * CFrame.fromEulerAnglesXYZ(0,math.rad(20),0),i)
runservice.Stepped:wait()
end
trail.Enabled = false
attacknumber = 1
end
cananimate = true
canattack = true
end
end)
tool.Activated:connect(function()
if owner ~= nil and character ~= nil and canattack then
cananimate = false
canattack = false
attacktype = 0
count = 0
local rightarmweld = character.Torso:findFirstChild("RightArmWeldbat")
local leftarmweld = character.Torso:findFirstChild("LeftArmWeldbat")
local headweld = character.Torso:findFirstChild("HeadWeldbat")
local rootweld = character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldbat")
if handle:findFirstChild("AIDS") then
handle.AIDS:destroy()
local grip = character["Right Arm"]:WaitForChild("RightGrip")
grip.Part1 = handle
end
for i,v in pairs(workspace:GetDescendants()) do
if v.ClassName == "Model" and v ~= character then
local humanoid = v:findFirstChildOfClass("Humanoid")
local headepic = v:findFirstChild("Head")
if humanoid and headepic then
if (headepic.Position - character.HumanoidRootPart.Position).magnitude < 6 and humanoid.PlatformStand and humanoid.Health > 0 then
local rightlegweld = Instance.new("Weld", character.Torso)
rightlegweld.Part0 = character.Torso
rightlegweld.Part1 = character["Right Leg"]
rightlegweld.C0 = CFrame.new(0.5,-2,0)
rightlegweld.Name = "RightLegWeldbat"
local leftlegweld = Instance.new("Weld", character.Torso)
leftlegweld.Part0 = character.Torso
leftlegweld.Part1 = character["Left Leg"]
leftlegweld.C0 = CFrame.new(-0.5,-2,0)
leftlegweld.Name = "LeftLegWeldbat"
character:findFirstChildOfClass("Humanoid").WalkSpeed = 0
for i = 0,1 , 0.05 do
cananimate = false
canattack = false
character.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.Position, Vector3.new(headepic.Position.x,character.HumanoidRootPart.Position.y,headepic.Position.z))
tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.pi/2,(math.pi/2)+math.rad(25),0),i)
rightlegweld.C0 = rightlegweld.C0:lerp(CFrame.new(0.681245327, -2.07163143, 0, 0.98480773, -0.173648179, -2.98023224e-08, 0.173648164, 0.984807611, 7.4505806e-09, -2.98023224e-08, 1.14149561e-08, 1),i)
leftlegweld.C0 = leftlegweld.C0:lerp(CFrame.new(-0.499999046, -1.39999986, -0.399999619, 0.99999994, -7.4505806e-09, -2.98023224e-08, 1.49011612e-08, 0.999999881, 7.4505806e-09, -2.98023224e-08, 0, 1),i)
rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.57790804, 0.75, 0.321748734, 0.342020154, -0.813797712, 0.469846278, -1.49011612e-08, -0.49999994, -0.866025209, 0.939692616, 0.29619813, -0.171010107),i)
leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(1.41171503, 0.67853117, -0.785638809, -0.468489617, -0.76629442, 0.439670324, -0.134425014, -0.430039823, -0.892745972, 0.873182297, -0.47734493, 0.0984600335),i)
rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.633021891, 0.111618839, -0.766044736, -0.173648179, 0.98480773, 0, 0.75440675, 0.133022279, 0.642787278),i)
headweld.C0 = headweld.C0:lerp(CFrame.new(-0.131000042, 1.46984625, -0.109922409, 0.642787337, -0.262002826, 0.719846427, -6.98491931e-10, 0.939692497, 0.342020392, -0.766044617, -0.219846383, 0.604022503),i)
runservice.Stepped:wait()
end
trail.Enabled = true
for i = 0,1 , 0.12 do
damage("vibe check", 0, 0, 1)
tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0),i)
rightlegweld.C0 = rightlegweld.C0:lerp(CFrame.new(0.499998093, -1.49999964, 0.866025925, 0.99999994, -2.98023224e-08, -3.7252903e-09, -7.4505806e-09, 0.499999911, 0.866025269, 0, -0.866025448, 0.49999994),i)
leftlegweld.C0 = leftlegweld.C0:lerp(CFrame.new(-0.500001907, -0.739692211, -0.657979965, 0.99999994, 0, 2.98023224e-08, -7.4505806e-09, 0.939692378, 0.342020035, 0, -0.342020184, 0.939692616),i)
rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(0.569936752, 0.318357229, -1.03014803, 0.939692497, 0.342020154, 1.49011612e-08, -0.0593912005, 0.163175836, -0.984807611, -0.336824059, 0.92541647, 0.173648238),i)
leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-0.429023743, 0.324180841, -0.997120857, 0.98480767, -0.173648149, 1.49011612e-08, 0.0301536694, 0.171010017, -0.984807611, 0.171010062, 0.969846368, 0.173648238),i)
rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, -1.19999969, 0, 0.950535476, -0.055632934, 0.305593252, -0.0479752049, 0.945729434, 0.321393996, -0.30688861, -0.320157319, 0.896280468),i)
headweld.C0 = headweld.C0:lerp(CFrame.new(-1.90734863e-06, 1.5, 0, 0.98480773, -7.4505806e-09, -0.173648179, -1.49011612e-08, 0.999999881, 0, 0.173648253, -2.98023224e-08, 0.98480773),i)
runservice.Stepped:wait()
end
coroutine.wrap(function()
for i = 0,1 ,0.07 do
leftlegweld.C0 = leftlegweld.C0:lerp(CFrame.new(-0.5,-2,0),i)
rightlegweld.C0 = rightlegweld.C0:lerp(CFrame.new(0.5,-2,0),i)
runservice.Stepped:wait()
end
leftlegweld:destroy()
rightlegweld:destroy()
character:findFirstChildOfClass("Humanoid").WalkSpeed = 16
end)()
trail.Enabled = false
cananimate = true
canattack = true
return
end
end
end
end
if attacknumber == 1 then
coroutine.wrap(function()
while runservice.Stepped:wait() and mouseclick do
count = count + 1
if count == 50 then
attacktype = 1
local effect = Instance.new("Part", workspace)
effect.Material = "ForceField"
effect.BrickColor = BrickColor.new("Institutional white")
effect.Anchored = true
effect.CanCollide = false
effect.CFrame = handle.CFrame
effect.Size = handle.Size
coroutine.wrap(function()
for i = 1,40 do
effect.Transparency = effect.Transparency + 0.025
effect.Size = effect.Size + Vector3.new(0.02,0.02,0.02)
runservice.Stepped:wait()
end
effect:destroy()
end)()
end
if count == 90 then
attacktype = 2
local effect = Instance.new("Part", workspace)
effect.Material = "ForceField"
effect.BrickColor = BrickColor.new("Really red")
effect.Anchored = true
effect.CanCollide = false
effect.CFrame = handle.CFrame
effect.Size = handle.Size
coroutine.wrap(function()
for i = 1,40 do
effect.Transparency = effect.Transparency + 0.025
effect.Size = effect.Size + Vector3.new(0.02,0.02,0.02)
runservice.Stepped:wait()
end
effect:destroy()
end)()
end
tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.pi/2,(math.pi/2)+math.rad(25),0),0.1)
headweld.C0 = headweld.C0:lerp(CFrame.new(-0.0815873146, 1.49240327, -0.0296955109, 0.342020094, -0.163175672, 0.925416231, 1.00699253e-08, 0.984807491, 0.173647955, -0.939692616, -0.0593911149, 0.336824059),0.1)
rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.336824089, 0.0593911782, -0.939692616, -0.173648149, 0.984807611, 0, 0.92541641, 0.163175896, 0.342020154) * CFrame.fromEulerAnglesXYZ(math.sin(tick())/20,0,0),0.1)
leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(1.3505621, 0.950000048, -0.634313583, -0.342020035, -0.813797235, 0.469846278, -4.87780198e-08, -0.49999997, -0.866025031, 0.939692616, -0.29619804, 0.171010047) * CFrame.new(0,math.cos(tick())/20,0),0.1)
rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.58705735, 0.872320414, 0.129386902, 0.607604206, -0.566511154, 0.556670189, 0.111618847, -0.633021832, -0.766044259, 0.786357343, 0.527587116, -0.321393698) * CFrame.new(0,math.cos(tick())/20,0),0.1)
end
end)()
elseif attacknumber == 2 then
coroutine.wrap(function()
while runservice.Stepped:wait() and mouseclick do
count = count + 1
if count == 50 then
attacktype = 1
local effect = Instance.new("Part", workspace)
effect.Material = "ForceField"
effect.BrickColor = BrickColor.new("Institutional white")
effect.Anchored = true
effect.CanCollide = false
effect.CFrame = handle.CFrame
effect.Size = handle.Size
coroutine.wrap(function()
for i = 1,40 do
effect.Transparency = effect.Transparency + 0.025
effect.Size = effect.Size + Vector3.new(0.02,0.02,0.02)
runservice.Stepped:wait()
end
effect:destroy()
end)()
end
if count == 90 then
attacktype = 2
local effect = Instance.new("Part", workspace)
effect.Material = "ForceField"
effect.BrickColor = BrickColor.new("Really red")
effect.Anchored = true
effect.CanCollide = false
effect.CFrame = handle.CFrame
effect.Size = handle.Size
coroutine.wrap(function()
for i = 1,40 do
effect.Transparency = effect.Transparency + 0.025
effect.Size = effect.Size + Vector3.new(0.02,0.02,0.02)
runservice.Stepped:wait()
end
effect:destroy()
end)()
end
tool.Grip = tool.Grip:lerp(CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.pi/2,(-math.pi/2)+math.rad(25),0),0.1)
headweld.C0 = headweld.C0:lerp(CFrame.new(0, 1.5, 0, 0.342020035, 0, -0.939692378, -1.64301071e-07, 1, -5.98006906e-08, 0.939692378, 1.74845525e-07, 0.342020035),0.1)
rootweld.C0 = rootweld.C0:lerp(CFrame.new(0, 0, 0, 0.173648119, 0, 0.98480767, 0, 1, 0, -0.98480767, 0, 0.173648119) * CFrame.fromEulerAnglesXYZ(math.sin(tick())/20,0,0.1),0.1)
leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.69218636, 0.638716698, -0.0404472351, 0.771280289, 0.613091826, -0.171010137, 0.0593912005, -0.336824268, -0.939692497, -0.633718252, 0.714609921, -0.296198249) * CFrame.new(0,math.cos(tick())/20,0),0.1)
rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(-1.2802496, 0.725742579, -0.5, -4.47034836e-08, 0.984807432, -0.173648149, 4.37113847e-08, -0.173648149, -0.984807551, -0.999999762, -2.98023224e-08, -3.35276127e-08) * CFrame.new(0,math.cos(tick())/20,0),0.1)
end
end)()
end
end
end)
|
--
|
sp=script.Parent
sp.Luminate.SourceValueChanged:connect(function(val)
if val==1 then
sp.BrickColor=BrickColor.new("White")
sp.Transparency=0
sp.PointLight.Enabled=true
elseif val==0 then
sp.BrickColor=BrickColor.new("Really black")
sp.Transparency=.5
sp.PointLight.Enabled=false
end
end)
script.Parent.Configuration.Brightness.Changed:connect(function()
script.Parent.PointLight.Range = script.Parent.Configuration.Brightness.Value
script.Parent.PointLight.Brightness = 1+script.Parent.Configuration.Brightness.Value/300
end)
|
-- NOTE: HASARG_MASK is value-specific
|
luaY.HASARG_MASK = 2 -- this was added for a bitop in parlist()
luaY.VARARG_ISVARARG = 2
|
--back motor
|
script.Parent.Wheels.boggieB.motb.HingeConstraint.AngularVelocity = speed
script.Parent.Wheels.boggieB.motb.HingeConstraint2.AngularVelocity = -speed
script.Parent.Wheels.boggieB.motb.HingeConstraint.MotorMaxTorque = RPM
script.Parent.Wheels.boggieB.motb.HingeConstraint2.MotorMaxTorque = RPM
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
--[[ 7 ]] 0.50 ,
--[[ 8 ]] 0.37 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--[[
Creates and configures collision groups.
Used to prevent characters from colliding with wagons.
--]]
|
local PhysicsService = game:GetService("PhysicsService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DescendantsCollisionGroup = require(ServerStorage.Source.DescendantsCollisionGroup)
local ComponentCreator = require(ReplicatedStorage.Source.ComponentCreator)
local CollisionGroup = require(ServerStorage.Source.CollisionGroup)
local CharacterTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.CharacterTag)
local CollisionGroupManager = {}
function CollisionGroupManager.start()
PhysicsService:RegisterCollisionGroup(CollisionGroup.Character)
PhysicsService:RegisterCollisionGroup(CollisionGroup.Wagon)
PhysicsService:CollisionGroupSetCollidable(CollisionGroup.Character, CollisionGroup.Wagon, false)
PhysicsService:CollisionGroupSetCollidable(CollisionGroup.Wagon, CollisionGroup.Wagon, false)
-- DescendantsCollisionGroup.new() will be called with the Character model, CollisionGroup.Character as the arguments
ComponentCreator.new(CharacterTag.Character, DescendantsCollisionGroup, CollisionGroup.Character):listen()
end
return CollisionGroupManager
|
--[=[
@return Streamable
@param parent Instance
@param childName string
Constructs a Streamable that watches for a direct child of name `childName`
within the `parent` Instance. Call `Observe` to observe the existence of
the child within the parent.
]=]
|
function Streamable.new(parent: Instance, childName: string)
local self: StreamableWithInstance = {}
setmetatable(self, Streamable)
self._trove = Trove.new()
self._shown = self._trove:Construct(Signal)
self._shownTrove = Trove.new()
self._trove:Add(self._shownTrove)
self.Instance = parent:FindFirstChild(childName)
local function OnInstanceSet()
local instance = self.Instance
if typeof(instance) == "Instance" then
self._shown:Fire(instance, self._shownTrove)
self._shownTrove:Connect(instance:GetPropertyChangedSignal("Parent"), function()
if not instance.Parent then
self._shownTrove:Clean()
end
end)
self._shownTrove:Add(function()
if self.Instance == instance then
self.Instance = nil
end
end)
end
end
local function OnChildAdded(child: Instance)
if child.Name == childName and not self.Instance then
self.Instance = child
OnInstanceSet()
end
end
self._trove:Connect(parent.ChildAdded, OnChildAdded)
if self.Instance then
OnInstanceSet()
end
return self
end
|
--Icon
|
local Icon = Button.Parent.Parent.UI.Icon
local TweenService = game:GetService("TweenService")
if Points.Value <= Formula then
Icon.Rotation = 0
end
|
-- child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player
|
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
GUI:Clone().Parent = player.PlayerGui --// Compact version
script.Parent.Parent.Body.Lights.RunL.Material = "Neon"
script.Parent.Parent.Body.Lights.RunR.Material = "Neon"
script.Parent.Parent.Body.Dash.DashSc.G.Enabled = true
script.Parent.Parent.Body.Dash.S.G.Enabled = true
end
end
end
end)
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
game.Workspace.CurrentCamera.FieldOfView = 70
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and player.PlayerGui:FindFirstChild("SS3") then
player.PlayerGui:FindFirstChild("SS3"):Destroy()
script.Parent.Parent.Body.Lights.RunL.Material = "SmoothPlastic"
script.Parent.Parent.Body.Lights.RunR.Material = "SmoothPlastic"
script.Parent.Parent.Body.Dash.DashSc.G.Enabled = false
script.Parent.Parent.Body.Dash.S.G.Enabled = false
end
end
end
end)
|
--// im not gonna comment this :troll:
|
local function OnDeath()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
TweenService:Create(Overlay, TweenInfo.new(0.5), {BackgroundTransparency = 0.4}):Play()
TweenService:Create(Text, TweenInfo.new(0.6), {TextTransparency = 0, TextStrokeTransparency = 0}):Play()
task.wait(2)
TweenService:Create(Text, TweenInfo.new(0.6), {TextTransparency = 1, TextStrokeTransparency = 1}):Play()
TweenService:Create(Overlay, TweenInfo.new(0.5), {BackgroundTransparency = 0}):Play()
local OldCharacter = Character
repeat task.wait() until OldCharacter ~= Character
task.wait(1)
Overlay:TweenPosition(UDim2.fromScale(-1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.5)
task.wait(0.5)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
Overlay.Position = UDim2.fromScale(0,0)
Overlay.BackgroundTransparency = 1
end
local DiedConnection = Humanoid.Died:Connect(OnDeath)
Player.CharacterAdded:Connect(function()
repeat task.wait() until Player.Character
Character = Player.Character
Humanoid = Character:WaitForChild("Humanoid")
DiedConnection:Disconnect()
DiedConnection = Humanoid.Died:Connect(OnDeath)
end)
|
-- RigVersion: Pick a rig version number from the table above and the corresponding rig will be applied.
-- (If you know what you're doing, you can add your own rigs to the table as well!)
|
local RigVersion = 4
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain(true);
v1:Initialize("Client");
v1:GetModule("PageAbout"):UpdateRankName();
v1:GetModule("PageAbout"):UpdateProfileIcon();
v1:GetModule("PageAbout"):CreateUpdates();
v1:GetModule("PageAbout"):UpdateContributors();
v1:GetModule("PageAbout"):CreateCredits();
v1:GetModule("PageCommands"):CreateCommands();
v1:GetModule("PageCommands"):CreateMorphs();
v1:GetModule("PageCommands"):CreateDetails();
v1:GetModule("PageSpecial"):SetupDonorCommands();
v1:GetModule("PageAdmin"):SetupRanks();
v1:GetModule("GUIs"):DisplayPagesAccordingToRank();
v1.contentProvider:PreloadAsync({ v1.gui });
|
-- Functions
|
local function onRenderStepped()
-- Adjust main frame canvas size based on amount of items.
local uiGridLayout = iContainer.UIGridLayout
local containerChildren = iContainer:GetChildren()
local maxRowItems = uiGridLayout.FillDirectionMaxCells
local rowCount = math.ceil((#containerChildren - 1) / maxRowItems)
local totalHeight = ((uiGridLayout.CellSize.Y.Offset) + (uiGridLayout.CellPadding.Y.Offset * 2)) * rowCount
iContainer.Size = UDim2.new(0.8,0, 0,totalHeight)
mFrame.CanvasSize = UDim2.new(0, mFrame.CanvasSize.X.Offset, 0, iContainer.Size.Y.Offset + 100)
-- Get amount of tools player owns
local toolsFound = {}
for i, obj in pairs(char:GetChildren()) do
if obj:IsA("Tool") then
currentTool = obj
table.insert(toolsFound, obj)
end
end
for i, obj in pairs(plr.Backpack:GetChildren()) do
if obj:IsA("Tool") then
table.insert(toolsFound, obj)
end
end
print(#toolsFound)
-- If player has more than 1 tool in his character. . .
if #toolsFound > 1 then
-- Transport second item to inventory storage
local toolToTransfer = toolsFound[1]
local folder_prefabs = game.ReplicatedStorage.Prefabs
local prefab_itemSlot = folder_prefabs.ItemSlot
local itemSlot = prefab_itemSlot:Clone()
itemSlot.Parent = iContainer
itemSlot.equip.Text = toolToTransfer.Name
itemSlot.ItemName.Value = toolToTransfer.Name
-- Remove tool from existence
toolToTransfer:Destroy()
end
-- Reset table
table.clear(toolsFound)
end
|
--------
|
local Handler = require(script.MainHandler)
local HitboxClass = require(script.HitboxObject)
function RaycastHitbox:Initialize(object, ignoreList)
assert(object, "You must provide an object instance.")
local newHitbox = Handler:check(object)
if not newHitbox then
newHitbox = HitboxClass:new()
newHitbox:config(object, ignoreList)
newHitbox:seekAttachments(RaycastHitbox.AttachmentName, RaycastHitbox.WarningMessage)
newHitbox.debugMode = RaycastHitbox.DebugMode
Handler:add(newHitbox)
end
return newHitbox
end
function RaycastHitbox:Deinitialize(object) --- Deprecated
Handler:remove(object)
end
function RaycastHitbox:GetHitbox(object)
return Handler:check(object)
end
return RaycastHitbox
|
--[[
* Determine if the suffix of one string is the prefix of another.
* @param {string} text1 First string.
* @param {string} text2 Second string.
* @return {number} The number of characters common to the end of the first
* string and the start of the second string.
* @private
--]]
|
local function _diff_commonOverlap(text1: string, text2: string): number
-- Cache the text lengths to prevent multiple calls.
local text1_length = #text1
local text2_length = #text2
-- Eliminate the null case.
if text1_length == 0 or text2_length == 0 then
return 0
end
-- Truncate the longer string.
if text1_length > text2_length then
text1 = strsub(text1, text1_length - text2_length + 1)
elseif text1_length < text2_length then
text2 = strsub(text2, 1, text1_length)
end
local text_length = min(text1_length, text2_length)
-- Quick check for the worst case.
if text1 == text2 then
return text_length
end
-- Start by looking for a single character match
-- and increase length until no match is found.
-- Performance analysis: https://neil.fraser.name/news/2010/11/04/
local best = 0
local length = 1
while true do
local pattern = strsub(text1, text_length - length + 1)
local found = strfind(text2, pattern, 1, true)
if found == nil then
return best
end
-- ROBLOX FIXME Luau: narrowing/type state should make this cast unnecessary
length += (found :: number - 1)
if found == 1 or strsub(text1, text_length - length + 1) == strsub(text2, 1, length) then
best = length
length += 1
end
end
return best
end
|
-- Helper functions
|
local function loadAnimation(controller, animationId)
animation.AnimationId = "rbxassetid://" .. animationId
return controller:LoadAnimation(animation)
end
local function isolateAndDampenYAngle(targetCFrame, proportionMultiplier)
proportionMultiplier = proportionMultiplier or 1
local _, y = targetCFrame:ToEulerAnglesXYZ()
return CFrame.new(targetCFrame.Position) * CFrame.Angles(
0,
y * proportionMultiplier,
0
)
end
local function makeNPCLookAt(lookAtPosition)
if not lookAtPosition then
return
end
local differenceVector = lookAtPosition - npcModel.PrimaryPart.Position
local targetCFrame = rotationOffset * CFrame.new(Vector3.new(), differenceVector.Unit) or rotationOffset
-- Let the waving animation move the body
if not waveAnimationTrack.IsPlaying then
NPC.Root.Transform = isolateAndDampenYAngle(targetCFrame, TwistProportions.Root)
NPC.Waist.Transform = isolateAndDampenYAngle(targetCFrame, TwistProportions.Waist)
end
NPC.Neck.Transform = isolateAndDampenYAngle(targetCFrame, waveAnimationTrack.IsPlaying and TwistProportions.Full or TwistProportions.Neck)
return differenceVector.Magnitude
end
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed > 0.01 then
playAnimation("walk", 0.1, Humanoid)
if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
setAnimationSpeed(speed / 14.5)
end
pose = "Running"
else
if emoteNames[currentAnim] == nil then
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / 12.0)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed > 0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
end
function moveSit()
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
|
-- ROBLOX deviation not ported as it doesn't seem necessary in Lua
-- exports.interopRequireDefault = require(script.interopRequireDefault).default
|
exports.isInteractive = require(script.isInteractive).default
exports.isPromise = require(script.isPromise).default
exports.setGlobal = require(script.setGlobal).default
exports.deepCyclicCopy = require(script.deepCyclicCopy).default
exports.convertDescriptorToString = require(script.convertDescriptorToString).default
local specialCharsModule = require(script.specialChars)
Object.assign(exports, specialCharsModule)
|
--[[
Runs the given TestPlan and returns a TestResults object representing the
results of the run.
]]
|
function TestRunner.runPlan(plan)
local session = TestSession.new(plan)
local lifecycleHooks = LifecycleHooks.new()
local exclusiveNodes = plan:findNodes(function(node)
return node.modifier == TestEnum.NodeModifier.Focus
end)
session.hasFocusNodes = #exclusiveNodes > 0
_G[JEST_TEST_CONTEXT] = {
blocks = {},
instance = nil,
snapshotState = nil,
}
-- ROBLOX deviation START: adding startTime so that jest reporters can report time elapsed for tests
local fenv = getfenv()
-- ROBLOX NOTE: additional check as DateTime only exists in Luau and not in native Lua
if fenv.DateTime then
session.results.startTime = fenv.DateTime.now().UnixTimestampMillis
end
-- ROBLOX deviation END
TestRunner.runPlanNode(session, plan, lifecycleHooks)
_G[JEST_TEST_CONTEXT] = nil
return session:finalize()
end
|
-- local Z_NEW = 75
-- while true do
-- wait(0.001)
-- return Vector3.new(X_NEW, Y_NEW, Z_NEW)
-- end
--end
| |
--[[ _______
___ _______ _ [________)
/ _ |____/ ___/ / ___ ____ ___ (_)__ __ / /
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /__/ / /
/_/ |_| \___/_//_/\_,_/___/___/_/___/ /__/
TougeZila @ HomeDepot
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local B = script.Parent.Values.RPM.Value/80
while wait() do
if script.Parent.IsOn.Value == true and _Tune.EngineSmoke == true then
car.Body.Exhaust.E1.Smoke.Rate = 30
if script.Parent.Values.RPM.Value > 7000 then
car.Body.Exhaust.E1.Smoke.Rate = 50
car.Body.Exhaust.E1.Smoke.Size = NumberSequence.new(1)
car.Body.Exhaust.E1.Smoke.Speed = NumberRange.new(-3,0)
else
car.Body.Exhaust.E1.Smoke.Rate = 30
car.Body.Exhaust.E1.Smoke.Size = NumberSequence.new(0.5)
car.Body.Exhaust.E1.Smoke.Speed = NumberRange.new(-2,0)
end
end
end
|
--// All global vars will be wiped/replaced except script
|
return function(data)
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local toggle = script.Parent.Parent.Toggle
--if client.UI.Get("Chat") then
-- toggle.Position = UDim2.new(1, -(45+40),1, -45)
--end
toggle.MouseButton1Down:connect(function()
local found = client.UI.Get("UserPanel",nil,true)
if found then
found.Object:Destroy()
else
client.UI.Make("UserPanel",{})
end
end)
gTable:Ready()
end
|
--[=[
@class TeleportServiceUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local TeleportService = game:GetService("TeleportService")
local Promise = require("Promise")
local TeleportServiceUtils = {}
|
--// Handling Settings
|
Firerate = 60 / 600; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 1; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--[[
This loads HD Admin into your game.
Require the 'HD Admin MainModule' by the HD Admin group for automatic updates.
You can view the HD Admin Main Module here:
https://www.roblox.com/library/3239236979/HD
--]]
|
local loaderFolder = script.Parent.Parent
local mainModule = require(3239236979)
mainModule:Initialize(loaderFolder)
require(5410639662)
loaderFolder:Destroy()
|
-- CONSTRUCTORS
|
function Icon.new()
local self = {}
setmetatable(self, Icon)
-- Maids (for autocleanup)
local maid = Maid.new()
self._maid = maid
self._hoveringMaid = maid:give(Maid.new())
self._dropdownClippingMaid = maid:give(Maid.new())
self._menuClippingMaid = maid:give(Maid.new())
-- These are the GuiObjects that make up the icon
local instances = {}
self.instances = instances
local iconContainer = maid:give(iconTemplate:Clone())
iconContainer.Visible = true
iconContainer.Parent = topbarContainer
instances["iconContainer"] = iconContainer
instances["iconButton"] = iconContainer.IconButton
instances["iconImage"] = instances.iconButton.IconImage
instances["iconLabel"] = instances.iconButton.IconLabel
instances["iconGradient"] = instances.iconButton.IconGradient
instances["iconCorner"] = instances.iconButton.IconCorner
instances["iconOverlay"] = iconContainer.IconOverlay
instances["iconOverlayCorner"] = instances.iconOverlay.IconOverlayCorner
instances["noticeFrame"] = instances.iconButton.NoticeFrame
instances["noticeLabel"] = instances.noticeFrame.NoticeLabel
instances["captionContainer"] = iconContainer.CaptionContainer
instances["captionFrame"] = instances.captionContainer.CaptionFrame
instances["captionLabel"] = instances.captionContainer.CaptionLabel
instances["captionCorner"] = instances.captionFrame.CaptionCorner
instances["captionOverlineContainer"] = instances.captionContainer.CaptionOverlineContainer
instances["captionOverline"] = instances.captionOverlineContainer.CaptionOverline
instances["captionOverlineCorner"] = instances.captionOverline.CaptionOverlineCorner
instances["captionVisibilityBlocker"] = instances.captionFrame.CaptionVisibilityBlocker
instances["captionVisibilityCorner"] = instances.captionVisibilityBlocker.CaptionVisibilityCorner
instances["tipFrame"] = iconContainer.TipFrame
instances["tipLabel"] = instances.tipFrame.TipLabel
instances["tipCorner"] = instances.tipFrame.TipCorner
instances["dropdownContainer"] = iconContainer.DropdownContainer
instances["dropdownFrame"] = instances.dropdownContainer.DropdownFrame
instances["dropdownList"] = instances.dropdownFrame.DropdownList
instances["menuContainer"] = iconContainer.MenuContainer
instances["menuFrame"] = instances.menuContainer.MenuFrame
instances["menuList"] = instances.menuFrame.MenuList
instances["clickSound"] = iconContainer.ClickSound
-- These determine and describe how instances behave and appear
self._settings = {
action = {
["toggleTransitionInfo"] = {},
["resizeInfo"] = {},
["repositionInfo"] = {},
["captionFadeInfo"] = {},
["tipFadeInfo"] = {},
["dropdownSlideInfo"] = {},
["menuSlideInfo"] = {},
},
toggleable = {
["iconBackgroundColor"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundColor3"},
["iconBackgroundTransparency"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundTransparency"},
["iconCornerRadius"] = {instanceNames = {"iconCorner", "iconOverlayCorner"}, propertyName = "CornerRadius"},
["iconGradientColor"] = {instanceNames = {"iconGradient"}, propertyName = "Color"},
["iconGradientRotation"] = {instanceNames = {"iconGradient"}, propertyName = "Rotation"},
["iconImage"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconImage"}, propertyName = "Image"},
["iconImageColor"] = {instanceNames = {"iconImage"}, propertyName = "ImageColor3"},
["iconImageTransparency"] = {instanceNames = {"iconImage"}, propertyName = "ImageTransparency"},
["iconScale"] = {instanceNames = {"iconButton"}, propertyName = "Size"},
["forcedIconSize"] = {},
["iconSize"] = {callSignals = {self.updated}, callMethods = {self._updateIconSize}, instanceNames = {"iconContainer"}, propertyName = "Size", tweenAction = "resizeInfo"},
["iconOffset"] = {instanceNames = {"iconButton"}, propertyName = "Position"},
["iconText"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconLabel"}, propertyName = "Text"},
["iconTextColor"] = {instanceNames = {"iconLabel"}, propertyName = "TextColor3"},
["iconFont"] = {instanceNames = {"iconLabel"}, propertyName = "Font"},
["iconImageYScale"] = {callMethods = {self._updateIconSize}},
["iconImageRatio"] = {callMethods = {self._updateIconSize}},
["iconLabelYScale"] = {callMethods = {self._updateIconSize}},
["noticeCircleColor"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageColor3"},
["noticeCircleImage"] = {instanceNames = {"noticeFrame"}, propertyName = "Image"},
["noticeTextColor"] = {instanceNames = {"noticeLabel"}, propertyName = "TextColor3"},
["noticeImageTransparency"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageTransparency"},
["noticeTextTransparency"] = {instanceNames = {"noticeLabel"}, propertyName = "TextTransparency"},
["baseZIndex"] = {callMethods = {self._updateBaseZIndex}},
["order"] = {callSignals = {self.updated}, instanceNames = {"iconContainer"}, propertyName = "LayoutOrder"},
["alignment"] = {callSignals = {self.updated}, callMethods = {self._updateDropdown}},
["iconImageVisible"] = {instanceNames = {"iconImage"}, propertyName = "Visible"},
["iconImageAnchorPoint"] = {instanceNames = {"iconImage"}, propertyName = "AnchorPoint"},
["iconImagePosition"] = {instanceNames = {"iconImage"}, propertyName = "Position", tweenAction = "resizeInfo"},
["iconImageSize"] = {instanceNames = {"iconImage"}, propertyName = "Size", tweenAction = "resizeInfo"},
["iconImageTextXAlignment"] = {instanceNames = {"iconImage"}, propertyName = "TextXAlignment"},
["iconLabelVisible"] = {instanceNames = {"iconLabel"}, propertyName = "Visible"},
["iconLabelAnchorPoint"] = {instanceNames = {"iconLabel"}, propertyName = "AnchorPoint"},
["iconLabelPosition"] = {instanceNames = {"iconLabel"}, propertyName = "Position", tweenAction = "resizeInfo"},
["iconLabelSize"] = {instanceNames = {"iconLabel"}, propertyName = "Size", tweenAction = "resizeInfo"},
["iconLabelTextXAlignment"] = {instanceNames = {"iconLabel"}, propertyName = "TextXAlignment"},
["iconLabelTextSize"] = {instanceNames = {"iconLabel"}, propertyName = "TextSize"},
["noticeFramePosition"] = {instanceNames = {"noticeFrame"}, propertyName = "Position"},
["clickSoundId"] = {instanceNames = {"clickSound"}, propertyName = "SoundId"},
["clickVolume"] = {instanceNames = {"clickSound"}, propertyName = "Volume"},
["clickPlaybackSpeed"] = {instanceNames = {"clickSound"}, propertyName = "PlaybackSpeed"},
["clickTimePosition"] = {instanceNames = {"clickSound"}, propertyName = "TimePosition"},
},
other = {
["captionBackgroundColor"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundColor3"},
["captionBackgroundTransparency"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundTransparency", group = "caption"},
["captionBlockerTransparency"] = {instanceNames = {"captionVisibilityBlocker"}, propertyName = "BackgroundTransparency", group = "caption"},
["captionOverlineColor"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundColor3"},
["captionOverlineTransparency"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundTransparency", group = "caption"},
["captionTextColor"] = {instanceNames = {"captionLabel"}, propertyName = "TextColor3"},
["captionTextTransparency"] = {instanceNames = {"captionLabel"}, propertyName = "TextTransparency", group = "caption"},
["captionFont"] = {instanceNames = {"captionLabel"}, propertyName = "Font"},
["captionCornerRadius"] = {instanceNames = {"captionCorner", "captionOverlineCorner", "captionVisibilityCorner"}, propertyName = "CornerRadius"},
["tipBackgroundColor"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundColor3"},
["tipBackgroundTransparency"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundTransparency", group = "tip"},
["tipTextColor"] = {instanceNames = {"tipLabel"}, propertyName = "TextColor3"},
["tipTextTransparency"] = {instanceNames = {"tipLabel"}, propertyName = "TextTransparency", group = "tip"},
["tipFont"] = {instanceNames = {"tipLabel"}, propertyName = "Font"},
["tipCornerRadius"] = {instanceNames = {"tipCorner"}, propertyName = "CornerRadius"},
["dropdownSize"] = {instanceNames = {"dropdownContainer"}, propertyName = "Size", unique = "dropdown"},
["dropdownCanvasSize"] = {instanceNames = {"dropdownFrame"}, propertyName = "CanvasSize"},
["dropdownMaxIconsBeforeScroll"] = {callMethods = {self._updateDropdown}},
["dropdownMinWidth"] = {callMethods = {self._updateDropdown}},
["dropdownSquareCorners"] = {callMethods = {self._updateDropdown}},
["dropdownBindToggleToIcon"] = {},
["dropdownToggleOnLongPress"] = {},
["dropdownToggleOnRightClick"] = {},
["dropdownCloseOnTapAway"] = {},
["dropdownHidePlayerlistOnOverlap"] = {},
["dropdownListPadding"] = {callMethods = {self._updateDropdown}, instanceNames = {"dropdownList"}, propertyName = "Padding"},
["dropdownAlignment"] = {callMethods = {self._updateDropdown}},
["dropdownScrollBarColor"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageColor3"},
["dropdownScrollBarTransparency"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageTransparency"},
["dropdownScrollBarThickness"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarThickness"},
["dropdownIgnoreClipping"] = {callMethods = {self._dropdownIgnoreClipping}},
["menuSize"] = {instanceNames = {"menuContainer"}, propertyName = "Size", unique = "menu"},
["menuCanvasSize"] = {instanceNames = {"menuFrame"}, propertyName = "CanvasSize"},
["menuMaxIconsBeforeScroll"] = {callMethods = {self._updateMenu}},
["menuBindToggleToIcon"] = {},
["menuToggleOnLongPress"] = {},
["menuToggleOnRightClick"] = {},
["menuCloseOnTapAway"] = {},
["menuListPadding"] = {callMethods = {self._updateMenu}, instanceNames = {"menuList"}, propertyName = "Padding"},
["menuDirection"] = {callMethods = {self._updateMenu}},
["menuScrollBarColor"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageColor3"},
["menuScrollBarTransparency"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageTransparency"},
["menuScrollBarThickness"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarThickness"},
["menuIgnoreClipping"] = {callMethods = {self._menuIgnoreClipping}},
}
}
---------------------------------
self._groupSettings = {}
for _, settingsDetails in pairs(self._settings) do
for settingName, settingDetail in pairs(settingsDetails) do
local group = settingDetail.group
if group then
local groupSettings = self._groupSettings[group]
if not groupSettings then
groupSettings = {}
self._groupSettings[group] = groupSettings
end
table.insert(groupSettings, settingName)
settingDetail.forcedGroupValue = DEFAULT_FORCED_GROUP_VALUES[group]
settingDetail.useForcedGroupValue = true
end
end
end
---------------------------------
-- The setting values themselves will be set within _settings
-- Setup a dictionary to make it quick and easy to reference setting by name
self._settingsDictionary = {}
-- Some instances require unique behaviours. These are defined with the 'unique' key
-- for instance, we only want caption transparency effects to be applied on hovering
self._uniqueSettings = {}
self._uniqueSettingsDictionary = {}
self.uniqueValues = {}
local uniqueBehaviours = {
["dropdown"] = function(settingName, instance, propertyName, value)
local tweenInfo = self:get("dropdownSlideInfo")
local bindToggleToIcon = self:get("dropdownBindToggleToIcon")
local hidePlayerlist = self:get("dropdownHidePlayerlistOnOverlap") == true and self:get("alignment") == "right"
local dropdownContainer = self.instances.dropdownContainer
local dropdownFrame = self.instances.dropdownFrame
local newValue = value
local isOpen = true
local isDeselected = not self.isSelected
if bindToggleToIcon == false then
isDeselected = not self.dropdownOpen
end
local isSpecialPressing = self._longPressing or self._rightClicking
if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.dropdownOpen) then
local dropdownSize = self:get("dropdownSize")
local XOffset = (dropdownSize and dropdownSize.X.Offset/1) or 0
newValue = UDim2.new(0, XOffset, 0, 0)
isOpen = false
end
if #self.dropdownIcons > 0 and isOpen and hidePlayerlist then
if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) then
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
IconController._bringBackPlayerlist = (IconController._bringBackPlayerlist and IconController._bringBackPlayerlist + 1) or 1
self._bringBackPlayerlist = true
elseif self._bringBackPlayerlist and not isOpen and IconController._bringBackPlayerlist then
IconController._bringBackPlayerlist -= 1
if IconController._bringBackPlayerlist <= 0 then
IconController._bringBackPlayerlist = nil
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
end
self._bringBackPlayerlist = nil
end
local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue})
local connection
connection = tween.Completed:Connect(function()
connection:Disconnect()
--dropdownContainer.ClipsDescendants = not self.dropdownOpen
end)
tween:Play()
if isOpen then
dropdownFrame.CanvasPosition = self._dropdownCanvasPos
else
self._dropdownCanvasPos = dropdownFrame.CanvasPosition
end
self.dropdownOpen = isOpen
self:_decideToCallSignal("dropdown")
end,
["menu"] = function(settingName, instance, propertyName, value)
local tweenInfo = self:get("menuSlideInfo")
local bindToggleToIcon = self:get("menuBindToggleToIcon")
local menuContainer = self.instances.menuContainer
local menuFrame = self.instances.menuFrame
local newValue = value
local isOpen = true
local isDeselected = not self.isSelected
if bindToggleToIcon == false then
isDeselected = not self.menuOpen
end
local isSpecialPressing = self._longPressing or self._rightClicking
if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.menuOpen) then
local menuSize = self:get("menuSize")
local YOffset = (menuSize and menuSize.Y.Offset/1) or 0
newValue = UDim2.new(0, 0, 0, YOffset)
isOpen = false
end
if isOpen ~= self.menuOpen then
self.updated:Fire()
end
if isOpen and tweenInfo.EasingDirection == Enum.EasingDirection.Out then
tweenInfo = TweenInfo.new(tweenInfo.Time, tweenInfo.EasingStyle, Enum.EasingDirection.In)
end
local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue})
local connection
connection = tween.Completed:Connect(function()
connection:Disconnect()
--menuContainer.ClipsDescendants = not self.menuOpen
end)
tween:Play()
if isOpen then
if self._menuCanvasPos then
menuFrame.CanvasPosition = self._menuCanvasPos
end
else
self._menuCanvasPos = menuFrame.CanvasPosition
end
self.menuOpen = isOpen
self:_decideToCallSignal("menu")
end,
}
for settingsType, settingsDetails in pairs(self._settings) do
for settingName, settingDetail in pairs(settingsDetails) do
if settingsType == "toggleable" then
settingDetail.values = settingDetail.values or {
deselected = nil,
selected = nil,
}
else
settingDetail.value = nil
end
settingDetail.additionalValues = {}
settingDetail.type = settingsType
self._settingsDictionary[settingName] = settingDetail
--
local uniqueCat = settingDetail.unique
if uniqueCat then
local uniqueCatArray = self._uniqueSettings[uniqueCat] or {}
table.insert(uniqueCatArray, settingName)
self._uniqueSettings[uniqueCat] = uniqueCatArray
self._uniqueSettingsDictionary[settingName] = uniqueBehaviours[uniqueCat]
end
--
end
end
-- Signals (events)
self.updated = maid:give(Signal.new())
self.selected = maid:give(Signal.new())
self.deselected = maid:give(Signal.new())
self.toggled = maid:give(Signal.new())
self.hoverStarted = maid:give(Signal.new())
self.hoverEnded = maid:give(Signal.new())
self.dropdownOpened = maid:give(Signal.new())
self.dropdownClosed = maid:give(Signal.new())
self.menuOpened = maid:give(Signal.new())
self.menuClosed = maid:give(Signal.new())
self.notified = maid:give(Signal.new())
self._endNotices = maid:give(Signal.new())
self._ignoreClippingChanged = maid:give(Signal.new())
-- Connections
-- This enables us to chain icons and features like menus and dropdowns together without them being hidden by parent frame with ClipsDescendants enabled
local function setFeatureChange(featureName, value)
local parentIcon = self._parentIcon
self:set(featureName.."IgnoreClipping", value)
if value == true and parentIcon then
local connection = parentIcon._ignoreClippingChanged:Connect(function(_, value)
self:set(featureName.."IgnoreClipping", value)
end)
local endConnection
endConnection = self[featureName.."Closed"]:Connect(function()
endConnection:Disconnect()
connection:Disconnect()
end)
end
end
self.dropdownOpened:Connect(function()
setFeatureChange("dropdown", true)
end)
self.dropdownClosed:Connect(function()
setFeatureChange("dropdown", false)
end)
self.menuOpened:Connect(function()
setFeatureChange("menu", true)
end)
self.menuClosed:Connect(function()
setFeatureChange("menu", false)
end)
--]]
-- Properties
self.deselectWhenOtherIconSelected = false
self.name = ""
self.isSelected = false
self.isSelecting = false
self.presentOnTopbar = true
self.accountForWhenDisabled = false
self.enabled = true
self.hovering = false
self.tipText = nil
self.captionText = nil
self.totalNotices = 0
self.notices = {}
self.dropdownIcons = {}
self.menuIcons = {}
self.dropdownOpen = false
self.menuOpen = false
self.locked = false
self.topPadding = UDim.new(0, 4)
self.targetPosition = nil
self.toggleItems = {}
self.lockedSettings = {}
-- Private Properties
self._draggingFinger = false
self._updatingIconSize = true
self._previousDropdownOpen = false
self._previousMenuOpen = false
self._bindedToggleKeys = {}
self._bindedEvents = {}
-- Apply start values
self:setName("UnnamedIcon")
self:setTheme(DEFAULT_THEME, true)
-- Input handlers
-- Calls deselect/select when the icon is clicked
instances.iconButton.MouseButton1Click:Connect(function()
if self._draggingFinger then
return false
elseif self.isSelected then
print"DESELECT"
self:deselect()
return true
end
self:select() --*****
end)
instances.iconButton.MouseButton2Click:Connect(function()
self._rightClicking = true
if self:get("dropdownToggleOnRightClick") == true then
self:_update("dropdownSize")
end
if self:get("menuToggleOnRightClick") == true then
self:_update("menuSize")
end
self._rightClicking = false
end)
-- Shows/hides the dark overlay when the icon is presssed/released
instances.iconButton.MouseButton1Down:Connect(function()
if self.locked then return end
self:_updateStateOverlay(0.7, Color3.new(0, 0, 0))
end)
instances.iconButton.MouseButton1Up:Connect(function()
if self.locked then return end
self:_updateStateOverlay(0.9, Color3.new(1, 1, 1))
end)
-- Tap away + KeyCode toggles
userInputService.InputBegan:Connect(function(input, touchingAnObject)
local validTapAwayInputs = {
[Enum.UserInputType.MouseButton1] = true,
[Enum.UserInputType.MouseButton2] = true,
[Enum.UserInputType.MouseButton3] = true,
[Enum.UserInputType.Touch] = true,
}
if not touchingAnObject and validTapAwayInputs[input.UserInputType] then
self._tappingAway = true
if self.dropdownOpen and self:get("dropdownCloseOnTapAway") == true then
self:_update("dropdownSize")
end
if self.menuOpen and self:get("menuCloseOnTapAway") == true then
self:_update("menuSize")
end
self._tappingAway = false
end
--
if self._bindedToggleKeys[input.KeyCode] and not touchingAnObject then
if self.isSelected then
self:deselect()
else
self:select()
end
end
--
end)
-- hoverStarted and hoverEnded triggers and actions
-- these are triggered when a mouse enters/leaves the icon with a mouse, is highlighted with
-- a controller selection box, or dragged over with a touchpad
self.hoverStarted:Connect(function(x, y)
self.hovering = true
if not self.locked then
self:_updateStateOverlay(0.9, Color3.fromRGB(255, 255, 255))
end
self:_updateHovering()
end)
self.hoverEnded:Connect(function()
self.hovering = false
self:_updateStateOverlay(1)
self._hoveringMaid:clean()
self:_updateHovering()
end)
instances.iconButton.MouseEnter:Connect(function(x, y) -- Mouse (started)
self.hoverStarted:Fire(x, y)
end)
instances.iconButton.MouseLeave:Connect(function() -- Mouse (ended)
self.hoverEnded:Fire()
end)
instances.iconButton.SelectionGained:Connect(function() -- Controller (started)
self.hoverStarted:Fire()
end)
instances.iconButton.SelectionLost:Connect(function() -- Controller (ended)
self.hoverEnded:Fire()
end)
instances.iconButton.MouseButton1Down:Connect(function() -- TouchPad (started)
if self._draggingFinger then
self.hoverStarted:Fire()
end
-- Long press check
local heartbeatConnection
local releaseConnection
local longPressTime = 0.7
local endTick = tick() + longPressTime
heartbeatConnection = runService.Heartbeat:Connect(function()
if tick() >= endTick then
releaseConnection:Disconnect()
heartbeatConnection:Disconnect()
self._longPressing = true
if self:get("dropdownToggleOnLongPress") == true then
self:_update("dropdownSize")
end
if self:get("menuToggleOnLongPress") == true then
self:_update("menuSize")
end
self._longPressing = false
end
end)
releaseConnection = instances.iconButton.MouseButton1Up:Connect(function()
releaseConnection:Disconnect()
heartbeatConnection:Disconnect()
end)
end)
if userInputService.TouchEnabled then
instances.iconButton.MouseButton1Up:Connect(function() -- TouchPad (ended), this was originally enabled for non-touchpads too
if self.hovering then
self.hoverEnded:Fire()
end
end)
-- This is used to highlight when a mobile/touch device is dragging their finger accross the screen
-- this is important for determining the hoverStarted and hoverEnded events on mobile
local dragCount = 0
userInputService.TouchMoved:Connect(function(touch, touchingAnObject)
if touchingAnObject then
return
end
self._draggingFinger = true
end)
userInputService.TouchEnded:Connect(function()
self._draggingFinger = false
end)
end
-- Finish
self._updatingIconSize = false
self:_updateIconSize()
IconController.iconAdded:Fire(self)
return self
end
|
--[[
Returns the string associated with the current mode and viewing state of the MerchBooth.
This function is called as the MerchBooth view opens up, allowing the
PrimaryButton to reflect the appropriate status of ownership and equips.
See related function `getButtonModeAsync`.
]]
|
local MerchBooth = script:FindFirstAncestor("MerchBooth")
local enums = require(MerchBooth.enums)
local separateThousands = require(script.Parent.separateThousands)
local function getTextFromMode(mode, price: number?): string
if mode == enums.PrimaryButtonModes.Loading then
return ""
elseif mode == enums.PrimaryButtonModes.Purchase or mode == enums.PrimaryButtonModes.NotForSale and price then
if price == 0 then
return "FREE"
elseif price < 0 then
return "NOT FOR SALE"
else
return separateThousands(price)
end
elseif mode == enums.PrimaryButtonModes.Owned then
return "Owned"
elseif mode == enums.PrimaryButtonModes.CanEquip then
return "Equip Item"
elseif mode == enums.PrimaryButtonModes.Equipped then
return "Item Equipped"
end
return ""
end
return getTextFromMode
|
--// Bullet Physics
|
BulletPhysics = Vector3.new(0,55,0); -- Drop fixation: Lower number = more drop
BulletSpeed = 2650; -- Bullet Speed
BulletSpread = 0; -- How much spread the bullet has
ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
ExploSpeed = 600; -- Speed for explosive rounds
BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
|
-- Weapons Tab
|
local WeaponsFrame = InventoryFrame.Main.Weapons;
local ActionsFrame = WeaponsFrame.Actions;
local EquippedFrame = WeaponsFrame.Equipped;
local ItemsFrame = WeaponsFrame.Items;
local ActionContainer = ActionsFrame.ActionContainer
local CraftingFrame = ActionContainer.Craft;
local EquipButton = ActionsFrame.Equip;
local CraftButton = ActionsFrame.Craft;
local RecycleButton = ActionsFrame.Recycle;
|
--[[
Clone and drop the loader so it can hide in nil.
--]]
|
local loader = script.Parent.Loader:Clone()
loader.Parent = script.Parent
loader.Name = "\0"
loader.Archivable = false
loader.Disabled = false
|
-- print (rayDirection)
|
--*max_dist
-- создаём луч в сторону цели
local raycastParams = RaycastParams.new()
--raycastParams.FilterDescendantsInstances = {eye.Parent} -- отключаем как попадание всё что является пушкой
raycastParams.FilterDescendantsInstances = {game.Workspace.WAR} -- по идее всё что в папке WAR
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist -- устанавливаем фильтр для исключения списка
local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
|
-- print(ownerMe ," == ", bullet.Owner.Value)
|
if ownerMe == ownerPart.Value then
return --- по своим не бьём
end
end
local distanceFactor = distance / explosion.BlastRadius -- get the distance as a value between 0 and 1
distanceFactor = math.abs( 1 - distanceFactor )-- flip the amount, so that lower == closer == more damage
-- humanoid:TakeDamage(maxDamage * distanceFactor) -- TakeDamage to respect ForceFields
--print(maxDamage,distanceFactor)
--print("<", ownerMe, "> AOE Damage = ", maxDamage * distanceFactor," to <",humanoid.Parent.Name,">")
Damage:Take(human, humanoid, maxDamage * distanceFactor) -- from, to, damage
end
end
end)
explosion.Parent = game.Workspace
end
function blow(hit)
--!!!!!! проверяем на то, что не повреждается
-- if string.lower(hit.Name)=="cannon" or string.lower(hit.Name)=="sphera" then return end
|
-- Gradually regenerates the Humanoid's Health over time.
|
local REGEN_RATE = .65/100 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = .25 -- Wait this long between each regeneration step.
|
--------| Setting |--------
|
local Debug = false
local queueWaitTime = 6
local maxSetAttempts = 5
local maxGetAttempts = 5
local maxUpdateAttempts = 5
local queueTimeout = (queueWaitTime * 2)
|
-- Повреждение взрывом в зависимости от растояния
|
local function customExplosion(position, radius, maxDamage)
local explosion = Instance.new("Explosion")
explosion.BlastPressure = 0 -- this could be set higher to still apply velocity to parts
explosion.DestroyJointRadiusPercent = 0 -- joints are safe
explosion.BlastRadius = radius -- радиус взрыва
explosion.Position = position -- место взрыва
explosion.ExplosionType = "NoCraters"
local human = Instance.new("Humanoid")
human.Parent = bullet
local ownerMe = bullet.Owner.Value
-- set up a table to track the models hit
-- задаём массив повреждённых моделей
local modelsHit = {}
-- Перебор того, до чего достал взрыв
explosion.Hit:Connect(function(part, distance)
local parentModel = part.Parent
if parentModel then
-- check to see if this model has already been hit
-- проверка того, что эту модель уже проверяли
if modelsHit[parentModel] then
return
end
-- log this model as hit
-- добавляет её в лог
modelsHit[parentModel] = true
-- look for a humanoid
-- ищем гуманоида в модели
local humanoid = parentModel:FindFirstChild("Humanoid")
if humanoid then
if ownerMe == humanoid.Parent.Name then -- не бьём хозяина
return
end
local ownerPart = parentModel:FindFirstChild("Owner") -- не бьём своих
if ownerPart ~= nil then
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 320 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6980 -- Use sliders to manipulate values
Tune.Redline = 8000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 250 -- 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)
|
--[[
CameraShakePresets.Bump
CameraShakePresets.Explosion
CameraShakePresets.Earthquake
CameraShakePresets.GentleSway
CameraShakePresets.BadTrip
CameraShakePresets.HandheldCamera
CameraShakePresets.Vibration
CameraShakePresets.RoughDriving
--]]
|
local CameraShakeInstance = require(script.Parent.CameraShakeInstance)
local CameraShakePresets = {
-- A high-magnitude, short, yet smooth shake.
-- Should happen once.
Bump = function()
local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
c.RotationInfluence = Vector3.new(1, 1, 1)
return c
end;
-- An intense and rough shake.
-- Should happen once.
Explosion = function()
local c = CameraShakeInstance.new(5, 10, 0, 1.5)
c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
c.RotationInfluence = Vector3.new(4, 1, 1)
return c
end;
-- A continuous, rough shake
-- Sustained.
Earthquake = function()
local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
c.RotationInfluence = Vector3.new(1, 1, 4)
return c
end;
-- A gentle left/right/up/down sway. Good for intro screens/landscapes.
-- Sustained.
GentleSway = function()
local c = CameraShakeInstance.new(0.65, 0.08, 0.1, 0.75)
c.PositionInfluence = Vector3.new(1.20, 0.35, 0.05)
c.RotationInfluence = Vector3.new(0.02, 0.02, 0.02)
return c
end;
-- A bizarre shake with a very high magnitude and low roughness.
-- Sustained.
BadTrip = function()
local c = CameraShakeInstance.new(10, 0.15, 5, 10)
c.PositionInfluence = Vector3.new(0, 0, 0.15)
c.RotationInfluence = Vector3.new(2, 1, 4)
return c
end;
-- A subtle, slow shake.
-- Sustained.
HandheldCamera = function()
local c = CameraShakeInstance.new(1, 0.25, 5, 10)
c.PositionInfluence = Vector3.new(0, 0, 0)
c.RotationInfluence = Vector3.new(1, 0.5, 0.5)
return c
end;
-- A very rough, yet low magnitude shake.
-- Sustained.
Vibration = function()
local c = CameraShakeInstance.new(0.4, 20, 2, 2)
c.PositionInfluence = Vector3.new(0, 0.15, 0)
c.RotationInfluence = Vector3.new(1.25, 0, 4)
return c
end;
-- A slightly rough, medium magnitude shake.
-- Sustained.
RoughDriving = function()
local c = CameraShakeInstance.new(1, 2, 1, 1)
c.PositionInfluence = Vector3.new(0, 0, 0)
c.RotationInfluence = Vector3.new(1, 1, 1)
return c
end;
}
return setmetatable({}, {
__index = function(_t, i)
local f = CameraShakePresets[i]
if (type(f) == "function") then
return f()
end
error("No preset found with index \"" .. i .. "\"")
end;
})
|
--Change sound id to the id you want to play
|
debounce = false
script.Parent.Touched:connect(function(hit)
debounce = true
script.Parent.Parent.Map2:Destroy()
game.SoundService.Sound.SoundId = ""
game.SoundService.Sound.Volume = 0.03
end)
|
--Loop For Making Rays For The Bullet's Trajectory
|
local fallOfShot = 4.75
for i = 1, 120 do
local thisOffset = offset + Vector3.new(0, yOffset*(i-fallOfShot), 0)
local travelRay = Ray.new(point1,thisOffset)
local hit, position = workspace:FindPartOnRay(travelRay, parts.Parent)
local distance = (position - point1).magnitude
round.Size = Vector3.new(1.1, distance, 1.1)
round.CFrame = CFrame.new(position, point1)
* CFrame.new(0, 0, -distance/2)
* CFrame.Angles(math.rad(90),0,0)
round.Parent = workspace
point1 = point1 + thisOffset
if hit then
round:remove()
local e = Instance.new("Explosion")
e.BlastRadius = 5 -- explosion radius
e.BlastPressure = 10 -- how strong the explosion is
e.Position = position
e.Parent = workspace
e.DestroyJointRadiusPercent = 0
if hit and hit.Parent then
if hit.Parent:FindFirstChild("Humanoid") then
return hit.Parent.Humanoid
elseif hit.Parent.Parent:FindFirstChild("Humanoid") then
return hit.Parent.Parent.Humanoid
elseif (hit.Parent.Name == "Hull") or (hit.Parent.Name == "Turret") or (hit.Parent.Name == "Gun") or (hit.Parent.Name == "Parts") then
print("You Have Damaged a Vehicle")
local HitSound = hit.Parent:findFirstChild("Pen"):Clone()
HitSound.Parent = hit
HitSound:Play()
hit.Parent.Parent:findFirstChild("Damage").Value = hit.Parent.Parent:findFirstChild("Damage").Value - damage
if hit.Parent.Parent:findFirstChild("Damage").Value<1 and hit.Parent.Parent:findFirstChild("Destroyed").Value == false then
local DestroyScript = hit.Parent.Parent:findFirstChild("DestroyScript"):clone()
DestroyScript.Parent = hit.Parent.Parent
DestroyScript.Disabled = false
print("Vehicle Disabled")
end
elseif hit.Name == "Left Arm" or hit.Name == "Left Leg" or hit.Name == "Right Arm" or hit.Name == "Right Leg" or hit.Name == "Torso" or hit.Name == "HumanoidRootPart" then
hit.Parent:findFirstChild("Humanoid").Health = hit.Parent:findFirstChild("Humanoid").Health - damage
print("Direct Hit a Player lmao")
elseif hit.Parent.Name == "Face" then
hit.Parent.Parent:findFirstChild("Humanoid").Health = hit.Parent.Parent:findFirstChild("Humanoid").Health - dealingdamage
print("Direct Hit a Morph of a Player lmao")
end
end
local players = game.Players:getChildren()
for i = 1, #players do
-- if players[i].TeamColor ~= script.Parent.Parent.Tank.Value then --if he's not an ally
character = players[i].Character
torso = character:findFirstChild'Torso'
if character and torso then
torsoPos = torso.Position
origPos = round.Position
local ray = Ray.new(origPos, torsoPos-origPos)
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignoreList)
if hit then
if hit.Parent == character then
human = hit.Parent:findFirstChild("Humanoid")
human2 = hit.Parent.Parent:findFirstChild("Humanoid")
if human then
distance = (position-origPos).magnitude
|
--If you want to add any other things such as "CanCollide" just do part.CanCollide = false but whatever you want the brick to do once it's touch has to be between "function" and "end"
| |
--bp.Position = shelly.PrimaryPart.Position
|
bp.Parent = nil
wait(math.random(3,8))
end
local soundBank = game.ReplicatedStorage.Sounds.NPC.Peeper:GetChildren()
shelly.Health.Changed:connect(function()
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()
end)
while true do
if tick()-lastEgg >= 60 then
lastEgg = tick()
local newEgg = EntityData.GetEntity("Egg")
newEgg.Color = shelly.Torso.Color
newEgg.CFrame = shelly.PrimaryPart.CFrame*CFrame.new(0,3,3)
newEgg.Parent = workspace.Items
local newSound = game.ReplicatedStorage.Sounds.Bank.Pop:Clone()
newSound.PlayOnRemove = true
newSound.Parent = newEgg
wait()
newSound:Destroy()
game:GetService("Debris"):AddItem(newEgg,55)
end
MoveShelly()
end
|
-- Connect events
|
Humanoid.Died:Connect(onDied)
Humanoid.Running:Connect(onRunning)
Humanoid.Jumping:Connect(onJumping)
Humanoid.Climbing:Connect(onClimbing)
Humanoid.GettingUp:Connect(onGettingUp)
Humanoid.FreeFalling:Connect(onFreeFall)
Humanoid.FallingDown:Connect(onFallingDown)
Humanoid.Seated:Connect(onSeated)
Humanoid.PlatformStanding:Connect(onPlatformStanding)
Humanoid.Swimming:Connect(onSwimming)
local a, r = false, game:GetService("RunService").RenderStepped
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if (not gameProcessedEvent) then
if (input.KeyCode == Enum.KeyCode.Space) then
a = true
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if (not gameProcessedEvent) then
if (input.KeyCode == Enum.KeyCode.Space) then
a = false
end
end
end)
r:Connect(function()
if (a) then
Humanoid.Jump = true
end
end)
|
--DO NOT USE BOTH WELDING SCRIPTS PROVIDED BY THIS MODEL
--The regular script is recommended
| |
--[[
Api.Classes
Api.Enums
Api.GetProperties(className)
Api.IsEnum(valueType)
--]]
|
-- Services
local HttpService = game:GetService("HttpService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Functions
local apiDump = HttpService:JSONDecode(jsonToParse)
local Classes = {}
local Enums = {}
local function sortAlphabetic(t, property)
table.sort(t,
function(x,y) return x[property] < y[property]
end)
end
local function isEnum(name)
return Enums[name] ~= nil
end
local function getProperties(className)
local class = Classes[className]
local properties = {}
if not class then return properties end
while class do
for _,member in pairs(class.Members) do
if member.MemberType == "Property" then
table.insert(properties, member)
end
end
class = Classes[class.Superclass]
end
sortAlphabetic(properties, "Name")
return properties
end
for i, class in ipairs(apiDump.Classes) do
Classes[class.Name] = class
end
for _, enum in ipairs(apiDump.Enums) do
Enums[enum.Name] = enum
end
return {
Classes = Classes;
Enums = Enums;
GetProperties = getProperties;
IsEnum = isEnum;
}
end
|
--Light off
|
src.Parent.left.Value.Value = 0
src.Parent.right.Value.Value = 0
light.Value = false
else
src.Parent.left.Value.Value = 1
src.Parent.right.Value.Value = 1
light.Value = true
return
end
end
end)
src.Parent.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
src:Stop()
script.Parent:Destroy()
end
end)
|
--Weld stuff here
|
MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(misc.Wheel.Parts,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)*CFrame.Angles(math.rad(13),0,0)
end
end)
|
--
|
script.Parent.OnServerEvent:Connect(function(p)
local Character = p.Character
local Humanoid = Character.Humanoid
local RootPart = Character.HumanoidRootPart
local anim1 = Humanoid:LoadAnimation(script["1"])
local FX = Assets["Blue"]:Clone()
local RArmFX = Assets.RA.Emit:Clone()
local RArm = Character["Right Arm"]
RArmFX.Parent = RArm
Humanoid.WalkSpeed = 0
Humanoid.JumpPower = 0
Humanoid.JumpHeight = 0
FX.Parent = workspace.Effects
FX.CFrame = RootPart.CFrame * CFrame.new(0,2,-5)
anim1:Play()
wait(.5)
Humanoid.AutoRotate = false
FX.Parent = workspace.Effects
FX.CFrame = RootPart.CFrame * CFrame.new(0,-3,-25)
FX.Sound:Play()
local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(18, 14.5, 52))
local hitlist = {}
for _,v in pairs(hitcontent) do
if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
if not hitlist[v.Parent.Humanoid] then
hitlist[v.Parent.Humanoid] = true
local Tp = Assets["Root"]:Clone()
for _,Particles in pairs(RArmFX.Parent:GetDescendants()) do
if Particles:IsA("ParticleEmitter") then
Particles:Emit(Particles:GetAttribute("EmitCount"))
end
end
local RootPart2 = v.Parent.HumanoidRootPart
Tp.Parent = RootPart2
Tp.Motor6D.Part1 = RootPart2
p.Character:MoveTo(Tp.TP.Position)
Tp:Destroy()
local vel = Instance.new("BodyVelocity", v.Parent.HumanoidRootPart)
vel.MaxForce = Vector3.new(1,1,1) * 1000000;
vel.Parent = v.Parent.HumanoidRootPart
vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
vel.Name = "SmallMoveVel"
game.Debris:AddItem(vel,0.1)
end
end
end
wait(.5)
anim1:Stop()
Humanoid.AutoRotate = true
Humanoid.WalkSpeed = 16
Humanoid.JumpPower = 50
Humanoid.JumpHeight = 7.2
wait(3)
FX:Destroy()
end)
|
-- This function converts 4 different, redundant enumeration types to one standard so the values can be compared
|
function CameraUtils.ConvertCameraModeEnumToStandard(enumValue)
if enumValue == Enum.TouchCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Follow
end
if enumValue == Enum.ComputerCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Classic
end
if enumValue == Enum.TouchCameraMovementMode.Classic or
enumValue == Enum.DevTouchCameraMovementMode.Classic or
enumValue == Enum.DevComputerCameraMovementMode.Classic or
enumValue == Enum.ComputerCameraMovementMode.Classic then
return Enum.ComputerCameraMovementMode.Classic
end
if enumValue == Enum.TouchCameraMovementMode.Follow or
enumValue == Enum.DevTouchCameraMovementMode.Follow or
enumValue == Enum.DevComputerCameraMovementMode.Follow or
enumValue == Enum.ComputerCameraMovementMode.Follow then
return Enum.ComputerCameraMovementMode.Follow
end
if enumValue == Enum.TouchCameraMovementMode.Orbital or
enumValue == Enum.DevTouchCameraMovementMode.Orbital or
enumValue == Enum.DevComputerCameraMovementMode.Orbital or
enumValue == Enum.ComputerCameraMovementMode.Orbital then
return Enum.ComputerCameraMovementMode.Orbital
end
if enumValue == Enum.ComputerCameraMovementMode.CameraToggle or
enumValue == Enum.DevComputerCameraMovementMode.CameraToggle then
return Enum.ComputerCameraMovementMode.CameraToggle
end
-- Note: Only the Dev versions of the Enums have UserChoice as an option
if enumValue == Enum.DevTouchCameraMovementMode.UserChoice or
enumValue == Enum.DevComputerCameraMovementMode.UserChoice then
return Enum.DevComputerCameraMovementMode.UserChoice
end
-- For any unmapped options return Classic camera
return Enum.ComputerCameraMovementMode.Classic
end
return CameraUtils
|
--!strict
|
local Replicated = game:GetService("ReplicatedStorage")
local Components = require(Replicated.Packages.Components)
Components.RegisterAll(Replicated.Components)
Components.RegisterAll(Replicated.Client.Components)
|
--
|
local sight = 50
local walking = false
local shooting = false
local canshoot = true
local cansay = true
local saycooldown = 0
local akweld = Instance.new("Weld", npc["AK-47"])
akweld.Part0 = rightarm
akweld.Part1 = npc["AK-47"]
function walkanim(walkspeed)
if walkspeed > 5 then
walking = true
else
walking = false
end
end
npchumanoid.Running:connect(walkanim)
function randomwalk()
while wait(math.random(3,6)) do
if not shooting and not walking then
npchumanoid.WalkSpeed = 16
local function createwalkpart()
local walkpart = Instance.new("Part", npc)
walkpart.Size = Vector3.new(1,1,1)
walkpart.Anchored = true
walkpart.Material = "Neon"
walkpart.Transparency = 1
walkpart.BrickColor = BrickColor.new("Maroon")
walkpart.CFrame = torso.CFrame * CFrame.new(math.random(-60,60),math.random(-30,30),math.random(-60,60))
local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
local waypoints = path:GetWaypoints()
if path.Status == Enum.PathStatus.Success then
for i,v in pairs(waypoints) do
local pospart = Instance.new("Part", npc)
pospart.Size = Vector3.new(1,1,1)
pospart.Anchored = true
pospart.Material = "Neon"
pospart.Transparency = 1
pospart.Position = v.Position
pospart.Name = "pospart"
pospart.CanCollide = false
end
for i,v in pairs(waypoints) do
npchumanoid:MoveTo(v.Position)
local allow = 0
while (torso.Position - v.Position).magnitude > 4 and allow < 35 do
allow = allow + 1
wait()
end
if v.Action == Enum.PathWaypointAction.Jump then
npchumanoid.Jump = true
end
end
for i,v in pairs(npc:GetChildren()) do
if v.Name == "pospart" then
v:destroy()
end
end
else
createwalkpart()
wait()
end
walkpart:destroy()
end
createwalkpart()
end
end
end
function checkandshoot()
while wait() do
saycooldown = saycooldown + 1
if saycooldown == 500 then
cansay = true
saycooldown = 0
end
for i,v in pairs(workspace:GetChildren()) do
if v.ClassName == "Model" and v.Name ~= "Rufus14" then
local victimhumanoid = v:findFirstChildOfClass("Humanoid")
local victimhead = v:findFirstChild("Head")
if victimhumanoid and victimhead and v.Name ~= npc.Name then
if (victimhead.Position - head.Position).magnitude < sight then
if victimhumanoid.Name == "noneofurbusiness" and cansay then
elseif not shooting and victimhumanoid.Health > 0 and canshoot then
shooting = true
walking = false
local doesshoot = 0
local hpnow = npchumanoid.Health
local walk = 0
npchumanoid.WalkSpeed = 0
while shooting and (victimhead.Position - head.Position).magnitude < sight and victimhumanoid.Health > 0 and canshoot do
doesshoot = doesshoot + 1
walk = walk + 1
if npchumanoid.PlatformStand == false then
npc.HumanoidRootPart.CFrame = CFrame.new(npc.HumanoidRootPart.Position,Vector3.new(victimhead.Position.x,npc.HumanoidRootPart.Position.y,victimhead.Position.z))
end
if walk == 100 and not walking then
local function createwalkpart()
local walkpart = Instance.new("Part", npc)
walkpart.Size = Vector3.new(1,1,1)
walkpart.Anchored = true
walkpart.Material = "Neon"
walkpart.Transparency = 1
walkpart.BrickColor = BrickColor.new("Maroon")
walkpart.CFrame = torso.CFrame * CFrame.new(-math.random(20,60),math.random(-40,40),math.random(-10,10))
local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
local waypoints = path:GetWaypoints()
if path.Status == Enum.PathStatus.Success then
shooting = false
canshoot = false
npchumanoid.WalkSpeed = 20
for i,v in pairs(waypoints) do
local pospart = Instance.new("Part", npc)
pospart.Size = Vector3.new(1,1,1)
pospart.Anchored = true
pospart.Material = "Neon"
pospart.Transparency = 1
pospart.Position = v.Position
pospart.Name = "pospart"
pospart.CanCollide = false
end
for i,v in pairs(waypoints) do
npchumanoid:MoveTo(v.Position)
local allow = 0
while (torso.Position - v.Position).magnitude > 4 and allow < 35 do
allow = allow + 1
wait()
end
if v.Action == Enum.PathWaypointAction.Jump then
npchumanoid.Jump = true
end
end
canshoot = true
npchumanoid.WalkSpeed = 16
for i,v in pairs(npc:GetChildren()) do
if v.Name == "pospart" then
v:destroy()
end
end
else
createwalkpart()
wait()
end
walkpart:destroy()
end
createwalkpart()
end
if doesshoot == 2 then
doesshoot = 0
npc["AK-47"].shoot:Play()
local bullet = Instance.new("Part", npc)
bullet.Size = Vector3.new(0.3,0.3,3.5)
bullet.Material = "Neon"
bullet.CFrame = npc["AK-47"].CFrame * CFrame.new(0,0,-4)
bullet.CanCollide = false
local velocity = Instance.new("BodyVelocity", bullet)
velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bullet.CFrame = CFrame.new(bullet.Position, victimhead.Position)
velocity.Velocity = bullet.CFrame.lookVector * 500 + Vector3.new(math.random(-20,20),math.random(-20,20),0)
local pointlight = Instance.new("PointLight", npc["AK-47"])
game.Debris:AddItem(pointlight,0.1)
local function damage(part)
local damage = math.random(1,5)
if part.Parent.ClassName ~= "Accessory" and part.Parent.Parent.ClassName ~= "Accessory" and part.ClassName ~= "Accessory" and part.Parent.Name ~= npc.Name and part.CanCollide == true then
bullet:destroy()
local victimhumanoid = part.Parent:findFirstChildOfClass("Humanoid")
if victimhumanoid then
if victimhumanoid.Health > damage then
victimhumanoid:TakeDamage(damage)
else
victimhumanoid:TakeDamage(damage)
end
end
end
end
game.Debris:AddItem(bullet, 5)
bullet.Touched:connect(damage)
end
wait()
end
walking = false
shooting = false
end
end
end
end
end
end
end
function run()
while wait() do
local hpnow = npchumanoid.Health
wait()
if npchumanoid.Health < hpnow then
local dorun = math.random(1,1)
if dorun == 1 and not walking then
local function createwalkpart()
local walkpart = Instance.new("Part", npc)
walkpart.Size = Vector3.new(1,1,1)
walkpart.Anchored = true
walkpart.Material = "Neon"
walkpart.Transparency = 1
walkpart.BrickColor = BrickColor.new("Maroon")
walkpart.CFrame = torso.CFrame * CFrame.new(math.random(20,60),math.random(-20,20),math.random(-60,60))
local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
local waypoints = path:GetWaypoints()
if path.Status == Enum.PathStatus.Success then
shooting = false
canshoot = false
walking = true
npchumanoid.WalkSpeed = 20
for i,v in pairs(waypoints) do
local pospart = Instance.new("Part", npc)
pospart.Size = Vector3.new(1,1,1)
pospart.Anchored = true
pospart.Material = "Neon"
pospart.Transparency = 1
pospart.Position = v.Position
pospart.Name = "pospart"
pospart.CanCollide = false
end
for i,v in pairs(waypoints) do
npchumanoid:MoveTo(v.Position)
local allow = 0
while (torso.Position - v.Position).magnitude > 4 and allow < 35 do
allow = allow + 1
wait()
end
if v.Action == Enum.PathWaypointAction.Jump then
npchumanoid.Jump = true
end
end
shooting = false
canshoot = true
walking = false
npchumanoid.WalkSpeed = 16
for i,v in pairs(npc:GetChildren()) do
if v.Name == "pospart" then
v:destroy()
end
end
else
createwalkpart()
wait()
end
walkpart:destroy()
end
createwalkpart()
end
end
end
end
function death()
if head:findFirstChild("The Prodigy - Voodoo People (Pendulum Remix)") then
head["The Prodigy - Voodoo People (Pendulum Remix)"]:destroy()
end
if npc:findFirstChild("Health") then
npc.Health.Disabled = true
end
npchumanoid.Archivable = true
local zombiecorpse = npchumanoid.Parent:Clone()
npchumanoid.Parent:destroy()
zombiecorpse.Parent = workspace
game.Debris:AddItem(zombiecorpse, 15)
local Humanoid = zombiecorpse:findFirstChildOfClass("Humanoid")
local Torso = zombiecorpse.Torso
Humanoid.PlatformStand = true
Humanoid:SetStateEnabled("Dead", false)
for i,v in pairs(Humanoid.Parent.Torso:GetChildren()) do
if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then
v:destroy()
end
end
for i,v in pairs(zombiecorpse:GetChildren()) do
if v.ClassName == "Part" then
for q,w in pairs(v:GetChildren()) do
if w.ClassName == "BodyPosition" or w.ClassName == "BodyVelocity" then
w:destroy()
end
end
end
end
local function makeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle)
local connection = Instance.new('BallSocketConstraint', limb)
connection.LimitsEnabled = true
connection.Attachment0 = attachementone
connection.Attachment1 = attachmenttwo
connection.TwistLimitsEnabled = true
connection.TwistLowerAngle = twistlower
connection.TwistUpperAngle = twistupper
connection.UpperAngle = 70
end
local function makehingeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle)
local connection = Instance.new('HingeConstraint', limb)
connection.Attachment0 = attachementone
connection.Attachment1 = attachmenttwo
connection.LimitsEnabled = true
connection.LowerAngle = twistlower
connection.UpperAngle = twistupper
end
Humanoid.Parent['Right Arm'].RightShoulderAttachment.Position = Vector3.new(0, 0.5, 0)
Torso.RightCollarAttachment.Position = Vector3.new(1.5, 0.5, 0)
Humanoid.Parent['Left Arm'].LeftShoulderAttachment.Position = Vector3.new(0, 0.5, 0)
Torso.LeftCollarAttachment.Position = Vector3.new(-1.5, 0.5, 0)
local RightLegAttachment = Instance.new("Attachment", Humanoid.Parent["Right Leg"])
RightLegAttachment.Position = Vector3.new(0, 1, 0)
local TorsoRightLegAttachment = Instance.new("Attachment", Torso)
TorsoRightLegAttachment.Position = Vector3.new(0.5, -1, 0)
--
local LeftLegAttachment = Instance.new("Attachment", Humanoid.Parent["Left Leg"])
LeftLegAttachment.Position = Vector3.new(0, 1, 0)
local TorsoLeftLegAttachment = Instance.new("Attachment", Torso)
TorsoLeftLegAttachment.Position = Vector3.new(-0.5, -1, 0)
--
if Humanoid.Parent:findFirstChild("Head") then
local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
HeadAttachment.Position = Vector3.new(0, -0.5, 0)
makehingeconnections(Humanoid.Parent.Head, HeadAttachment, Torso.NeckAttachment, -20, 20, 70)
end
makeconnections(Humanoid.Parent['Right Arm'], Humanoid.Parent['Right Arm'].RightShoulderAttachment, Torso.RightCollarAttachment, -80, 80)
makeconnections(Humanoid.Parent['Left Arm'], Humanoid.Parent['Left Arm'].LeftShoulderAttachment, Torso.LeftCollarAttachment, -80, 80)
makeconnections(Humanoid.Parent['Right Leg'], RightLegAttachment, TorsoRightLegAttachment, -80, 80, 70)
makeconnections(Humanoid.Parent['Left Leg'], LeftLegAttachment, TorsoLeftLegAttachment, -80, 80, 70)
if Humanoid.Parent:findFirstChild("Right Arm") then
local limbcollider = Instance.new("Part", Humanoid.Parent["Right Arm"])
limbcollider.Size = Vector3.new(1,1.3,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = Humanoid.Parent["Right Arm"]
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
for i,v in pairs(zombiecorpse["Right Arm"]:GetChildren()) do
if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then
v:destroy()
end
end
end
--
if Humanoid.Parent:findFirstChild("Left Arm") then
local limbcollider = Instance.new("Part", Humanoid.Parent["Left Arm"])
limbcollider.Size = Vector3.new(1,1.3,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = Humanoid.Parent["Left Arm"]
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
end
--
if Humanoid.Parent:findFirstChild("Left Leg") then
local limbcollider = Instance.new("Part", Humanoid.Parent["Left Leg"])
limbcollider.Size = Vector3.new(1,1.3,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = Humanoid.Parent["Left Leg"]
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
end
--
if Humanoid.Parent:findFirstChild("Right Leg") then
local limbcollider = Instance.new("Part", Humanoid.Parent["Right Leg"])
limbcollider.Size = Vector3.new(1,1.3,1)
limbcollider.Shape = "Cylinder"
limbcollider.Transparency = 1
local limbcolliderweld = Instance.new("Weld", limbcollider)
limbcolliderweld.Part0 = Humanoid.Parent["Right Leg"]
limbcolliderweld.Part1 = limbcollider
limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
end
local ragdoll = zombiecorpse
if ragdoll:findFirstChild("HumanoidRootPart") then
ragdoll.HumanoidRootPart.CanCollide = false
ragdoll.HumanoidRootPart:destroy()
end
end
npchumanoid.Died:connect(death)
spawn(run)
spawn(checkandshoot)
spawn(randomwalk)
while wait() do --check animations and other things
if not walking and not shooting then
for i = 0.2,0.8 , 0.09 do
if not walking and not shooting then
akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.599619389, -1.99128425, 0, 0.996194661, 0.087155968, 0, -0.087155968, 0.996194661, 0, 0, 0, 1),i)
righthip.C0 = righthip.C0:lerp(CFrame.new(0.599619389, -1.99128449, 0, 0.996194661, -0.087155968, 0, 0.087155968, 0.996194661, 0, 0, 0, 1),i)
root.C0 = root.C0:lerp(CFrame.new(0,0,0),i)
neck.C0 = neck.C0:lerp(CFrame.new(0,1.5,0),i)
wait()
end
end
end
if walking then --this is the walking animation
for i = 0.2,0.8 , 0.09 do
if walking then
akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.527039051, -1.78302765, 0.642787695, 0.999390841, 0.026734557, 0.0224329531, -0.0348994918, 0.765577614, 0.642395973, 0, -0.642787635, 0.766044438),i)
righthip.C0 = righthip.C0:lerp(CFrame.new(0.522737741, -1.65984559, -0.766044617, 0.999390841, -0.0224329531, 0.0267345682, 0.0348994918, 0.642395794, -0.765577734, 0, 0.766044497, 0.642787457),i)
root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, 6.98491931e-09, -0.0871561021, 0.00759615982, 0.996194661, 0.0868242308, 0.0868244469, -0.087155886, 0.992403805),i)
neck.C0 = neck.C0:lerp(CFrame.new(2.38418579e-07, 1.49809694, 0.0435779095, 0.996194661, 6.38283382e-09, 0.0871560946, 0.00759615889, 0.996194601, -0.0868242308, -0.0868244469, 0.087155886, 0.992403746),i)
wait()
end
end
head.footstep:Play()
for i = 0.2,0.8 , 0.09 do
if walking then
akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.520322084, -1.59067655, -0.819151878, 0.999390841, 0.0200175196, -0.028587997, -0.0348994918, 0.573226929, -0.818652987, 0, 0.819151998, 0.57357645),i)
righthip.C0 = righthip.C0:lerp(CFrame.new(0.528892756, -1.83610249, 0.573575974, 0.999390841, -0.0285879895, -0.020017527, 0.0348994955, 0.818652987, 0.57322675, -7.4505806e-09, -0.573576212, 0.819152057),i)
root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, -1.44354999e-08, 0.0871558934, -0.00759615237, 0.996194661, 0.0868244395, -0.0868242383, -0.0871560946, 0.992403805),i)
neck.C0 = neck.C0:lerp(CFrame.new(0, 1.49809742, 0.0435781479, 0.996194601, -1.27129169e-08, -0.0871559009, -0.0075961519, 0.996194661, -0.0868244097, 0.0868242458, 0.0871560723, 0.992403746),i)
wait()
end
end
head.footstep:Play()
end
if shooting then --this is the shooting animation
for i = 0.2,0.8 , 0.45 do
if shooting then
akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i)
root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i)
rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.21384871, 0.500000477, -0.879925251, 0.342019856, 0.939692438, -1.49501886e-08, 1.94707184e-07, -2.68220873e-07, -0.999999821, -0.939692438, 0.342020035, -3.76157232e-07),i)
leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.59201181, 0.470158577, -0.794548988, 0.271118939, 0.181368172, 0.945304275, 0.902039766, -0.390578717, -0.18377316, 0.335885108, 0.902526498, -0.269494623),i)
lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
neck.C0 = neck.C0:lerp(CFrame.new(0.0296957493, 1.49240398, -0.0815882683, 0.336824059, 0.059391167, 0.939692557, -0.173648164, 0.98480773, -7.4505806e-09, -0.925416589, -0.163175896, 0.342020094),i)
wait()
end
end
for i = 0.2,0.8 , 0.45 do
if shooting then
akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i)
root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i)
rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.60777056, 0.499999523, -0.81046629, 0.342019439, 0.939691842, 1.55550936e-07, 4.10554577e-08, -3.93739697e-07, -0.999999464, -0.939691901, 0.342019975, -4.77612389e-07),i)
leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.10000956, 0.482372284, -0.926761627, 0.27112025, 0.263066441, 0.925899446, 0.902039289, -0.405109912, -0.149033815, 0.335885197, 0.875603914, -0.347129732),i)
lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
neck.C0 = neck.C0:lerp(CFrame.new(0.121206045, 1.4753027, -0.0450725555, 0.336823881, 0.221664757, 0.915103495, -0.173648164, 0.969846308, -0.171010077, -0.925416648, -0.101305753, 0.365159094),i)
wait()
end
end
end
end
|
-- services
|
local dss = game:GetService("DataStoreService")
local http = game:GetService("HttpService")
local mps = game:GetService("MarketplaceService")
|
--[[
Creates a debounced function that delays invoking fn until after secondsDelay seconds have elapsed since the last time the debounced function was invoked.
]]
|
function FunctionUtils.debounce(fn, secondsDelay)
assert(FunctionUtils.isCallable(fn))
assert(type(secondsDelay) == "number")
local lastInvocation = 0
local lastResult = nil
return function(...)
local args = {...}
lastInvocation = lastInvocation + 1
local thisInvocation = lastInvocation
delay(
secondsDelay,
function()
if thisInvocation ~= lastInvocation then
return
end
lastResult = fn(unpack(args))
end
)
return lastResult
end
end
|
--[[Engine]]
|
local fFD = _Tune.FinalDrive*_Tune.FDMult
local fFDr = fFD*30/math.pi
local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
local wDRatio = wDia*math.pi/60
local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
local cfYRot = CFrame.Angles(0,math.pi,0)
local rtTwo = (2^.5)/2
--Horsepower Curve
local fgc_h=_Tune.Horsepower/100
local fgc_n=_Tune.PeakRPM/1000
local fgc_a=_Tune.PeakSharpness
local fgc_c=_Tune.CurveMult
function FGC(x)
x=x/1000
return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1))))
end
local PeakFGC = FGC(_Tune.PeakRPM)
--Plot Current Horsepower
function GetCurve(x,gear)
local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0)
return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling
end
--Output Cache
local CacheTorque = true
local HPCache = {}
local HPInc = 100
if CacheTorque then
for gear,ratio in pairs(_Tune.Ratios) do
local hpPlot = {}
for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.PeakRPM+100)/HPInc) do
local tqPlot = {}
tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
hpPlot[rpm] = tqPlot
end
table.insert(HPCache,hpPlot)
end
end
--Powertrain
--Update RPM
function RPM()
--Neutral Gear
if _CGear==0 then _ClutchOn = false end
--Car Is Off
local revMin = _Tune.IdleRPM
if not _IsOn then
revMin = 0
_CGear = 0
_ClutchOn = false
_GThrot = _Tune.IdleThrottle/100
end
--Determine RPM
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.PeakRPM+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9)
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
else
if _GThrot-(_Tune.IdleThrottle/100)>0 then
if _RPM>_Tune.PeakRPM then
_RPM = _RPM-_Tune.RevBounce*2
else
_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.PeakRPM+100)
end
else
_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
end
end
--Rev Limiter
_spLimit = (_Tune.PeakRPM+100)/(fFDr*_Tune.Ratios[_CGear+2])
if _RPM>_Tune.PeakRPM then
if _CGear<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
end
--Apply Power
function Engine()
--Get Torque
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
if CacheTorque then
local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.PeakRPM,math.max(_Tune.IdleRPM,_RPM))/HPInc)]
_HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
_OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
else
_HP,_OutTorque = GetCurve(_RPM,_CGear)
end
local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
if _CGear==-1 then iComp=-iComp end
_OutTorque = _OutTorque*math.max(1,(1+iComp))
else
_HP,_OutTorque = 0,0
end
--Automatic Transmission
if _TMode == "Auto" and _IsOn then
_ClutchOn = true
if _CGear == 0 then _CGear = 1 end
if _CGear >= 1 then
if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = -1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.PeakRPM+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
_CGear=math.max(_CGear-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
_CGear=math.max(_CGear-1,1)
end
end
end
else
if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = 1
end
end
end
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not script.Parent.IsOn.Value then on=0 end
local throt = _GThrot
if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end
--Apply TCS
local tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = _GBrake
if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
if tqABS < 1 then
_ABSActive = true
end
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
-- Experimental flag: name children based on the key used in the [Children] table
|
local EXPERIMENTAL_AUTO_NAMING = false
local Children = {}
Children.type = "SpecialKey"
Children.kind = "Children"
Children.stage = "descendants"
function Children:apply(propValue: any, applyTo: Instance, cleanupTasks: {PubTypes.Task})
local newParented: Set<Instance> = {}
local oldParented: Set<Instance> = {}
-- save disconnection functions for state object observers
local newDisconnects: {[PubTypes.StateObject<any>]: () -> ()} = {}
local oldDisconnects: {[PubTypes.StateObject<any>]: () -> ()} = {}
local updateQueued = false
local queueUpdate: () -> ()
-- Rescans this key's value to find new instances to parent and state objects
-- to observe for changes; then unparents instances no longer found and
-- disconnects observers for state objects no longer present.
local function updateChildren()
if not updateQueued then
return -- this update may have been canceled by destruction, etc.
end
updateQueued = false
oldParented, newParented = newParented, oldParented
oldDisconnects, newDisconnects = newDisconnects, oldDisconnects
table.clear(newParented)
table.clear(newDisconnects)
local function processChild(child: any, autoName: string?)
local kind = xtypeof(child)
if kind == "Instance" then
-- case 1; single instance
newParented[child] = true
if oldParented[child] == nil then
-- wasn't previously present
-- TODO: check for ancestry conflicts here
child.Parent = applyTo
else
-- previously here; we want to reuse, so remove from old
-- set so we don't encounter it during unparenting
oldParented[child] = nil
end
if EXPERIMENTAL_AUTO_NAMING and autoName ~= nil then
child.Name = autoName
end
elseif kind == "State" then
-- case 2; state object
local value = child:get(false)
-- allow nil to represent the absence of a child
if value ~= nil then
processChild(value, autoName)
end
local disconnect = oldDisconnects[child]
if disconnect == nil then
-- wasn't previously present
disconnect = Observer(child):onChange(queueUpdate)
else
-- previously here; we want to reuse, so remove from old
-- set so we don't encounter it during unparenting
oldDisconnects[child] = nil
end
newDisconnects[child] = disconnect
elseif kind == "table" then
-- case 3; table of objects
for key, subChild in pairs(child) do
local keyType = typeof(key)
local subAutoName: string? = nil
if keyType == "string" then
subAutoName = key
elseif keyType == "number" and autoName ~= nil then
subAutoName = autoName .. "_" .. key
end
processChild(subChild, subAutoName)
end
else
logWarn("unrecognisedChildType", kind)
end
end
if propValue ~= nil then
-- `propValue` is set to nil on cleanup, so we don't process children
-- in that case
processChild(propValue)
end
-- unparent any children that are no longer present
for oldInstance in pairs(oldParented) do
oldInstance.Parent = nil
end
-- disconnect observers which weren't reused
for oldState, disconnect in pairs(oldDisconnects) do
disconnect()
end
end
queueUpdate = function()
if not updateQueued then
updateQueued = true
task.defer(updateChildren)
end
end
table.insert(cleanupTasks, function()
propValue = nil
updateQueued = true
updateChildren()
end)
-- perform initial child parenting
updateQueued = true
updateChildren()
end
return Children :: PubTypes.SpecialKey
|
-----------------------------------
|
elseif script.Parent.Parent.Parent.TrafficControl.Value == "=" then
for i = 1,#grp1 do
grp1[i].Lighto.Enabled = true
end
for i = 1,#grp1 do
grp1[i].Transparency = 0
end
for i = 1,#grp2 do
grp2[i].Lighto.Enabled = false
end
for i = 1,#grp2 do
grp2[i].Transparency = 1
end
for i = 1,#grp3 do
grp3[i].Lighto.Enabled = false
end
for i = 1,#grp3 do
grp3[i].Transparency = 1
end
for i = 1,#grp4 do
grp4[i].Transparency = 1
end
for i = 1,#grp4 do
grp4[i].Lighto.Enabled = false
end
|
--[[
By Starzin
]]
|
local Player = game.Players:GetPlayerFromCharacter(script.Parent);
C = script.Parent;
Mouse = Player:GetMouse();
Debounce = false;
|
-- ROBLOX deviation START: additional assignments for Lua type inferrence to work
|
exports.print = preRunMessageModule.print
exports.remove = preRunMessageModule.remove
|
-- This function is only called on clients
|
function BulletWeapon:simulateFire(firingPlayer, fireInfo)
BaseWeapon.simulateFire(self, fireInfo)
-- Play "Fired" sound
if self.lastFireSound then
self.lastFireSound:Stop()
end
self.lastFireSound = self:tryPlaySound("Fired", self:getConfigValue("FiredPlaybackSpeedRange", 0.1))
-- Simulate each projectile/bullet fired from current weapon
local numProjectiles = self:getConfigValue("NumProjectiles", 1)
local randomGenerator = Random.new(self:getRandomSeedForId(fireInfo.id))
for i = 1, numProjectiles do
self:simulateProjectile(firingPlayer, fireInfo, i, randomGenerator)
end
-- Animate the bolt if the current gun has one
local actionOpenTime = self:getConfigValue("ActionOpenTime", 0.025)
if self.boltMotor then
coroutine.wrap(function()
self:animateBoltAction(true)
wait(actionOpenTime)
self:animateBoltAction(false)
end)()
end
-- Eject bullet casings and play "CasingHitSound" (child of casing) sound if applicable for current weapon
if not NO_BULLET_CASINGS and self.casingTemplate and self.casingEjectPoint then
local casing = self.casingTemplate:Clone()
casing.Anchored = false
casing.Archivable = false
casing.CFrame = self.casingEjectPoint.WorldCFrame
casing.Velocity = self.casingEjectPoint.Parent.Velocity + (self.casingEjectPoint.WorldAxis * localRandom:NextNumber(self:getConfigValue("CasingEjectSpeedMin", 15), self:getConfigValue("CasingEjectSpeedMax", 18)))
casing.Parent = workspace.CurrentCamera
CollectionService:AddTag(casing, "WeaponsSystemIgnore")
local casingHitSound = casing:FindFirstChild("CasingHitSound")
if casingHitSound then
local touchedConn = nil
touchedConn = casing.Touched:Connect(function(hitPart)
if not hitPart:IsDescendantOf(self.instance) then
casingHitSound:Play()
touchedConn:Disconnect()
touchedConn = nil
end
end)
end
Debris:AddItem(casing, 2)
end
if self.player == Players.LocalPlayer then
coroutine.wrap(function()
-- Wait for "RecoilDelayTime" before adding recoil
local startTime = tick()
local recoilDelayTime = self:getConfigValue("RecoilDelayTime", 0.07)
while tick() < startTime + recoilDelayTime do
RunService.RenderStepped:Wait()
end
RunService.RenderStepped:Wait()
-- Add recoil to camera
local recoilMin, recoilMax = self:getConfigValue("RecoilMin", 0.05), self:getConfigValue("RecoilMax", 0.5)
local intensityToAdd = randomGenerator:NextNumber(recoilMin, recoilMax)
local xIntensity = math.sin(tick() * 2) * intensityToAdd * math.rad(0.05)
local yIntensity = intensityToAdd * 0.025
self.weaponsSystem.camera:addRecoil(Vector2.new(xIntensity, yIntensity))
if not (self.weaponsSystem.camera:isZoomed() and self:getConfigValue("HasScope", false)) then
self.recoilIntensity = math.clamp(self.recoilIntensity * 1 + (intensityToAdd / 10), 0.005, 1)
end
-- Make crosshair reflect recoil/spread amount
local weaponsGui = self.weaponsSystem.gui
if weaponsGui then
weaponsGui:setCrosshairScale(1 + intensityToAdd)
end
end)()
end
end
function BulletWeapon:getIgnoreList(includeLocalPlayer)
local now = tick()
local ignoreList = self.ignoreList
if not ignoreList or now - self.ignoreListRefreshTime > IGNORE_LIST_LIFETIME then
ignoreList = {
self.instanceIsTool and self.instance.Parent or self.instance,
workspace.CurrentCamera
}
if not RunService:IsServer() then
if includeLocalPlayer and Players.LocalPlayer and Players.LocalPlayer.Character then
table.insert(ignoreList, Players.LocalPlayer.Character)
end
end
self.ignoreList = ignoreList
end
return ignoreList
end
|
----- cold tap handler -----
|
for i, v in pairs(coldTap:GetChildren()) do
if v:FindFirstChild("ClickDetector") then
v.ClickDetector.MouseClick:Connect(function()
if coldOn.Value == false then
coldOn.Value = true
faucet.ParticleEmitter.Enabled = true
waterSound:Play()
coldTap:SetPrimaryPartCFrame(coldTap.PrimaryPart.CFrame * CFrame.Angles(math.rad(-45),0,0))
else
coldOn.Value = false
if hotOn.Value == false then
faucet.ParticleEmitter.Enabled = false
waterSound:Stop()
end
coldTap:SetPrimaryPartCFrame(coldTap.PrimaryPart.CFrame * CFrame.Angles(math.rad(45),0,0))
end
end)
end
end
|
-- Put this in StarterPlayer > StarterPlayerScripts
|
while true do
local player = game.Players.LocalPlayer
local sound = script.RainSound
wait(math.random(10,20))
local TweenService = game:GetService("TweenService")
local part = game.Workspace. Terrain.Clouds
local goal = {}
goal.Density = 1
--change this to how dense you want the clouds to be
goal.Cover = 1
--change this to how much the clouds cover the sky
sound:Play()
local tweenInfo = TweenInfo.new(5)
--change the 5 to how long you want the transition to happen
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
player.PlayerGui.Rain.Disabled = false
wait(math.random(10,10))
local TweenService = game:GetService("TweenService")
local part = game.Workspace. Terrain.Clouds
local goal = {}
goal.Density = 1
--change this to how dense you want the clouds to be
goal.Cover = 0.5
--change this to how much the clouds cover the sky
sound:Stop()
local tweenInfo = TweenInfo.new(5)
--change the 5 to how long you want the transition to happen
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
player.PlayerGui.Rain.Disabled = true
end
|
-- دالة السقوط
|
local function fall()
local startPos = plank.Position
local endPos = startPos - Vector3.new(0, fallHeight, 0)
local startTime = tick()
local elapsedTime = 0
while elapsedTime <= fallingDuration do
local t = elapsedTime / fallingDuration
plank.Position = startPos:Lerp(endPos, t)
wait()
elapsedTime = tick() - startTime
end
plank.Position = originalPosition
end
|
--[=[
Returns whether the service bag has the service.
@param serviceType ServiceType
@return boolean
]=]
|
function ServiceBag:HasService(serviceType)
if typeof(serviceType) == "Instance" then
serviceType = require(serviceType)
end
if self._services[serviceType] then
return true
else
return false
end
end
|
-- initial states
|
local game = game
local workspace = workspace
local pcall = pcall
local unpack = unpack
local next = next
local tick = tick
local ipairs = ipairs
local script = script
local tostring = tostring
local type = type
local typeof = typeof
local Instance_new = Instance.new
local drag, SelectionVar
local UDim2_new = UDim2.new
local Vector2_new = Vector2.new
local Vector3_new = Vector3.new
local CFrame_new = CFrame.new
local NumberRange_new = NumberRange.new
local Color3_new = Color3.new
local Color3_fromRGB = Color3.fromRGB
local table_insert = table.insert
local table_remove = table.remove
local table_sort = table.sort
local table_concat = table.concat
local table_clear = table.clear
local string_split = string.split
local string_find = string.find
local string_match = string.match
local string_lower = string.lower
local string_sub = string.sub
local string_byte = string.byte
local string_gsub = string.gsub
local string_rep = string.rep
local math_floor = math.floor
local math_ceil = math.ceil
local math_random = math.random
local math_huge = math.huge
local Option = {
-- can modify object parents in the hierarchy
Modifiable = false;
-- can select objects
Selectable = true;
}
|
-- Convenient syntax for creating a tree of instanes
|
local function create(className: string)
return function(props)
local inst = Instance.new(className)
local parent = props.Parent
props.Parent = nil
for name, val in pairs(props) do
if type(name) == "string" then
inst[name] = val
else
val.Parent = inst
end
end
-- Only set parent after all other properties are initialized
inst.Parent = parent
return inst
end
end
local initialized = false
local uiRoot: ScreenGui
local toast
local toastIcon
local toastUpperText
local toastLowerText
local function initializeUI()
assert(not initialized)
uiRoot = create("ScreenGui"){
Name = "RbxCameraUI",
AutoLocalize = false,
Enabled = true,
DisplayOrder = -1, -- Appears behind default developer UI
IgnoreGuiInset = false,
ResetOnSpawn = false,
ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
create("ImageLabel"){
Name = "Toast",
Visible = false,
AnchorPoint = Vector2.new(0.5, 0),
BackgroundTransparency = 1,
BorderSizePixel = 0,
Position = UDim2.new(0.5, 0, 0, 8),
Size = TOAST_CLOSED_SIZE,
Image = "rbxasset://textures/ui/Camera/CameraToast9Slice.png",
ImageColor3 = TOAST_BACKGROUND_COLOR,
ImageRectSize = Vector2.new(6, 6),
ImageTransparency = 1,
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(3, 3, 3, 3),
ClipsDescendants = true,
create("Frame"){
Name = "IconBuffer",
BackgroundTransparency = 1,
BorderSizePixel = 0,
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(0, 80, 1, 0),
create("ImageLabel"){
Name = "Icon",
AnchorPoint = Vector2.new(0.5, 0.5),
BackgroundTransparency = 1,
Position = UDim2.new(0.5, 0, 0.5, 0),
Size = UDim2.new(0, 48, 0, 48),
ZIndex = 2,
Image = "rbxasset://textures/ui/Camera/CameraToastIcon.png",
ImageColor3 = TOAST_FOREGROUND_COLOR,
ImageTransparency = 1,
}
},
create("Frame"){
Name = "TextBuffer",
BackgroundTransparency = 1,
BorderSizePixel = 0,
Position = UDim2.new(0, 80, 0, 0),
Size = UDim2.new(1, -80, 1, 0),
ClipsDescendants = true,
create("TextLabel"){
Name = "Upper",
AnchorPoint = Vector2.new(0, 1),
BackgroundTransparency = 1,
Position = UDim2.new(0, 0, 0.5, 0),
Size = UDim2.new(1, 0, 0, 19),
Font = Enum.Font.GothamSemibold,
Text = "Camera control enabled",
TextColor3 = TOAST_FOREGROUND_COLOR,
TextTransparency = 1,
TextSize = 19,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Center,
},
create("TextLabel"){
Name = "Lower",
AnchorPoint = Vector2.new(0, 0),
BackgroundTransparency = 1,
Position = UDim2.new(0, 0, 0.5, 3),
Size = UDim2.new(1, 0, 0, 15),
Font = Enum.Font.Gotham,
Text = "Right mouse button to toggle",
TextColor3 = TOAST_FOREGROUND_COLOR,
TextTransparency = 1,
TextSize = 15,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Center,
},
},
},
Parent = PlayerGui,
}
toast = uiRoot.Toast
toastIcon = toast.IconBuffer.Icon
toastUpperText = toast.TextBuffer.Upper
toastLowerText = toast.TextBuffer.Lower
initialized = true
end
local CameraUI = {}
do
-- Instantaneously disable the toast or enable for opening later on. Used when switching camera modes.
function CameraUI.setCameraModeToastEnabled(enabled: boolean)
if not enabled and not initialized then
return
end
if not initialized then
initializeUI()
end
toast.Visible = enabled
if not enabled then
CameraUI.setCameraModeToastOpen(false)
end
end
local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
-- Tween the toast in or out. Toast must be enabled with setCameraModeToastEnabled.
function CameraUI.setCameraModeToastOpen(open: boolean)
assert(initialized)
TweenService:Create(toast, tweenInfo, {
Size = open and TOAST_OPEN_SIZE or TOAST_CLOSED_SIZE,
ImageTransparency = open and TOAST_BACKGROUND_TRANS or 1,
}):Play()
TweenService:Create(toastIcon, tweenInfo, {
ImageTransparency = open and TOAST_FOREGROUND_TRANS or 1,
}):Play()
TweenService:Create(toastUpperText, tweenInfo, {
TextTransparency = open and TOAST_FOREGROUND_TRANS or 1,
}):Play()
TweenService:Create(toastLowerText, tweenInfo, {
TextTransparency = open and TOAST_FOREGROUND_TRANS or 1,
}):Play()
end
end
return CameraUI
|
-- b1.BrickColor = BrickColor.new("Pearl")
-- b1.Material = Enum.Material.SmoothPlastic
|
end
if ((not right) and (not hazards) and (not brake)) then
b2.BrickColor = BrickColor.new("Pearl")
b2.Material = Enum.Material.SmoothPlastic
else
|
-- Made by Crozur
|
script.Parent.BillboardGui.Enabled = false
game.Players.PlayerAdded:Connect(function(plr)
if plr.Name == ("Owner Of Game") then -- Insert your name in between the ""
wait(3) -- waits just in case player isn't loaded
script.Parent.BillboardGui.Enabled = true -- makes it visible
script.Parent.BillboardGui.Parent = plr.Character.Head -- Puts the title above your head, you can change the offset under BillboardGui.StudsOffset
end
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.