prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[
Template messages:
Announcement: The RHS servers will be restarting in 10 minutes for a new update. You'll automatically be teleported to an updated server then!
--]]
| |
--- Skill
|
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = false
Tool.Active.Value = "LightBeam"
Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
Track1:Play()
wait(0.27)
script.Fire:FireServer(plr)
local hum = Player.Character.Humanoid
for i = 1,2 do
wait()
hum.CameraOffset = Vector3.new(
math.random(-1,1),
math.random(-1,1),
math.random(-1,1)
)
end
hum.CameraOffset = Vector3.new(0,0,0)
Tool.Active.Value = "None"
wait(1.5)
Debounce = true
end
end)
|
---
|
lastHealth=100
damagedone=100
function AnimateHurtOverlay()
|
--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.WaterLily-- 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)
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
RunService = game:GetService("RunService")
UserInputService = game:GetService("UserInputService")
Animations = {}
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
Rate = (1 / 60)
ToolEquipped = false
function SetAnimation(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop(value.FadeTime)
table.remove(Animations, i)
end
end
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
PlayerMouse = Player:GetMouse()
end
function Unequipped()
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
Animations = {}
ToolEquipped = false
end
function InvokeServer(mode, value)
local ServerReturn
pcall(function()
ServerReturn = ServerControl:InvokeServer(mode, value)
end)
return ServerReturn
end
function OnClientInvoke(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" and value then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return ((PlayerMouse and {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}) or nil)
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--[[
local keyboard = require(this)
METHODS:
(IsDown)
Boolean isDown: keyboard:IsDown(KeyCode key)
EVENTS:
(KeyDown, KeyUp)
keyboard.KeyDown(KeyCode key)
keyboard.KeyUp(KeyCode key)
--]]
|
assert(game:GetService("RunService"):IsClient(), "Keyboard can only be used from client")
local Keyboard = {}
local userInput = game:GetService("UserInputService")
local isDown = {}
local keyboardInput = Enum.UserInputType.Keyboard
local onKeyDown = Instance.new("BindableEvent")
local onKeyUp = Instance.new("BindableEvent")
Keyboard.KeyDown = onKeyDown.Event
Keyboard.KeyUp = onKeyUp.Event
function Keyboard:IsDown(keyCode)
return (isDown[keyCode] == true)
end
local function InputBegan(input, processed)
if (processed) then return end
if (input.UserInputType == keyboardInput) then
local key = input.KeyCode
isDown[key] = true
onKeyDown:Fire(key)
end
end
local function InputEnded(input, processed)
if (processed) then return end
if (input.UserInputType == keyboardInput) then
local key = input.KeyCode
isDown[key] = false
onKeyUp:Fire(key)
end
end
userInput.InputBegan:Connect(InputBegan)
userInput.InputEnded:Connect(InputEnded)
return Keyboard
|
--Tune
|
OverheatSpeed = .05 --How fast the car will overheat
CoolingEfficiency = .01 --How fast the car will cool down
RunningTemp = 50 --In degrees
Fan = true --Cooling fan
FanTemp = 90 --At what temperature the cooling fan will activate
FanTempAlpha = 80 --At what temperature the cooling fan will deactivate
FanSpeed = .02 --How fast the car will cool down
FanVolume = .5 --Sound volume
BlowupTemp = 130 --At what temperature the engine will blow up
GUI = true --GUI temperature gauge
|
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = Zombie:LoadAnimation(anim)
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
|
--------------------------------------------------------------------------------
|
local Car = script.Parent.Car.Value
local Values = script.Parent.Values
local _Tune = require(Car["A-Chassis Tune"])
local Handler = Car:WaitForChild("ENGINE_PACK")
local FE = workspace.FilteringEnabled
local ENG_PCK = nil
for _,Child in pairs(Car.Misc:GetDescendants()) do
if Child:IsA("ObjectValue") and Child.Name == "ENGINE_PACK" then ENG_PCK = Child.Value end
end
local CG = ENG_PCK:FindFirstChild("Cam_Gears")
local ES = ENG_PCK:FindFirstChild("Engine_Shake")
local MH = ENG_PCK:FindFirstChild("Manifold_Heat")
local TB = ENG_PCK:FindFirstChild("Throttle_Body")
local TI = ENG_PCK:FindFirstChild("Timing_Belt")
local TC = ENG_PCK:FindFirstChild("Turbochargers")
local VAL = 0
local ThrottleChanged = Values.Throttle.Changed:Connect(function()
if FE then
Handler:FireServer("Throttle",Values.Throttle.Value,TB,THROTTLE_BODY)
else
if THROTTLE_BODY and TB ~= nil then
for i,Body in pairs(TB:GetChildren()) do
if string.sub(Body.Name,1,4) == "Body" then
local Motor = Body.W:FindFirstChildOfClass("Motor")
Motor.DesiredAngle = Values.Throttle.Value * 1.5
end
end
end
end
end)
local RPMChanged = Values.RPM.Changed:Connect(function()
if FE then
Handler:FireServer("RPM",Values.RPM.Value,CG,ES,TI,CAM_GEARS,ENGINE_SHAKE,TIMING_BELT,GEAR_SPEED,SHAKE_VALUE,BELT_SPEED)
else
if CAM_GEARS and CG ~= nil then
for i,Gear in pairs(CG:GetChildren()) do
if string.sub(Gear.Name,1,4) == "Gear" then
local Motor = Gear.W:FindFirstChildOfClass("Motor")
Motor.DesiredAngle = 9e9
Motor.MaxVelocity = Values.RPM.Value/1000 * GEAR_SPEED
end
end
end
if ENGINE_SHAKE and ES ~= nil then
local Motor = ES.W:FindFirstChildOfClass("Motor")
Motor.MaxVelocity = Values.RPM.Value/50000 * (SHAKE_VALUE/10)
end
if TIMING_BELT and TI ~= nil then
for i,Beam in pairs(TI.Beams:GetChildren()) do
Beam.TextureSpeed = Values.RPM.Value/1000 * BELT_SPEED
end
end
end
end)
local BoostChanged = Values.Boost.Changed:connect(function()
if FE then
Handler:FireServer("Boost",Values.Boost.Value,_Tune,TC,TURBO_CHARGED,TURBO_BLUR,TURBO_SPEED)
else
if TURBO_CHARGED and TC ~= nil then
for i,Turbo in pairs(TC:GetChildren()) do
if string.sub(Turbo.Name,1,5) == "Turbo" then
local Motor = Turbo.W:FindFirstChildOfClass("Motor")
Motor.DesiredAngle = 9e9
if math.floor(Values.Boost.Value) * TURBO_SPEED == 0 then
Motor.MaxVelocity = 0
else
Motor.MaxVelocity = Values.Boost.Value * TURBO_SPEED
end
if TURBO_BLUR and Turbo.Parts:FindFirstChild("MotionBlur") then
Turbo.Parts.MotionBlur.Blur.Transparency = 1 - (Values.Boost.Value/_Tune.T_Boost/2*0.9)
end
end
end
end
end
end)
local Disable = script.Parent.IsOn.Changed:Connect(function()
if FE then Handler:FireServer("Disable",script.Parent.IsOn.Value,ENG_PCK,CAM_GEARS,ENGINE_SHAKE,MANIFOLD_HEAT,THROTTLE_BODY,TIMING_BELT,TURBO_CHARGED)
else
if script.Parent.IsOn.Value == true then
CAM_GEARS = true
ENGINE_SHAKE = true
MANIFOLD_HEAT = true
THROTTLE_BODY = true
TIMING_BELT = true
TURBO_CHARGED = true
else
CAM_GEARS = false
ENGINE_SHAKE = false
MANIFOLD_HEAT = false
THROTTLE_BODY = false
TIMING_BELT = false
TURBO_CHARGED = false
for i,Object in pairs(ENG_PCK:GetDescendants()) do
if Object:IsA("Motor") then
Object.MaxVelocity = 0
end
if Object:IsA("Beam") then
Object.TextureSpeed = 0
end
end
end
end
end)
Car.DriveSeat.ChildRemoved:Connect(function(Child)
if Child.Name == "SeatWeld" and LEAVE_DISABLE then
if FE then
Handler:FireServer("Disable",false,ENG_PCK,CAM_GEARS,ENGINE_SHAKE,MANIFOLD_HEAT,THROTTLE_BODY,TIMING_BELT,TURBO_CHARGED)
else
CAM_GEARS = false
ENGINE_SHAKE = false
MANIFOLD_HEAT = false
THROTTLE_BODY = false
TIMING_BELT = false
TURBO_CHARGED = false
for i,Object in pairs(ENG_PCK:GetDescendants()) do
if Object:IsA("Motor") then
Object.MaxVelocity = 0
end
if Object:IsA("Beam") then
Object.TextureSpeed = 0
end
end
end
end
end)
if FE then
Handler:FireServer("Loop",ES,MH,TI,ENGINE_SHAKE,MANIFOLD_HEAT,TIMING_BELT,SHAKE_ANGLE,MH_THRESHOLD,MH_COOLDOWN,BELT_TEXTURE,BELT_WIDTH)
else
spawn(function()
if ENGINE_SHAKE and ES ~= nil then
ES.W.Motor.DesiredAngle = math.rad(SHAKE_ANGLE)
end
if TIMING_BELT and TI ~= nil then
for i,Beam in pairs(TI.Beams:GetChildren()) do
if Beam:IsA("Beam") then
Beam.Texture = "rbxassetid://"..BELT_TEXTURE
Beam.Width0 = BELT_WIDTH
Beam.Width1 = BELT_WIDTH
end
end
end
while wait() do
if ENGINE_SHAKE and ES ~= nil then
ES.W.Motor.DesiredAngle = -(ES.W.Motor.DesiredAngle)
end
if MANIFOLD_HEAT and MH ~= nil then
if Values.RPM.Value > MH_THRESHOLD then
VAL = math.max(math.min(VAL + Values.RPM.Value/900000,1),0)
for i,ManifoldPart in pairs(MH.Parts:GetDescendants()) do
if ManifoldPart:IsA("BasePart") then
ManifoldPart.Color = Color3.fromRGB((110*VAL)+60,(45*VAL)+40,40-(40*VAL))
end
end
elseif Values.RPM.Value < MH_THRESHOLD then
VAL = math.max(math.min(VAL + -(MH_COOLDOWN/1000),1),0)
for i,ManifoldPart in pairs(MH.Parts:GetDescendants()) do
if ManifoldPart:IsA("BasePart") then
ManifoldPart.Color = Color3.fromRGB((110*VAL)+60,(45*VAL)+40,40-(40*VAL))
end
end
end
end
end
end)
end
|
--Offset For Each New Ray For The Bullet's Trajectory
|
local offset = (parts.Parent.Gun.Muzzle.CFrame*CFrame.new(math.random(-5,5)/5,100,math.random(-5,5)/5).p
- parts.Parent.Gun.Muzzle.Position).unit
*script.Parent.Stats.GunVelocity.Value
local point1 = parts.Parent.Gun.Muzzle.Position
|
-- This function selects the lowest number gamepad from the currently-connected gamepad
-- and sets it as the active gamepad
|
function Gamepad:GetHighestPriorityGamepad()
local connectedGamepads = UserInputService:GetConnectedGamepads()
local bestGamepad = NONE -- Note that this value is higher than all valid gamepad values
for _, gamepad in pairs(connectedGamepads) do
if gamepad.Value < bestGamepad.Value then
bestGamepad = gamepad
end
end
return bestGamepad
end
function Gamepad:BindContextActions()
if self.activeGamepad == NONE then
-- There must be an active gamepad to set up bindings
return false
end
local handleJumpAction = function(actionName, inputState, inputObject)
self.isJumping = (inputState == Enum.UserInputState.Begin)
return Enum.ContextActionResult.Sink
end
local handleThumbstickInput = function(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.Cancel then
self.moveVector = ZERO_VECTOR3
return Enum.ContextActionResult.Sink
end
if self.activeGamepad ~= inputObject.UserInputType then
return Enum.ContextActionResult.Pass
end
if inputObject.KeyCode ~= Enum.KeyCode.Thumbstick1 then return end
if inputObject.Position.magnitude > thumbstickDeadzone then
self.moveVector = Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y)
else
self.moveVector = ZERO_VECTOR3
end
return Enum.ContextActionResult.Sink
end
--ContextActionService:BindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false,
self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA)
ContextActionService:BindActionAtPriority("moveThumbstick", handleThumbstickInput, false,
self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1)
return true
end
function Gamepad:UnbindContextActions()
if self.activeGamepad ~= NONE then
ContextActionService:UnbindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
end
ContextActionService:UnbindAction("moveThumbstick")
ContextActionService:UnbindAction("jumpAction")
end
function Gamepad:OnNewGamepadConnected()
-- A new gamepad has been connected.
local bestGamepad: Enum.UserInputType = self:GetHighestPriorityGamepad()
if bestGamepad == self.activeGamepad then
-- A new gamepad was connected, but our active gamepad is not changing
return
end
if bestGamepad == NONE then
-- There should be an active gamepad when GamepadConnected fires, so this should not
-- normally be hit. If there is no active gamepad, unbind actions but leave
-- the module enabled and continue to listen for a new gamepad connection.
warn("Gamepad:OnNewGamepadConnected found no connected gamepads")
self:UnbindContextActions()
return
end
if self.activeGamepad ~= NONE then
-- Switching from one active gamepad to another
self:UnbindContextActions()
end
self.activeGamepad = bestGamepad
self:BindContextActions()
end
function Gamepad:OnCurrentGamepadDisconnected()
if self.activeGamepad ~= NONE then
ContextActionService:UnbindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
end
local bestGamepad = self:GetHighestPriorityGamepad()
if self.activeGamepad ~= NONE and bestGamepad == self.activeGamepad then
warn("Gamepad:OnCurrentGamepadDisconnected found the supposedly disconnected gamepad in connectedGamepads.")
self:UnbindContextActions()
self.activeGamepad = NONE
return
end
if bestGamepad == NONE then
-- No active gamepad, unbinding actions but leaving gamepad connection listener active
self:UnbindContextActions()
self.activeGamepad = NONE
else
-- Set new gamepad as active and bind to tool activation
self.activeGamepad = bestGamepad
ContextActionService:BindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
end
end
function Gamepad:ConnectGamepadConnectionListeners()
self.gamepadConnectedConn = UserInputService.GamepadConnected:Connect(function(gamepadEnum)
self:OnNewGamepadConnected()
end)
self.gamepadDisconnectedConn = UserInputService.GamepadDisconnected:Connect(function(gamepadEnum)
if self.activeGamepad == gamepadEnum then
self:OnCurrentGamepadDisconnected()
end
end)
end
function Gamepad:DisconnectGamepadConnectionListeners()
if self.gamepadConnectedConn then
self.gamepadConnectedConn:Disconnect()
self.gamepadConnectedConn = nil
end
if self.gamepadDisconnectedConn then
self.gamepadDisconnectedConn:Disconnect()
self.gamepadDisconnectedConn = nil
end
end
return Gamepad
|
--[[
Useful for hovering over ui elements
--]]
|
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
local Hover = {}
Hover.__index = Hover
-- pass the element, and two functions (1=enter, 2=leave)
function Hover.Connect(element,enter,leave, call_leave_on_selection_lost)
local self = {}
setmetatable(self,Hover)
self.Connections = {}
self.Active = false;
if element and (enter or leave) then -- support both, or just one function (maybe we just want a sound to play on leave, etc)
if call_leave_on_selection_lost then
table.insert(self.Connections,
element.SelectionGained:Connect(function()
self.Active = true
if enter then enter() end
end)
)
table.insert(self.Connections,
element.SelectionLost:Connect(function()
self.Active = true
if leave then leave() end
end)
)
end
table.insert(self.Connections,
element.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
self.Active = true
if enter then enter() end
end
end)
)
table.insert(self.Connections,
element.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
self.Active = false
if leave then leave() end
end
end)
)
end
return self
end
-- disconnects the events.
function Hover:Disconnect()
if self and self.Connections then
for i=1,#self.Connections do
local connection = self.Connections[i]
if connection then connection:Disconnect() end
end
end
self = nil
end
return Hover
|
--There's a reason why this hasn't been done before by ROBLOX users (as far as I know)
--It's really mathy, really long, and really confusing.
--0.000033 seconds is the worst, 0.000018 looks like the average case.
--Also I ran out of local variables so I had to redo everything so that I could reuse the names lol.
--So don't even try to read it.
|
local BoxCollision do
local components=CFrame.new().components
function BoxCollision(CFrame0,Size0,CFrame1,Size1,AssumeTrue)
local m00,m01,m02,
m03,m04,m05,
m06,m07,m08,
m09,m10,m11 =components(CFrame0)
local m12,m13,m14,
m15,m16,m17,
m18,m19,m20,
m21,m22,m23 =components(CFrame1)
local m24,m25,m26 =Size0.x/2,Size0.y/2,Size0.z/2
local m27,m28,m29 =Size1.x/2,Size1.y/2,Size1.z/2
local m30,m31,m32 =m12-m00,m13-m01,m14-m02
local m00 =m03*m30+m06*m31+m09*m32
local m01 =m04*m30+m07*m31+m10*m32
local m02 =m05*m30+m08*m31+m11*m32
local m12 =m15*m30+m18*m31+m21*m32
local m13 =m16*m30+m19*m31+m22*m32
local m14 =m17*m30+m20*m31+m23*m32
local m30 =m12>m27 and m12-m27
or m12<-m27 and m12+m27
or 0
local m31 =m13>m28 and m13-m28
or m13<-m28 and m13+m28
or 0
local m32 =m14>m29 and m14-m29
or m14<-m29 and m14+m29
or 0
local m33 =m00>m24 and m00-m24
or m00<-m24 and m00+m24
or 0
local m34 =m01>m25 and m01-m25
or m01<-m25 and m01+m25
or 0
local m35 =m02>m26 and m02-m26
or m02<-m26 and m02+m26
or 0
local m36 =m30*m30+m31*m31+m32*m32
local m30 =m33*m33+m34*m34+m35*m35
local m31 =m24<m25 and (m24<m26 and m24 or m26)
or (m25<m26 and m25 or m26)
local m32 =m27<m28 and (m27<m29 and m27 or m29)
or (m28<m29 and m28 or m29)
if m36<m31*m31 or m30<m32*m32 then
return true
elseif m36>m24*m24+m25*m25+m26*m26 or m30>m27*m27+m28*m28+m29*m29 then
return false
elseif AssumeTrue==nil then
--LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL
--(This is how you tell if something was made by Axis Angle)
local m30=m03*m15+m06*m18+m09*m21
local m31=m03*m16+m06*m19+m09*m22
local m32=m03*m17+m06*m20+m09*m23
local m03=m04*m15+m07*m18+m10*m21
local m06=m04*m16+m07*m19+m10*m22
local m09=m04*m17+m07*m20+m10*m23
local m04=m05*m15+m08*m18+m11*m21
local m07=m05*m16+m08*m19+m11*m22
local m10=m05*m17+m08*m20+m11*m23
local m05=m29*m29
local m08=m27*m27
local m11=m28*m28
local m15=m24*m30
local m16=m25*m03
local m17=m26*m04
local m18=m24*m31
local m19=m25*m06
local m20=m26*m07
local m21=m24*m32
local m22=m25*m09
local m23=m26*m10
local m33=m15+m16+m17-m12;if m33*m33<m08 then local m34=m18+m19+m20-m13;if m34*m34<m11 then local m35=m21+m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=-m15+m16+m17-m12;if m33*m33<m08 then local m34=-m18+m19+m20-m13;if m34*m34<m11 then local m35=-m21+m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=m15-m16+m17-m12;if m33*m33<m08 then local m34=m18-m19+m20-m13;if m34*m34<m11 then local m35=m21-m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=-m15-m16+m17-m12;if m33*m33<m08 then local m34=-m18-m19+m20-m13;if m34*m34<m11 then local m35=-m21-m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=m15+m16-m17-m12;if m33*m33<m08 then local m34=m18+m19-m20-m13;if m34*m34<m11 then local m35=m21+m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=-m15+m16-m17-m12;if m33*m33<m08 then local m34=-m18+m19-m20-m13;if m34*m34<m11 then local m35=-m21+m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=m15-m16-m17-m12;if m33*m33<m08 then local m34=m18-m19-m20-m13;if m34*m34<m11 then local m35=m21-m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
local m33=-m15-m16-m17-m12;if m33*m33<m08 then local m34=-m18-m19-m20-m13;if m34*m34<m11 then local m35=-m21-m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
local m12=m24*m24
local m13=m25*m25
local m14=m26*m26
local m15=m27*m04
local m16=m28*m07
local m17=m27*m30
local m18=m28*m31
local m19=m27*m03
local m20=m28*m06
local m21=m29*m10
local m22=m29*m32
local m23=m29*m09
local m35=(m02-m26+m15+m16)/m10;if m35*m35<m05 then local m33=m00+m17+m18-m35*m32;if m33*m33<m12 then local m34=m01+m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26+m15+m16)/m10;if m35*m35<m05 then local m33=m00+m17+m18-m35*m32;if m33*m33<m12 then local m34=m01+m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26-m15+m16)/m10;if m35*m35<m05 then local m33=m00-m17+m18-m35*m32;if m33*m33<m12 then local m34=m01-m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26-m15+m16)/m10;if m35*m35<m05 then local m33=m00-m17+m18-m35*m32;if m33*m33<m12 then local m34=m01-m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26+m15-m16)/m10;if m35*m35<m05 then local m33=m00+m17-m18-m35*m32;if m33*m33<m12 then local m34=m01+m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26+m15-m16)/m10;if m35*m35<m05 then local m33=m00+m17-m18-m35*m32;if m33*m33<m12 then local m34=m01+m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26-m15-m16)/m10;if m35*m35<m05 then local m33=m00-m17-m18-m35*m32;if m33*m33<m12 then local m34=m01-m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26-m15-m16)/m10;if m35*m35<m05 then local m33=m00-m17-m18-m35*m32;if m33*m33<m12 then local m34=m01-m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
local m35=(m00-m24+m17+m18)/m32;if m35*m35<m05 then local m33=m01+m19+m20-m35*m09;if m33*m33<m13 then local m34=m02+m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24+m17+m18)/m32;if m35*m35<m05 then local m33=m01+m19+m20-m35*m09;if m33*m33<m13 then local m34=m02+m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24-m17+m18)/m32;if m35*m35<m05 then local m33=m01-m19+m20-m35*m09;if m33*m33<m13 then local m34=m02-m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24-m17+m18)/m32;if m35*m35<m05 then local m33=m01-m19+m20-m35*m09;if m33*m33<m13 then local m34=m02-m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24+m17-m18)/m32;if m35*m35<m05 then local m33=m01+m19-m20-m35*m09;if m33*m33<m13 then local m34=m02+m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24+m17-m18)/m32;if m35*m35<m05 then local m33=m01+m19-m20-m35*m09;if m33*m33<m13 then local m34=m02+m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24-m17-m18)/m32;if m35*m35<m05 then local m33=m01-m19-m20-m35*m09;if m33*m33<m13 then local m34=m02-m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24-m17-m18)/m32;if m35*m35<m05 then local m33=m01-m19-m20-m35*m09;if m33*m33<m13 then local m34=m02-m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
local m35=(m01-m25+m19+m20)/m09;if m35*m35<m05 then local m33=m02+m15+m16-m35*m10;if m33*m33<m14 then local m34=m00+m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25+m19+m20)/m09;if m35*m35<m05 then local m33=m02+m15+m16-m35*m10;if m33*m33<m14 then local m34=m00+m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25-m19+m20)/m09;if m35*m35<m05 then local m33=m02-m15+m16-m35*m10;if m33*m33<m14 then local m34=m00-m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25-m19+m20)/m09;if m35*m35<m05 then local m33=m02-m15+m16-m35*m10;if m33*m33<m14 then local m34=m00-m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25+m19-m20)/m09;if m35*m35<m05 then local m33=m02+m15-m16-m35*m10;if m33*m33<m14 then local m34=m00+m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25+m19-m20)/m09;if m35*m35<m05 then local m33=m02+m15-m16-m35*m10;if m33*m33<m14 then local m34=m00+m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25-m19-m20)/m09;if m35*m35<m05 then local m33=m02-m15-m16-m35*m10;if m33*m33<m14 then local m34=m00-m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25-m19-m20)/m09;if m35*m35<m05 then local m33=m02-m15-m16-m35*m10;if m33*m33<m14 then local m34=m00-m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
local m35=(m02-m26+m16+m21)/m04;if m35*m35<m08 then local m33=m00+m18+m22-m35*m30;if m33*m33<m12 then local m34=m01+m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26+m16+m21)/m04;if m35*m35<m08 then local m33=m00+m18+m22-m35*m30;if m33*m33<m12 then local m34=m01+m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26-m16+m21)/m04;if m35*m35<m08 then local m33=m00-m18+m22-m35*m30;if m33*m33<m12 then local m34=m01-m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26-m16+m21)/m04;if m35*m35<m08 then local m33=m00-m18+m22-m35*m30;if m33*m33<m12 then local m34=m01-m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26+m16-m21)/m04;if m35*m35<m08 then local m33=m00+m18-m22-m35*m30;if m33*m33<m12 then local Axi=m01+m20-m23-m35*m03;if Axi*Axi<m13 then return true;end;end;end;
local m35=(m02+m26+m16-m21)/m04;if m35*m35<m08 then local m33=m00+m18-m22-m35*m30;if m33*m33<m12 then local sAn=m01+m20-m23-m35*m03;if sAn*sAn<m13 then return true;end;end;end;
local m35=(m02-m26-m16-m21)/m04;if m35*m35<m08 then local m33=m00-m18-m22-m35*m30;if m33*m33<m12 then local gle=m01-m20-m23-m35*m03;if gle*gle<m13 then return true;end;end;end;
local m35=(m02+m26-m16-m21)/m04;if m35*m35<m08 then local m33=m00-m18-m22-m35*m30;if m33*m33<m12 then local m34=m01-m20-m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
local m35=(m00-m24+m18+m22)/m30;if m35*m35<m08 then local m33=m01+m20+m23-m35*m03;if m33*m33<m13 then local m34=m02+m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24+m18+m22)/m30;if m35*m35<m08 then local m33=m01+m20+m23-m35*m03;if m33*m33<m13 then local m34=m02+m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24-m18+m22)/m30;if m35*m35<m08 then local m33=m01-m20+m23-m35*m03;if m33*m33<m13 then local m34=m02-m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24-m18+m22)/m30;if m35*m35<m08 then local m33=m01-m20+m23-m35*m03;if m33*m33<m13 then local m34=m02-m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24+m18-m22)/m30;if m35*m35<m08 then local m33=m01+m20-m23-m35*m03;if m33*m33<m13 then local m34=m02+m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24+m18-m22)/m30;if m35*m35<m08 then local m33=m01+m20-m23-m35*m03;if m33*m33<m13 then local m34=m02+m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24-m18-m22)/m30;if m35*m35<m08 then local m33=m01-m20-m23-m35*m03;if m33*m33<m13 then local m34=m02-m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24-m18-m22)/m30;if m35*m35<m08 then local m33=m01-m20-m23-m35*m03;if m33*m33<m13 then local m34=m02-m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
local m35=(m01-m25+m20+m23)/m03;if m35*m35<m08 then local m33=m02+m16+m21-m35*m04;if m33*m33<m14 then local m34=m00+m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25+m20+m23)/m03;if m35*m35<m08 then local m33=m02+m16+m21-m35*m04;if m33*m33<m14 then local m34=m00+m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25-m20+m23)/m03;if m35*m35<m08 then local m33=m02-m16+m21-m35*m04;if m33*m33<m14 then local m34=m00-m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25-m20+m23)/m03;if m35*m35<m08 then local m33=m02-m16+m21-m35*m04;if m33*m33<m14 then local m34=m00-m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25+m20-m23)/m03;if m35*m35<m08 then local m33=m02+m16-m21-m35*m04;if m33*m33<m14 then local m34=m00+m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25+m20-m23)/m03;if m35*m35<m08 then local m33=m02+m16-m21-m35*m04;if m33*m33<m14 then local m34=m00+m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25-m20-m23)/m03;if m35*m35<m08 then local m33=m02-m16-m21-m35*m04;if m33*m33<m14 then local m34=m00-m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25-m20-m23)/m03;if m35*m35<m08 then local m33=m02-m16-m21-m35*m04;if m33*m33<m14 then local m34=m00-m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
local m35=(m02-m26+m21+m15)/m07;if m35*m35<m11 then local m33=m00+m22+m17-m35*m31;if m33*m33<m12 then local m34=m01+m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26+m21+m15)/m07;if m35*m35<m11 then local m33=m00+m22+m17-m35*m31;if m33*m33<m12 then local m34=m01+m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26-m21+m15)/m07;if m35*m35<m11 then local m33=m00-m22+m17-m35*m31;if m33*m33<m12 then local m34=m01-m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26-m21+m15)/m07;if m35*m35<m11 then local m33=m00-m22+m17-m35*m31;if m33*m33<m12 then local m34=m01-m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26+m21-m15)/m07;if m35*m35<m11 then local m33=m00+m22-m17-m35*m31;if m33*m33<m12 then local m34=m01+m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26+m21-m15)/m07;if m35*m35<m11 then local m33=m00+m22-m17-m35*m31;if m33*m33<m12 then local m34=m01+m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02-m26-m21-m15)/m07;if m35*m35<m11 then local m33=m00-m22-m17-m35*m31;if m33*m33<m12 then local m34=m01-m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m02+m26-m21-m15)/m07;if m35*m35<m11 then local m33=m00-m22-m17-m35*m31;if m33*m33<m12 then local m34=m01-m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
local m35=(m00-m24+m22+m17)/m31;if m35*m35<m11 then local m33=m01+m23+m19-m35*m06;if m33*m33<m13 then local m34=m02+m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24+m22+m17)/m31;if m35*m35<m11 then local m33=m01+m23+m19-m35*m06;if m33*m33<m13 then local m34=m02+m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24-m22+m17)/m31;if m35*m35<m11 then local m33=m01-m23+m19-m35*m06;if m33*m33<m13 then local m34=m02-m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24-m22+m17)/m31;if m35*m35<m11 then local m33=m01-m23+m19-m35*m06;if m33*m33<m13 then local m34=m02-m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24+m22-m17)/m31;if m35*m35<m11 then local m33=m01+m23-m19-m35*m06;if m33*m33<m13 then local m34=m02+m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24+m22-m17)/m31;if m35*m35<m11 then local m33=m01+m23-m19-m35*m06;if m33*m33<m13 then local m34=m02+m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00-m24-m22-m17)/m31;if m35*m35<m11 then local m33=m01-m23-m19-m35*m06;if m33*m33<m13 then local m34=m02-m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m00+m24-m22-m17)/m31;if m35*m35<m11 then local m33=m01-m23-m19-m35*m06;if m33*m33<m13 then local m34=m02-m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
local m35=(m01-m25+m23+m19)/m06;if m35*m35<m11 then local m33=m02+m21+m15-m35*m07;if m33*m33<m14 then local m34=m00+m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25+m23+m19)/m06;if m35*m35<m11 then local m33=m02+m21+m15-m35*m07;if m33*m33<m14 then local m34=m00+m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25-m23+m19)/m06;if m35*m35<m11 then local m33=m02-m21+m15-m35*m07;if m33*m33<m14 then local m34=m00-m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25-m23+m19)/m06;if m35*m35<m11 then local m33=m02-m21+m15-m35*m07;if m33*m33<m14 then local m34=m00-m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25+m23-m19)/m06;if m35*m35<m11 then local m33=m02+m21-m15-m35*m07;if m33*m33<m14 then local m34=m00+m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25+m23-m19)/m06;if m35*m35<m11 then local m33=m02+m21-m15-m35*m07;if m33*m33<m14 then local m34=m00+m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01-m25-m23-m19)/m06;if m35*m35<m11 then local m33=m02-m21-m15-m35*m07;if m33*m33<m14 then local m34=m00-m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
local m35=(m01+m25-m23-m19)/m06;if m35*m35<m11 then local m33=m02-m21-m15-m35*m07;if m33*m33<m14 then local m34=m00-m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
return false
else
return AssumeTrue
end
end
end
local setmetatable =setmetatable
local components =CFrame.new().components
local Workspace =Workspace
local BoxCast =Workspace.FindPartsInRegion3WithIgnoreList
local unpack =unpack
local type =type
local IsA =game.IsA
local r3 =Region3.new
local v3 =Vector3.new
local function Region3BoundingBox(CFrame,Size)
local x,y,z,
xx,yx,zx,
xy,yy,zy,
xz,yz,zz=components(CFrame)
local sx,sy,sz=Size.x/2,Size.y/2,Size.z/2
local px =sx*(xx<0 and -xx or xx)
+sy*(yx<0 and -yx or yx)
+sz*(zx<0 and -zx or zx)
local py =sx*(xy<0 and -xy or xy)
+sy*(yy<0 and -yy or yy)
+sz*(zy<0 and -zy or zy)
local pz =sx*(xz<0 and -xz or xz)
+sy*(yz<0 and -yz or yz)
+sz*(zz<0 and -zz or zz)
return r3(v3(x-px,y-py,z-pz),v3(x+px,y+py,z+pz))
end
local function FindAllPartsInRegion3(Region3,Ignore)
local Ignore=type(Ignore)=="table" and Ignore or {Ignore}
local Last=#Ignore
repeat
local Parts=BoxCast(Workspace,Region3,Ignore,100)
local Start=#Ignore
for i=1,#Parts do
Ignore[Start+i]=Parts[i]
end
until #Parts<100;
return {unpack(Ignore,Last+1,#Ignore)}
end
local function CastPoint(Region,Point)
return BoxPointCollision(Region.CFrame,Region.Size,Point)
end
local function CastSphere(Region,Center,Radius)
return BoxSphereCollision(Region.CFrame,Region.Size,Center,Radius)
end
local function CastBox(Region,CFrame,Size)
return BoxCollision(Region.CFrame,Region.Size,CFrame,Size)
end
local function CastPart(Region,Part)
return (not IsA(Part,"Part") or Part.Shape=="Block") and
BoxCollision(Region.CFrame,Region.Size,Part.CFrame,Part.Size)
or BoxSphereCollision(Region.CFrame,Region.Size,Part.Position,Part.Size.x)
end
local function CastParts(Region,Parts)
local Inside={}
for i=1,#Parts do
if CastPart(Region,Parts[i]) then
Inside[#Inside+1]=Parts[i]
end
end
return Inside
end
local function Cast(Region,Ignore)
local Inside={}
local Parts=FindAllPartsInRegion3(Region.Region3,Ignore)
for i=1,#Parts do
if CastPart(Region,Parts[i]) then
Inside[#Inside+1]=Parts[i]
end
end
return Inside
end
local function NewRegion(CFrame,Size)
local Object ={
CFrame =CFrame;
Size =Size;
Region3 =Region3BoundingBox(CFrame,Size);
Cast =Cast;
CastPart =CastPart;
CastParts =CastParts;
CastPoint =CastPoint;
CastSphere =CastSphere;
CastBox =CastBox;
}
return setmetatable({},{
__index=Object;
__newindex=function(_,Index,Value)
Object[Index]=Value
Object.Region3=Region3BoundingBox(Object.CFrame,Object.Size)
end;
})
end
Region.Region3BoundingBox =Region3BoundingBox
Region.FindAllPartsInRegion3=FindAllPartsInRegion3
Region.BoxPointCollision =BoxPointCollision
Region.BoxSphereCollision =BoxSphereCollision
Region.BoxCollision =BoxCollision
Region.new =NewRegion
function Region.FromPart(Part)
return NewRegion(Part.CFrame,Part.Size)
end
return Region
|
--여기까지
|
local ser = game:GetService("Debris")
local skill = game.ReplicatedStorage.Skill:FindFirstChild(skillName) --스킬 찾기
local Cooldown = true
local DamageCool = false
script.Parent.SkillEvent.OnServerEvent:Connect(function(plr, X, Y, Z) --플레이어가 스킬을 클릭하면
if Cooldown == true then
Cooldown = false
local clone = skill:Clone() --스킬 복사
clone.Parent = game.Workspace.SkillPart --스킬 적용
clone.Position = Vector3.new(X, (Y + 0.01), Z) --스킬 위치를 플레이어가 터치한 자리에
local clone2 = game.ReplicatedStorage.Skill.Part1:Clone()
clone2.Transparency = 1
clone2.Parent = game.Workspace.SkillPart
clone2.Position = Vector3.new(X, Y, Z)
clone.Touched:Connect(function(hit) --다른 플레이어가 스킬에 닿이면
local human = hit.Parent:FindFirstChild("Humanoid") --휴머노이드 찾기
local human2 = hit.Parent.Parent:FindFirstChild("Humanoid") --휴머노이드 찾기
if human ~= nil and hit.Parent then
if hit.Parent.Name == script.Parent.Parent.Name and DamageCool == false then return end
if human and DamageCool == false then --해당 조건이 맞으면
DamageCool = true
human:TakeDamage(Damage) --데미지 입히기
wait(DamageCoolTime) --스킬 데미지 쿨타임 기다리기
DamageCool = false
elseif human2 and DamageCool == false then
DamageCool = true
human2:TakeDamage(Damage) --데미지 입히기
wait(DamageCoolTime) --스킬 데미지 쿨타임 기다리기
DamageCool = false
end
end
end) --끝
script.Parent.Handle:FindFirstChild(Sound):Play() --오디오 틀기
script.Parent.SkillEvent:FireClient(plr)
while clone2.Transparency >= 0 do --서서히 나타나는
clone2.Transparency = clone2.Transparency - 0.1
wait()
end
wait(2)
while clone2.Transparency <= 1 do --서서히 사라지는
clone2.Transparency = clone2.Transparency + 0.1
wait()
end
ser:AddItem(clone2, 3)
while clone.Transparency <= 1 do --서서히 사라지는
clone.Transparency = clone.Transparency + 0.1
wait()
end
ser:AddItem(clone, Delete) --초뒤 스킬 삭제
wait(CoolTime) --스킬 쿨타임 기다리기
Cooldown = true
end
end) --끝
|
--!GENERATED
|
local Rain = require(script.Rain)
Rain:SetColor(Color3.fromRGB(script.Color.Value.x, script.Color.Value.y, script.Color.Value.z))
Rain:SetDirection(script.Direction.Value)
Rain:SetTransparency(script.Transparency.Value)
Rain:SetSpeedRatio(script.SpeedRatio.Value)
Rain:SetIntensityRatio(script.IntensityRatio.Value)
Rain:SetLightInfluence(script.LightInfluence.Value)
Rain:SetLightEmission(script.LightEmission.Value)
Rain:SetVolume(script.Volume.Value)
Rain:SetSoundId(script.SoundId.Value)
Rain:SetStraightTexture(script.StraightTexture.Value)
Rain:SetTopDownTexture(script.TopDownTexture.Value)
Rain:SetSplashTexture(script.SplashTexture.Value)
local threshold = script.TransparencyThreshold.Value
if script.TransparencyConstraint.Value and script.CanCollideConstraint.Value then
Rain:SetCollisionMode(
Rain.CollisionMode.Function,
function(p)
return p.Transparency <= threshold and p.CanCollide
end
)
elseif script.TransparencyConstraint.Value then
Rain:SetCollisionMode(
Rain.CollisionMode.Function,
function(p)
return p.Transparency <= threshold
end
)
elseif script.CanCollideConstraint.Value then
Rain:SetCollisionMode(
Rain.CollisionMode.Function,
function(p)
return p.CanCollide
end
)
end
|
--[=[
@interface ComponentConfig
@within Component
.Tag string -- CollectionService tag to use
.Ancestors {Instance}? -- Optional array of ancestors in which components will be started
.Extensions {Extension}? -- Optional array of extension objects
Component configuration passed to `Component.new`.
- If no Ancestors option is included, it defaults to `{workspace, game.Players}`.
- If no Extensions option is included, it defaults to a blank table `{}`.
]=]
|
type ComponentConfig = {
Tag: string,
Ancestors: AncestorList?,
Extensions: { Extension }?,
}
|
---Drivetrain Initialize
|
local wDia = 0
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
table.insert(Drive,v)
end
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
table.insert(Drive,v)
end
end
end
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
|
-- TUNE
|
SpeedType = "MPH" -- MPH or KPH
local Smoothness = 0.8
local TurboSmoothness = 0.9
local autoscaling = true --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 230 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 370 ,
spInc = 40 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 400 ,
spInc = 40 , -- Increment between labelled notches
}
}
|
-- setup emote chat hook
|
script.msg.Changed:connect(function(msg)
script.msg.Value = ""
local emote = ""
if (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, Enemy)
end
|
--------------------------------------------------- Mobile Button
|
local function handleContext(name, state, input)
if state == Enum.UserInputState.Begin then
Humanoid.WalkSpeed = CrouchSpeed
CAnim:Play()
else
Humanoid.WalkSpeed = NormalWalkSpeed
CAnim:Stop()
end
end
cas:BindAction("Crouch", handleContext, true, Leftc, RightC)
cas:SetPosition("Crouch", UDim2.new(.2, 0, .5, 0))
cas:SetTitle("Crouch", "Crouch")
cas:GetButton("Crouch").Size = UDim2.new(.3, 0, .3, 0)
|
-------------------------
|
function DoorClose()
if Shaft00.MetalDoor.CanCollide == false then
Shaft00.MetalDoor.CanCollide = true
while Shaft00.MetalDoor.Transparency > 0.0 do
Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) --Change 10 to change the speed.
end
if Shaft01.MetalDoor.CanCollide == false then
Shaft01.MetalDoor.CanCollide = true
while Shaft01.MetalDoor.Transparency > 0.0 do
Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft02.MetalDoor.CanCollide == false then
Shaft02.MetalDoor.CanCollide = true
while Shaft02.MetalDoor.Transparency > 0.0 do
Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft03.MetalDoor.CanCollide == false then
Shaft03.MetalDoor.CanCollide = true
while Shaft03.MetalDoor.Transparency > 0.0 do
Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft04.MetalDoor.CanCollide == false then
Shaft04.MetalDoor.CanCollide = true
while Shaft04.MetalDoor.Transparency > 0.0 do
Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft05.MetalDoor.CanCollide == false then
Shaft05.MetalDoor.CanCollide = true
while Shaft05.MetalDoor.Transparency > 0.0 do
Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft06.MetalDoor.CanCollide == false then
Shaft06.MetalDoor.CanCollide = true
while Shaft06.MetalDoor.Transparency > 0.0 do
Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft07.MetalDoor.CanCollide == false then
Shaft07.MetalDoor.CanCollide = true
while Shaft07.MetalDoor.Transparency > 0.0 do
Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft08.MetalDoor.CanCollide == false then
Shaft08.MetalDoor.CanCollide = true
while Shaft08.MetalDoor.Transparency > 0.0 do
Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1
wait(0.000001)
end
end
if Shaft09.MetalDoor.CanCollide == false then
Shaft09.MetalDoor.CanCollide = true
while Shaft09.MetalDoor.Transparency > 0.0 do
Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft10.MetalDoor.CanCollide == false then
Shaft10.MetalDoor.CanCollide = true
while Shaft10.MetalDoor.Transparency > 0.0 do
Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft11.MetalDoor.CanCollide == false then
Shaft11.MetalDoor.CanCollide = true
while Shaft11.MetalDoor.Transparency > 0.0 do
Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft12.MetalDoor.CanCollide == false then
Shaft12.MetalDoor.CanCollide = true
while Shaft12.MetalDoor.Transparency > 0.0 do
Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft13.MetalDoor.CanCollide == false then
Shaft13.MetalDoor.CanCollide = true
while Shaft13.MetalDoor.Transparency > 0.0 do
Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
end
function onClicked()
DoorClose()
end
script.Parent.MouseButton1Click:connect(onClicked)
script.Parent.MouseButton1Click:connect(function()
if clicker == true
then clicker = false
else
return
end
end)
script.Parent.MouseButton1Click:connect(function()
Car.Touched:connect(function(otherPart)
if otherPart == Elevator.Floors.F09
then StopE() DoorOpen()
end
end)end)
function StopE()
Car.BodyVelocity.velocity = Vector3.new(0, 0, 0)
Car.BodyPosition.position = Elevator.Floors.F09.Position
clicker = true
end
function DoorOpen()
while Shaft08.MetalDoor.Transparency < 1.0 do
Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency + .1
wait(0.000001)
end
Shaft08.MetalDoor.CanCollide = false
end
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0.01 then
playAnimation("walk", 0.1, Humanoid)
if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
setAnimationSpeed(speed / 14.5)
end
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / 12.0)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 0
local slash_damage = 3
local lunge_damage = 5
sword = script.Parent.Center
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
print("SWORD HIT")
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
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,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(0,-1,0)
Tool.GripRight = Vector3.new(-1,0,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(-1,0,0)
Tool.GripUp = Vector3.new(0,1,0)
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 < 0) then
lunge()
else
attack()
end
last_attack = t
wait(.75)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--[=[
Observes an instance's ancestry
@param instance Instance
@return Observable<Instance>
]=]
|
function RxInstanceUtils.observeAncestry(instance)
local startWithParent = Rx.start(function()
return instance, instance.Parent
end)
return startWithParent(Rx.fromSignal(instance.AncestryChanged))
end
|
--Feel free to poke around and see how this works. It's not very complex
|
local car = script.Parent.Car.Value
local Values = script.Parent:WaitForChild("Values") --This bit of code is still in 90% of A-Chassis plugins lol
local _Tune = require(car["A-Chassis Tune"])
local Handler = car:WaitForChild("ExhaustHandler")
local IsFlaming = false --Exhaust flame debounce. Debounces are important so code block doesn't run too quickly
Values.Throttle.Changed:Connect(function() -- This is where all the magic happens. Flames are determined by when you release the throttle
local RPMRatio = Values.RPM.Value / _Tune.Redline
print(RPMRatio)
if RPMRatio > 0.8 and not IsFlaming and car.DriveSeat.Throttle < 1 then
IsFlaming = true
Handler:FireServer("Flames",true)
wait(0.1)
Handler:FireServer("Flames",false)
Handler:FireServer("FlamesSmall",true)
wait(1)
Handler:FireServer("FlamesSmall",false)
IsFlaming = false
elseif Values.Throttle.Value < 0.5 then
Handler:FireServer("FlamesSmall",false)
end
end)
|
-- dButton:TweenPosition(DpositionNormal, "InOut", "Sine", 0.1)
|
end)
|
--updated 10/09/2022
|
npc= nil
hum= nil
health_gui= script.Parent
health_text= script.Parent:WaitForChild("TextLabel")
if (health_gui.Parent~= nil and health_gui.Parent.ClassName== "Model" and health_gui.Parent:FindFirstChildOfClass("Humanoid")) then
npc= health_gui.Parent
hum= health_gui.Parent:FindFirstChildOfClass("Humanoid")
elseif (health_gui.Parent.Parent~= nil and health_gui.Parent.Parent.ClassName== "Model" and health_gui.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
npc= health_gui.Parent.Parent
hum= health_gui.Parent.Parent:FindFirstChildOfClass("Humanoid")
elseif (health_gui.Parent.Parent.Parent~= nil and health_gui.Parent.Parent.Parent.ClassName== "Model" and health_gui.Parent.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
npc= health_gui.Parent.Parent.Parent
hum= health_gui.Parent.Parent.Parent:FindFirstChildOfClass("Humanoid")
end
if not npc then
health_gui:Remove()
end
if not hum then
health_text.Text= "humanoid not found"
health_text.TextColor3= Color3.fromRGB(255, 255, 127)
end
hum.DisplayDistanceType= Enum.HumanoidDisplayDistanceType.None
hum.HealthDisplayType= Enum.HumanoidHealthDisplayType.AlwaysOff
game["Run Service"].Heartbeat:Connect(function()
--for text health
health_text.Text= npc.Name.. " | ".. hum.Health.. " / ".. hum.MaxHealth
--for color
local GoodColor= Color3.fromRGB(85, 255, 127)
local MediumColor= Color3.fromRGB(255, 255, 127)
local BadColor= Color3.fromRGB(255, 140, 142)
if hum.Health >= hum.MaxHealth * 0.6 then
health_text.TextColor3= GoodColor
end
if hum.Health <= hum.MaxHealth * 0.6 then
health_text.TextColor3= MediumColor
end
if hum.Health <= hum.MaxHealth * 0.25 then
health_text.TextColor3= BadColor
end
end)
|
--cyan 4
|
if k == "c" and ibo.Value==true then
bin.Blade.BrickColor = BrickColor.new("Cyan")
bin.Blade2.BrickColor = BrickColor.new("Institutional white")
bin.Blade.White.Enabled=false colorbin.white.Value = false
bin.Blade.Blue.Enabled=false colorbin.blue.Value = false
bin.Blade.Green.Enabled=false colorbin.green.Value = false
bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false
bin.Blade.Orange.Enabled=false colorbin.orange.Value = false
bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false
bin.Blade.Violet.Enabled=false colorbin.violet.Value = false
bin.Blade.Red.Enabled=false colorbin.red.Value = false
bin.Blade.Silver.Enabled=false colorbin.silver.Value = false
bin.Blade.Black.Enabled=false colorbin.black.Value = false
bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false
bin.Blade.Yellow.Enabled=false colorbin.yellow.Value = false
bin.Blade.Cyan.Enabled=true colorbin.cyan.Value = true
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 175 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6200 -- Use sliders to manipulate values
Tune.Redline = 7600 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 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 = 1 -- Clutch engagement threshold (higher = faster response)
|
-- Hide command bar when Enter key is pressed
|
input.FocusLost:Connect(function(enterPressed)
if enterPressed then
toggleCommandBar()
end
end)
|
--[[Transmission]]
|
Tune.TransModes = {"Auto","Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = 480 -- Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 50 -- Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
--Gear Ratios
Tune.FinalDrive = 3.65 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.45 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 4.40 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.75 ,
--[[ 3 ]] 1.85 ,
--[[ 4 ]] 1.40 ,
--[[ 5 ]] 1.00 ,
--[[ 6 ]] 0.75 ,
}
Tune.FDMult = 1.1 -- Ratio multiplier (keep this at 1 if car is not struggling with torque)
|
--[[
The entry point for the Fusion library.
]]
|
local PubTypes = require(script.PubTypes)
local restrictRead = require(script.Utility.restrictRead)
export type StateObject<T> = PubTypes.StateObject<T>
export type CanBeState<T> = PubTypes.CanBeState<T>
export type Symbol = PubTypes.Symbol
export type Value<T> = PubTypes.Value<T>
export type Computed<T> = PubTypes.Computed<T>
export type ComputedPairs<K, V> = PubTypes.ComputedPairs<K, V>
export type Observer = PubTypes.Observer
export type Tween<T> = PubTypes.Tween<T>
export type Spring<T> = PubTypes.Spring<T>
type Fusion = {
New: (className: string) -> ((propertyTable: PubTypes.PropertyTable) -> Instance),
Children: PubTypes.ChildrenKey,
OnEvent: (eventName: string) -> PubTypes.OnEventKey,
OnChange: (propertyName: string) -> PubTypes.OnChangeKey,
Value: <T>(initialValue: T) -> Value<T>,
Computed: <T>(callback: () -> T) -> Computed<T>,
ComputedPairs: <K, VI, VO>(inputTable: CanBeState<{[K]: VI}>, processor: (K, VI) -> VO, destructor: (VO) -> ()?) -> ComputedPairs<K, VO>,
Observer: (watchedState: StateObject<any>) -> Observer,
Tween: <T>(goalState: StateObject<T>, tweenInfo: TweenInfo?) -> Tween<T>,
Spring: <T>(goalState: StateObject<T>, speed: number?, damping: number?) -> Spring<T>
}
return restrictRead("Fusion", {
New = require(script.Instances.New),
Children = require(script.Instances.Children),
OnEvent = require(script.Instances.OnEvent),
OnChange = require(script.Instances.OnChange),
Value = require(script.State.Value),
Computed = require(script.State.Computed),
ComputedPairs = require(script.State.ComputedPairs),
Observer = require(script.State.Observer),
Tween = require(script.Animation.Tween),
Spring = require(script.Animation.Spring)
}) :: Fusion
|
--// Events
|
local L_72_ = L_17_:WaitForChild('Equipped')
local L_73_ = L_17_:WaitForChild('ShootEvent')
local L_74_ = L_17_:WaitForChild('DamageEvent')
local L_75_ = L_17_:WaitForChild('CreateOwner')
local L_76_ = L_17_:WaitForChild('Stance')
local L_77_ = L_17_:WaitForChild('HitEvent')
|
--[[
MatchTable {
Some: (value: any) -> any
None: () -> any
}
CONSTRUCTORS:
Option.Some(anyNonNilValue): Option<any>
Option.Wrap(anyValue): Option<any>
STATIC FIELDS:
Option.None: Option<None>
STATIC METHODS:
Option.Is(obj): boolean
METHODS:
opt:Match(): (matches: MatchTable) -> any
opt:IsSome(): boolean
opt:IsNone(): boolean
opt:Unwrap(): any
opt:Expect(errMsg: string): any
opt:ExpectNone(errMsg: string): void
opt:UnwrapOr(default: any): any
opt:UnwrapOrElse(default: () -> any): any
opt:And(opt2: Option<any>): Option<any>
opt:AndThen(predicate: (unwrapped: any) -> Option<any>): Option<any>
opt:Or(opt2: Option<any>): Option<any>
opt:OrElse(orElseFunc: () -> Option<any>): Option<any>
opt:XOr(opt2: Option<any>): Option<any>
opt:Contains(value: any): boolean
--------------------------------------------------------------------
Options are useful for handling nil-value cases. Any time that an
operation might return nil, it is useful to instead return an
Option, which will indicate that the value might be nil, and should
be explicitly checked before using the value. This will help
prevent common bugs caused by nil values that can fail silently.
Example:
local result1 = Option.Some(32)
local result2 = Option.Some(nil)
local result3 = Option.Some("Hi")
local result4 = Option.Some(nil)
local result5 = Option.None
-- Use 'Match' to match if the value is Some or None:
result1:Match {
Some = function(value) print(value) end;
None = function() print("No value") end;
}
-- Raw check:
if result2:IsSome() then
local value = result2:Unwrap() -- Explicitly call Unwrap
print("Value of result2:", value)
end
if result3:IsNone() then
print("No result for result3")
end
-- Bad, will throw error bc result4 is none:
local value = result4:Unwrap()
--]]
|
local CLASSNAME = "Option"
local Option = {}
Option.__index = Option
function Option._new(value)
local self = setmetatable({
ClassName = CLASSNAME;
_v = value;
_s = (value ~= nil);
}, Option)
return self
end
function Option.Some(value)
assert(value ~= nil, "Option.Some() value cannot be nil")
return Option._new(value)
end
function Option.Wrap(value)
if value == nil then
return Option.None
else
return Option.Some(value)
end
end
function Option.Is(obj)
return type(obj) == "table" and getmetatable(obj) == Option
end
function Option.Assert(obj)
assert(Option.Is(obj), "Result was not of type Option")
end
function Option.Deserialize(data) -- type data = {ClassName: string, Value: any}
assert(type(data) == "table" and data.ClassName == CLASSNAME, "Invalid data for deserializing Option")
return data.Value == nil and Option.None or Option.Some(data.Value)
end
function Option:Serialize()
return {
ClassName = self.ClassName;
Value = self._v;
}
end
function Option:Match(matches)
local onSome = matches.Some
local onNone = matches.None
assert(type(onSome) == "function", "Missing 'Some' match")
assert(type(onNone) == "function", "Missing 'None' match")
if self:IsSome() then
return onSome(self:Unwrap())
else
return onNone()
end
end
function Option:IsSome()
return self._s
end
function Option:IsNone()
return (not self._s)
end
function Option:Expect(msg)
assert(self:IsSome(), msg)
return self._v
end
function Option:ExpectNone(msg)
assert(self:IsNone(), msg)
end
function Option:Unwrap()
return self:Expect("Cannot unwrap option of None type")
end
function Option:UnwrapOr(default)
if self:IsSome() then
return self:Unwrap()
else
return default
end
end
function Option:UnwrapOrElse(defaultFunc)
if self:IsSome() then
return self:Unwrap()
else
return defaultFunc()
end
end
function Option:And(optB)
if self:IsSome() then
return optB
else
return Option.None
end
end
function Option:AndThen(andThenFunc)
if self:IsSome() then
local result = andThenFunc(self:Unwrap())
Option.Assert(result)
return result
else
return Option.None
end
end
function Option:Or(optB)
if self:IsSome() then
return self
else
return optB
end
end
function Option:OrElse(orElseFunc)
if self:IsSome() then
return self
else
local result = orElseFunc()
Option.Assert(result)
return result
end
end
function Option:XOr(optB)
local someOptA = self:IsSome()
local someOptB = optB:IsSome()
if someOptA == someOptB then
return Option.None
elseif someOptA then
return self
else
return optB
end
end
function Option:Filter(predicate)
if self:IsNone() or not predicate(self._v) then
return Option.None
else
return self
end
end
function Option:Contains(value)
return self:IsSome() and self._v == value
end
function Option:__tostring()
if self:IsSome() then
return ("Option<" .. typeof(self._v) .. ">")
else
return "Option<None>"
end
end
function Option:__eq(opt)
if Option.Is(opt) then
if self:IsSome() and opt:IsSome() then
return (self:Unwrap() == opt:Unwrap())
elseif self:IsNone() and opt:IsNone() then
return true
end
end
return false
end
Option.None = Option._new()
return Option
|
--[[Steering]]
|
Tune.SteerInner = 32 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 33 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .02 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .04 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
|
--Put this in StarterPlayer, StarterCharacterScripts
|
local human = script.Parent:WaitForChild("Humanoid")
local AttackArm = true
local canattack = true
game:GetService("UserInputService").InputBegan:connect(function(input, gamepor)
if (input.KeyCode == Enum.KeyCode.X or input.KeyCode == Enum.KeyCode.ButtonY) and canattack then
canattack = false
script.RemoteEvent:FireServer(AttackArm)
human:LoadAnimation(AttackArm and script.R or script.L):Play()
wait(0.6)
AttackArm = not AttackArm
canattack = true
end
end)
|
--NOTE: We create the rocket once and then clone it when the player fires
|
local Rocket = Instance.new('Part') do
-- Set up the rocket part
Rocket.Name = 'Rocket'
Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
Rocket.Size = ROCKET_PART_SIZE
Rocket.CanCollide = false
Rocket.Anchored = true
-- Add the mesh
local mesh = Instance.new('SpecialMesh', Rocket)
mesh.MeshId = MISSILE_MESH_ID
mesh.Scale = MISSILE_MESH_SCALE
-- Add fire
local fire = Instance.new('Fire', Rocket)
fire.Heat = 5
fire.Size = 2
-- Clone the sounds and set Boom to PlayOnRemove
local swooshSoundClone = SwooshSound:Clone()
swooshSoundClone.Parent = Rocket
local boomSoundClone = BoomSound:Clone()
boomSoundClone.PlayOnRemove = true
boomSoundClone.Parent = Rocket
-- Attach creator tags to the rocket early on
local creatorTag = Instance.new('ObjectValue', Rocket)
creatorTag.Value = MyPlayer
creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
local iconTag = Instance.new('StringValue', creatorTag)
iconTag.Value = Tool.TextureId
iconTag.Name = 'icon'
-- Finally, clone the rocket script and enable it
local rocketScriptClone = RocketScript:Clone()
rocketScriptClone.Parent = Rocket
rocketScriptClone.Disabled = false
end
|
--- RUNTIME ---
|
local Tool = {}
Tool.MouseButton1 = function(Character)
if Character:GetAttribute("Cooldown") == true then return end
Character:SetAttribute("Cooldown", true)
Character.Humanoid:LoadAnimation(script.Animation):Play()
Character[script.Name].Handle.Swing:Play()
local MousePosition = MousePosition:InvokeClient(Players:GetPlayerFromCharacter(Character))
-- Character.PrimaryPart.CFrame = CFrame.new(Character.PrimaryPart.Position, MousePosition) -- Points character at mouse, at extreme angles it trips so I'm disabling for now
task.wait(0.33)
Character[script.Name].Handle.Shoot:Play()
Projectile(Character, MousePosition)
task.wait(2)
Character:SetAttribute("Cooldown", false)
end
return Tool
|
-- Component
-- Stephen Leitnick
-- November 26, 2021
|
type AncestorList = {Instance}
|
--[[
Server-side manager that listens to events to advance the FTUE stage in a player's data and
trigger server-side world changes according to the current stage
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local PlayerDataServer = require(ServerStorage.Source.PlayerData.Server)
local FtueStage = require(ReplicatedStorage.Source.SharedConstants.FtueStage)
local InFarmFtueStage = require(script.StageHandlers.InFarmFtueStage)
local SellingPlantFtueStage = require(script.StageHandlers.SellingPlantFtueStage)
local PurchasingSeedFtueStage = require(script.StageHandlers.PurchasingSeedFtueStage)
local PurchasingPotFtueStage = require(script.StageHandlers.PurchasingPotFtueStage)
local ReturningToFarmFtueStage = require(script.StageHandlers.ReturningToFarmFtueStage)
local PlayerDataKey = require(ReplicatedStorage.Source.SharedConstants.PlayerDataKey)
type FtueStage = {
handleAsync: (Player) -> FtueStage.EnumType?,
}
local handlerByStage: { [string]: FtueStage } = {
[FtueStage.InFarm] = InFarmFtueStage,
[FtueStage.SellingPlant] = SellingPlantFtueStage,
[FtueStage.PurchasingSeed] = PurchasingSeedFtueStage,
[FtueStage.PurchasingPot] = PurchasingPotFtueStage,
[FtueStage.ReturningToFarm] = ReturningToFarmFtueStage,
}
local FtueManagerServer = {}
function FtueManagerServer.onPlayerAdded(player: Player)
local ftueStage = PlayerDataServer.getValue(player, PlayerDataKey.FtueStage)
FtueManagerServer._updateFtueStage(player, ftueStage)
end
function FtueManagerServer._updateFtueStage(player: Player, ftueStage: FtueStage.EnumType?)
PlayerDataServer.setValue(player, PlayerDataKey.FtueStage, ftueStage)
if not ftueStage then
return
end
task.spawn(function()
local stageHandler = handlerByStage[ftueStage :: FtueStage.EnumType]
local nextStage: FtueStage.EnumType? = stageHandler.handleAsync(player)
FtueManagerServer._updateFtueStage(player, nextStage)
end)
end
return FtueManagerServer
|
-- Connect key state change event
|
userInputService.InputBegan:Connect(function(input)
handleKeyState(input.KeyCode, true)
end)
userInputService.InputEnded:Connect(function(input)
handleKeyState(input.KeyCode, false)
end)
|
--[[
--Instructions--
-For every material you want, you must add a new elseif statement, set "Enum.Materal" to the material you want. For example "Enum.Material.Glass"
-Then just change the properties of the sound within that elseif statement to what you want.
-Don't forget to edit the "Running" Script!
--]]
--CREDITS FOR BUILDING THIS SCRIPT:
--Spathi
| |
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
return (not ClassInformationTable:GetClassFolder(player,"Brawler").GuardBreak.Value)
end
|
-- função para adicionar vírgulas a um número
|
local function commaSeparateNumber(amount)
local formatted = amount
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if k == 0 then
break
end
end
return formatted
end
|
-- Function to handle player character additions
|
local function onCharacterAdded(character)
explodePlayer(character.Parent)
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 100 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[
Calculate the actual spot Frame position in studs by making use of adornee position.
Parameters:
- surfaceGui (SurfaceGui): SurfaceGui instance that the spot belongs to
- spot (Frame): Frame instance representing a Spot
Returns:
- (Vector3): World position of the spot
]]
|
function CameraModule:getSpotPosition(surfaceGui, spot)
local adornee = surfaceGui.Adornee
local face = surfaceGui.Face
-- Find offset of the spot's Frame from the center of the SurfaceGui (in studs)
local spotCenter = spot.AbsolutePosition + (Vector2.new(0.5, 0.5) - spot.AnchorPoint) * spot.AbsoluteSize
local guiOffset = (spotCenter - surfaceGui.AbsoluteSize / 2) / surfaceGui.PixelsPerStud
-- Calculate the actual position of the center of spot (in studs)
local spotPosition = adornee.CFrame:PointToWorldSpace(self:_getPointByFace(guiOffset, adornee, face))
return spotPosition
end
function CameraModule:_tweenCamera(target)
-- Animate to the spot
local tweenTime = constants.CameraTweenTime
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local tween = self.tweenService:Create(self.camera, tweenInfo, { CFrame = target })
tween:Play()
task.wait(tweenTime)
end
|
--[[
3/19/20
newwil
DataStore/Leaderstats
--]]
|
local DataStoreService = game:GetService("DataStoreService")
local playerData = DataStoreService:GetDataStore("playerData")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Parent = leaderstats
local data
local success, errormessage = pcall(function()
data = playerData:GetAsync(player.UserId.."-cash")
end)
if success then
cash.Value = data
else
print("Error while getting your data")
warn(errormessage)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local success, errormessage = pcall(function()
playerData:SetAsync(player.UserId.."-cash", player.leaderstats.Cash.Value)
end)
if success then
print("Data successfully saved!")
else
print("There was an error while saving the data")
warn(errormessage)
end
end)
|
--// Hash: 53ab6b5234323af6aa5c293925b6bd3fa53a7304d8e5f6ed1458452d96a6c330fc93ce57e3f8ea4393a6e5ed4eb1e6ca
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local u1 = {
Disconnect = function(p1)
local l___listener__2 = p1._listener;
if l___listener__2 ~= nil then
local l___listener_table__3 = p1._listener_table;
local v4 = table.find(l___listener_table__3, l___listener__2);
if v4 ~= nil then
table.remove(l___listener_table__3, v4);
end;
p1._listener = nil;
end;
if p1._disconnect_listener ~= nil then
p1._disconnect_listener(p1._disconnect_param);
p1._disconnect_listener = nil;
end;
end
};
function v1.NewArrayScriptConnection(p2, p3, p4, p5)
return {
_listener = p3,
_listener_table = p2,
_disconnect_listener = p4,
_disconnect_param = p5,
Disconnect = u1.Disconnect
};
end;
local v5 = {};
local u2 = {
Disconnect = function(p6)
local l___listener__6 = p6._listener;
if l___listener__6 ~= nil then
local l___script_signal__7 = p6._script_signal;
local l___fire_pointer_stack__8 = l___script_signal__7._fire_pointer_stack;
local l___listeners_next__9 = l___script_signal__7._listeners_next;
local l___listeners_back__10 = l___script_signal__7._listeners_back;
for v11 = 1, l___script_signal__7._stack_count do
if l___fire_pointer_stack__8[v11] == l___listener__6 then
l___fire_pointer_stack__8[v11] = l___listeners_next__9[l___listener__6];
end;
end;
if l___script_signal__7._tail_listener == l___listener__6 then
local v12 = l___listeners_back__10[l___listener__6];
if v12 ~= nil then
l___listeners_next__9[v12] = nil;
l___listeners_back__10[l___listener__6] = nil;
else
l___script_signal__7._head_listener = nil;
end;
l___script_signal__7._tail_listener = v12;
elseif l___script_signal__7._head_listener == l___listener__6 then
local v13 = l___listeners_next__9[l___listener__6];
l___listeners_back__10[v13] = nil;
l___listeners_next__9[l___listener__6] = nil;
l___script_signal__7._head_listener = v13;
else
local v14 = l___listeners_next__9[l___listener__6];
local v15 = l___listeners_back__10[l___listener__6];
if v14 ~= nil or v15 ~= nil then
l___listeners_next__9[v15] = v14;
l___listeners_back__10[v14] = v15;
l___listeners_next__9[l___listener__6] = nil;
l___listeners_back__10[l___listener__6] = nil;
end;
end;
p6._listener = nil;
l___script_signal__7._listener_count = l___script_signal__7._listener_count - 1;
end;
if p6._disconnect_listener ~= nil then
p6._disconnect_listener(p6._disconnect_param);
p6._disconnect_listener = nil;
end;
end
};
function v5.Connect(p7, p8, p9, p10)
if type(p8) ~= "function" then
error("[MadworkScriptSignal]: Only functions can be passed to ScriptSignal:Connect()");
end;
local l___tail_listener__16 = p7._tail_listener;
if l___tail_listener__16 == nil then
p7._head_listener = p8;
p7._tail_listener = p8;
p7._listener_count = p7._listener_count + 1;
elseif l___tail_listener__16 ~= p8 and p7._listeners_next[p8] == nil then
p7._listeners_next[l___tail_listener__16] = p8;
p7._listeners_back[p8] = l___tail_listener__16;
p7._tail_listener = p8;
p7._listener_count = p7._listener_count + 1;
end;
return {
_listener = p8,
_script_signal = p7,
_disconnect_listener = p9,
_disconnect_param = p10,
Disconnect = u2.Disconnect
};
end;
function v5.GetListenerCount(p11)
return p11._listener_count;
end;
function v5.Fire(p12, ...)
local l___fire_pointer_stack__17 = p12._fire_pointer_stack;
local v18 = p12._stack_count + 1;
p12._stack_count = v18;
local l___listeners_next__19 = p12._listeners_next;
l___fire_pointer_stack__17[v18] = p12._head_listener;
while true do
local v20 = l___fire_pointer_stack__17[v18];
l___fire_pointer_stack__17[v18] = l___listeners_next__19[v20];
if v20 == nil then
break;
end;
v20(...);
end;
p12._stack_count = p12._stack_count - 1;
end;
function v1.NewScriptSignal()
return {
_fire_pointer_stack = {},
_stack_count = 0,
_listener_count = 0,
_listeners_next = {},
_listeners_back = {},
_head_listener = nil,
_tail_listener = nil,
Connect = v5.Connect,
GetListenerCount = v5.GetListenerCount,
Fire = v5.Fire
};
end;
return v1;
|
-- BaseCamera mod
|
local BaseCamera = require(baseCameraModule)
BaseCamera.UpCFrame = IDENTITYCF
function BaseCamera:UpdateUpCFrame(cf)
self.UpCFrame = cf
end
function BaseCamera:CalculateNewLookCFrame(suppliedLookVector)
local currLookVector = suppliedLookVector or self:GetCameraLookVector()
currLookVector = self.UpCFrame:VectorToObjectSpace(currLookVector)
local currPitchAngle = math.asin(currLookVector.y)
local yTheta = math.clamp(self.rotateInput.y, -MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle)
local constrainedRotateInput = Vector2.new(self.rotateInput.x, yTheta)
local startCFrame = CFrame.new(ZERO, currLookVector)
local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0)
return newLookCFrame
end
|
--[[VARIABLE DEFINITION ANOMALY DETECTED, DECOMPILATION OUTPUT POTENTIALLY INCORRECT]]--
-- Decompiled with the Synapse X Luau decompiler.
|
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local v1 = {};
local l__InfoOverlay__2 = u1.Assets.UI:WaitForChild("InfoOverlay");
local u2 = nil;
local l__Blocks__3 = l__InfoOverlay__2:WaitForChild("Blocks");
local u4 = {};
local u5 = nil;
local v36
local v37
local v38
local v39
local v40
local u6 = u1.PlayerModule.Get("Mouse");
local u7 = game:GetService("GuiService"):GetGuiInset();
local u8 = {};
function v1.Add(p1, ...)
if u2 then
v1.Remove();
end;
local v3 = l__InfoOverlay__2:FindFirstChild("Base"):Clone();
local v4 = 0;
for v5, v6 in ipairs({ ... }) do
if not v5 then
break;
end;
local v8 = v6[1];
local v9 = l__Blocks__3:FindFirstChild(v8):Clone();
local l__settings__10 = v9:FindFirstChild("settings");
if l__settings__10 and l__settings__10:FindFirstChild("code") then
coroutine.wrap(function()
(u4[v8] or require(l__settings__10:FindFirstChild("code")))(v9, unpack(v6));
end)();
end;
v9.LayoutOrder = v5 * 100;
if l__settings__10 then
local v11 = l__settings__10:GetAttribute("boundsX");
local l__Y__12 = v11.Y;
local v13 = 0;
local v14 = 0;
local v15 = 0;
for v16, v17 in ipairs(v9:GetChildren()) do
if not v16 then
break;
end;
if v17:IsA("GuiObject") and v17.Visible then
if v17.ClassName == "TextLabel" or v17.ClassName == "TextButton" then
if v17.Size.X.Scale ~= 0 then
local v19 = u1.TextService:GetTextSize(string.gsub(v17.Text, "<.->", function()
return "";
end), v17.TextSize, v17.Font, (Vector2.new(l__Y__12 * v17.Size.X.Scale, 1000))) + Vector2.new(4, 1);
v13 = math.max(v19.X, v13);
v14 = v14 + math.max(v19.Y, v9.AbsoluteSize.Y);
v17.Size = UDim2.new(0, v19.X, 0, v19.Y);
end;
elseif v17.Size.X.Scale ~= 0 then
v15 = v15 + v17.AbsoluteSize.Y;
end;
end;
end;
local v20 = v9:FindFirstChildOfClass("UIListLayout");
if v20 and v20.FillDirection == Enum.FillDirection.Horizontal then
v13 = math.max(v20.AbsoluteContentSize.X, v13);
end;
v9.Size = UDim2.new(1, 0, 0, v14 + v15);
v4 = math.max(math.clamp(v13, v11.X, l__Y__12), v4);
end;
v9.Parent = v3.Frame.Blocks;
end;
local v21 = v3.Frame.Blocks:FindFirstChildOfClass("UIPadding");
local v22 = v3.Frame.Blocks:FindFirstChildOfClass("UIListLayout");
v22:ApplyLayout();
v3.Size = UDim2.new(0, v4 + v21.PaddingLeft.Offset + v21.PaddingRight.Offset, 0, v22.AbsoluteContentSize.Y + v21.PaddingTop.Offset + v21.PaddingBottom.Offset);
v3.UIScale.Scale = 1 - (1 - math.min(u1.Functions.ResolutionScale(), 1)) / 1.5;
if not u5 then
u5 = Instance.new("ScreenGui");
u5.DisplayOrder = 100;
u5.ZIndexBehavior = Enum.ZIndexBehavior.Global;
u5.ResetOnSpawn = false;
u5.Name = "InfoOverlay";
u5.Parent = u1.PlayerModule.Get("PlayerGui");
end;
v3.Parent = u5;
u2 = v3;
u1.GUI.ToggleCursor(false);
local v23 = nil;
for v24, v25 in ipairs({ ... }) do
if not v24 then
break;
end;
if v25[1] == "Rarity" and v25[2] then
v23 = v25[2];
break;
end;
end;
if v23 == "Mythical" or v23 == "Exclusive" then
local v27 = v3.Frame:FindFirstChildOfClass("UIStroke");
v27.Color = Color3.new(1, 1, 1);
local v28 = u1.Assets.UI.Raritys:FindFirstChild(v23):Clone();
v28.Parent = v27;
if v23 == "Mythical" then
v3.pointer.pointer.ImageColor3 = Color3.fromRGB(255, 85, 255);
elseif v23 == "Exclusive" then
v3.pointer.pointer.ImageColor3 = Color3.fromRGB(255, 170, 255);
end;
if v23 == "Mythical" then
task.defer(function()
local v29 = true;
while v3 and v3.Parent do
local v30 = v29 and Color3.fromRGB(255, 245, 230) or Color3.new(1, 1, 1);
u1.Functions.Tween(v3.pointer, { 1.25, 1, 2 }, {
ImageColor3 = v30
});
u1.Functions.Tween(v3.Frame, { 1.25, 1, 2 }, {
BackgroundColor3 = v30
}).Completed:Wait();
v29 = not v29;
end;
end);
end;
task.defer(function()
while v3 and v3.Parent do
v28.Rotation = os.clock() * 250;
u1.RenderStepped();
end;
end);
end;
local u9 = "Down";
task.defer(function()
while v3 and v3.Parent do
local v31 = u6.X;
local v32 = u6.Y;
local l__X__33 = v3.AbsoluteSize.X;
local l__Y__34 = v3.AbsoluteSize.Y;
local v35 = game.Workspace.CurrentCamera.ViewportSize.Y - u7.Y;
if u1.Variables.Console then
v31 = p1.AbsolutePosition.X + p1.AbsoluteSize.X * 0.5;
v32 = p1.AbsolutePosition.Y + p1.AbsoluteSize.Y * 0.5;
end;
if v32 + l__Y__34 + 30 < v35 then
u9 = "Down";
elseif v32 - l__Y__34 - 30 > 0 then
u9 = "Up";
end;
if u9 == "Down" then
v36 = 30;
else
v36 = -30;
end;
if u9 == "Down" then
v37 = 0;
else
v37 = 1;
end;
v3.AnchorPoint = Vector2.new(0, v37);
v3.Position = UDim2.new(0, math.clamp(v31 + 30, 0, game.Workspace.CurrentCamera.ViewportSize.X - u7.X + (-l__X__33 and l__X__33)), 0, math.clamp(v32 + v36, 0, v35 + (u9 == "Down" and -l__Y__34 or l__Y__34)));
if u9 == "Down" then
v38 = 1;
else
v38 = 0;
end;
v3.pointer.AnchorPoint = Vector2.new(1, v38);
if u9 == "Down" then
v39 = 0;
else
v39 = 1;
end;
if u9 == "Down" then
v40 = 30;
else
v40 = -30;
end;
v3.pointer.Position = UDim2.new(0, 30, v39, v40);
if u9 == "Down" then
v3.pointer.Rotation = 0;
elseif u9 == "Up" then
v3.pointer.Rotation = -90;
else
v3.pointer.Rotation = -180;
end;
u1.RenderStepped();
end;
end);
task.defer(function()
while v3 and v3.Parent do
local l__X__41 = u6.X;
local l__Y__42 = u6.Y;
local l__X__43 = p1.AbsolutePosition.X;
local l__Y__44 = p1.AbsolutePosition.Y;
if not u1.Variables.Console then
if l__X__43 + p1.AbsoluteSize.X < l__X__41 or l__X__41 < l__X__43 or l__Y__44 + p1.AbsoluteSize.Y < l__Y__42 or l__Y__42 < l__Y__44 then
v1.Remove();
end;
elseif u1.GuiService.SelectedObject ~= p1 then
v1.Remove();
end;
u1.RenderStepped();
end;
end);
if u1.Variables.Mobile then
local u10 = nil;
local u11 = tick();
u10 = p1.MouseButton1Up:Connect(function()
u10:Disconnect();
if tick() - u11 < 0.5 then
v1.Remove();
end;
end);
u8[#u8 + 1] = u10;
end;
end;
function v1.Remove()
if u2 then
for v45, v46 in ipairs(u8) do
if not v45 then
break;
end;
v46:Disconnect();
end;
u8 = {};
u2:Destroy();
u1.GUI.ToggleCursor(true);
u2 = nil;
end;
end;
return v1;
|
--Moxiii~<3 // LerpColor and IsDark taken from ROBLOX Battle
|
wait(2)
local MAX_STEPS = 20
local COLOR = script.Parent.Value
local t = tick()
math.randomseed(t/2)
|
-----------------
--| Variables |--
-----------------
|
local DebrisService = Game:GetService('Debris')
local PlayersService = Game:GetService('Players')
local Rocket = script.Parent
local CreatorTag = Rocket:WaitForChild('creator')
local Tank = Rocket:WaitForChild('Tank').Value
local SwooshSound = Rocket:WaitForChild('Swoosh')
local Target = Rocket:WaitForChild('Target')
|
--[[Run]]
|
--Print Version
local ver=require(car["A-Chassis Tune"].README)
print("Novena: AC6T Loaded - Build "..ver)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Suspension
if not workspace:PGSIsEnabled() and _Tune.SusEnabled then
Suspension()
end
--Power
Engine()
--Update External Values
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Boost.Value = (_Boost/2)*_TPsi
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.HpNatural.Value = _NH
script.Parent.Values.HpBoosted.Value = _BH*(_Boost/2)
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TqNatural.Value = _NT
script.Parent.Values.TqBoosted.Value = _BT*(_Boost/2)
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot*_GThrotShift
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.TCSAmt.Value = 1-_TCSAmt
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
-- car.DriveSeat.CC.Changed:connect(function()
|
--//Services//--
|
local Debris = game:GetService("Debris")
local TweenService = game:GetService("TweenService")
|
--For Omega Rainbow Katana thumbnail to display a lot of particles.
|
for i, v in pairs(Handle:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = 20
end
end
|
--[=[
@param ... any
Same as `Fire`, but uses `task.defer` internally & doesn't take advantage of thread reuse.
```lua
signal:FireDeferred("Hello")
```
]=]
|
function Signal:FireDeferred(...)
local item = self._handlerListHead
while item do
task.defer(item._fn, ...)
item = item._next
end
end
|
------------------------------------------------------------------------
-- initial parsing for statements, calls a lot of functions
-- * returns boolean instead of 0|1
-- * used in chunk()
------------------------------------------------------------------------
|
function luaY:statement(ls)
local line = ls.linenumber -- may be needed for error messages
local c = ls.t.token
if c == "TK_IF" then -- stat -> ifstat
self:ifstat(ls, line)
return false
elseif c == "TK_WHILE" then -- stat -> whilestat
self:whilestat(ls, line)
return false
elseif c == "TK_DO" then -- stat -> DO block END
luaX:next(ls) -- skip DO
self:block(ls)
self:check_match(ls, "TK_END", "TK_DO", line)
return false
elseif c == "TK_FOR" then -- stat -> forstat
self:forstat(ls, line)
return false
elseif c == "TK_REPEAT" then -- stat -> repeatstat
self:repeatstat(ls, line)
return false
elseif c == "TK_FUNCTION" then -- stat -> funcstat
self:funcstat(ls, line)
return false
elseif c == "TK_LOCAL" then -- stat -> localstat
luaX:next(ls) -- skip LOCAL
if self:testnext(ls, "TK_FUNCTION") then -- local function?
self:localfunc(ls)
else
self:localstat(ls)
end
return false
elseif c == "TK_RETURN" then -- stat -> retstat
self:retstat(ls)
return true -- must be last statement
elseif c == "TK_BREAK" then -- stat -> breakstat
luaX:next(ls) -- skip BREAK
self:breakstat(ls)
return true -- must be last statement
else
self:exprstat(ls)
return false -- to avoid warnings
end--if c
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 250*1.3 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 1000 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7000 -- Use sliders to manipulate values
Tune.Redline = 10000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 6500
Tune.PeakSharpness = 5
Tune.CurveMult = 0.5
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[ Script Variables ]]
|
--
while not Players.LocalPlayer do
wait()
end
local LocalPlayer = Players.LocalPlayer
local Humanoid = MasterControl:GetHumanoid()
local JumpButton = nil
local OnInputEnded = nil -- defined in Create()
local CharacterAddedConnection = nil
local HumStateConnection = nil
local HumChangeConnection = nil
local ExternallyEnabled = false
local JumpPower = 0
local JumpStateEnabled = true
|
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
-- Display result dialog
|
local function openDlg(resultString, resultTime)
-- Display result string
ResultString.Text = string.upper(resultString)
-- Display result time if > 0 (formatted)
if resultTime and resultTime > 0 then
local minutes = math.floor(resultTime/60)
local seconds = math.floor(resultTime%60)
if seconds < 10 then seconds = "0"..tostring(seconds) end
ResultTime.Text = string.upper("WINNING TIME: "..tostring(minutes)..":"..tostring(seconds))
else
ResultTime.Text = ""
end
dlg.Visible = true
wait(DISPLAY_DURATION)
dlg.Visible = false
end -- openDlg()
|
--[[**
ensures value is an integer
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
function t.integer(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if value%1 == 0 then
return true
else
return false, string.format("integer expected, got %d", value)
end
end
|
--- Skill
|
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
wait(1)
|
-- Motor(s)
|
local SeeSawMotor = script.Parent:WaitForChild("SeeSawMotor")
local function OnSeatsChange(ChangedSeat)
local Seat1Occupant = Seat1.Occupant
local Seat2Occupant = Seat2.Occupant
local Seat1T = Seat1.Throttle
local Seat2T = Seat2.Throttle
if Seat1Occupant and Seat2Occupant == nil then
SeeSawMotor.DesiredAngle = 0.3
elseif Seat2Occupant and Seat1Occupant == nil then
SeeSawMotor.DesiredAngle = -0.3
end
if Seat1Occupant and Seat2Occupant then
-- When both inputs are equal or would seem equal, make it balanced
if Seat2T == 0 and Seat1T == 0 or Seat1T == -1 and Seat2T == -1 or Seat1T == 1 and Seat2T == 1 or Seat1T == -1 and Seat2T == 0 or Seat1T == 0 and Seat2T == -1 then
SeeSawMotor.DesiredAngle = 0
return
end
-- Seat1 logic
if Seat1T == 1 and Seat2T == 0 or Seat1T == 1 and Seat2T == -1 then
SeeSawMotor.DesiredAngle = 0.3
end
-- Seat2 logic
if Seat2T == 1 and Seat1T == 0 or Seat2T == 1 and Seat1T == -1 then
SeeSawMotor.DesiredAngle = -0.3
end
end
end
|
---SG Is Here---
---Please Dont Change Anything Can Dont Work If You Change--
|
local db = true
local player = game.Players.LocalPlayer
local target = game.Workspace.Sell
local delay = 3
script.Parent.MouseButton1Click:connect(function()
if db == true then
db = false
player.Character.HumanoidRootPart.CFrame = target.CFrame * CFrame.new(0, 3, 0)
for i = delay, 1, -1 do
script.Parent.Text = i
wait(1)
end
script.Parent.Text = "Sell"
db = true
end
end)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "Rocket circle" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--Door Script
--This script toggles the door when it is clicked.
--Unless you know what you're doing, do not modify this script.
|
local clickdetector = Instance.new("ClickDetector", script.Parent) --This creates a click detector for the door.
clickdetector.MouseClick:Connect(function() --This detects a click on the door.
if script.Parent.CanCollide == true then --This checks if the door is closed.
script.Parent.Open:Play() --This plays the open sound.
script.Parent.Transparency = 0.25 --This causes the door to be slightly transparent.
script.Parent.CanCollide = false --This causes the door to stop colliding.
else --If the door is open, then the code below will run instead.
script.Parent.Close:Play() --This plays the close sound.
script.Parent.Transparency = 0 --This causes the door to be completely opaque.
script.Parent.CanCollide = true --This causes the door to begin colliding.
end
end)
|
--// F key, Horn
|
mouse.KeyDown:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Airhorn:Play()
veh.Lightbar.middle.Wail.Volume = 0
veh.Lightbar.middle.Yelp.Volume = 0
veh.Lightbar.middle.Priority.Volume = 0
veh.Lightbar.middle.Manual.Volume = 0
veh.Lightbar.middle.rWail.Volume = 0
veh.Lightbar.middle.rYelp.Volume = 0
veh.Lightbar.middle.rPriority.Volume = 0
end
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.Visible = false;
if game.Players.LocalPlayer.Character.Values.Actions.CarriedPlr.Value ~= "" then
script.Parent.Parent.Parent.Dialog3.Visible = true;
return;
end;
script.Parent.Parent.Parent.Dialog2.Visible = true;
end);
|
--[[
Generates a mathmatically unique UID hex.
Functions.GenerateUID()
--]]
| |
--[[Misc]]
|
Tune.LoadDelay = 3.0 -- Delay before initializing chassis (in seconds)
Tune.AutoStart = false -- Set to false if using manual ignition plugin
Tune.AutoFlip = true -- Set to false if using manual flip plugin
Tune.AutoUpdate = true -- Automatically applies minor updates to the chassis if any are found.
-- Will NOT apply major updates, but will notify you of any.
-- Set to false to mute notifications, or if using modified Drive.
|
--Instert in Tool
|
local tool = script.Parent
local anim = script.Animation --Animation ID
local track
tool.Equipped:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track:Play()
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
|
--[[
Gets camera modifiers and effects while it is in Dead mode.
]]
|
local TweenService = game:GetService("TweenService")
local CameraStateDead = {}
|
--created by
------------------------------------------
--Clear And Enter
|
check = true -- Global
function Clear()
print("Cleared")
Input = ""
end
script.Parent.Clear.ClickDetector.MouseClick:connect(Clear)
function Enter()
if Input == Code then
print("Entered")
Input = ""
local door = script.Parent.Parent.Door
for i = 1, 35 do
door.CFrame = CFrame.new(door.Position + Vector3.new(0,0,0.1))
wait(0.01)
end
wait(5) --Closes
for i = 1, 35 do
door.CFrame = CFrame.new(door.Position - Vector3.new(0,0,0.1))
wait(0.01)
end
return end
Input = ""
print("Wrong Code")
end
script.Parent.Enter.ClickDetector.MouseClick:connect(Enter)
|
-- Gets the current size of the default Roblox chat on your device.
|
local chatWindowSize = StarterGui:GetCore("ChatWindowSize")
StarterGui:SetCore("ChatWindowPosition", UDim2.new(0, 0, (1 - chatWindowSize.Y.Scale), 0))
|
--Shade Script
|
sp=script.Parent
lastattack=0
nextrandom=0
nextsound=0
nextjump=0
chasing=false
variance=2
damage=15
attackrange=15
sightrange=200
runspeed=15
wonderspeed=4
healthregen=false
function raycast(spos,vec,currentdist)
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),sp)
if hit2~=nil and pos2 then
if hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" then
local currentdist=currentdist-(pos2-spos).magnitude
return raycast(pos2,vec,currentdist)
end
end
return hit2,pos2
end
function waitForChild(parent,childName)
local child=parent:findFirstChild(childName)
if child then return child end
while true do
child=parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
UserInputService = game:GetService("UserInputService")
Folders = Tool:WaitForChild("Folders")
RemotesFolder = Folders:WaitForChild("Remotes")
ServerControl = RemotesFolder:WaitForChild("ServerControl")
ClientControl = RemotesFolder:WaitForChild("ClientControl")
Animations = {}
ToolEquipped = false
function SetAnimation(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
PlayerMouse = Mouse
Mouse.Button1Down:connect(function()
InvokeServer("MouseClick", {Down = true})
end)
Mouse.Button1Up:connect(function()
InvokeServer("MouseClick", {Down = false})
end)
for i, v in pairs({KeyDown, KeyUp}) do
if v then
v:disconnect()
end
end
KeyDown = UserInputService.InputBegan:connect(function(InputObject)
local InputType = InputObject.UserInputType
local KeyCode = InputObject.KeyCode
if InputType == Enum.UserInputType.Keyboard then
InvokeServer("KeyPressed", {Key = KeyCode.Name, Down = true})
end
end)
KeyUp = UserInputService.InputEnded:connect(function(InputObject)
local InputType = InputObject.UserInputType
local KeyCode = InputObject.KeyCode
if InputType == Enum.UserInputType.Keyboard then
InvokeServer("KeyPressed", {Key = KeyCode.Name, Down = false})
end
end)
end
function Unequipped()
for i, v in pairs({KeyDown, KeyUp}) do
if v then
v:disconnect()
end
end
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
Animations = {}
ToolEquipped = false
end
function InvokeServer(mode, value)
local ServerReturn
pcall(function()
ServerReturn = ServerControl:InvokeServer(mode, value)
end)
return ServerReturn
end
function OnClientInvoke(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" and value then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return ((PlayerMouse and {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}) or nil)
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- util
|
function waitForChild(parent, childName)
while true do
local child = parent:findFirstChild(childName)
if child then
return child
end
parent.ChildAdded:wait()
end
end
function newSound(id)
local sound = Instance.new("Sound")
sound.SoundId = id
sound.Parent = script.Parent.Head
return sound
end
|
--Put the objects you want regenned in the model, if the object's parent is changed it will not be deleted when the button is pushed again.
|
debounce = false
regen = {}
last = {}
for a,b in ipairs(script.Parent.Parent:GetChildren()) do
if b ~= script.Parent then
table.insert(regen,b:clone())
table.insert(last,b)
end end
script.Parent.Touched:connect(function(hit)
if hit.Parent ~= nil then
if game.Players:playerFromCharacter(hit.Parent) ~= nil and debounce == false then
debounce = true
for a,b in ipairs(last) do
if b.Parent == script.Parent.Parent then
end end
last = {}
for a,b in ipairs(regen) do
local c = b:clone()
table.insert(last,c)
c.Parent = script.Parent.Parent
pcall(function() c:MakeJoints() end)
end
script.Parent.BrickColor = BrickColor.new(26)
wait(2)
script.Parent.BrickColor = BrickColor.new(104)
debounce = false
end end end)
|
--cam.FieldOfView=math.random(69,71)
|
task.wait()
end
|
--[=[
Gets a signal that will fire when the Brio dies. If the brio is already dead
calling this method will error.
:::info
Calling this while the brio is already dead will throw a error.
:::
```lua
local brio = Brio.new("a", "b")
brio:GetDiedSignal():Connect(function()
print("Brio died")
end)
brio:Kill() --> Brio died
brio:Kill() -- no output
```
@return Signal
]=]
|
function Brio:GetDiedSignal()
if self:IsDead() then
error("Brio is dead")
end
if self._diedEvent then
return self._diedEvent.Event
end
self._diedEvent = Instance.new("BindableEvent")
return self._diedEvent.Event
end
|
--------RIGHT DOOR --------
|
game.Workspace.doorright.l11.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(1023)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(106)
game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
|
-- declarations
|
local sDied = newSound("rbxasset://sounds/uuhhh.wav")
local sFallingDown = newSound("rbxasset://sounds/splat.wav")
local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
local sGettingUp = newSound("rbxasset://sounds/hit.wav")
local sJumping = newSound("rbxasset://sounds/button.wav")
local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
sRunning.Looped = true
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["DiffSequences"]["DiffSequences"])
export type Callbacks = Package.Callbacks
return Package
|
-- SOULDRAGON'S INSANAQUARIUM DEADFISH SCRIPT
|
h = script.Parent.Parent.Humanoid
while true do
if h.Health < 1 then
script.Parent.Parent.Name = "Goodbye"
script.Parent.BrickColor = BrickColor.new(26)
script.Parent.Transparency = 0.5
script.Parent.Anchored = true
end
wait(1)
end
|
-- Made by Freakinve
-- 12/23/20
|
local dayOutdoorAmbient = Color3.fromRGB(128, 128, 128)
local nightOutdoorAmbient = Color3.fromRGB(0, 0, 0)
local dayAmbient = Color3.fromRGB(128, 128, 128)
local nightAmbient = Color3.fromRGB(0, 0, 0)
|
-- The script below is to put the screen gui to the player gui (in case you forgot to put this screen gui into starter gui)
|
local item_buyer = script.Parent
game.Players.PlayerAdded:Connect(function(plr)
item_buyer.Parent = plr:WaitForChild("PlayerGui")
end)
|
------------------------------------------------------------------------------
--------------------[ MAIN PROGRAM ]------------------------------------------
------------------------------------------------------------------------------
|
while true do
if (not Main:IsDescendantOf(game))
or (Main.Parent.Name == "Knife" and FindFirstClass(Main, "Weld"))
or Main.Anchored then
break
end
if S.GrenadeTrail and S.GrenadeTransparency ~= 1
and S.GrenadeTrailThickness ~= 0 and S.GrenadeTrailVisibleTime ~= 0 then
local Trail = Instance.new("Part")
Trail.BrickColor = S.GrenadeTrailColor
Trail.Transparency = S.GrenadeTrailTransparency
Trail.Anchored = true
Trail.CanCollide = false
Trail.Size = VEC3(1, 1, 1)
local Mesh = Instance.new("BlockMesh")
Mesh.Offset = VEC3(0, 0, -(Main.Position - LastPos).magnitude / 2)
Mesh.Scale = VEC3(S.GrenadeTrailThickness, S.GrenadeTrailThickness, (Main.Position - LastPos).magnitude)
Mesh.Parent = Trail
Trail.Parent = Main.Parent
Trail.CFrame = CF(LastPos, Main.Position)
delay(S.GrenadeTrailVisibleTime, function()
if S.GrenadeTrailDisappearTime > 0 then
local X = 0
while true do
if X == 90 then break end
local NewX = X + (3 / S.GrenadeTrailDisappearTime)
X = (NewX > 90 and 90 or NewX)
local Alpha = X / 90
Trail.Transparency = NumLerp(S.GrenadeTrailTransparency, 1, Alpha)
wait()
end
Trail:Destroy()
else
Trail:Destroy()
end
end)
LastPos = Main.Position
end
wait()
end
if (not Main:IsDescendantOf(game)) then
Grenade:Destroy()
end
|
-- LOCAL FUNCTIONS
|
local function checkTopbarEnabled()
local success, bool = xpcall(function()
return starterGui:GetCore("TopbarEnabled")
end,function(err)
--has not been registered yet, but default is that is enabled
return true
end)
return (success and bool)
end
local function checkTopbarEnabledAccountingForMimic()
local topbarEnabledAccountingForMimic = (checkTopbarEnabled() or not IconController.mimicCoreGui)
return topbarEnabledAccountingForMimic
end
|
---Steering
|
function Steering()
if _MSteer then
local mST = ((mouse.X-mouse.ViewSizeX/2)/_Tune.MSteerWidth)
if math.abs(mST)<=_Tune.MSteerDZone then
_GSteerT = 0
else
_GSteerT = (math.max(math.min((math.abs(mST)-_Tune.MSteerDZone),(1-_Tune.MSteerDZone)),0)/(1-_Tune.MSteerDZone))^_Tune.MSteerExp * (mST / math.abs(mST))
end
end
if _GSteerC < _GSteerT then
_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
else
_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
end
local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-_Tune.MinSteer))
if car.Wheels:FindFirstChild("FL")~= nil then
if _GSteerC>= 0 then
car.Wheels.FL.Arm.Steer.cframe=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
else
car.Wheels.FL.Arm.Steer.cframe=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
end
end
if car.Wheels:FindFirstChild("FR")~= nil then
if _GSteerC>= 0 then
car.Wheels.FR.Arm.Steer.cframe=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
else
car.Wheels.FR.Arm.Steer.cframe=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
end
end
end
|
----------------------------------------------------------------------------------------------------
-----------------=[ General ]=----------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
TeamKill = true --- Enable TeamKill?
,TeamDamageMultiplier = 1 --- Between 0-1 | This will make you cause less damage if you hit your teammate
,ReplicatedBullets = true --- Keep in mind that some bullets will pass through surfaces...
,AntiBunnyHop = true --- Enable anti bunny hop system?
,JumpCoolDown = 3 --- Seconds before you can jump again
,JumpPower = 50 --- Jump power, default is 50
,RealisticLaser = true --- True = Laser line is invisible
,ReplicatedLaser = true
,ReplicatedFlashlight = true
,EnableRagdoll = true --- Enable ragdoll death?
,TeamTags = true --- Aaaaaaa
,HitmarkerSound = false --- GGWP MLG 360 NO SCOPE xD
|
--- Skip forwards in now
-- @param delta now to skip forwards
|
function Spring:TimeSkip(delta)
local now = tick()
local position, velocity = self:_positionVelocity(now+delta)
self._position0 = position
self._velocity0 = velocity
self._time0 = now
end
function Spring:__index(index)
if Spring[index] then
return Spring[index]
elseif index == "Value" or index == "Position" or index == "p" then
local position, _ = self:_positionVelocity(tick())
return position
elseif index == "Velocity" or index == "v" then
local _, velocity = self:_positionVelocity(tick())
return velocity
elseif index == "Target" or index == "t" then
return self._target
elseif index == "Damper" or index == "d" then
return self._damper
elseif index == "Speed" or index == "s" then
return self._speed
else
error(("%q is not a valid member of Spring"):format(tostring(index)), 2)
end
end
function Spring:__newindex(index, value)
local now = tick()
if index == "Value" or index == "Position" or index == "p" then
local _, velocity = self:_positionVelocity(now)
self._position0 = value
self._velocity0 = velocity
elseif index == "Velocity" or index == "v" then
local position, _ = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = value
elseif index == "Target" or index == "t" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._target = value
elseif index == "Damper" or index == "d" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._damper = math.clamp(value, 0, 1)
elseif index == "Speed" or index == "s" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._speed = value < 0 and 0 or value
else
error(("%q is not a valid member of Spring"):format(tostring(index)), 2)
end
self._time0 = now
end
function Spring:_positionVelocity(now)
local p0 = self._position0
local v0 = self._velocity0
local p1 = self._target
local d = self._damper
local s = self._speed
local t = s*(now - self._time0)
local d2 = d*d
local h, si, co
if d2 < 1 then
h = math.sqrt(1 - d2)
local ep = math.exp(-d*t)/h
co, si = ep*math.cos(h*t), ep*math.sin(h*t)
elseif d2 == 1 then
h = 1
local ep = math.exp(-d*t)/h
co, si = ep, ep*t
else
h = math.sqrt(d2 - 1)
local u = math.exp((-d + h)*t)/(2*h)
local v = math.exp((-d - h)*t)/(2*h)
co, si = u + v, u - v
end
local a0 = h*co + d*si
local a1 = 1 - (h*co + d*si)
local a2 = si/s
local b0 = -s*si
local b1 = s*si
local b2 = h*co - d*si
return
a0*p0 + a1*p1 + a2*v0,
b0*p0 + b1*p1 + b2*v0
end
return Spring
|
--// F key, Horn
|
mouse.KeyUp:connect(function(key)
if key=="f" then
script.Parent.Parent.Horn.TextTransparency = 0.8
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 1
veh.Lightbar.middle.Yelp.Volume = 1
veh.Lightbar.middle.Priority.Volume = 1
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end)
mouse.KeyDown:connect(function(key)
if key=="j" then
veh.Lightbar.middle.Beep:Play()
if On3 then On3=false else
On3=true
while On3 do
script.Parent.Parent.Lights.TextTransparency = 0
veh.Lightbar.on.Value = true
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
wait(0.01)
veh.Lightbar.on.Value = false
script.Parent.Parent.Lights.TextTransparency = 0.8
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end
end
end)
mouse.KeyDown:connect(function(key)
if key=="k" then
veh.Lightbar.middle.Beep:Play()
if On2 then On2=false else
On2=true
while On2 do
script.Parent.Parent.TD.TextTransparency = 0
veh.Takedown.on.Value = true
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
wait(0.01)
veh.Takedown.on.Value = false
script.Parent.Parent.TD.TextTransparency = 0.8
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end
end
end)
|
--// Hash: c99d8d3f6918230ee9fd250b85efbd7b960723d8cb9e3c5a023095d441bc7c42774ba920206560321de3df3240be618c
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v3 = require(game:GetService("ReplicatedStorage"):WaitForChild("ReplicaDataModule"));
print(v3.data);
return v3.data;
|
-- Invisicam Version 2.5 (Occlusion Series)
-- For the latest standalone version see id=183837794
-- OnlyTwentyCharacters
|
local Invisicam = {}
|
--[[Wheel Stabilizer Gyro]]
|
--
Tune.FGyroDamp = 100 -- Front Wheel Non-Axial Dampening
Tune.RGyroDamp = 100 -- Rear Wheel Non-Axial Dampening
|
-- the number equals the walkspeed. start is starting walkspeed(if you want to boost it) and the others are for the speed increase stages
|
start = 16
stage1 = 20
stage2 = 25
stage3 = 30
stage4 = 35
stage5 = 40
stage6 = 50
|
--------END SIDE DOOR--------
|
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--for _, item in ipairs(Shield:GetChildren()) do
-- if item:IsA("BasePart") == true and item:FindFirstChild("Ignore") == nil then
-- item.Touched:connect(function(Hit)
-- if Hit == nil then return end
-- if Hit.Parent == nil then return end
--
-- local Item = Hit.Parent
--
-- if Item:IsA("Tool") == true then return end
-- if Hit.Name == "Torso" then return end
-- if Hit.Name == "HumanoidRootPart" then return end
-- if Hit.Name == "Left Leg" then return end
-- if Hit.Name == "Right Leg" then return end
-- if Hit.Name == "Head" then return end
-- if Hit.Name == "Left Arm" then return end
-- if Hit.Name == "Right Arm" then return end
--
-- if Game:GetService("Players"):GetPlayerFromCharacter(Item) ~= nil then return end
--
-- for _, x in ipairs(Hit:GetChildren()) do
-- if x:IsA("TouchTransmitter") == true then x:Destroy() break end
-- end
--
-- if Item.Name == "ShadowGrab" then
-- Health = Health + (MaxHealth / 12)
--
-- HealthBar.Shield.Bar:TweenSize(UDim2.new((Health / MaxHealth), 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 0.5, true)
--
-- Item:Destroy()
--
-- if Health < MaxHealth then
-- -- yay, still alive.
-- else
-- HealthBar.Parent.Parent:Destroy()
-- end
-- end
-- end)
-- end
--end
|
function CreateRegion3FromLocAndSize(Position, Size)
local SizeOffset = Size / 2
local Point1 = Position - SizeOffset
local Point2 = Position + SizeOffset
return Region3.new(Point1, Point2)
end
function FindNear(part, radius)
local r = CreateRegion3FromLocAndSize(part.Position, Vector3.new(part.Size.X + radius, 50, part.Size.Z + radius))
return Game:GetService("Workspace"):FindPartsInRegion3(r, part, 100)
end
while true do
for _, x in ipairs(Shield:GetChildren()) do
if x:IsA("BasePart") == true and x.Name ~= "Overhead" and x:FindFirstChild("Ignore") == nil then
for _, item in ipairs(FindNear(x, 15)) do
if item:IsA("BasePart") == true and item:FindFirstChild("Pierce") == nil then
local own, dmg = GetOwnerAndDamage(item)
if own ~= nil and dmg ~= nil then
if (item.Position - x.Position).magnitude <= 10 and item ~= x then
if Health < MaxHealth then
if (Health + dmg) <= MaxHealth then
Health = Health + dmg
HealthBar.Shield.Bar:TweenSize(UDim2.new((Health / MaxHealth), 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 0.5, true)
for _, b in ipairs(item:GetChildren()) do
if b:IsA("TouchTransmitter") == true then b:Destroy() end
end
item:Destroy()
if Health < MaxHealth then
-- yay, still alive.
else
HealthBar.Parent.Parent:Destroy()
end
else
HealthBar.Parent.Parent:Destroy()
end
else
HealthBar.Parent.Parent:Destroy()
end
end
end
end
end
end
end
Game:GetService("RunService").Stepped:wait()
end
|
--[[
Run the given test plan node and its descendants, using the given test
session to store all of the results.
]]
|
function TestRunner.runPlanNode(session, planNode, lifecycleHooks)
local function runCallback(callback, messagePrefix)
local success = true
local errorMessage
-- Any code can check RUNNING_GLOBAL to fork behavior based on
-- whether a test is running. We use this to avoid accessing
-- protected APIs; it's a workaround that will go away someday.
_G[RUNNING_GLOBAL] = true
messagePrefix = messagePrefix or ""
local testEnvironment = getfenv(callback)
for key, value in pairs(TestRunner.environment) do
testEnvironment[key] = value
end
testEnvironment.fail = function(message)
if message == nil then
message = "fail() was called."
end
success = false
errorMessage = messagePrefix .. debug.traceback(tostring(message), 2)
end
testEnvironment.expect = wrapExpectContextWithPublicApi(session:getExpectationContext())
local context = session:getContext()
local nodeSuccess, nodeResult = xpcall(
function()
callback(context)
end,
function(message)
return messagePrefix .. debug.traceback(tostring(message), 2)
end
)
-- If a node threw an error, we prefer to use that message over
-- one created by fail() if it was set.
if not nodeSuccess then
success = false
errorMessage = nodeResult
end
_G[RUNNING_GLOBAL] = nil
return success, errorMessage
end
local function runNode(childPlanNode)
-- Errors can be set either via `error` propagating upwards or
-- by a test calling fail([message]).
for _, hook in ipairs(lifecycleHooks:getBeforeEachHooks()) do
local success, errorMessage = runCallback(hook, "beforeEach hook: ")
if not success then
return false, errorMessage
end
end
local testSuccess, testErrorMessage = runCallback(childPlanNode.callback)
for _, hook in ipairs(lifecycleHooks:getAfterEachHooks()) do
local success, errorMessage = runCallback(hook, "afterEach hook: ")
if not success then
if not testSuccess then
return false, testErrorMessage .. "\nWhile cleaning up the failed test another error was found:\n" .. errorMessage
end
return false, errorMessage
end
end
if not testSuccess then
return false, testErrorMessage
end
return true, nil
end
lifecycleHooks:pushHooksFrom(planNode)
local halt = false
for _, hook in ipairs(lifecycleHooks:getBeforeAllHooks()) do
local success, errorMessage = runCallback(hook, "beforeAll hook: ")
if not success then
session:addDummyError("beforeAll", errorMessage)
halt = true
end
end
if not halt then
for _, childPlanNode in ipairs(planNode.children) do
if childPlanNode.type == TestEnum.NodeType.It then
session:pushNode(childPlanNode)
if session:shouldSkip() then
session:setSkipped()
else
local success, errorMessage = runNode(childPlanNode)
if success then
session:setSuccess()
else
session:setError(errorMessage)
end
end
session:popNode()
elseif childPlanNode.type == TestEnum.NodeType.Describe then
session:pushNode(childPlanNode)
TestRunner.runPlanNode(session, childPlanNode, lifecycleHooks)
-- Did we have an error trying build a test plan?
if childPlanNode.loadError then
local message = "Error during planning: " .. childPlanNode.loadError
session:setError(message)
else
session:setStatusFromChildren()
end
session:popNode()
end
end
end
for _, hook in ipairs(lifecycleHooks:getAfterAllHooks()) do
local success, errorMessage = runCallback(hook, "afterAll hook: ")
if not success then
session:addDummyError("afterAll", errorMessage)
end
end
lifecycleHooks:popHooks()
end
return TestRunner
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.