prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[Weight and CG]]
|
Tune.Weight = 3500 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 100 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = 1 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- if UIS.TouchEnabled then
-- local part, pos, norm, mat = MiddleScreenRay()
-- Rep.Relay.VoodooSpell:FireServer(pos)
-- else
-- local part, pos, norm, mat = CursorRay()
-- Rep.Relay.VoodooSpell:FireServer(pos)
-- Rep.Relay.VoodooSpell:FireServer(pos)
-- end
| |
--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
|
function ConvertKey(Key)
if Key == string.char(8) then
return "BKSPCE"
elseif Key == string.char(9) then
return "TAB"
elseif Key == string.char(13) then
return "ENTER"
elseif Key == string.char(17) then
return "UP"
elseif Key == string.char(18) then
return "DOWN"
elseif Key == string.char(19) then
return "RIGHT"
elseif Key == string.char(20) then
return "LEFT"
elseif Key == string.char(22) then
return "HOME"
elseif Key == string.char(23) then
return "END"
elseif Key == string.char(27) then
return "F2"
elseif Key == string.char(29) then
return "F4"
elseif Key == string.char(30) then
return "F5"
elseif Key == string.char(32) or Key == " " then
return "F7"
elseif Key == string.char(33) or Key == "!" then
return "F8"
elseif Key == string.char(34) or Key == '"' then
return "F9"
elseif Key == string.char(35) or Key == "#" then
return "F10"
elseif Key == string.char(37) or Key == "%" then
return "F12"
elseif Key == string.char(47) or Key == "/" then
return "R-SHIFT"
elseif Key == string.char(48) or Key == "0" then
return "L-SHIFT"
elseif Key == string.char(49) or Key == "1" then
return "R-CTRL"
elseif Key == string.char(50) or Key == "2" then
return "L-CTRL"
elseif Key == string.char(51) or Key == "3" then
return "R-ALT"
elseif Key == string.char(52) or Key == "4" then
return "L-ALT"
else
return string.upper(Key)
end
end
function CreateControlFrame(Key, Desc, Num)
local Controls = Gui_Clone:WaitForChild("HUD"):WaitForChild("Controls")
local C = Instance.new("Frame")
C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
C.BorderSizePixel = 0
C.Name = "C"..Num
C.Position = UDim2.new(0, 0, 0, Num * 20)
C.Size = UDim2.new(1, 0, 0, 20)
local K = Instance.new("TextLabel")
K.BackgroundTransparency = 1
K.Name = "Key"
K.Size = UDim2.new(0, 45, 1, 0)
K.Font = Enum.Font.ArialBold
K.FontSize = Enum.FontSize.Size14
K.Text = Key
K.TextColor3 = Color3.new(1, 1, 1)
K.TextScaled = (string.len(Key) > 5)
K.TextWrapped = (string.len(Key) > 5)
K.Parent = C
local D = Instance.new("TextLabel")
D.BackgroundTransparency = 1
D.Name = "Desc"
D.Position = UDim2.new(0, 50, 0, 0)
D.Size = UDim2.new(1, -50, 1, 0)
D.Font = Enum.Font.ArialBold
D.FontSize = Enum.FontSize.Size14
D.Text = "- "..Desc
D.TextColor3 = Color3.new(1, 1, 1)
D.TextXAlignment = Enum.TextXAlignment.Left
D.Parent = C
C.Parent = Controls
end
function SetUpGui()
local HUD = Gui_Clone:WaitForChild("HUD")
local Scope = Gui_Clone:WaitForChild("Scope")
local Grenades = HUD:WaitForChild("Grenades")
local Controls = HUD:WaitForChild("Controls")
local CurrentNum = 1
if S.CanChangeStance then
local Dive = (S.DolphinDive and " / Dive" or "")
CreateControlFrame(ConvertKey(S.LowerStanceKey), "Lower Stance"..Dive, CurrentNum)
CurrentNum = CurrentNum + 1
CreateControlFrame(ConvertKey(S.RaiseStanceKey), "Raise Stance", CurrentNum)
CurrentNum = CurrentNum + 1
end
CreateControlFrame(ConvertKey(S.ReloadKey), "Reload", CurrentNum)
CurrentNum = CurrentNum + 1
if S.CanKnife then
CreateControlFrame(ConvertKey(S.KnifeKey), "Knife", CurrentNum)
CurrentNum = CurrentNum + 1
end
if S.Throwables then
CreateControlFrame(ConvertKey(S.LethalGrenadeKey), "Throw Lethal", CurrentNum)
CurrentNum = CurrentNum + 1
CreateControlFrame(ConvertKey(S.TacticalGrenadeKey), "Throw Tactical", CurrentNum)
CurrentNum = CurrentNum + 1
end
CreateControlFrame(ConvertKey(S.SprintKey), "Sprint", CurrentNum)
CurrentNum = CurrentNum + 1
if S.ADSKey ~= "" then
local Hold = (S.HoldMouseOrKeyToADS and "HOLD " or "")
CreateControlFrame(Hold..ConvertKey(S.ADSKey).." OR R-MOUSE", "Aim Down Sights", CurrentNum)
CurrentNum = CurrentNum + 1
end
Controls.Size = UDim2.new(1, 0, 0, CurrentNum * 20)
Controls.Position = UDim2.new(0, 0, 0, -(CurrentNum * 20) - 80)
if S.GuiScope then
Scope:WaitForChild("Img").Image = S.GuiId
Scope:WaitForChild("Steady").Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
end
HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Icon").Image = LethalIcons[S.LethalGrenadeType]
HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Icon").Image = TacticalIcons[S.TacticalGrenadeType]
end
|
--Serverside logic
|
Event.OnServerEvent:Connect(function(player,ExhaustParticle,FireBool)
print("ExhaustParticle")
if FireBool then
local RanNum = tostring(math.random(1,3))
ExhaustPart["Backfire"..RanNum]:Play()
ExhaustPart.PointLight.Enabled = true
ExhaustPart[ExhaustParticle].Enabled = true
if ExhaustParticle == "FlamesSmall" then
ExhaustPart.PointLight.Range = 6
ExhaustPart.PointLight.Brightness = 5
ExhaustPart.Sparks.Enabled = false
else
ExhaustPart.PointLight.Range = 8
ExhaustPart.PointLight.Brightness = 12
ExhaustPart.Sparks.Enabled = true
end
else
ExhaustPart[ExhaustParticle].Enabled = false
ExhaustPart.PointLight.Enabled = false
end
end)
|
--[=[
@function difference
@within Set
@param set Set<V> -- The set to compare.
@param ... ...Set<V> -- The sets to compare against.
@return Set<V> -- The difference between the sets.
Returns a set of values that are in the first set, but not in the other sets.
```lua
local set1 = { hello = true, world = true }
local set2 = { cat = true, dog = true, hello = true }
local difference = Difference(set1, set2) -- { world = true }
```
]=]
|
local function difference<V>(set: T.Set<V>, ...: T.Set<V>): T.Set<V>
local diff = table.clone(set)
for _, nextSet in { ... } do
if typeof(nextSet) ~= "table" then
continue
end
for value in nextSet do
diff[value] = nil
end
end
return diff
end
return difference
|
--Interior
|
local INT_PCK = nil
for i,v in pairs(misc:GetDescendants()) do
if v:IsA("ObjectValue") and v.Name == "INTERIOR_PACK" then INT_PCK = v.Value end
end
if INT_PCK then
if INT_PCK:FindFirstChild("Handbrake") then
local HB = INT_PCK.Handbrake
MakeWeld(HB.W,car.DriveSeat,"Motor",0.1)
ModelWeld(HB.Parts,HB.W)
ModelWeld(HB.Misc,car.DriveSeat)
end
if INT_PCK:FindFirstChild("Paddle_Shifter") then
local PS = INT_PCK.Paddle_Shifter
MakeWeld(PS.L,car.DriveSeat,"Motor",0.1)
ModelWeld(PS.Left,PS.L)
MakeWeld(PS.R,car.DriveSeat,"Motor",0.1)
ModelWeld(PS.Right,PS.R)
end
if INT_PCK:FindFirstChild("Pedals") then
local PD = INT_PCK.Pedals
MakeWeld(PD.B,car.DriveSeat,"Motor",0.1)
ModelWeld(PD.Brake,PD.B)
MakeWeld(PD.C,car.DriveSeat,"Motor",0.1)
ModelWeld(PD.Clutch,PD.C)
MakeWeld(PD.T,car.DriveSeat,"Motor",0.1)
ModelWeld(PD.Throttle,PD.T)
end
if INT_PCK:FindFirstChild("Shifter") then
local SH = INT_PCK.Shifter
MakeWeld(SH.Hinge,car.DriveSeat,"Weld")
MakeWeld(SH.W1,SH.Hinge,"Motor",0.05)
MakeWeld(SH.W2,SH.W1,"Motor",0.05)
ModelWeld(SH.Parts,SH.W2)
ModelWeld(SH.Misc,car.DriveSeat)
end
if INT_PCK:FindFirstChild("Steering_Wheel") then
local SW = INT_PCK.Steering_Wheel
MakeWeld(SW.W,car.DriveSeat,"Motor",0.5)
ModelWeld(SW.Parts,SW.W)
end
end
|
-- Check if the tool exists in the workspace
|
if tool and tool:IsA("Tool") then
local player = game.Players.LocalPlayer
local chatService = game:GetService("Chat")
-- Listen for chat messages
chatService.ChatAdded:Connect(function(message)
local lowerMessage = string.lower(message.Message)
-- Check if the chat message contains "the guy"
if string.find(lowerMessage, "the guy") then
-- Check if the player already has the tool in their backpack
if not player.Backpack:FindFirstChild(toolName) then
-- Clone the tool and add it to the player's backpack
local toolClone = tool:Clone()
toolClone.Parent = player.Backpack
end
end
end)
end
|
--Pre-Toggled PBrake
|
if math.abs(Front.Axle.HingeConstraint.MotorMaxTorque-PBrakeForce)<1 then _PBrake=true end
|
-- Manually call OnTouched for parts the rocket might have spawned inside of
--TODO: Remove when Touched correctly fires for parts spawned within other parts
|
local partClone = Rocket:Clone()
partClone:ClearAllChildren()
partClone.Transparency = 1
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.Batarang -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--short-cuts
|
bin = script.Parent
hurt = bin.Hurt
punchload = false
|
--- Shallow merges two lists without modifying either
-- @tparam table orig original table
-- @tparam table new new table
-- @treturn table
|
function Table.mergeLists(orig, new)
local _table = {}
for _, val in pairs(orig) do
table.insert(_table, val)
end
for _, val in pairs(new) do
table.insert(_table, val)
end
return _table
end
|
-- Compiled with roblox-ts v1.3.3
|
local TS = _G[script]
local exports = {}
for _k, _v in pairs(TS.import(script, script, "classes", "Queue") or {}) do
exports[_k] = _v
end
for _k, _v in pairs(TS.import(script, script, "classes", "Stack") or {}) do
exports[_k] = _v
end
return exports
|
--[[
VRCamera - Roblox VR camera control module
2021 Roblox VR
--]]
| |
-- Customized explosive effect that doesn't affect teammates and only breaks joints on dead parts
|
local function OnExplosionHit(hitPart, hitDistance, blastCenter)
if hitPart and hitDistance then
local character, humanoid = FindCharacterAncestor(hitPart.Parent)
if humanoid and humanoid.Health > 0 then -- Humanoids are tagged and damaged
if hitPart.Name == 'Torso' then
--ApplyTags(humanoid)
DamageTag(character,BLAST_DAMAGE)
--humanoid:TakeDamage(BLAST_DAMAGE)
end
end
end
end
local function OnTouched(otherPart,RayPos)
if Rocket and otherPart then
-- Fly through anything in the ignore list
if IGNORE_LIST[string.lower(otherPart.Name)] then
return
end
local myPlayer = CreatorTag.Value
if myPlayer then
-- Fly through the creator
if myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
return
end
-- Fly through friendlies
if not myPlayer.Neutral then
local character = FindCharacterAncestor(otherPart.Parent)
local player = PlayersService:GetPlayerFromCharacter(character)
if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
return
end
end
end
-- Fly through terrain water
if otherPart == Workspace.Terrain then
--NOTE: If the rocket is large, then the simplifications made here will cause it to fly through terrain in some cases
local frontOfRocket = Rocket.Position + (Rocket.CFrame.lookVector * (Rocket.Size.Z / 2))
local cellLocation = Workspace.Terrain:WorldToCellPreferSolid(frontOfRocket)
local cellMaterial = Workspace.Terrain:GetCell(cellLocation.X, cellLocation.Y, cellLocation.Z)
if cellMaterial == Enum.CellMaterial.Water or cellMaterial == Enum.CellMaterial.Empty then
return
end
end
Rocket.Transparency = 1
Rocket.CFrame = CFrame.new(RayPos.X,RayPos.Y,RayPos.Z)
-- Create the explosion
local explosion = Instance.new('Explosion')
explosion.BlastPressure = 500000 -- Completely safe explosion
explosion.BlastRadius = BLAST_RADIUS
explosion.DestroyJointRadiusPercent = 0
explosion.ExplosionType = Enum.ExplosionType.NoCraters
explosion.Position = Rocket.Position
explosion.Parent = game.Players.LocalPlayer.Character.Torso
-- Connect custom logic for the explosion
explosion.Hit:connect(function(hitPart, hitDistance) OnExplosionHit(hitPart, hitDistance, explosion.Position) end)
ypcall(function()
for i = 1, 3 do
ExplodeClone = Explode:clone()
ExplodeClone.Position = Rocket.Position
ExplodeClone.Mesh.Scale = Vector3.new(5,5,5)*5
ExplodeClone.CFrame = ExplodeClone.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-10000,10000)/100,math.random(-10000,10000)/100,math.random(-10000,10000)/100)
ExplodeClone.Parent = game.Players.LocalPlayer.Character.Torso
NewScript = Rocket.Script:clone()
NewScript.Disabled = false
NewScript.Parent = ExplodeClone
end
end)
-- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket
script.Parent = explosion
CreatorTag.Parent = script
Rocket:Destroy()
end
end
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 25
local slash_damage = 50
local lunge_damage = 100
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
if (hit.Parent == nil) then return end -- happens when bullet hits sword
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,0,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.15)
swordOut()
wait(.15)
force.Parent = nil
wait(.15)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(0.083, -0.997, 1)
Tool.GripRight = Vector3.new(0.997, 0.083, 0)
Tool.GripUp = Vector3.new(0, 0, -1)
end
function swordOut()
Tool.GripForward = Vector3.new(0.083, -0.997, -0)
Tool.GripRight = Vector3.new(0.997, 0.083, 0)
Tool.GripUp = Vector3.new(0, 0, -1)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--Repilee 4/21/19
--This script will make any player who is sitting in the car will remove muffle.
|
local body = script.CarSeat.Value
wait(.1)
body.Parent.DriveSeat.Values.MusicVolume.Changed:Connect(function()
body.MP.Sound.Volume = body.Parent.DriveSeat.Values.MusicVolume.Value
end)
body.MP.Sound.Volume = body.Parent.DriveSeat.Values.MusicVolume.Value
body.MP.OutsideSound.Volume = 0
body.MP.OutsideSound.Changed:Connect(function(val)
if val == "Volume" then
--body.MP.Sound.Volume = body.Parent.DriveSeat.Values.MusicVolume.Value
body.MP.OutsideSound.Volume = 0 --prevents muffle
|
-- ALEX WAS HERE LOL
|
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local u2
u2 = {
HasAccess = function(p1, p2)
if not u1.Saving.Get(p1) then
return false;
end;
local v1 = u1.Directory.Worlds[p2];
if not v1 then
return false;
end;
local l__requiredArea__2 = v1.requiredArea;
if l__requiredArea__2 and not u2.HasArea(p1, l__requiredArea__2) then
return false;
end;
return true;
end
};
local l____WORLDS__3 = game.ServerStorage:WaitForChild("__WORLDS");
function u2.Load(p3, p4)
if p3 then
local v3 = u1.Saving.Get(p3);
local l__PlayerGui__4 = p3:FindFirstChild("PlayerGui");
if v3 and l__PlayerGui__4 then
local v5 = u1.Directory.Worlds[p4];
if not v5 or v5.disabled then
print("Tried to load world " .. p4 .. ", doesn't exist", true);
p4 = "Spawn";
end;
if not u1.Shared.IsTradingPlaza and p4 == "Trading Plaza" then
p4 = "Spawn";
elseif u1.Shared.IsTradingPlaza then
p4 = "Trading Plaza";
end;
if not u2.HasAccess(p3, p4) then
print("Changing " .. p3.Name .. "'s world to Spawn because requested world is locked");
p4 = "Spawn";
end;
if p4 == 'Void' and not v3.HackerPortalUnlocked then
print("Changing " .. p3.Name .. "'s world to Spawn because he does not have the hacker portal unlocked");
p4 = "Spawn";
end
if p4 == "Fantasy" then
coroutine.wrap(function()
wait(3);
if not u2.HasArea(p3, "Enchanted Forest") then
u2.GiveArea(p3, "Enchanted Forest");
u2.GiveArea(p3, "Fantasy Shop");
u1.Achievements.Add(p3, "Unlock Fantasy", 1);
end;
end)();
elseif p4 == "Tech" then
coroutine.wrap(function()
wait(3);
if not u2.HasArea(p3, "Tech City") then
u2.GiveArea(p3, "Tech City");
u2.GiveArea(p3, "Tech Shop");
u1.Achievements.Add(p3, "Unlock Tech", 1);
end;
end)();
elseif p4 == 'Secret' then
coroutine.wrap(function()
wait(3);
u2.GiveArea(p3, "Cat");
end)();
elseif p4 == "Trading Plaza" then
coroutine.wrap(function()
wait(3);
u2.GiveArea(p3, "Plaza Presents");
u1.Achievements.Add(p3, "Join Trading Plaza", 1);
end)();
elseif p4 == "Halloween Event" then
coroutine.wrap(function()
wait(3);
u2.GiveArea(p3, "Halloween");
u1.Achievements.Add(p3, "Halloween 2021", 1);
end)();
elseif p4 == "Christmas Event" then
coroutine.wrap(function()
wait(3);
u2.GiveArea(p3, "Christmas");
u1.Achievements.Add(p3, "Christmas 2021", 1);
end)();
elseif p4 == "Void" then
coroutine.wrap(function()
wait(3);
if not u2.HasArea(p3, "The Void") then
u2.GiveArea(p3, "The Void");
u1.Achievements.Add(p3, "Unlock Void", 1);
end;
end)();
elseif p4 == "Axolotl Ocean" then
coroutine.wrap(function()
wait(3);
if not u2.HasArea(p3, "Axolotl Ocean") then
u2.GiveArea(p3, "Axolotl Ocean");
u1.Achievements.Add(p3, "Unlock Axolotl Ocean", 1);
end;
end)();
elseif p4 == "Pixel" then
coroutine.wrap(function()
wait(3);
if not u2.HasArea(p3, "Pixel Forest") then
u2.GiveArea(p3, "Pixel Forest");
u1.Achievements.Add(p3, "Unlock Pixel World", 1);
end;
end)();
end;
local v6 = l____WORLDS__3:FindFirstChild(p4):Clone();
v6.Name = "__MAP";
v6.Parent = l__PlayerGui__4;
v3.World = p4;
u1.Signal.Fire("World Changed", p3, p4);
end;
end;
end;
function u2.GetNetworkList(p5)
local v7 = {};
for v8, v9 in ipairs(game.Players:GetPlayers()) do
local v10 = u1.Saving.Get(v9);
if v10 and p5 == v10.World then
table.insert(v7, v9);
end;
end;
return v7;
end;
function u2.HasArea(p6, p7)
local v11 = u1.Saving.Get(p6);
if v11 and u1.Functions.SearchDictionary(v11.AreasUnlocked, p7) then
return true;
end;
return false;
end;
function u2.GiveArea(p8, p9)
local v12 = u1.Saving.Get(p8);
if not v12 or not (not u2.HasArea(p8, p9)) then
return;
end;
table.insert(v12.AreasUnlocked, p9);
return true;
end;
u1.Network.Fired('Request World'):Connect(u2.Load)
return u2;
|
--[[
Enjin | Novena
RikOne2 | Avxnturador
Bike Chassis
*We assume you know what you're doing if you're gonna change something here.* ]]
|
--
|
--Sound variables
|
local runningSound = head:WaitForChild("Running")
local jumpingSound = head:WaitForChild("Jumping")
local diedSound = head:WaitForChild("Died")
human.Running:Connect(function(speed)
if speed>0 then
runningSound:Play()
else
runningSound:Stop()
end
end)
human.Jumping:Connect(function()
jumpingSound:Play()
end)
human.Died:Connect(function()
diedSound:Play()
end)
|
--[[ Roblox Services ]]
|
--
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
|
--[[
The Pathfinder-class manages all pathfinding done for the Runner (parent) module.
--]]
| |
--//2nd//--
|
if script.Parent.CarSeat.Gear.Value == 2 then
if GEAR.Value == 2 then
if Wrpm.Value*(Gear2/FinalDrive)*100 < Idle then
rpm.Value = Idle
else
rpm.Value = Wrpm.Value*(Gear2/FinalDrive)*100
end
if Wrpm.Value*(Gear2/FinalDrive)*100 >= RPMLimiter then
rwd.Torque = 0
else
if script.Parent.Control.Throttle.Computer.Value == 0 and script.Parent.CarSeat.CC.Value == false then
rwd.Torque = 0.2
else
if (((rpm.Value/10000)-((sconfig*rpm.Value)/10000)^4.8)*hp/(config*size)) < ((Gear2/FinalDrive)*(hp/650))*scale then
rwd.Torque = (((Gear2/FinalDrive)*(hp/650))*scale)*th.Value
else
rwd.Torque =
(((rpm.Value/10000)-((sconfig*rpm.Value)/10000)^4.8)*hp/(config*size))*th.Value
end
end
end
end
end if script.Parent.CarSeat.Gear.Value == 3 then
|
--!nonstrict
--[[
OrbitalCamera - Spherical coordinates control camera for top-down games
2018 Camera Update - AllYourBlox
--]]
| |
--[[Engine (Avxnturador)]]
|
-- Everything below can be illustrated and tuned with the graph below.
-- https://www.desmos.com/calculator/oishj9m1tq
-- This includes everything, from the engines, to boost, to electric.
-- To import engines prior to AC6C V1.3, consult the README.
-- Naturally Aspirated Engine
Tune.Engine = true
Tune.Horsepower = 500
Tune.IdleRPM = 750
Tune.PeakRPM = 6800
Tune.Redline = 8000
Tune.EqPoint = 5252
Tune.PeakSharpness = 10
Tune.CurveMult = 0.4
-- Electric Engine
Tune.Electric = false
Tune.E_Redline = 12700
Tune.E_Trans1 = 4000
Tune.E_Trans2 = 7000
-- Horsepower
Tune.E_Horsepower = 223
Tune.EH_FrontMult = 0.15
Tune.EH_EndMult = 2.9
Tune.EH_EndPercent = 7
-- Torque
Tune.E_Torque = 286
Tune.ET_EndMult = 1.505
Tune.ET_EndPercent = 27.5
-- Turbocharger
Tune.Turbochargers = 1 -- Number of turbochargers in the engine
-- Set to 0 for no turbochargers
Tune.T_Boost = 7
Tune.T_Efficiency = 8.5
Tune.T_Size = 80 -- Turbo Size; Bigger size = more turbo lag
-- Supercharger
Tune.Superchargers = 1 -- Number of superchargers in the engine
-- Set to 0 for no superchargers
Tune.S_Boost = 7
Tune.S_Efficiency = 8.5
Tune.S_Sensitivity = 0.05 -- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1)
--Misc
Tune.ThrotAccel = .05 -- Throttle acceleration, applied per tick (recommended values between 0.05 to 0.1)
Tune.ThrotDecel = .2 -- Throttle deceleration, applied per tick (recommended values between 0.1 to 0.3)
Tune.BrakeAccel = .2 -- Brake acceleration, applied per tick
Tune.BrakeDecel = .5 -- Brake deceleration, applied per tick
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.Flywheel = 500 -- Flywheel weight (higher = faster response, lower = more stable RPM)
Tune.InclineComp = 1 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
|
--// Declarables
|
local L_15_ = false
local L_16_ = false
local L_17_ = true
local L_18_ = L_1_:WaitForChild('Resource')
local L_19_ = L_18_:WaitForChild('FX')
local L_20_ = L_18_:WaitForChild('Events')
local L_21_ = L_18_:WaitForChild('HUD')
local L_22_ = L_18_:WaitForChild('Modules')
local L_23_ = L_18_:WaitForChild('SettingsModule')
local L_24_ = require(L_23_:WaitForChild("ClientConfig"))
local L_25_ = L_18_:WaitForChild('Vars')
local L_26_
local L_27_
local L_28_
local L_29_
local L_30_
local L_31_
local L_32_
local L_33_
local L_34_
local L_35_
local L_36_
local L_37_
local L_38_
local L_39_
local L_40_
local L_41_
local L_42_
local L_43_
local L_44_
local L_45_
local L_46_
local L_47_
local L_48_
local L_49_
local L_50_ = L_24_.AimZoom
local L_51_ = L_24_.MouseSensitivity
local L_52_ = L_12_.MouseDeltaSensitivity
|
--------------------------------CUSTOMIZABLE STUFF------------------------------------
|
local resetcooldown = 300 -- how long it takes to let you rob again.
local timetodrill = 20 -- how long it takes to drill a deposit box
|
--[[--------------------------------------------------------------------
-- state needed to generate code for a given function
-- struct FuncState:
-- f -- current function header (table: Proto)
-- h -- table to find (and reuse) elements in 'k' (table: Table)
-- prev -- enclosing function (table: FuncState)
-- ls -- lexical state (table: LexState)
-- L -- copy of the Lua state (table: lua_State)
-- bl -- chain of current blocks (table: BlockCnt)
-- pc -- next position to code (equivalent to 'ncode')
-- lasttarget -- 'pc' of last 'jump target'
-- jpc -- list of pending jumps to 'pc'
-- freereg -- first free register
-- nk -- number of elements in 'k'
-- np -- number of elements in 'p'
-- nlocvars -- number of elements in 'locvars'
-- nactvar -- number of active local variables
-- upvalues[LUAI_MAXUPVALUES] -- upvalues (table: upvaldesc)
-- actvar[LUAI_MAXVARS] -- declared-variable stack
----------------------------------------------------------------------]]
| |
--The server will fire the ExitSeat remote to the client when the humanoid has been removed from a seat.
--This script listens to that and uses it to prevent the humanoid tripping when exiting a seat.
--As the player is removed from the seat server side, this scripts listens to the event instead of being
-- inside the ExitSeat function so that:
-- A) The timing is right - the exit seat function will run before the character is unsat by the server
-- B) If a server script removes the player from a seat, the anti-trip will still run
|
local function antiTrip()
local humanoid = getLocalHumanoid()
if humanoid then
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end
Remotes.ExitSeat.OnClientEvent:Connect(function(doAntiTrip)
for _, func in pairs(module.OnExitFunctions) do
func(nil)
end
if doAntiTrip then
antiTrip()
end
end)
|
-- functions
|
function onRunning(speed)
if isSeated then return end
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
isSeated = false
pose = "Jumping"
end
function onClimbing()
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
isSeated = true
pose = "Seated"
print("Seated")
end
function moveJump()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1
LeftShoulder.DesiredAngle = -1
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveClimb()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0.78
LeftShoulder.DesiredAngle = -0.78
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveSit()
print("Move Sit")
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = 3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end
function getTool()
kidTable = Figure:children()
if (kidTable ~= nil) then
numKids = #kidTable
for i=1,numKids do
if (kidTable[i].className == "Tool") then return kidTable[i] end
end
end
return nil
end
function getToolAnim(tool)
c = tool:children()
for i=1,#c do
if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
return c[i]
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
RightShoulder.DesiredAngle = 1.57
return
end
if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0.78
return
end
if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Climbing") then
moveClimb()
return
end
if (pose == "Seated") then
moveSit()
return
end
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
if (pose == "Running") then
amplitude = 0.4
frequency = 9
else
amplitude = 0.1
frequency = 1
end
desiredAngle = amplitude * math.sin(time*frequency)
RightShoulder.DesiredAngle = 1.57
LeftShoulder.DesiredAngle = -1.57
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
local tool = getTool()
if tool ~= nil then
animStringValueObject = getToolAnim(tool)
if animStringValueObject ~= nil then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
-- Want to turn off Invisicam? Be sure to call this after.
|
function Invisicam:Cleanup()
for hit, originalFade in pairs(self.savedHits) do
hit.LocalTransparencyModifier = originalFade
end
end
function Invisicam:Update(dt, desiredCameraCFrame, desiredCameraFocus)
-- Bail if there is no Character
if not self.enabled or not self.char then
return desiredCameraCFrame, desiredCameraFocus
end
self.camera = game.Workspace.CurrentCamera
-- TODO: Move this to a GetHumanoidRootPart helper, probably combine with CheckTorsoReference
-- Make sure we still have a HumanoidRootPart
if not self.humanoidRootPart then
local humanoid = self.char:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.RootPart then
self.humanoidRootPart = humanoid.RootPart
else
-- Not set up with Humanoid? Try and see if there's one in the Character at all:
self.humanoidRootPart = self.char:FindFirstChild("HumanoidRootPart")
if not self.humanoidRootPart then
-- Bail out, since we're relying on HumanoidRootPart existing
return desiredCameraCFrame, desiredCameraFocus
end
end
-- TODO: Replace this with something more sensible
local ancestryChangedConn
ancestryChangedConn = self.humanoidRootPart.AncestryChanged:Connect(function(child, parent)
if child == self.humanoidRootPart and not parent then
self.humanoidRootPart = nil
if ancestryChangedConn and ancestryChangedConn.Connected then
ancestryChangedConn:Disconnect()
ancestryChangedConn = nil
end
end
end)
end
if not self.torsoPart then
self:CheckTorsoReference()
if not self.torsoPart then
-- Bail out, since we're relying on Torso existing, should never happen since we fall back to using HumanoidRootPart as torso
return desiredCameraCFrame, desiredCameraFocus
end
end
-- Make a list of world points to raycast to
local castPoints = {}
self.behaviorFunction(self, castPoints)
-- Cast to get a list of objects between the camera and the cast points
local currentHits = {}
local ignoreList = {self.char}
local function add(hit)
currentHits[hit] = true
if not self.savedHits[hit] then
self.savedHits[hit] = hit.LocalTransparencyModifier
end
end
local hitParts
local hitPartCount = 0
-- Hash table to treat head-ray-hit parts differently than the rest of the hit parts hit by other rays
-- head/torso ray hit parts will be more transparent than peripheral parts when USE_STACKING_TRANSPARENCY is enabled
local headTorsoRayHitParts = {}
local partIsTouchingCamera = {}
local perPartTransparencyHeadTorsoHits = TARGET_TRANSPARENCY
local perPartTransparencyOtherHits = TARGET_TRANSPARENCY
if USE_STACKING_TRANSPARENCY then
-- This first call uses head and torso rays to find out how many parts are stacked up
-- for the purpose of calculating required per-part transparency
local headPoint = self.headPart and self.headPart.CFrame.p or castPoints[1]
local torsoPoint = self.torsoPart and self.torsoPart.CFrame.p or castPoints[2]
hitParts = self.camera:GetPartsObscuringTarget({headPoint, torsoPoint}, ignoreList)
-- Count how many things the sample rays passed through, including decals. This should only
-- count decals facing the camera, but GetPartsObscuringTarget does not return surface normals,
-- so my compromise for now is to just let any decal increase the part count by 1. Only one
-- decal per part will be considered.
for i = 1, #hitParts do
local hitPart = hitParts[i]
hitPartCount = hitPartCount + 1 -- count the part itself
headTorsoRayHitParts[hitPart] = true
for _, child in pairs(hitPart:GetChildren()) do
if child:IsA('Decal') or child:IsA('Texture') then
hitPartCount = hitPartCount + 1 -- count first decal hit, then break
break
end
end
end
if (hitPartCount > 0) then
perPartTransparencyHeadTorsoHits = math.pow( ((0.5 * TARGET_TRANSPARENCY) + (0.5 * TARGET_TRANSPARENCY / hitPartCount)), 1 / hitPartCount )
perPartTransparencyOtherHits = math.pow( ((0.5 * TARGET_TRANSPARENCY_PERIPHERAL) + (0.5 * TARGET_TRANSPARENCY_PERIPHERAL / hitPartCount)), 1 / hitPartCount )
end
end
-- Now get all the parts hit by all the rays
hitParts = self.camera:GetPartsObscuringTarget(castPoints, ignoreList)
local partTargetTransparency = {}
-- Include decals and textures
for i = 1, #hitParts do
local hitPart = hitParts[i]
partTargetTransparency[hitPart] =headTorsoRayHitParts[hitPart] and perPartTransparencyHeadTorsoHits or perPartTransparencyOtherHits
-- If the part is not already as transparent or more transparent than what invisicam requires, add it to the list of
-- parts to be modified by invisicam
if hitPart.Transparency < partTargetTransparency[hitPart] then
add(hitPart)
end
-- Check all decals and textures on the part
for _, child in pairs(hitPart:GetChildren()) do
if child:IsA('Decal') or child:IsA('Texture') then
if (child.Transparency < partTargetTransparency[hitPart]) then
partTargetTransparency[child] = partTargetTransparency[hitPart]
add(child)
end
end
end
end
-- Invisibilize objects that are in the way, restore those that aren't anymore
for hitPart, originalLTM in pairs(self.savedHits) do
if currentHits[hitPart] then
-- LocalTransparencyModifier gets whatever value is required to print the part's total transparency to equal perPartTransparency
hitPart.LocalTransparencyModifier = (hitPart.Transparency < 1) and ((partTargetTransparency[hitPart] - hitPart.Transparency) / (1.0 - hitPart.Transparency)) or 0
else -- Restore original pre-invisicam value of LTM
hitPart.LocalTransparencyModifier = originalLTM
self.savedHits[hitPart] = nil
end
end
-- Invisicam does not change the camera values
return desiredCameraCFrame, desiredCameraFocus
end
return Invisicam
|
--------| Variables |--------
|
local cachedProductInfo = {}
|
--Protected Turn 2--: Standard GYR with a protected turn for two signal directions on the same road
|
--USES: Signal1, Signal1a, Signal2, Signal2a(Optional), Turn1, Turn1a
while true do
PedValues = script.Parent.Parent.PedValues
SignalValues = script.Parent.Parent.SignalValues
TurnValues = script.Parent.Parent.TurnValues
|
--[=[
Destroys the ClientRemoteProperty object.
]=]
|
function ClientRemoteProperty:Destroy()
self._rs:Destroy()
if self._readyPromise then
self._readyPromise:cancel()
end
if self._changed then
self._changed:Disconnect()
end
self.Changed:Destroy()
end
return ClientRemoteProperty
|
--[[
Recalculates this Computed's cached value and dependencies.
Returns true if it changed, or false if it's identical.
]]
|
function class:update()
-- remove this object from its dependencies' dependent sets
for dependency in self.dependencySet do
dependency.dependentSet[self] = nil
end
-- we need to create a new, empty dependency set to capture dependencies
-- into, but in case there's an error, we want to restore our old set of
-- dependencies. by using this table-swapping solution, we can avoid the
-- overhead of allocating new tables each update.
self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet
table.clear(self.dependencySet)
local ran, newValue, newMetatable = Dependencies.captureDependencies(self.dependencySet, self._processor)
if ran then
if not self._destructor and utility.needsDestruction(newValue) then
warn("destructorNeededComputed")
end
if newMetatable then
warn("multiReturnComputed")
end
local value = self._value
if self._destructor then
self._destructor(value)
end
self._value = newValue
-- add this object to the dependencies' dependent sets
for dependency in self.dependencySet do
dependency.dependentSet[self] = true
end
return not utility.isSimilar(value, newValue)
else
-- this needs to be non-fatal, because otherwise it'd disrupt the
-- update process
warn("computedCallbackError", newValue)
-- restore old dependencies, because the new dependencies may be corrupt
self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet
-- restore this object in the dependencies' dependent sets
for dependency in self.dependencySet do
dependency.dependentSet[self] = true
end
return false
end
end
return Computed
|
--------| Reference |--------
|
local rng = Random.new()
|
--[=[
Checks if the given object is a Symbol an in the given scope
@param obj any -- Anything
@param scope Symbol -- Scope symbol
@return boolean -- Returns `true` if the `obj` parameter is a Symbol and in the given scope
]=]
|
function Symbol.IsInScope(obj: any, scope: Symbol): boolean
return Symbol.Is(obj) and obj._scope == scope
end
function Symbol:__tostring()
return ("Symbol<%s>"):format(self._id)
end
export type Symbol = typeof(Symbol.new("Test", nil))
return Symbol
|
--Add local seating script to players and starter players if one is not already present
|
if not game.StarterPlayer.StarterPlayerScripts:FindFirstChild("LocalVehicleSeatingScript") then
LocalSeatingScript:Clone().Parent = game.StarterPlayer.StarterPlayerScripts
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character ~= nil then
LocalSeatingScript:Clone().Parent = v.Character
end
end
end
|
--Tune--
|
local StockHP = 297 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve)
local TurboCount = 2 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos)
local TurboSize = 65 --bigger the turbo, the more lag it has (actually be realistic with it) no 20mm turbos
local WasteGatePressure = 9 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo)
local CompressionRatio = 11/1 --Compression of your car (look up the compression of the engine you are running)
local AntiLag = true --if true basically keeps the turbo spooled up so less lag
local BOV_Loudness = 5 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 5 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 7 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
|
--[[
CameraShaker.CameraShakeInstance
cameraShaker = CameraShaker.new(renderPriority, callbackFunction)
CameraShaker:Start()
CameraShaker:Stop()
CameraShaker:StopSustained([fadeOutTime])
CameraShaker:Shake(shakeInstance)
CameraShaker:ShakeSustain(shakeInstance)
CameraShaker:ShakeOnce(magnitude, roughness [, fadeInTime, fadeOutTime, posInfluence, rotInfluence])
CameraShaker:StartShake(magnitude, roughness [, fadeInTime, posInfluence, rotInfluence])
EXAMPLE:
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
camera.CFrame = playerCFrame * shakeCFrame
end)
camShake:Start()
-- Explosion shake:
camShake:Shake(CameraShaker.Presets.Explosion)
wait(1)
-- Custom shake:
camShake:ShakeOnce(3, 1, 0.2, 1.5)
-- Sustained shake:
camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
-- Stop all sustained shakes:
camShake:StopSustained(1) -- Argument is the fadeout time (defaults to the same as fadein time if not supplied)
-- Stop only one sustained shake:
shakeInstance = camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
wait(2)
shakeInstance:StartFadeOut(1) -- Argument is the fadeout time
NOTE:
This was based entirely on the EZ Camera Shake asset for Unity3D. I was given written
permission by the developer, Road Turtle Games, to port this to Roblox.
Original asset link: https://assetstore.unity.com/packages/tools/camera/ez-camera-shake-33148
GitHub repository: https://github.com/Sleitnick/RbxCameraShaker
--]]
|
local CameraShaker = {}
CameraShaker.__index = CameraShaker
local profileBegin = debug.profilebegin
local profileEnd = debug.profileend
local profileTag = "CameraShakerUpdate"
local V3 = Vector3.new
local CF = CFrame.new
local ANG = CFrame.Angles
local RAD = math.rad
local v3Zero = V3()
local CameraShakeInstance = require(script.CameraShakeInstance)
local CameraShakeState = CameraShakeInstance.CameraShakeState
local defaultPosInfluence = V3(0, 0, 0)
local defaultRotInfluence = V3(1, 1, 1)
CameraShaker.CameraShakeInstance = CameraShakeInstance
CameraShaker.Presets = require(script.CameraShakePresets)
function CameraShaker.new(renderPriority, callback)
assert(type(renderPriority) == "number", "RenderPriority must be a number (e.g.: Enum.RenderPriority.Camera.Value)")
assert(type(callback) == "function", "Callback must be a function")
local self = setmetatable({
_running = false;
_renderName = "CameraShaker";
_renderPriority = renderPriority;
_posAddShake = v3Zero;
_rotAddShake = v3Zero;
_camShakeInstances = {};
_removeInstances = {};
_callback = callback;
}, CameraShaker)
return self
end
function CameraShaker:Start()
if (self._running) then return end
self._running = true
local callback = self._callback
game:GetService("RunService"):BindToRenderStep(self._renderName, self._renderPriority, function(dt)
profileBegin(profileTag)
local cf = self:Update(dt)
profileEnd()
callback(cf)
end)
end
function CameraShaker:Stop()
if (not self._running) then return end
game:GetService("RunService"):UnbindFromRenderStep(self._renderName)
self._running = false
end
function CameraShaker:StopSustained(duration)
for _,c in pairs(self._camShakeInstances) do
if (c.fadeOutDuration == 0) then
c:StartFadeOut(duration or c.fadeInDuration)
end
end
end
function CameraShaker:Update(dt)
local posAddShake = v3Zero
local rotAddShake = v3Zero
local instances = self._camShakeInstances
-- Update all instances:
for i = 1,#instances do
local c = instances[i]
local state = c:GetState()
if (state == CameraShakeState.Inactive and c.DeleteOnInactive) then
self._removeInstances[#self._removeInstances + 1] = i
elseif (state ~= CameraShakeState.Inactive) then
local shake = c:UpdateShake(dt)
posAddShake = posAddShake + (shake * c.PositionInfluence)
rotAddShake = rotAddShake + (shake * c.RotationInfluence)
end
end
-- Remove dead instances:
for i = #self._removeInstances,1,-1 do
local instIndex = self._removeInstances[i]
table.remove(instances, instIndex)
self._removeInstances[i] = nil
end
return CF(posAddShake) *
ANG(0, RAD(rotAddShake.Y), 0) *
ANG(RAD(rotAddShake.X), 0, RAD(rotAddShake.Z))
end
function CameraShaker:Shake(shakeInstance)
assert(type(shakeInstance) == "table" and shakeInstance._camShakeInstance, "ShakeInstance must be of type CameraShakeInstance")
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
return shakeInstance
end
function CameraShaker:ShakeSustain(shakeInstance)
assert(type(shakeInstance) == "table" and shakeInstance._camShakeInstance, "ShakeInstance must be of type CameraShakeInstance")
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
shakeInstance:StartFadeIn(shakeInstance.fadeInDuration)
return shakeInstance
end
function CameraShaker:ShakeOnce(magnitude, roughness, fadeInTime, fadeOutTime, posInfluence, rotInfluence)
local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
return shakeInstance
end
function CameraShaker:StartShake(magnitude, roughness, fadeInTime, posInfluence, rotInfluence)
local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime)
shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
shakeInstance:StartFadeIn(fadeInTime)
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
return shakeInstance
end
return CameraShaker
|
--Delete it because the old one name PurchaseHandler will delete purchases before the new one
--called PurchaseHandlerNew can get to it.
|
for k = 1,#tycoons,1 do
tycoons[k].PurchaseHandler:Destroy()
end
print("Latest-----------------2020/06/03")
local content = script:WaitForChild("Content")
content.PlayerStatManager.Parent = script.Parent
|
-- Enums --
|
elseif (itemType == 'Enum') then
Enums[item.Name] = item
item.EnumItems = {}
elseif (itemType == 'EnumItem') then
Enums[item.Enum].EnumItems[item.Name] = item
end
end
return {
Classes = Classes;
Enums = Enums;
GetProperties = getProperties;
IsEnum = isEnum;
}
end
|
--thats the end of the script people! HOPE YOU LIKE IT!
| |
--TheNexusAvenger
--Configuration of the rocket launcher.
|
return {
--Reload time of the rocket.
ROCKET_RELOAD_TIME = 3,
--Times for showing rocket.
ROCKET_RELOAD_WAIT_TO_SHOW_TIME = 1,
ROCKET_RELOAD_VISIBLE_TIME = 0.45,
--Speed of the rocket.
ROCKET_LAUNCH_SPEED = 60,
--List of the instances to ignore by name. Case does not matter.
IGNORE_LIST = {
rocket = true,
effect = true,
water = true,
handle = true,
reflector = true,
},
--Blast radius of the rocket.
BLAST_RADIUS = 7,
--Force of rocket launcher blast.
FORCE_GRANULARITY = 2,
BLAST_PRESSURE = 750000,
--Time before the rocket disappears after launching.
ROCKET_DECAY_TIME = 30,
--Maximum and minimum damage of the rocket on characters.
MAX_DAMAGE = 80,
MIN_DAMAGE = 42,
}
|
--Stickmasterluke
--A nice simple axe
|
sp=script.Parent
r=game:service("RunService")
anims={"RightSlash","LeftSlash","OverHeadSwing"}
basedamage=0 + (script.Parent.AddDam.Value/4)
slashdamage=15 + script.Parent.AddDam.Value
swingdamage=15 + script.Parent.AddDam.Value
damage=basedamage
sword=sp.Handle
sp.Taunting.Value=false
local SlashSound=Instance.new("Sound")
SlashSound.SoundId="rbxasset://sounds\\swordslash.wav"
SlashSound.Parent=sword
SlashSound.Volume=.7
local UnsheathSound=Instance.new("Sound")
UnsheathSound.SoundId="rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent=sword
UnsheathSound.Volume=0
function blow(hit)
if (hit.Parent==nil) then return end -- happens when bullet hits sword
local humanoid=hit.Parent:findFirstChild("Humanoid")
local vCharacter=sp.Parent
local vPlayer=game.Players:playerFromCharacter(vCharacter)
local hum=vCharacter:findFirstChild("Humanoid") -- non-nil if sp held by a character
if humanoid~=nil and humanoid~=hum and hum~=nil then
-- final check, make sure sword is in-hand
local right_arm=vCharacter:FindFirstChild("Right Arm")
if (right_arm~=nil) then
local joint=right_arm:FindFirstChild("RightGrip")
if (joint~=nil and (joint.Part0==sword or joint.Part1==sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag=Instance.new("ObjectValue")
creator_tag.Value=player
creator_tag.Name="creator"
creator_tag.Parent=humanoid
end
function untagHumanoid(humanoid)
if humanoid~=nil then
local tag=humanoid:findFirstChild("creator")
if tag~=nil then
tag.Parent=nil
end
end
end
sp.Enabled=true
function onActivated()
if sp.Enabled and not sp.Taunting.Value then
sp.Enabled=false
local character=sp.Parent;
local humanoid=character.Humanoid
if humanoid==nil then
print("Humanoid not found")
return
end
SlashSound:play()
newanim=anims[math.random(1,#anims)]
while newanim==sp.RunAnim.Value do
newanim=anims[math.random(1,#anims)]
end
sp.RunAnim.Value=newanim
if newanim=="OverHeadSwing" then
damage=swingdamage
else
damage=slashdamage
end
wait(1)
damage=basedamage
sp.Enabled=true
end
end
function onEquipped()
UnsheathSound:play()
end
sp.Activated:connect(onActivated)
sp.Equipped:connect(onEquipped)
connection=sword.Touched:connect(blow)
|
-----------------
--| Constants |--
-----------------
|
local GRAVITY_ACCELERATION = 196.2
local RELOAD_TIME = tool.Configurations.ReloadTime.Value -- Seconds until tool can be used again
local ROCKET_SPEED = tool.Configurations.RocketSpeed.Value -- Speed of the projectile
local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
local RocketScript = script:WaitForChild('Rocket')
local SwooshSound = script:WaitForChild('Swoosh')
local BoomSound = script:WaitForChild('Boom')
local attackCooldown = tool.Configurations.AttackCooldown.Value
local damage = tool.Configurations.Damage.Value
local reloadTime = tool.Configurations.ReloadTime.Value
local function createEvent(eventName)
local event = game.ReplicatedStorage:FindFirstChild(eventName)
if not event then
event = Instance.new("RemoteEvent", game.ReplicatedStorage)
event.Name = eventName
end
return event
end
local updateEvent = createEvent("ROBLOX_RocketUpdateEvent")
local equipEvent = createEvent("ROBLOX_RocketEquipEvent")
local unequipEvent = createEvent("ROBLOX_RocketUnequipEvent")
local fireEvent = createEvent("ROBLOX_RocketFireEvent")
updateEvent.OnServerEvent:connect(function(player, neckC0, rshoulderC0)
local character = player.Character
local humanoid = character.Humanoid
if humanoid.Health <= 0 then return end
if humanoid.RigType == Enum.HumanoidRigType.R6 then
character.Torso.Neck.C0 = neckC0
character.Torso:FindFirstChild("Right Shoulder").C0 = rshoulderC0
gunWeld = character:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
character.Head.Neck.C0 = neckC0
character.RightUpperArm.RightShoulder.C0 = rshoulderC0
gunWeld = character.RightHand:WaitForChild("RightGrip")
end
end)
equipEvent.OnServerEvent:connect(function(player)
player.Character.Humanoid.AutoRotate = false
end)
unequipEvent.OnServerEvent:connect(function(player)
player.Character.Humanoid.AutoRotate = true
end)
|
-- CastBehavior.CosmeticBulletTemplate = CosmeticBullet -- Uncomment if you just want a simple template part and aren't using PartCache
|
CastBehavior.CosmeticBulletProvider = CosmeticPartProvider -- Comment out if you aren't using PartCache.
CastBehavior.CosmeticBulletContainer = CosmeticBulletsFolder
CastBehavior.Acceleration = BULLET_GRAVITY
CastBehavior.AutoIgnoreContainer = false -- We already do this! We don't need the default value of true (see the bottom of this script)
|
-- Local private variables and constants
|
local UNIT_X = Vector3.new(1,0,0)
local UNIT_Y = Vector3.new(0,1,0)
local UNIT_Z = Vector3.new(0,0,1)
local X1_Y0_Z1 = Vector3.new(1,0,1) --Note: not a unit vector, used for projecting onto XZ plane
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local ZERO_VECTOR2 = Vector2.new(0,0)
local TAU = 2 * math.pi
local VR_PITCH_FRACTION = 0.25
local tweenAcceleration = math.rad(220) --Radians/Second^2
local tweenSpeed = math.rad(0) --Radians/Second
local tweenMaxSpeed = math.rad(250) --Radians/Second
local TIME_BEFORE_AUTO_ROTATE = 2.0 --Seconds, used when auto-aligning camera with vehicles
local PORTRAIT_OFFSET = Vector3.new(0,-3,0)
local bindAtPriorityFlagExists, bindAtPriorityFlagEnabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPlayerScriptsBindAtPriority")
end)
local FFlagPlayerScriptsBindAtPriority = bindAtPriorityFlagExists and bindAtPriorityFlagEnabled
|
-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
|
function RayCast(startPos, vec, rayLength)
local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
if hitObject and hitPos then
local distance = rayLength - (hitPos - startPos).magnitude
if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
-- there is a chance here for potential infinite recursion
return RayCast(hitPos, vec, distance)
end
end
return hitObject, hitPos
end
function TagHumanoid(humanoid, player)
-- Add more tags here to customize what tags are available.
while humanoid:FindFirstChild('creator') do
humanoid:FindFirstChild('creator'):Destroy()
end
local creatorTag = Instance.new("ObjectValue")
creatorTag.Value = player
creatorTag.Name = "creator"
creatorTag.Parent = humanoid
DebrisService:AddItem(creatorTag, 1.5)
local weaponIconTag = Instance.new("StringValue")
weaponIconTag.Value = IconURL
weaponIconTag.Name = "icon"
weaponIconTag.Parent = creatorTag
end
local function CreateBullet(bulletPos)
local bullet = Instance.new('Part', Workspace)
bullet.FormFactor = Enum.FormFactor.Custom
bullet.Size = Vector3.new(0.1, 0.1, 0.1)
bullet.BrickColor = BrickColor.new("Black")
bullet.Shape = Enum.PartType.Block
bullet.CanCollide = false
bullet.CFrame = CFrame.new(bulletPos)
bullet.Anchored = true
bullet.TopSurface = Enum.SurfaceType.Smooth
bullet.BottomSurface = Enum.SurfaceType.Smooth
bullet.Name = 'Bullet'
DebrisService:AddItem(bullet, 2.5)
return bullet
end
local function Reload()
if not Reloading then
Reloading = true
-- Don't reload if you are already full or have no extra ammo
if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
if RecoilTrack then
RecoilTrack:Stop()
end
if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
WeaponGui.Crosshair.ReloadingLabel.Visible = true
end
end
script.Parent.Handle.Reload:Play()
wait(ReloadTime)
-- Only use as much ammo as you have
local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
AmmoInClip = AmmoInClip + ammoToUse
SpareAmmo = SpareAmmo - ammoToUse
UpdateAmmo(AmmoInClip)
WeaponGui.Reload.Visible = false
end
Reloading = false
end
end
function OnFire()
if IsShooting then return end
if MyHumanoid and MyHumanoid.Health > 0 then
if RecoilTrack and AmmoInClip > 0 then
RecoilTrack:Play()
end
IsShooting = true
while LeftButtonDown and AmmoInClip > 0 and not Reloading do
if Spread and not DecreasedAimLastShot then
Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
UpdateCrosshair(Spread)
end
DecreasedAimLastShot = not DecreasedAimLastShot
if Handle:FindFirstChild('FireSound') then
Handle.FireSound:Play()
Handle.Flash.Enabled = true
end
if MyMouse then
local targetPoint = MyMouse.Hit.p
local shootDirection = (targetPoint - Handle.Position).unit
-- Adjust the shoot direction randomly off by a little bit to account for recoil
shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
(0.5 - math.random()) * 2 * Spread,
(0.5 - math.random()) * 2 * Spread) * shootDirection
local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
local bullet
-- Create a bullet here
if hitObject then
bullet = CreateBullet(bulletPos)
end
if hitObject and hitObject.Parent then
local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
if hitHumanoid then
local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
if MyPlayer.Neutral or hitPlayer then
TagHumanoid(hitHumanoid, MyPlayer)
hitHumanoid:TakeDamage(Damage)
if bullet then
bullet:Destroy()
bullet = nil
--bullet.Transparency = 1
end
Spawn(UpdateTargetHit)
end
end
end
AmmoInClip = AmmoInClip - 1
UpdateAmmo(AmmoInClip)
end
wait(FireRate)
end
Handle.Flash.Enabled = false
IsShooting = false
if AmmoInClip == 0 then
Handle.Tick:Play()
WeaponGui.Reload.Visible = true
end
if RecoilTrack then
RecoilTrack:Stop()
end
end
end
local TargetHits = 0
function UpdateTargetHit()
TargetHits = TargetHits + 1
if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
WeaponGui.Crosshair.TargetHitImage.Visible = true
end
wait(0.5)
TargetHits = TargetHits - 1
if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
WeaponGui.Crosshair.TargetHitImage.Visible = false
end
end
function UpdateCrosshair(value, mouse)
if WeaponGui then
local absoluteY = 650
WeaponGui.Crosshair:TweenSize(
UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
0.33)
end
end
function UpdateAmmo(value)
if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
WeaponGui.Crosshair.ReloadingLabel.Visible = false
end
end
if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
end
end
function OnMouseDown()
LeftButtonDown = true
OnFire()
end
function OnMouseUp()
LeftButtonDown = false
end
function OnKeyDown(key)
if string.lower(key) == 'r' then
Reload()
end
end
function OnEquipped(mouse)
Handle.EquipSound:Play()
RecoilAnim = WaitForChild(Tool, 'Recoil')
FireSound = WaitForChild(Handle, 'FireSound')
MyCharacter = Tool.Parent
MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
MyTorso = MyCharacter:FindFirstChild('Torso')
MyMouse = mouse
WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
if WeaponGui and MyPlayer then
WeaponGui.Parent = MyPlayer.PlayerGui
UpdateAmmo(AmmoInClip)
end
if RecoilAnim then
RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
end
if MyMouse then
-- Disable mouse icon
MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
MyMouse.Button1Down:connect(OnMouseDown)
MyMouse.Button1Up:connect(OnMouseUp)
MyMouse.KeyDown:connect(OnKeyDown)
end
end
|
--Main
|
local Linear: any = {}
Linear.__index = Linear
function Linear.new(...: Vector3): ()
local points: {Vector3} = {...}
local length: number do
length = 0
for i, point in ipairs(points) do
if i == 1 then
continue
end
local prevPoint: Vector3 = points[i - 1]
length += (point - prevPoint).Magnitude
end
end
return setmetatable({
Points = points,
Length = length
}, Linear)
end
function Linear:Get(val: number): Vector3
val = math.clamp(val, 0, 1)
local points: {Vector3} = self.Points
local length: number = self.Length
local targetLength: number = length * val
local currentLength: number = 0
local i: number = 1
local foundPoint: Vector3 = points[1]
while true do
local thisPoint: Vector3, nextPoint: Vector3 = points[i], points[i + 1]
local thisLength: number = (nextPoint - thisPoint).Magnitude
if currentLength + thisLength > targetLength then
--Mid point must be somewhere between this point and next point
local remainingLength: number = targetLength - currentLength
foundPoint = thisPoint + (nextPoint - thisPoint).Unit * remainingLength
break
end
currentLength += thisLength
i += 1
if i == #points then
foundPoint = points[#points]
break
end
end
return foundPoint
end
return {
Raw = Linear,
new = Linear.new
}
|
--If both DriverControls are enabled and touch controls are enabled then the accelerate and brake buttons will appear.
|
function VehicleGui:EnableDriverControls()
self.driverControlsEnabled = true
if self.touchEnabled then
self:DisplayTouchDriveControls()
end
end
function VehicleGui:EnableSpeedo()
self.speedoFrame.Visible = true
end
function VehicleGui:DisableSpeedo()
self.speedoFrame.Visible = false
end
function VehicleGui:DisplayTouchDriveControls()
self.brakeButton.Visible = true
self.accelButton.Visible = true
--Read button inputs
local ADown = false
local BDown = false
local HDown = false
local function ProcessTouchThrottle()
if (ADown and BDown) or (not ADown and not BDown) then
self.throttleInput = 0
elseif ADown then
self.throttleInput = 1
elseif BDown then
self.throttleInput = -1
end
if HDown then
self.handBrakeInput = 1
else
self.handBrakeInput = 0
end
end
--Accel
self.accelButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch then
ADown = true
self.accelButton.ImageTransparency = 1
self.accelButton.Pressed.ImageTransparency = 0
ProcessTouchThrottle()
end
end)
self.accelButton.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch then
ADown = false
self.accelButton.ImageTransparency = 0
self.accelButton.Pressed.ImageTransparency = 1
ProcessTouchThrottle()
end
end)
--Brake
local lastBrakeTapTime = 0
local brakeLastInputBegan = 0
self.brakeButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch then
if tick() - lastBrakeTapTime <= DOUBLE_TAP_THRESHOLD then
HDown = true
else
brakeLastInputBegan = tick()
BDown = true
end
self.brakeButton.ImageTransparency = 1
self.brakeButton.Pressed.ImageTransparency = 0
ProcessTouchThrottle()
end
end)
self.brakeButton.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch then
if not HDown then
if tick() - brakeLastInputBegan <= SINGLE_TAP_THRESHOLD then
lastBrakeTapTime = tick()
end
end
brakeLastInputBegan = 0
HDown = false
BDown = false
self.brakeButton.ImageTransparency = 0
self.brakeButton.Pressed.ImageTransparency = 1
ProcessTouchThrottle()
end
end)
end
function VehicleGui:EnableTouchControls()
if self.touchEnabled then return end
self.touchEnabled = true
disableJumpButton()
self:ConfigureButtons()
if self.driverControlsEnabled then
self:DisplayTouchDriveControls()
end
end
function VehicleGui:DisableTouchControls()
if not self.touchEnabled then return end
self.touchEnabled = false
enableJumpButton()
self.brakeButton.Visible = false
self.accelButton.Visible = false
end
function VehicleGui:EnableKeyboardUI()
self.speedoFrame.Size = UDim2.new(0, 400, 0, 90)
self.speedoOn.Size = self.speedoFrame.Size
self.speedoOff.Size = self.speedoFrame.Size
self.speedoFrame.Position = UDim2.new(0.5, 0, 1, -40)
self.speedoOn.Image = "rbxassetid://2848312414"
self.speedoOff.Image = "rbxassetid://2848312878"
self.speedText.TextSize = 40
self.speedText.Size = UDim2.new(0, 60, 0, 40)
self.speedText.Position = UDim2.new(0, 215, 0, 94)
self.unitText.TextSize = 20
self.unitText.Size = UDim2.new(0, 30, 0, 20)
self.unitText.Position = UDim2.new(0, 225, 0, 90)
self:DisableTouchControls()
end
function VehicleGui:EnableTouchUI()
self.speedoFrame.Size = UDim2.new(0, 240, 0, 54)
self.speedoOn.Size = self.speedoFrame.Size
self.speedoOff.Size = self.speedoFrame.Size
self.speedoFrame.Position = UDim2.new(0.5, 0, 1, -20)
self.speedoOn.Image = "rbxassetid://2847843718"
self.speedoOff.Image = "rbxassetid://2847843839"
self.speedText.TextSize = 24
self.speedText.Size = UDim2.new(0, 24*3*0.5, 0, 24)
self.speedText.Position = UDim2.new(0, 120, 0, 54)
self.unitText.TextSize = 12
self.unitText.Size = UDim2.new(0, 12*3*0.5, 0, 12)
self.unitText.Position = UDim2.new(0, 125, 0, 54)
self:EnableTouchControls()
end
function VehicleGui:EnableGamepadUI()
self.speedoFrame.Size = UDim2.new(0, 600, 0, 135)
self.speedoOn.Size = self.speedoFrame.Size
self.speedoOff.Size = self.speedoFrame.Size
self.speedoFrame.Position = UDim2.new(0.5, 0, 1, -40)
self.speedoOn.Image = "rbxassetid://2836208803"
self.speedoOff.Image = "rbxassetid://2836208488"
self.speedText.TextSize = 60
self.speedText.Size = UDim2.new(0, 90, 0, 60)
self.speedText.Position = UDim2.new(0, 315, 0, 140)
self.unitText.TextSize = 30
self.unitText.Size = UDim2.new(0, 45, 0, 30)
self.unitText.Position = UDim2.new(0, 325, 0, 135)
self:DisableTouchControls()
end
return VehicleGui
|
--[[
Adds a change listener. When the watched state changes value, the listener
will be fired.
Returns a function which, when called, will disconnect the change listener.
As long as there is at least one active change listener, this Observer
will be held in memory, preventing GC, so disconnecting is important.
]]
|
function class:onChange(callback: () -> ()): () -> ()
self._numChangeListeners += 1
self._changeListeners[callback] = true
-- disallow gc (this is important to make sure changes are received)
strongRefs[self] = true
local disconnected = false
return function()
if disconnected then
return
end
disconnected = true
self._changeListeners[callback] = nil
self._numChangeListeners -= 1
if self._numChangeListeners == 0 then
-- allow gc if all listeners are disconnected
strongRefs[self] = nil
end
end
end
local function Observer(watchedState: PubTypes.Value<any>): Types.Observer
local self = setmetatable({
type = "State",
kind = "Observer",
dependencySet = {[watchedState] = true},
dependentSet = {},
_changeListeners = {},
_numChangeListeners = 0
}, CLASS_METATABLE)
initDependency(self)
-- add this object to the watched state's dependent set
watchedState.dependentSet[self] = true
return self
end
return Observer
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 510
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Fog",Paint)
end)
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Darkgreen",Paint)
end)
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 50 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6500 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
--[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
--[[end;]]
|
--
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 AttackDebounce=false;
local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
local WalkDebounce=false;
local Notice=false;
local JeffLaughDebounce=false;
local MusicDebounce=false;
local NoticeDebounce=false;
local ChosenMusic;
function FindNearestBae()
local NoticeDistance=90;
local TargetMain;
for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("HumanoidRootPart")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
Spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
Wait(0.3);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(10000000000000000000000000000);
if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
end;
end;
Wait(0.1);
AttackDebounce=false;
end);
end;
end;
end;
end;
end;
return TargetMain;
end;
while Wait(0)do
local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
local Jumpable=false;
if Blockage then
Jumpable=true;
if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
local BlockageHumanoid;
for _,Child in pairs(Blockage.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
BlockageHumanoid=Child;
end;
end;
if Blockage and Blockage:IsA("Terrain")then
local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
if CellMaterial==Enum.CellMaterial.Water then
Jumpable=false;
end;
elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
Jumpable=false;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
JeffTheKillerHumanoid.Jump=true;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
Spawn(function()
WalkDebounce=true;
local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
if RayTarget then
local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
JeffTheKillerHeadFootStepClone:Play();
JeffTheKillerHeadFootStepClone:Destroy();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
Wait(0.5);
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
Wait(0.2);
end
end;
WalkDebounce=false;
end);
end;
local MainTarget=FindNearestBae();
local FoundHumanoid;
if MainTarget then
for _,Child in pairs(MainTarget.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
JeffTheKillerHumanoid.Jump=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
if not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
end;
end;
if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
local MusicChoice=math.random(1,2);
if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
end;
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
ChosenMusic.Volume=0.5;
ChosenMusic:Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
if not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
end;
end;
if not MainTarget and not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
if not MainTarget and not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
if MainTarget then
Notice=true;
if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
NoticeDebounce=true;
end
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
JeffTheKillerHumanoid.WalkSpeed=30.9;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=0.004;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
else
Notice=false;
NoticeDebounce=false;
local RandomWalk=math.random(1,150);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
if RandomWalk==1 then
JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="ColdBloodedKiller";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=9200;
JeffTheKillerHumanoid.JumpPower=90;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end;
|
--[[
We need a lot of information to determine which collisions to filter, but they are all
condensed into one place to minimize redundant loops in case someone is spam-spawning
characters with hundreds of limbs. Returns the following information:
limbs:
{
["Arm"] = { LeftUpperArm, LeftLowerArm, LeftHand, RightUpperArm, RightLowerArm, RightHand},
["Head"] = { Head },
["Torso"] = { LowerTorso, UpperTorso },
...
}
limbRootParts:
{ {Part=Head, Type=Head}, {Part=LeftUpperArm, Type="Arm"}, {Part=RightUpperArm, Type="Arm"}, ... }
limbParents:
{
["Arm"] = { "Torso" },
["Head"] = { "Torso" },
["Torso"] = {},
...
}
--]]
|
function getLimbs(characterRoot, attachmentMap)
local limbs = {}
local limbRootParts = {}
local limbParents = {}
local function parsePart(part, lastLimb)
if part.Name ~= "HumanoidRootPart" then
local limbType = getLimbType(part.Name)
limbs[limbType] = limbs[limbType] or {}
table.insert(limbs[limbType], part)
--//local limbData = limbs[limbType]
if limbType ~= lastLimb then
limbParents[limbType] = limbParents[limbType] or {}
if lastLimb then
limbParents[limbType][lastLimb] = true
end
table.insert(limbRootParts, {Part=part, Type=limbType})
lastLimb = limbType
end
end
for _,v in pairs(part:GetChildren()) do
if v:isA("Attachment") and attachmentMap[v.Name] then
local part1 = attachmentMap[v.Name].Attachment1.Parent
if part1 and part1 ~= part then
parsePart(part1, lastLimb)
end
end
end
end
parsePart(characterRoot)
return limbs, limbRootParts, limbParents
end
function createNoCollision(part0, part1)
local noCollision = Instance.new("NoCollisionConstraint")
noCollision.Name = part0.Name.."<->"..part1.Name
noCollision.Part0 = part0
noCollision.Part1 = part1
return noCollision
end
return function(attachmentMap, characterRoot)
local noCollisionConstraints = Instance.new("Folder")
noCollisionConstraints.Name = "NoCollisionConstraints"
local limbs, limbRootParts, limbParents = getLimbs(characterRoot, attachmentMap)
--[[
Disable collisions between all limb roots (e.g. left/right shoulders, head, etc) unless
one of them is a parent of the other (handled in next step). This is to ensure limbs
maintain free range of motion and we don't have issues like
- Large shoulders clipping with the head and all of them being unable to move
- Legs being stuck together because rotating would cause the collision boxes to intersect
--]]
for i=1, #limbRootParts do
for j=i+1, #limbRootParts do
local limbType0, limbType1 = limbRootParts[i].Type, limbRootParts[j].Type
if not (limbParents[limbType0][limbType1] or limbParents[limbType1][limbType0]) then
createNoCollision(limbRootParts[i].Part, limbRootParts[j].Part).Parent = noCollisionConstraints
end
end
end
--[[
Disable collisions between limbs and their parent limbs. This is mostly to address
bundle torsos having insane hitboxes that touch more than just limb roots
--]]
for limbType, parts in pairs(limbs) do
for parentLimbType,_ in pairs(limbParents[limbType]) do
for _,part2 in pairs(limbs[parentLimbType]) do
for _,part in pairs(parts) do
createNoCollision(part, part2).Parent = noCollisionConstraints
end
end
end
end
return noCollisionConstraints
end
|
-- newAnimal:SetPrimaryPartCFrame(oldCF)
-- newAnimal.Parent = workspace.Structures
| |
-- (Hat Giver Script - Loaded.)
|
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Valkyrie Helm"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(1, 0.8, 1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentForward = Vector3.new (0, -0.255, -0.967)
h.AttachmentPos = Vector3.new(0, -0.34, -0.24)
h.AttachmentRight = Vector3.new (1, 0, 0)
h.AttachmentUp = Vector3.new (0, 0.967, -0.255)
wait(5)
debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
--Make the character temporarily invisible & Invincible
--Make Player Camera follow one of the orbs
--(Possibly) Create sparkles splash effect
--Spawn the Character at the targeted destination
|
local Light_Segments = 10
local LightBallAnimations = {}
local TrackOrb,FixCam = script:WaitForChild("TrackOrb"),script:WaitForChild("FixCam")
local AffectedParts = {}
local Parts = Character:GetDescendants()
for i=1,#Parts do
if Parts[i]:IsA("BasePart") then
AffectedParts[#AffectedParts+1] = {Part = Parts[i], Transparency = Parts[i].Transparency,CanCollide = Parts[i].CanCollide,Anchored = Parts[i].Anchored}
Parts[i].CanCollide = false
Parts[i].Transparency = 1
Parts[i].Anchored = true
end
end
local ForceFieldExists = Character:FindFirstChildOfClass("ForceField")
local ForceField
if ForceFieldExists then
ForceFieldExists.Visible = false
end
if not ForceFieldExists then -- give invincibility when travelling
ForceField = Create("ForceField"){
Name = "Invincibility",
Visible = false,
Parent = Character
}
end
local HeldTool = Character:FindFirstChildOfClass("Tool")
if HeldTool then
Humanoid:UnequipTools()
end
|
--Made by Luckymaxer
|
Humanoid = script.Parent
Humanoid.PlatformStand = true
Humanoid.AutoRotate = false
Humanoid.Changed:connect(function(Property)
if Property == "Jump" then
Humanoid.Jump = false
elseif Property == "PlatformStand" then
Humanoid.PlatformStand = true
elseif Property == "AutoRotate" then
Humanoid.AutoRotate = false
end
end)
|
-- Deprecated in favour of GetMessageModeTextButton
-- Retained for compatibility reasons.
|
function methods:GetMessageModeTextLabel()
return self:GetMessageModeTextButton()
end
function methods:IsFocused()
if self.UserHasChatOff then
return false
end
return self:GetTextBox():IsFocused()
end
function methods:GetVisible()
return self.GuiObject.Visible
end
function methods:CaptureFocus()
if not self.UserHasChatOff then
self:GetTextBox():CaptureFocus()
end
end
function methods:ReleaseFocus(didRelease)
self:GetTextBox():ReleaseFocus(didRelease)
end
function methods:ResetText()
self:GetTextBox().Text = ""
end
function methods:SetText(text)
self:GetTextBox().Text = text
end
function methods:GetEnabled()
return self.GuiObject.Visible
end
function methods:SetEnabled(enabled)
if self.UserHasChatOff then
-- The chat bar can not be removed if a user has chat turned off so that
-- the chat bar can display a message explaining that chat is turned off.
self.GuiObject.Visible = true
else
self.GuiObject.Visible = enabled
end
end
function methods:SetTextLabelText(text)
if not self.UserHasChatOff then
self.TextLabel.Text = text
end
end
function methods:SetTextBoxText(text)
self.TextBox.Text = text
end
function methods:GetTextBoxText()
return self.TextBox.Text
end
function methods:ResetSize()
self.TargetYSize = 0
self:TweenToTargetYSize()
end
function methods:CalculateSize()
if self.CalculatingSizeLock then
return
end
self.CalculatingSizeLock = true
local lastPos = self.GuiObject.Size
self.GuiObject.Size = UDim2.new(1, 0, 0, 1000)
local textSize = nil
local bounds = nil
if self:IsFocused() or self.TextBox.Text ~= "" then
textSize = self.TextBox.textSize
bounds = self.TextBox.TextBounds.Y
else
textSize = self.TextLabel.textSize
bounds = self.TextLabel.TextBounds.Y
end
self.GuiObject.Size = lastPos
local newTargetYSize = bounds - textSize
if (self.TargetYSize ~= newTargetYSize) then
self.TargetYSize = newTargetYSize
self:TweenToTargetYSize()
end
self.CalculatingSizeLock = false
end
function methods:TweenToTargetYSize()
local endSize = UDim2.new(1, 0, 1, self.TargetYSize)
local curSize = self.GuiObject.Size
local curAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y
self.GuiObject.Size = endSize
local endAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y
self.GuiObject.Size = curSize
local pixelDistance = math.abs(endAbsoluteSizeY - curAbsoluteSizeY)
local tweeningTime = math.min(1, (pixelDistance * (1 / self.TweenPixelsPerSecond))) -- pixelDistance * (seconds per pixels)
local success = pcall(function() self.GuiObject:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweeningTime, true) end)
if (not success) then
self.GuiObject.Size = endSize
end
end
function methods:SetTextSize(textSize)
if not self:IsInCustomState() then
if self.TextBox then
self.TextBox.TextSize = textSize
end
if self.TextLabel then
self.TextLabel.TextSize = textSize
end
end
end
function methods:GetDefaultChannelNameColor()
if ChatSettings.DefaultChannelNameColor then
return ChatSettings.DefaultChannelNameColor
end
return Color3.fromRGB(35, 76, 142)
end
function methods:SetChannelTarget(targetChannel)
local messageModeTextButton = self.GuiObjects.MessageModeTextButton
local textBox = self.TextBox
local textLabel = self.TextLabel
self.TargetChannel = targetChannel
if not self:IsInCustomState() then
if targetChannel ~= ChatSettings.GeneralChannelName then
messageModeTextButton.Size = UDim2.new(0, 1000, 1, 0)
messageModeTextButton.Text = string.format("[%s] ", targetChannel)
local channelNameColor = self:GetChannelNameColor(targetChannel)
if channelNameColor then
messageModeTextButton.TextColor3 = channelNameColor
else
messageModeTextButton.TextColor3 = self:GetDefaultChannelNameColor()
end
local xSize = messageModeTextButton.TextBounds.X
messageModeTextButton.Size = UDim2.new(0, xSize, 1, 0)
textBox.Size = UDim2.new(1, -xSize, 1, 0)
textBox.Position = UDim2.new(0, xSize, 0, 0)
textLabel.Size = UDim2.new(1, -xSize, 1, 0)
textLabel.Position = UDim2.new(0, xSize, 0, 0)
else
messageModeTextButton.Text = ""
messageModeTextButton.Size = UDim2.new(0, 0, 0, 0)
textBox.Size = UDim2.new(1, 0, 1, 0)
textBox.Position = UDim2.new(0, 0, 0, 0)
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Position = UDim2.new(0, 0, 0, 0)
end
end
end
function methods:IsInCustomState()
return self.InCustomState
end
function methods:ResetCustomState()
if self.InCustomState then
self.CustomState:Destroy()
self.CustomState = nil
self.InCustomState = false
self.ChatBarParentFrame:ClearAllChildren()
self:CreateGuiObjects(self.ChatBarParentFrame)
self:SetTextLabelText('To chat click here or press "/" key')
end
end
function methods:GetCustomMessage()
if self.InCustomState then
return self.CustomState:GetMessage()
end
return nil
end
function methods:CustomStateProcessCompletedMessage(message)
if self.InCustomState then
return self.CustomState:ProcessCompletedMessage()
end
return false
end
function methods:FadeOutBackground(duration)
self.AnimParams.Background_TargetTransparency = 1
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
self:FadeOutText(duration)
end
function methods:FadeInBackground(duration)
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
self:FadeInText(duration)
end
function methods:FadeOutText(duration)
self.AnimParams.Text_TargetTransparency = 1
self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:FadeInText(duration)
self.AnimParams.Text_TargetTransparency = 0.4
self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:AnimGuiObjects()
self.GuiObject.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.TextBoxFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.TextLabel.TextTransparency = self.AnimParams.Text_CurrentTransparency
self.GuiObjects.TextBox.TextTransparency = self.AnimParams.Text_CurrentTransparency
self.GuiObjects.MessageModeTextButton.TextTransparency = self.AnimParams.Text_CurrentTransparency
end
function methods:InitializeAnimParams()
self.AnimParams.Text_TargetTransparency = 0.4
self.AnimParams.Text_CurrentTransparency = 0.4
self.AnimParams.Text_NormalizedExptValue = 1
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_CurrentTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = 1
end
function methods:Update(dtScale)
self.AnimParams.Text_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Text_CurrentTransparency,
self.AnimParams.Text_TargetTransparency,
self.AnimParams.Text_NormalizedExptValue,
dtScale
)
self.AnimParams.Background_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Background_CurrentTransparency,
self.AnimParams.Background_TargetTransparency,
self.AnimParams.Background_NormalizedExptValue,
dtScale
)
self:AnimGuiObjects()
end
function methods:SetChannelNameColor(channelName, channelNameColor)
self.ChannelNameColors[channelName] = channelNameColor
if self.GuiObjects.MessageModeTextButton.Text == channelName then
self.GuiObjects.MessageModeTextButton.TextColor3 = channelNameColor
end
end
function methods:GetChannelNameColor(channelName)
return self.ChannelNameColors[channelName]
end
|
--!strict
|
export type WeakMap<T, V> = {
-- method definitions
get: (self: WeakMap<T, V>, T) -> V,
set: (self: WeakMap<T, V>, T, V) -> WeakMap<T, V>,
has: (self: WeakMap<T, V>, T) -> boolean,
}
local WeakMap = {}
WeakMap.__index = WeakMap
function WeakMap.new(): WeakMap<any, any>
local weakMap = setmetatable({}, { __mode = "k" })
return (setmetatable({ _weakMap = weakMap }, WeakMap) :: any) :: WeakMap<any, any>
end
function WeakMap:get(key)
return self._weakMap[key]
end
function WeakMap:set(key, value)
self._weakMap[key] = value
return self
end
function WeakMap:has(key): boolean
return self._weakMap[key] ~= nil
end
return WeakMap
|
--------------| SYSTEM SETTINGS |--------------
|
Prefix = ":"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Blue"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 0;
["Admin"] = 0;
["Settings"] = 0;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
RankRequiredToViewIcon = 0;
WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
["fly"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["fly2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["speed"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["jumpPower"] = {
Limit = 10000;
IgnoreLimit = 3;
};
};
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
|
-- [[ VR Support Section ]] --
|
function BaseCamera:GetCameraHeight()
if VRService.VREnabled and not self.inFirstPerson then
return math.sin(VR_ANGLE) * self.currentSubjectDistance
end
return 0
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local l__ReplicatedStorage__2 = game.ReplicatedStorage;
local v3 = require(game.ReplicatedStorage.Modules.Lightning);
local v4 = require(game.ReplicatedStorage.Modules.Xeno);
local v5 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__6 = game.TweenService;
local l__Debris__7 = game.Debris;
function v1.RunStompFx(p1, p2, p3, p4)
local v8 = game.ReplicatedStorage.KillFX.Sero.Cero:Clone();
v8.PrimaryPart.CFrame = CFrame.new(p2.CFrame.p) * CFrame.new(math.random(-25, 25), math.random(7, 15), math.random(-25, 25));
v8.PrimaryPart.CFrame = CFrame.lookAt(v8.PrimaryPart.CFrame.p, p2.Position + CFrame.new(0, 5, 0).Position);
v8.Parent = workspace.Ignored.Animations;
for v9, v10 in pairs(v8:GetChildren()) do
if v10:IsA("BasePart") and v10.Name ~= "HumanoidRootPart" then
game.TweenService:Create(v10, TweenInfo.new(0.7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
Transparency = 0
}):Play();
end;
end;
game.Debris:AddItem(v8, 3);
v8.gg:Play();
local v11 = v8.AnimationController:LoadAnimation(v8.Animation);
v11:Play();
v11:AdjustSpeed(0.7);
v11:GetMarkerReachedSignal("Blast"):Connect(function()
v8.ar:Play();
v11:AdjustSpeed(1.3);
local v12 = game.ReplicatedStorage.KillFX.Sero.Beam:Clone();
local l__Magnitude__13 = (p2.Position - v8.Head.Attachment.WorldPosition).Magnitude;
v12.Parent = v8;
v12.CFrame = CFrame.lookAt(v8.Head.Attachment.WorldPosition, p2.Position) * CFrame.new(0, 0, -l__Magnitude__13 / 2) * CFrame.Angles(1.5707963267948966, 0, 0);
task.delay(0.1, function()
for v14, v15 in pairs(p2.Parent:GetDescendants()) do
if v15:IsA("BasePart") then
v15.Transparency = 1;
end;
end;
v12.Sound:Play();
local v16 = game.ReplicatedStorage.KillFX.Sero.Particle:Clone();
local v17 = Instance.new("Attachment", p2);
v16.Parent = p2;
for v18, v19 in pairs(v16:GetChildren()) do
v19.Enabled = true;
v19.Parent = v17;
end;
task.wait(0.25);
for v20, v21 in pairs(v17:GetChildren()) do
v21.Enabled = false;
end;
end);
task.delay(0, function()
game.TweenService:Create(v12, TweenInfo.new(0.4, Enum.EasingStyle.Bounce), {
Transparency = 0.5,
Size = Vector3.new(7, l__Magnitude__13 + 15, 7)
}):Play();
while true do
v12.Attachment.Position = Vector3.new(0, v12.Size.Y / 2, 0);
v12.Attachment1.Position = Vector3.new(0, -v12.Size.Y / 2, 0);
v12.CFrame = CFrame.lookAt(v8.Head.Attachment.WorldPosition, p2.Position) * CFrame.new(0, 0, -l__Magnitude__13 / 2 - 10) * CFrame.Angles(1.5707963267948966, 0, 0);
task.wait();
if v8.Parent == nil then
break;
end;
end;
end);
v8.Sound:Play();
task.delay(0.25, function()
for v22, v23 in pairs(v8:GetChildren()) do
if v23:IsA("BasePart") and v23.Name ~= "HumanoidRootPart" then
game.TweenService:Create(v23, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
Transparency = 1
}):Play();
end;
end;
task.wait(0.25);
for v24, v25 in pairs(v12.Beam:GetChildren()) do
v25.Enabled = false;
end;
game.TweenService:Create(v12, TweenInfo.new(0.5, Enum.EasingStyle.Quart), {
Transparency = 0,
Size = Vector3.new(0, l__Magnitude__13 + 15, 0)
}):Play();
end);
end);
return nil;
end;
return v1;
|
-- Define the duration of the tween animation
|
local tweenDuration = 0.2
|
-- Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
-- This prevents e.g. <img src=""> from making an unnecessary HTTP request for certain browsers.
|
exports.enableFilterEmptyStringAttributesDOM = true
|
-- Leaderboard
|
function loadLeaderstats(player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local highScore = Instance.new("IntValue")
highScore.Name = "High Score"
highScore.Parent = stats
highScore.Value = 0
local currentScore = Instance.new("IntValue")
currentScore.Name = "Score"
currentScore.Parent = stats
stats.Parent = player
end
function initialiseRunStats(player)
if player:FindFirstChild("RunStats") then
player.RunStats.Distance.Value = 0
player.RunStats.CoinsCollected.Value = 0
end
end
function showResults(player)
local resultsGUI = game.ServerStorage.GUIs.PostRunGUI:Clone()
resultsGUI.Frame.DistanceValue.Text = player.RunStats.Distance.Value
resultsGUI.Frame.CoinsValue.Text = player.RunStats.CoinsCollected.Value
resultsGUI.Frame.ScoreValue.Text = player.leaderstats.Score.Value
resultsGUI.Parent = player.PlayerGui
return resultsGUI
end
function initialiseNewRun(player, delayTime, charExpected, showLastResults)
if not path then
while not path do
wait()
end
end
local lastResultsGUI = nil
if showLastResults then
lastResultsGUI = showResults(player)
end
if delayTime ~= 0 then
wait(delayTime)
end
if lastResultsGUI ~= nil then
lastResultsGUI:Destroy()
end
if player and player.Parent then
-- charExpected is needed to avoid calling LoadCharacter on players leaving the game
if player.Character or charExpected == false then
player:LoadCharacter()
initialiseRunStats(player)
local playersPath = path()
lastActivePath[player.Name] = playersPath
playersPath:init(player.Name)
end
end
end
function setUpPostRunStats(player)
local folder = Instance.new("Folder")
folder.Name = "RunStats"
folder.Parent = player
local currentDistance = Instance.new("IntValue")
currentDistance.Name = "Distance"
currentDistance.Value = 0
currentDistance.Parent = folder
local coinsCollected = Instance.new("IntValue")
coinsCollected.Name = "CoinsCollected"
coinsCollected.Value = 0
coinsCollected.Parent = folder
end
function onPlayerEntered(player)
player.CharacterAdded:connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.Died:connect(function()
initialiseNewRun(player, 3, true, true)
end)
end
end)
-- Initial loading
loadLeaderstats(player)
setUpPostRunStats(player)
-- Start game
initialiseNewRun(player, 0, false, false)
end
game.Players.PlayerAdded:connect(onPlayerEntered)
function onPlayerRemoving(player)
local track = game.Workspace.Tracks:FindFirstChild(player.Name)
if track ~= nil then
track:Destroy()
end
end
game.Players.PlayerRemoving:connect(onPlayerRemoving)
for _, player in pairs(game.Players:GetChildren()) do
onPlayerEntered(player)
end
|
--////////////////////////////////////////////////////////////////////////////////////////////
--///////////// Code to talk to topbar and maintain set/get core backwards compatibility stuff
--////////////////////////////////////////////////////////////////////////////////////////////
|
local Util = {}
do
function Util.Signal()
local sig = {}
local mSignaler = Instance.new('BindableEvent')
local mArgData = nil
local mArgDataCount = nil
function sig:fire(...)
mArgData = {...}
mArgDataCount = select('#', ...)
mSignaler:Fire()
end
function sig:connect(f)
if not f then error("connect(nil)", 2) end
return mSignaler.Event:connect(function()
f(unpack(mArgData, 1, mArgDataCount))
end)
end
function sig:wait()
mSignaler.Event:wait()
assert(mArgData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
return unpack(mArgData, 1, mArgDataCount)
end
return sig
end
end
function SetVisibility(val)
ChatWindow:SetVisible(val)
moduleApiTable.VisibilityStateChanged:fire(val)
moduleApiTable.Visible = val
if (moduleApiTable.IsCoreGuiEnabled) then
if (val) then
InstantFadeIn()
else
InstantFadeOut()
end
end
end
local DoChatBarFocus = nil
do
moduleApiTable.TopbarEnabled = true
moduleApiTable.MessageCount = 0
moduleApiTable.Visible = true
moduleApiTable.IsCoreGuiEnabled = true
function moduleApiTable:ToggleVisibility()
SetVisibility(not ChatWindow:GetVisible())
end
function moduleApiTable:SetVisible(visible)
if (ChatWindow:GetVisible() ~= visible) then
SetVisibility(visible)
end
end
function moduleApiTable:FocusChatBar()
ChatBar:CaptureFocus()
end
function moduleApiTable:EnterWhisperState(player)
ChatBar:EnterWhisperState(player)
end
function moduleApiTable:GetVisibility()
return ChatWindow:GetVisible()
end
function moduleApiTable:GetMessageCount()
return self.MessageCount
end
function moduleApiTable:TopbarEnabledChanged(enabled)
self.TopbarEnabled = enabled
self.CoreGuiEnabled:fire(game:GetService("StarterGui"):GetCoreGuiEnabled(Enum.CoreGuiType.Chat))
end
function moduleApiTable:IsFocused(useWasFocused)
return ChatBar:IsFocused()
end
moduleApiTable.ChatBarFocusChanged = Util.Signal()
moduleApiTable.VisibilityStateChanged = Util.Signal()
moduleApiTable.MessagesChanged = Util.Signal()
moduleApiTable.MessagePosted = Util.Signal()
moduleApiTable.CoreGuiEnabled = Util.Signal()
moduleApiTable.ChatMakeSystemMessageEvent = Util.Signal()
moduleApiTable.ChatWindowPositionEvent = Util.Signal()
moduleApiTable.ChatWindowSizeEvent = Util.Signal()
moduleApiTable.ChatBarDisabledEvent = Util.Signal()
function moduleApiTable:fChatWindowPosition()
return ChatWindow.GuiObject.Position
end
function moduleApiTable:fChatWindowSize()
return ChatWindow.GuiObject.Size
end
function moduleApiTable:fChatBarDisabled()
return not ChatBar:GetEnabled()
end
if FFlagUserHandleChatHotKeyWithContextActionService then
local TOGGLE_CHAT_ACTION_NAME = "ToggleChat"
-- Callback when chat hotkey is pressed
local function handleAction(actionName, inputState, inputObject)
if actionName == TOGGLE_CHAT_ACTION_NAME and inputState == Enum.UserInputState.Begin and canChat and inputObject.UserInputType == Enum.UserInputType.Keyboard then
DoChatBarFocus()
end
end
ContextActionService:BindAction(TOGGLE_CHAT_ACTION_NAME, handleAction, true, Enum.KeyCode.Slash)
else
function moduleApiTable:SpecialKeyPressed(key, modifiers)
if (key == Enum.SpecialKey.ChatHotkey) then
if canChat then
DoChatBarFocus()
end
end
end
end
end
moduleApiTable.CoreGuiEnabled:connect(function(enabled)
moduleApiTable.IsCoreGuiEnabled = enabled
enabled = enabled and (moduleApiTable.TopbarEnabled or ChatSettings.ChatOnWithTopBarOff)
ChatWindow:SetCoreGuiEnabled(enabled)
if (not enabled) then
ChatBar:ReleaseFocus()
InstantFadeOut()
else
InstantFadeIn()
end
end)
function trimTrailingSpaces(str)
local lastSpace = #str
while lastSpace > 0 do
--- The pattern ^%s matches whitespace at the start of the string. (Starting from lastSpace)
if str:find("^%s", lastSpace) then
lastSpace = lastSpace - 1
else
break
end
end
return str:sub(1, lastSpace)
end
moduleApiTable.ChatMakeSystemMessageEvent:connect(function(valueTable)
if (valueTable["Text"] and type(valueTable["Text"]) == "string") then
while (not DidFirstChannelsLoads) do wait() end
local channel = ChatSettings.GeneralChannelName
local channelObj = ChatWindow:GetChannel(channel)
if (channelObj) then
local messageObject = {
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = channel,
IsFiltered = true,
MessageLength = string.len(valueTable.Text),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(valueTable.Text)),
Message = trimTrailingSpaces(valueTable.Text),
MessageType = ChatConstants.MessageTypeSetCore,
Time = os.time(),
ExtraData = valueTable,
}
channelObj:AddMessageToChannel(messageObject)
ChannelsBar:UpdateMessagePostedInChannel(channel)
moduleApiTable.MessageCount = moduleApiTable.MessageCount + 1
moduleApiTable.MessagesChanged:fire(moduleApiTable.MessageCount)
end
end
end)
moduleApiTable.ChatBarDisabledEvent:connect(function(disabled)
if canChat then
ChatBar:SetEnabled(not disabled)
if (disabled) then
ChatBar:ReleaseFocus()
end
end
end)
moduleApiTable.ChatWindowSizeEvent:connect(function(size)
ChatWindow.GuiObject.Size = size
end)
moduleApiTable.ChatWindowPositionEvent:connect(function(position)
ChatWindow.GuiObject.Position = position
end)
|
-- parry
|
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
attack()
wait(1)
Tool.Enabled = true
end
function onEquipped()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--[[
Finds an empty canvas spot and returns it.
Returns:
- isSuccess (boolean): true if spot can be found, false if the canvas is full
]]
|
function Canvas:getEmptySpot()
if self:isFull() then
return false, constants.Errors.CanvasFull
end
local emptySpots = {}
for _, spot in ipairs(self.spots) do
if not spot:hasArt() then
table.insert(emptySpots, spot)
end
end
local spotIndex = self.rng:NextInteger(1, #emptySpots)
return true, emptySpots[spotIndex]
end
|
--Check if player has access to panel, and copy the appropriate version to their PlayerGUI
|
function givePanel(player)
for i, v in next, _G.panelAdmins do
if i == player.UserId then
local kick, ban, unban, shutdown, kill, broadcast = false, false, false, false, false, false
for s in string.gmatch(v, "%a+") do
if s == "kick" then
kick = true
elseif s == "ban" then
ban = true
elseif s == "unban" then
unban = true
elseif s == "shutdown" then
shutdown = true
elseif s == "kill" then
kill = true
elseif s == "broadcast" then
broadcast = true
end
end
local panel = script.PartnerPanelGui:Clone()
if not kick then
panel.MenuFrame.KickPlayer:Destroy()
panel.KickMenuFrame:Destroy()
panel.Events.KickFunction:Destroy()
end
if not ban then
panel.MenuFrame.BanPlayer:Destroy()
panel.BanMenuFrame:Destroy()
panel.Events.BanFunction:Destroy()
end
if not unban then
panel.MenuFrame.UnbanPlayer:Destroy()
panel.UnbanMenuFrame:Destroy()
panel.Events.UnbanFunction:Destroy()
end
if not shutdown then
panel.MenuFrame.ShutdownServer:Destroy()
panel.Events.ShutdownEvent:Destroy()
end
if not kill then
panel.MenuFrame.KillPlayer:Destroy()
panel.KillMenuFrame:Destroy()
panel.Events.KillFunction:Destroy()
end
if not broadcast then
panel.MenuFrame.BroadcastMessage:Destroy()
panel.BroadcastMenuFrame:Destroy()
panel.Events.BroadcastEvent:Destroy()
end
panel.Parent = player.PlayerGui
break
end
end
end
function thread()
while true do
if workspace.FilteringEnabled == false then
script:Remove()
warn("FilteringEnabled is required to run the Kaixeleron admin panel.")
break
end
wait()
end
end
spawn(thread)
|
--[=[
@within Plasma
@function row
@tag widgets
@param options {padding: Vector2}
@param children () -> () -- Children
Lays out children horizontally
]=]
|
local Runtime = require(script.Parent.Parent.Runtime)
local automaticSize = require(script.Parent.Parent.automaticSize)
return Runtime.widget(function(options, fn)
if type(options) == "function" and fn == nil then
fn = options
options = {}
end
if options.padding then
if type(options.padding) == "number" then
options.padding = UDim.new(0, options.padding)
end
else
options.padding = UDim.new(0, 10)
end
local refs = Runtime.useInstance(function(ref)
local Frame = Instance.new("Frame")
Frame.BackgroundTransparency = 1
local UIListLayout = Instance.new("UIListLayout")
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.FillDirection = Enum.FillDirection.Horizontal
UIListLayout.Padding = options.padding
UIListLayout.Parent = Frame
ref.frame = Frame
automaticSize(Frame)
return Frame
end)
local frame = refs.frame
frame.UIListLayout.HorizontalAlignment = options.alignment or Enum.HorizontalAlignment.Left
Runtime.scope(fn)
end)
|
-- You may turn both of these on at once. In that case, zone-specific music will play in the appropriate zones, and global background music will play whenever you're not within any zone.
|
settings.UseGlobalBackgroundMusic = true -- If you want to play Global Background Music for everyone in your game, set this to true.
settings.UseMusicZones = true -- If you are using the Background Music Zones to play specific music in certain areas, set this to true.
settings.DisplayMuteButton = true -- If set to true, there will be a button in the bottom-right corner of the screen allowing players to mute the background music.
settings.MusicFadeoutTime = 2 -- How long music takes to fade out, in seconds.
settings.MusicOnlyPlaysWithinZones = false -- (This setting only applies when UseGlobalBackgroundMusic is set to false) If a player walks into an area that's not covered by any music zone, what should happen? If true, music will stop playing. If false, the music from the previous zone will continue to play.
return settings
|
-- Public Constructors
|
function RadioButtonLabelClass.new(frame)
local self = setmetatable({}, RadioButtonLabelClass)
self._Maid = Lazy.Utilities.Maid.new()
self.Frame = frame
self.Button = frame.RadioContainer.RadioButton
init(self)
self:SetValue(false)
return self
end
function RadioButtonLabelClass.Create(text)
local cbLabel = RADIOBUTTON_LABEL:Clone()
cbLabel.Label.Text = text
return RadioButtonLabelClass.new(cbLabel)
end
|
-- Connect the "leaderboardSetup()" function to the "PlayerAdded" event
|
Players.PlayerAdded:Connect(leaderboardSetup)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "OwO broke ground" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--PROBABLY WOULDNT TOUCH ABOVE UNLESS YOU KNOW WHAT YOURE DOING
|
Tool.Equipped:Connect(function()
CheckTables() --Check if Table with list of Sounds and Animations are made. If not, make them. Please do not delete this
CanSwing = false
if Settings.EquipAnim == true and Tool.Animations:findFirstChild("Equip") and Hum then --if equip animation true and requirements are met, do this
local EA = Chr.Humanoid:LoadAnimation(Tool.Animations.Equip)
EA:Play()
if Tool.Sounds:findFirstChild("Equip") then
Tool.Sounds.Equip:Play()
end
EA.Stopped:wait()
elseif Settings.EquipAnim == true then --if equip is true but you're missing an animation, print that so we know
print(Plr.Name .. "'s equip animation failed, requirement not met.")
end
CanSwing = true
end)
Tool.Activated:Connect(function()
if CanSwing == true and Hum.Health > 0 then --if youre able to swing and you arent dead
CanSwing = false
CanDamage = true
local Swing = PickThing("Swing")
local Sound = PickThing("Sound")
--go though swings if more than one
local SA = Hum:LoadAnimation(Swing)
SA:Play()
Sound:Play()
wait(Settings.Cooldown)
CanDamage = false
CanSwing = true
end
end)
Tool.Unequipped:Connect(function()
CanSwing = false
CanDamage = false
end)
Settings.Hitbox.Touched:Connect(function(Hit)
local Mod = Hit.Parent
if CanDamage == true then
while not Mod:FindFirstChild("Humanoid") and Mod.Parent ~= game do
Mod = Mod.Parent
end
local Hum = Mod:FindFirstChild("Humanoid")
if game.Players:findFirstChild(Hum.Parent.Name) then
else
if Settings.KillNPCs == true then
-- Check if target is not already dead
if Hum.Health > 0 then
Hum:TakeDamage(Settings.Damage)
CanDamage = false
-- Check if target is now dead
if Hum.Health <= 0 then
-- Increment Plr.leaderstats.Kills.Value by 1
Plr.leaderstats.Kills.Value = Plr.leaderstats.Kills.Value + 1
end
end
else
return
end
end
end
end)
|
-----------------------------------------
|
while true do -- Makes a loop
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
end -- Ends loop
|
--[[ Script Variables ]]
|
--
while not Players.LocalPlayer do
wait()
end
local LocalPlayer = Players.LocalPlayer
local CachedHumanoid = nil
local DPadFrame = nil
local TouchObject = nil
local OnInputEnded = nil -- defined in Create()
|
-- << VARIABLES >>
|
local frame = main.gui.MainFrame.Pages.About
local info = frame.Info
local updatesFrame = frame.Updates
local creditsFrame = frame.Credits
|
-- setup emote chat hook
--[[game:GetService("Players").LocalPlayer.Chatted:Connect(function(msg)
local emote = ""
if msg == "/e dance" then
emote = dances[math.random(1, #dances)]
elseif (string.sub(msg, 1, 3) == "/e ") then
emote = string.sub(msg, 4)
elseif (string.sub(msg, 1, 7) == "/emote ") then
emote = string.sub(msg, 8)
end
if (pose == "Standing" and emoteNames[emote] ~= nil) then
playAnimation(emote, 0.1, Humanoid)
end
end)
]]
| |
-- Components
|
local ScopeOutTooltip = require(script:WaitForChild 'ScopeOutTooltip')
local ScopeLockTooltip = require(script:WaitForChild 'ScopeLockTooltip')
local ScopeInTooltip = require(script:WaitForChild 'ScopeInTooltip')
local AltTooltip = require(script:WaitForChild 'AltTooltip')
local function HotkeyTooltip(props)
local Tooltip = nil
-- Select appropriate tooltip
if props.IsAltDown then
if props.IsScopeParent then
Tooltip = Roact.createElement(ScopeOutTooltip, props)
elseif props.IsScope and (not props.IsScopeLocked) then
Tooltip = Roact.createElement(ScopeLockTooltip, props)
elseif props.IsScopable then
Tooltip = Roact.createElement(ScopeInTooltip, props)
end
elseif props.DisplayAltHotkey then
Tooltip = Roact.createElement(AltTooltip, props)
end
-- Return tooltip with spacer
return Roact.createFragment({
Tooltip = Tooltip;
Spacer = Tooltip and Roact.createElement('Frame', {
BackgroundTransparency = 1;
Size = UDim2.new(0, 0, 1, 0);
LayoutOrder = props.LayoutOrder and (props.LayoutOrder - 1) or 2;
});
})
end
return HotkeyTooltip
|
--[=[
Converts a table to a list.
@param _table table -- Table to convert to a list
@return table
]=]
|
function Table.toList(_table)
local list = {}
for _, item in pairs(_table) do
table.insert(list, item)
end
return list
end
|
-- ROBLOX deviation: omitting DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent
| |
--[=[
Lua-side duplication of the API of events on Roblox objects.
Signals are needed for to ensure that for local events objects are passed by
reference rather than by value where possible, as the BindableEvent objects
always pass signal arguments by value, meaning tables will be deep copied.
Roblox's deep copy method parses to a non-lua table compatable format.
This class is designed to work both in deferred mode and in regular mode.
It follows whatever mode is set.
```lua
local signal = Signal.new()
local arg = {}
signal:Connect(function(value)
assert(arg == value, "Tables are preserved when firing a Signal")
end)
signal:Fire(arg)
```
:::info
Why this over a direct [BindableEvent]? Well, in this case, the signal
prevents Roblox from trying to serialize and desialize each table reference
fired through the BindableEvent.
:::
@class Signal
]=]
|
local HttpService = game:GetService("HttpService")
local ENABLE_TRACEBACK = false
local Signal = {}
Signal.__index = Signal
Signal.ClassName = "Signal"
|
--// updated by bus, because this man's code is garbage.
--// Config
|
local Sensitivity = 1.5 -- how quick/snappy the Sway movements are. Don't go above 2
local SwaySize = 1 -- how large/powerful the Sway is. Don't go above 2
local IncludeStrafe = false -- if true the fps arms will Sway when the Character is strafing
local IncludeWalkSway = true -- if true, fps arms will Sway when you are walking
local IncludeCameraSway = true -- if true, fps arms will Sway when you move the camera
local IncludeJumpSway = true -- if true, jumping will have an effect on the Viewmodel
local HeadOffset = Vector3.new(0,0,0) -- the offset from the default camera position of the head. (0,1,0) will put the camera one stud above the head.
local baseArmTransparency = 0 -- the transparency of the arms in first person; set to 1 for invisible and set to 0 for fully visible.
|
--======================================--
--==============Weld Parents(WPR)==============--
--======================================--
|
w1.Parent = bin.Handle
w2.Parent = bin.Handle
w3.Parent = bin.Handle
w4.Parent = bin.Handle
w5.Parent = bin.Handle
w6.Parent = bin.Handle
w7.Parent = bin.Handle
w8.Parent = bin.Handle
w9.Parent = bin.Handle
w10.Parent = bin.Handle
w11.Parent = bin.Handle
w12.Parent = bin.Handle
|
-------------------
---[[Functions]]---
-------------------
|
local function HasProperty(object, prop)
local success, val = pcall(function()
return object[prop]
end)
return success and val ~= object:FindFirstChild(prop)
end
|
-- FOLDERS --
|
local Modules = RS:WaitForChild("Modules")
local Remotes = RS:WaitForChild("Remotes")
local Hitboxes = RS:WaitForChild("Hitboxes")
local FX = RS:WaitForChild("FX")
local Sounds = RS:WaitForChild("Sounds")
|
--[[
Recursively iterates through the object to construct strings and add it to the localization table
@param localeId string -- The localizationid to add
@param baseKey string -- the key to add
@param object any -- The value to iterate over
]]
|
local function recurseAdd(localizationTable, localeId, baseKey, object)
if baseKey ~= "" then
baseKey = baseKey .. "."
end
for index, value in pairs(object) do
local key = baseKey .. index
if type(value) == "table" then
recurseAdd(localizationTable, localeId, key, value)
elseif type(value) == "string" then
local source = ""
local context = ""
if localeId == "en" then
source = value
end
localizationTable:SetEntryValue(key, source, context, localeId, value)
else
error("Bad type for value in '" .. key .. "'.")
end
end
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 600 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 1090 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 5400 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent._Index
local Package = require(PackageIndex["CollisionMatchers2D"]["CollisionMatchers2D"])
return Package
|
--Evento animación de muerte
|
Humanoid.HealthChanged:Connect(function(Health)
if Health <= 0 then
script.Parent.HumanoidRootPart.Anchored = true
DeathAnimation:Play()
wait(1.20) --Aquí colocar tiempo para que empieze a desaparecer el NPC
for i, v in pairs( NPC:GetDescendants()) do
if v:IsA("Part") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal") then
local deathFade = TweenService:Create(v, TweenInfo.new(0.4), {Transparency = 1})
deathFade:Play()
end
end
wait(0.5)
NPC:Remove()
wait(4) --Aquí colocar tiempo para que el NPC haga respawn
newNPC.Parent = game.Workspace
end
end)
|
-- Local Variables
|
local TimeObject = game.Workspace:WaitForChild('MapPurgeProof'):WaitForChild('Time')
local ScreenGui = script.Parent.ScreenGui
local Timer = ScreenGui.ScoreFrame.Timer
local Events = game.ReplicatedStorage.Events
local DisplayTimerInfo = Events.DisplayTimerInfo
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local methods = {}
methods.__index = methods
function methods:SendSystemMessage(message, extraData)
local messageObj = self:InternalCreateMessageObject(message, nil, true, extraData)
local success, err = pcall(function() self.eMessagePosted:Fire(messageObj) end)
if not success and err then
print("Error posting message: " ..err)
end
self:InternalAddMessageToHistoryLog(messageObj)
for i, speaker in pairs(self.Speakers) do
speaker:InternalSendSystemMessage(messageObj, self.Name)
end
return messageObj
end
function methods:SendSystemMessageToSpeaker(message, speakerName, extraData)
local speaker = self.Speakers[speakerName]
if (speaker) then
local messageObj = self:InternalCreateMessageObject(message, nil, true, extraData)
speaker:InternalSendSystemMessage(messageObj, self.Name)
elseif RunService:IsStudio() then
warn(string.format("Speaker '%s' is not in channel '%s' and cannot be sent a system message", speakerName, self.Name))
end
end
function methods:SendMessageObjToFilters(message, messageObj, fromSpeaker)
local oldMessage = messageObj.Message
messageObj.Message = message
self:InternalDoMessageFilter(fromSpeaker.Name, messageObj, self.Name)
self.ChatService:InternalDoMessageFilter(fromSpeaker.Name, messageObj, self.Name)
local newMessage = messageObj.Message
messageObj.Message = oldMessage
return newMessage
end
function methods:CanCommunicateByUserId(userId1, userId2)
if RunService:IsStudio() then
return true
end
-- UserId is set as 0 for non player speakers.
if userId1 == 0 or userId2 == 0 then
return true
end
local success, canCommunicate = pcall(function()
return Chat:CanUsersChatAsync(userId1, userId2)
end)
return success and canCommunicate
end
function methods:CanCommunicate(speakerObj1, speakerObj2)
local player1 = speakerObj1:GetPlayer()
local player2 = speakerObj2:GetPlayer()
if player1 and player2 then
return self:CanCommunicateByUserId(player1.UserId, player2.UserId)
end
return true
end
function methods:SendMessageToSpeaker(message, speakerName, fromSpeakerName, extraData)
local speakerTo = self.Speakers[speakerName]
local speakerFrom = self.ChatService:GetSpeaker(fromSpeakerName)
if speakerTo and speakerFrom then
local isMuted = speakerTo:IsSpeakerMuted(fromSpeakerName)
if isMuted then
return
end
if not self:CanCommunicate(speakerTo, speakerFrom) then
return
end
-- We need to claim the message is filtered even if it not in this case for compatibility with legacy client side code.
local isFiltered = speakerName == fromSpeakerName
local messageObj = self:InternalCreateMessageObject(message, fromSpeakerName, isFiltered, extraData)
message = self:SendMessageObjToFilters(message, messageObj, fromSpeakerName)
speakerTo:InternalSendMessage(messageObj, self.Name)
local textContext = self.Private and Enum.TextFilterContext.PrivateChat or Enum.TextFilterContext.PublicChat
local filterSuccess, isFilterResult, filteredMessage = self.ChatService:InternalApplyRobloxFilterNewAPI(
messageObj.FromSpeaker,
message,
textContext
)
if (filterSuccess) then
messageObj.FilterResult = filteredMessage
messageObj.IsFilterResult = isFilterResult
messageObj.IsFiltered = true
speakerTo:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
end
elseif RunService:IsStudio() then
warn(string.format("Speaker '%s' is not in channel '%s' and cannot be sent a message", speakerName, self.Name))
end
end
function methods:KickSpeaker(speakerName, reason)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
local messageToSpeaker = ""
local messageToChannel = ""
local playerName = speaker:GetNameForDisplay()
if (reason) then
messageToSpeaker = string.format("You were kicked from '%s' for the following reason(s): %s", self.Name, reason)
messageToChannel = string.format("%s was kicked for the following reason(s): %s", playerName, reason)
else
messageToSpeaker = string.format("You were kicked from '%s'", self.Name)
messageToChannel = string.format("%s was kicked", playerName)
end
self:SendSystemMessageToSpeaker(messageToSpeaker, speakerName)
speaker:LeaveChannel(self.Name)
self:SendSystemMessage(messageToChannel)
end
function methods:MuteSpeaker(speakerName, reason, length)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
self.Mutes[speakerName:lower()] = (length == 0 or length == nil) and 0 or (os.time() + length)
if (reason) then
local playerName = speaker:GetNameForDisplay()
self:SendSystemMessage(string.format("%s was muted for the following reason(s): %s", playerName, reason))
end
local success, err = pcall(function() self.eSpeakerMuted:Fire(speakerName, reason, length) end)
if not success and err then
print("Error mutting speaker: " ..err)
end
local spkr = self.ChatService:GetSpeaker(speakerName)
if (spkr) then
local success, err = pcall(function() spkr.eMuted:Fire(self.Name, reason, length) end)
if not success and err then
print("Error mutting speaker: " ..err)
end
end
end
function methods:UnmuteSpeaker(speakerName)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
self.Mutes[speakerName:lower()] = nil
local success, err = pcall(function() self.eSpeakerUnmuted:Fire(speakerName) end)
if not success and err then
print("Error unmuting speaker: " ..err)
end
local spkr = self.ChatService:GetSpeaker(speakerName)
if (spkr) then
local success, err = pcall(function() spkr.eUnmuted:Fire(self.Name) end)
if not success and err then
print("Error unmuting speaker: " ..err)
end
end
end
function methods:IsSpeakerMuted(speakerName)
return (self.Mutes[speakerName:lower()] ~= nil)
end
function methods:GetSpeakerList()
local list = {}
for i, speaker in pairs(self.Speakers) do
table.insert(list, speaker.Name)
end
return list
end
function methods:RegisterFilterMessageFunction(funcId, func, priority)
if self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' already exists", funcId))
end
self.FilterMessageFunctions:AddFunction(funcId, func, priority)
end
function methods:FilterMessageFunctionExists(funcId)
return self.FilterMessageFunctions:HasFunction(funcId)
end
function methods:UnregisterFilterMessageFunction(funcId)
if not self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' does not exists", funcId))
end
self.FilterMessageFunctions:RemoveFunction(funcId)
end
function methods:RegisterProcessCommandsFunction(funcId, func, priority)
if self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' already exists", funcId))
end
self.ProcessCommandsFunctions:AddFunction(funcId, func, priority)
end
function methods:ProcessCommandsFunctionExists(funcId)
return self.ProcessCommandsFunctions:HasFunction(funcId)
end
function methods:UnregisterProcessCommandsFunction(funcId)
if not self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' does not exist", funcId))
end
self.ProcessCommandsFunctions:RemoveFunction(funcId)
end
local function ShallowCopy(table)
local copy = {}
for i, v in pairs(table) do
copy[i] = v
end
return copy
end
function methods:GetHistoryLog()
return ShallowCopy(self.ChatHistory)
end
function methods:GetHistoryLogForSpeaker(speaker)
local userId = -1
local player = speaker:GetPlayer()
if player then
userId = player.UserId
end
local chatlog = {}
for i = 1, #self.ChatHistory do
local logUserId = self.ChatHistory[i].SpeakerUserId
if self:CanCommunicateByUserId(userId, logUserId) then
local messageObj = ShallowCopy(self.ChatHistory[i])
--// Since we're using the new filter API, we need to convert the stored filter result
--// into an actual string message to send to players for their chat history.
--// System messages aren't filtered the same way, so they just have a regular
--// text value in the Message field.
if (messageObj.MessageType == ChatConstants.MessageTypeDefault or messageObj.MessageType == ChatConstants.MessageTypeMeCommand) then
local filterResult = messageObj.FilterResult
if (messageObj.IsFilterResult) then
if (player) then
messageObj.Message = filterResult:GetChatForUserAsync(player.UserId)
else
messageObj.Message = filterResult:GetNonChatStringForBroadcastAsync()
end
else
messageObj.Message = filterResult
end
end
table.insert(chatlog, messageObj)
end
end
return chatlog
end
|
--------------------------------------------------------------------------
|
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .8 ,
FTargetFriction = 0.93 ,
FMinFriction = .1 ,
RWearSpeed = .8 ,
RTargetFriction = 0.97 ,
RMinFriction = .1 ,
--Tire Slip
TCSOffRatio = 1/3 ,
WheelLockRatio = 1/2 , --SS6 Default = 1/4
WheelspinRatio = 1/1.1 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = .5 , --SS6 Default = .5
RElasticity = .5 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
|
-- Get reference to the Dock frame
|
local dock = script.Parent.Parent.AdmDockShelf
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.