Main project assembled!

This commit is contained in:
CloneTrooper1019 2019-11-08 19:59:38 -06:00
parent f7d4244911
commit 57379dc161
128 changed files with 3329 additions and 1193 deletions

View File

@ -1,3 +1 @@
{
"ClassName": "RemoteEvent"
}
{ "ClassName": "RemoteEvent" }

View File

@ -1,68 +0,0 @@
-- util
function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
function newSound(id)
local sound = Instance.new("Sound")
sound.SoundId = id
sound.archivable = false
sound.Parent = script.Parent.Head
return sound
end
-- declarations
local sDied = newSound("rbxasset://sounds/uuhhh.wav")
local sFallingDown = newSound("rbxasset://sounds/splat.wav")
local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
local sGettingUp = newSound("rbxasset://sounds/hit.wav")
local sJumping = newSound("rbxasset://sounds/button.wav")
local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
sRunning.Looped = true
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
--local Climbing = Figure:WaitForChild("Climbing")
-- functions
function onDied()
sDied:Play()
end
function onJumping()
sJumping:Play()
wait(0.2)
sJumping:Stop()
end
function onState(state, sound)
sound.TimePosition = 0
sound.Playing = state
end
function onRunning(speed)
sRunning.Playing = (speed>0.1)
end
-- connect up
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
Humanoid.FreeFalling:connect(function(state)
--if not Climbing.Value then
onState(state, sFreeFalling)
--end
end)
Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)

View File

@ -12,9 +12,14 @@ local RunService = game:GetService("RunService")
local Animators = {}
local function createAnimator(humanoid)
local Figure = humanoid.Parent
local Torso = Figure:WaitForChild("Torso")
local Climbing = Figure:WaitForChild("Climbing")
local Figure = humanoid.Parent
local Torso = Figure:WaitForChild("Torso", 5)
local Climbing = Figure:WaitForChild("Climbing", 5)
if not (Torso and Climbing) then
return
end
local animator = {}
animator.Joints = {}
@ -183,17 +188,13 @@ local function createAnimator(humanoid)
return animator
end
local function onAnimatorAdded(humanoid)
if humanoid:IsA("Humanoid") then
local function createAnimatorAsync(humanoid, callback)
local async = coroutine.wrap(function ()
local animator = createAnimator(humanoid)
Animators[humanoid] = animator
end
end
local function onAnimatorRemoved(humanoid)
if Animators[humanoid] then
Animators[humanoid] = nil
end
callback(animator)
end)
async()
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -205,10 +206,24 @@ local animTag = "Animator"
local animAdded = CollectionService:GetInstanceAddedSignal(animTag)
local animRemoved = CollectionService:GetInstanceRemovedSignal(animTag)
local function onAnimatorAdded(humanoid)
if humanoid:IsA("Humanoid") then
createAnimatorAsync(humanoid, function (animator)
if CollectionService:HasTag(humanoid, animTag) then
Animators[humanoid] = animator
end
end)
end
end
local function onAnimatorRemoved(humanoid)
if Animators[humanoid] then
Animators[humanoid] = nil
end
end
for _,humanoid in pairs(CollectionService:GetTagged(animTag)) do
spawn(function ()
onAnimatorAdded(humanoid)
end)
onAnimatorAdded(humanoid)
end
animAdded:Connect(onAnimatorAdded)
@ -218,11 +233,10 @@ animRemoved:Connect(onAnimatorRemoved)
-- Motor Angle Updater
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local desiredFPS = 1 / 30 -- The framerate that would be expected given the MaxVelocity in use.
local lastUpdate = tick()
local desiredFPS = 30 -- The framerate that would be expected given the MaxVelocity in use.
local function updateAnimations(deltaTime)
local velocityAdjust = (1 / desiredFPS) * deltaTime
local velocityAdjust = desiredFPS * deltaTime
for humanoid, animator in pairs(Animators) do
-- Update the motor states

View File

@ -1,7 +1,7 @@
local TeleportService = game:GetService("TeleportService")
local classicExp = script:WaitForChild("ClassicExp")
local c = workspace.CurrentCamera
local classicExp = script:WaitForChild("Particle")
local camera = workspace.CurrentCamera
local baseExpAdorn = Instance.new("UnionOperation")
baseExpAdorn.Name = "ExplosionAdorn"
@ -15,8 +15,10 @@ local function onDescendantAdded(exp)
if exp:IsA("Explosion") then
local cf = CFrame.new(exp.Position)
local expAdorn = baseExpAdorn:Clone()
local lifeTime = 1.5
exp.Visible = false
if TeleportService:GetTeleportSetting("RetroExplosions") then
local expObj = Instance.new("SphereHandleAdornment")
expObj.Adornee = expAdorn
@ -24,25 +26,31 @@ local function onDescendantAdded(exp)
expObj.Color3 = Color3.new(1,0,0)
expObj.CFrame = cf
expObj.Parent = expAdorn
lifeTime = 1
if exp.BlastRadius > 1 then
lifeTime = lifeTime - (1/exp.BlastRadius)
end
else
local e = classicExp:Clone()
e.Parent = expAdorn
expAdorn.CFrame = cf
spawn(function ()
local e = classicExp:Clone()
e.Parent = expAdorn
expAdorn.CFrame = cf
local lessParticles = TeleportService:GetTeleportSetting("ReducedParticles")
local count = lessParticles and 25 or 100
for i = 1,8 do
for i = 1, 8 do
e:Emit(count)
wait(0.125)
end
end)
end
expAdorn.Parent = c
expAdorn.Parent = camera
wait(lifeTime)
expAdorn:Destroy()
end
end

View File

@ -0,0 +1,142 @@
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Debris = game:GetService("Debris")
local soundTag = "HumanoidSound"
local soundMounted = CollectionService:GetInstanceAddedSignal(soundTag)
----------------------------------------------------------------------------------------------------
local function deleteSound(sound)
sound.EmitterSize = 0
Debris:AddItem(sound, 0.1)
end
local function setSoundId(soundId, andThen)
return function (sound, humanoid)
sound.SoundId = "rbxasset://sounds/" .. soundId
sound.Pitch = 1
if andThen then
andThen(sound, humanoid)
end
end
end
local function mountSoundToState(sound)
return function (state)
sound.TimePosition = 0
sound.Playing = state
end
end
local function createSound(name, fileName, parent)
local sound = Instance.new("Sound")
sound.SoundId = "rbxasset://sounds/" .. fileName
sound.Parent = parent
sound.Name = name
return sound
end
local function promiseChild(object, name, andThen, ...)
local args = {...}
local callback = coroutine.wrap(function ()
local child = object:WaitForChild(name, 10)
if child then
andThen(child, unpack(args))
end
end)
callback()
end
----------------------------------------------------------------------------------------------------
local soundActions =
{
Splash = deleteSound;
Landing = deleteSound;
Climbing = deleteSound;
Swimming = deleteSound;
FreeFalling = deleteSound;
GettingUp = setSoundId("hit.wav");
Running = setSoundId("bfsl-minifigfoots1.mp3");
Jumping = setSoundId("button.wav", function (jumping, humanoid)
humanoid.Jumping:Connect(function ()
wait(0.1 + (math.random() / 10))
jumping:Stop()
end)
end);
}
local function onSoundMounted(humanoid)
if not humanoid:IsA("Humanoid") then
return
end
local avatar = humanoid.Parent
promiseChild(avatar, "HumanoidRootPart", function (rootPart)
local fallingDown = createSound("FallingDown", "splat.wav", rootPart)
humanoid.FallingDown:Connect(mountSoundToState(fallingDown))
local freeFalling = createSound("FreeFall", "swoosh.wav", rootPart)
humanoid.FreeFalling:Connect(mountSoundToState(freeFalling))
for soundName, soundAction in pairs(soundActions) do
promiseChild(rootPart, soundName, soundAction, humanoid)
end
local mountClimbSound = coroutine.wrap(function ()
local running = rootPart:WaitForChild("Running", 10)
local climbing = avatar:WaitForChild("Climbing", 10)
if not (running and climbing) then
return
end
local function onClimbing(isClimbing)
if not isClimbing then
return
end
while climbing.Value do
if not avatar:IsDescendantOf(workspace) then
break
end
local state = humanoid:GetState()
if state.Name == "Freefall" then
if running.IsPaused then
running:Resume()
end
if freeFalling.IsPlaying then
freeFalling:Stop()
end
end
RunService.Heartbeat:Wait()
end
end
climbing.Changed:Connect(onClimbing)
end)
mountClimbSound()
end)
end
for _,humanoid in pairs(CollectionService:GetTagged(soundTag)) do
onSoundMounted(humanoid)
end
soundMounted:Connect(onSoundMounted)
----------------------------------------------------------------------------------------------------

View File

@ -0,0 +1,23 @@
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local TeleportService = game:GetService("TeleportService")
local camera = workspace.CurrentCamera
local moon = script:WaitForChild("Moon")
moon.Locked = true
moon.Size = Vector3.new(50, 50, 1)
local function moonUpdate()
if TeleportService:GetTeleportSetting("ClassicSky") then
local pos = Lighting:GetMoonDirection() * 900
local origin = camera.CFrame.Position
moon.Parent = camera
moon.CFrame = CFrame.new(origin + pos, origin)
else
moon.Parent = nil
end
end
RunService:BindToRenderStep("MoonUpdate", 201, moonUpdate)

View File

@ -0,0 +1 @@
{ "ClassName": "BindableEvent" }

View File

@ -1,9 +0,0 @@
local TARGET = script.Name
do
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local client = ReplicatedStorage:WaitForChild("Client")
local targetScript = client:WaitForChild(TARGET)
local activation = require(targetScript)
activation(script)
end

133
Client/Sky/init.client.lua Normal file
View File

@ -0,0 +1,133 @@
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Services
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local TeleportService = game:GetService("TeleportService")
local UserInputService = game:GetService("UserInputService")
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Sky Colors
local midnight = 0
local day = 86400
local hour = day/24
local sunRise = day * .25
local sunSet = day * .75
local riseAndSetTime = hour/2
local times =
{
midnight;
sunRise - hour;
sunRise - riseAndSetTime;
sunRise;
sunRise + riseAndSetTime;
sunSet - riseAndSetTime;
sunSet;
sunSet + (hour/3);
day;
}
local colors =
{
Color3.new();
Color3.new();
Color3.new(.2, .15, .01);
Color3.new(.2, .15, .01);
Color3.new(1, 1, 1);
Color3.new(1, 1, 1);
Color3.new(.4, .2, .05);
Color3.new();
Color3.new();
}
local function linearSpline(x, times, values)
assert(#times == #values)
if #values == 1 or x < times[1] then
return values[1]
end
for i = 2, #times do
if x < times[i] then
local alpha = (times[i] - x) / (times[i] - times[i - 1])
return values[i - 1]:lerp(values[i], 1 - alpha)
end
end
return values[#values]
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local function r()
return -1 + (math.random()*2)
end
local lastTime = 0
local camera = workspace.CurrentCamera
local skyAdorn = script:WaitForChild("SkyAdorn")
local night = skyAdorn:WaitForChild("Night")
local nightFrame = night:WaitForChild("NightFrame")
local star = script:WaitForChild("Star")
local shadowsOn = true
for i = 1, 500 do
local bb = star:Clone()
bb.StudsOffsetWorldSpace = Vector3.new(r(), r(), r()).Unit * 2500
bb.Size = UDim2.new(0, math.random(2, 5), 0, math.random(2, 5))
bb.Adornee = skyAdorn
bb.Parent = skyAdorn
end
local function updateSky()
local shadowState = TeleportService:GetTeleportSetting("StencilShadows")
if shadowState == nil then
TeleportService:SetTeleportSetting("StencilShadows", true)
shadowState = true
end
if shadowState ~= shadowsOn then
shadowsOn = shadowState
if shadowsOn then
local black = Color3.new()
Lighting.GlobalShadows = true
Lighting.Ambient = black:Lerp(Lighting.OutdoorAmbient, 0.5)
else
Lighting.GlobalShadows = false
Lighting.Ambient = Lighting.OutdoorAmbient
end
end
if TeleportService:GetTeleportSetting("ClassicSky") then
local seconds = Lighting:GetMinutesAfterMidnight() * 60
if seconds < 0 then
seconds = day + seconds
end
if seconds ~= lastTime then
local sunDir = game.Lighting:GetSunDirection()
local skyColor = linearSpline(seconds, times, colors)
nightFrame.BackgroundColor3 = skyColor
nightFrame.BackgroundTransparency = math.clamp((sunDir.Y + .033) * 10, 0, 1)
lastTime = seconds
end
local sunDir = Lighting:GetSunDirection()
skyAdorn.CFrame = CFrame.new(c.CFrame.p) * CFrame.new(Vector3.new(), sunDir)
skyAdorn.Parent = (nightFrame.BackgroundTransparency < 1 and c or nil)
else
skyAdorn.Parent = nil
end
end
RunService:BindToRenderStep("UpdateSky", 201, updateSky)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -9,10 +9,10 @@ local function getCamera()
return workspace.CurrentCamera
end
local function projectRay(ray,length)
local function projectRay(ray, length)
local origin = ray.Origin
local direction = ray.Direction
return Ray.new(origin,direction.Unit * length)
return Ray.new(origin, direction.Unit * length)
end
local function computeSunVisibility()
@ -20,29 +20,30 @@ local function computeSunVisibility()
local camera = getCamera()
local cf = camera.CFrame
if sunPos:Dot(cf.lookVector) > 0 then
local sunView = camera:WorldToViewportPoint(cf.p + sunPos)
if sunPos:Dot(cf.LookVector) > 0 then
local sunView = camera:WorldToViewportPoint(cf.Position + sunPos)
local visibility = 0
local total = 0
for dx = -1,1 do
for dy = -1,1 do
for dx = -1, 1 do
for dy = -1, 1 do
local posX = math.floor(sunView.X + dx * 15)
local posY = math.floor(sunView.Y + dy * 15)
local sunRay = camera:ViewportPointToRay(posX, posY)
sunRay = projectRay(sunRay,5000)
sunRay = projectRay(sunRay, 5000)
local hit, pos = workspace:FindPartOnRay(sunRay, camera)
local hit,pos = workspace:FindPartOnRay(sunRay,camera)
if not hit then
visibility = visibility + 1
end
total = total + 1
end
end
visibility = visibility / total
return visibility,sunView
return visibility / total, sunView
end
return 0
@ -52,19 +53,20 @@ local function update()
if TeleportService:GetTeleportSetting("ClassicSky") then
local sunPos = Lighting:GetSunDirection()
if sunPos.Y >= -.1 then
local visibility,sunView = computeSunVisibility()
local visibility, sunView = computeSunVisibility()
if visibility > 0.001 then
local attenuation = (1 - (2*visibility - 1)*(2*visibility - 1))
local strength = math.clamp((((1 - sunPos.Y)*2) / math.sqrt(2)), 0, 1)
local attenuation = (1 - (2 * visibility - 1) * (2 * visibility - 1))
local strength = math.clamp((((1 - sunPos.Y) * 2) / math.sqrt(2)), 0, 1)
local opacity = attenuation * 0.4 * strength
local camera = getCamera()
local rayPos = camera:ViewportPointToRay(sunView.X,sunView.Y,1).Origin
local rayLook = camera.CFrame.p
local rayPos = camera:ViewportPointToRay(sunView.X, sunView.Y, 1).Origin
local rayLook = camera.CFrame.Position
adorn.Parent = camera
adorn.CFrame = CFrame.new(rayPos,rayLook)
sunRays.Transparency = NumberSequence.new(1-opacity)
adorn.CFrame = CFrame.new(rayPos, rayLook)
sunRays.Transparency = NumberSequence.new(1 - opacity)
return
end
@ -74,6 +76,4 @@ local function update()
adorn.Parent = nil
end
return function ()
RunService:BindToRenderStep("SunRays",201,update)
end
RunService:BindToRenderStep("SunRays", 201, update)

View File

@ -1,25 +1,21 @@
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local TeleportService = game:GetService("TeleportService")
local ReplicatedFirst = script.Parent
local JointsService = game:GetService("JointsService")
local RunService = game:GetService("RunService")
local StarterGui = game:GetService("StarterGui")
do
local StarterGui = game:GetService("StarterGui")
local function setCoreSafe(method,...)
while not pcall(StarterGui.SetCore, StarterGui, method,...) do
spawn(function ()
local function setCoreSafe(method, ...)
while not pcall(StarterGui.SetCore, StarterGui, method, ...) do
wait()
end
end
spawn(function ()
setCoreSafe("ResetButtonCallback", false)
end)
setCoreSafe("TopbarEnabled", false)
end
setCoreSafe("ResetButtonCallback", false)
end)
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
@ -29,8 +25,13 @@ if not UserInputService.TouchEnabled then
mouse.Icon = "rbxassetid://334630296"
end
local guiRoot = script:WaitForChild("GuiRoot")
guiRoot.Parent = playerGui
local ui = script:FindFirstChild("UI")
if ui then
ui.Parent = playerGui
else
ui = playerGui:WaitForChild("UI")
end
ReplicatedFirst:RemoveDefaultLoadingScreen()
@ -38,14 +39,12 @@ if playerGui:FindFirstChild("ConnectingGui") then
playerGui.ConnectingGui:Destroy()
end
if RunService:IsStudio() then
--[[if RunService:IsStudio() then
return
end
end]]
local c = workspace.CurrentCamera
local IS_PHONE = c.ViewportSize.Y < 600
local topbar = guiRoot:WaitForChild("Topbar")
local IS_PHONE = ui.AbsoluteSize.Y < 600
local topbar = ui:WaitForChild("Topbar")
if IS_PHONE then
local uiScale = Instance.new("UIScale")
@ -53,7 +52,7 @@ if IS_PHONE then
uiScale.Parent = topbar
end
local messageGui = guiRoot:WaitForChild("MessageGui")
local messageGui = ui:WaitForChild("GameJoin")
local message = messageGui:WaitForChild("Message")
local partWatch = nil
@ -90,9 +89,9 @@ end
---------------------------------------------------------------------
local c = workspace.CurrentCamera
c.CameraType = "Follow"
c.CameraSubject = workspace
local camera = workspace.CurrentCamera
camera.CameraType = "Follow"
camera.CameraSubject = workspace
messageGui.Visible = true
@ -140,7 +139,7 @@ if partWatch then
partWatch = nil
end
c.CameraSubject = nil
camera.CameraSubject = nil
message.Text = "Requesting character..."
wait(1)
@ -157,4 +156,4 @@ while not player.Character do
end
messageGui.Visible = false
c.CameraType = "Custom"
camera.CameraType = "Custom"

View File

@ -0,0 +1,3 @@
{
"className": "ScreenGui"
}

View File

@ -1,35 +0,0 @@
local safeChatTree =
{
Label = "ROOT";
Branches = {};
}
do
local mTreeData = script:WaitForChild("RawTreeData")
local treeData = require(mTreeData)
local stack = {}
stack[0] = safeChatTree
for line in treeData:gmatch("[^\n]+") do
if #line > 0 then
local stackIndex = 0
while line:sub(1,1) == "\t" do
stackIndex = stackIndex + 1
line = line:sub(2)
end
local tree = stack[stackIndex]
assert(tree,"Bad safechat tree setup at depth " .. stackIndex .. ": " .. line)
local branch = {}
branch.Label = line
branch.Branches = {}
table.insert(tree.Branches,branch)
stack[stackIndex+1] = branch
end
end
end
return safeChatTree

View File

@ -0,0 +1,143 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Folder" referent="RBX0671216DD8724E6D8D051844CF481DCE">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">CharacterAssets</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="BodyColors" referent="RBXA150CA367D6A4C1F9E84B6DE920B6C99">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Color3 name="HeadColor3">
<R>0.960784376</R>
<G>0.80392158</G>
<B>0.188235298</B>
</Color3>
<Color3 name="LeftArmColor3">
<R>0.960784376</R>
<G>0.80392158</G>
<B>0.188235298</B>
</Color3>
<Color3 name="LeftLegColor3">
<R>0.643137276</R>
<G>0.741176486</G>
<B>0.278431386</B>
</Color3>
<string name="Name">BodyColors</string>
<Color3 name="RightArmColor3">
<R>0.960784376</R>
<G>0.80392158</G>
<B>0.188235298</B>
</Color3>
<Color3 name="RightLegColor3">
<R>0.643137276</R>
<G>0.741176486</G>
<B>0.278431386</B>
</Color3>
<BinaryString name="Tags"></BinaryString>
<Color3 name="TorsoColor3">
<R>0.0509804003</R>
<G>0.411764711</G>
<B>0.674509823</B>
</Color3>
</Properties>
</Item>
<Item class="Pants" referent="RBX31FA469E6C3C4F3DBE7E0444A5401B8B">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Color3 name="Color3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<string name="Name">Pants</string>
<Content name="PantsTemplate"><url>rbxassetid://1110695628</url></Content>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="Shirt" referent="RBXB0336FE25D3E4EB39E650E41F27B98F2">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Color3 name="Color3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<string name="Name">Shirt</string>
<Content name="ShirtTemplate"><url>rbxassetid://1110695025</url></Content>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ShirtGraphic" referent="RBX83FFD5C00DBB411A81916D8E661D6578">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Color3 name="Color3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<Content name="Graphic"><null></null></Content>
<string name="Name">ShirtGraphic</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="CharacterMesh" referent="RBXB954AF1FA0AA4D5490A4B7B6F371786E">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<int64 name="BaseTextureId">0</int64>
<token name="BodyPart">2</token>
<int64 name="MeshId">1112256772</int64>
<string name="Name">CL_LeftArm</string>
<int64 name="OverlayTextureId">0</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="CharacterMesh" referent="RBX40811AF2E89147E9AD8A8A4D144C9ACF">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<int64 name="BaseTextureId">0</int64>
<token name="BodyPart">4</token>
<int64 name="MeshId">1112275294</int64>
<string name="Name">CL_LeftLeg</string>
<int64 name="OverlayTextureId">0</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="CharacterMesh" referent="RBX9C26FFD1EC6041DAA20951AEBECEC074">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<int64 name="BaseTextureId">0</int64>
<token name="BodyPart">3</token>
<int64 name="MeshId">1112244824</int64>
<string name="Name">CL_RightArm</string>
<int64 name="OverlayTextureId">0</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="CharacterMesh" referent="RBX014C72ED7C384ACD90CF1CAC6D72BFC5">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<int64 name="BaseTextureId">0</int64>
<token name="BodyPart">5</token>
<int64 name="MeshId">1112267576</int64>
<string name="Name">CL_RightLeg</string>
<int64 name="OverlayTextureId">0</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="CharacterMesh" referent="RBXBA7911C3A8A0491AA5936C2CFA96007E">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<int64 name="BaseTextureId">0</int64>
<token name="BodyPart">1</token>
<int64 name="MeshId">1112228624</int64>
<string name="Name">CL_Torso</string>
<int64 name="OverlayTextureId">0</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
</roblox>

View File

@ -0,0 +1,185 @@
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local Debris = game:GetService("Debris")
local gateway = script.Parent
local tool = gateway.Parent
local remote = gateway:WaitForChild("Gateway")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local isActive = false
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Standard Input
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local function activate(active,cf)
isActive = active
remote:FireServer("SetActive",active,cf)
while isActive do
wait(.1)
remote:FireServer("SetTarget",mouse.Hit)
end
end
local function onKey(input)
local keyCode = input.KeyCode.Name
local down = (input.UserInputState.Name == "Begin")
remote:FireServer("KeyEvent",keyCode,down)
end
local function onInputBegan(input,gameProcessed)
if not gameProcessed then
local name = input.UserInputType.Name
if name == "MouseButton1" then
activate(true,mouse.Hit)
elseif name == "Touch" then
wait(.1)
local state = input.UserInputState.Name
if state == "End" or state == "Cancel" then
activate(true,mouse.Hit)
end
elseif name == "Gamepad1" then
local keyCode = input.KeyCode.Name
if keyCode == "ButtonR2" then
activate(true,mouse.Hit)
end
elseif name == "Keyboard" then
onKey(input)
end
end
end
local function onInputEnded(input,gameProcessed)
if not gameProcessed and isActive then
local name = input.UserInputType.Name
if name == "MouseButton1" or name == "Touch" or name == "Gamepad1" then
activate(false,mouse.Hit)
elseif name == "Keyboard" then
onKey(input)
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)
UserInputService.InputEnded:Connect(onInputEnded)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Special case Input
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local mControlScheme = tool:WaitForChild("ControlScheme",5)
if mControlScheme then
local controlSchemeData = require(mControlScheme)
local controlScheme = controlSchemeData.Buttons
local activateContext = controlSchemeData.ActivateContext
local keyEvent = tool:WaitForChild("KeyEvent")
local callbacks = {}
local hands = { L = "Left", R = "Right" }
local handTypes = {"Bumper","Trigger","Joystick (Press)"}
local schemeDocs =
{
Keyboard = {"Hold Left Mouse Button - " .. activateContext};
Gamepad = {"Hold Right Trigger - " .. activateContext};
}
for key,data in pairs(controlScheme) do
local down = false
callbacks[key] = function (actionName,inputState,inputObject)
if (inputState.Name == "Begin") and not down then
down = true
if data.Client then
keyEvent:Fire(key,true)
else
remote:FireServer("KeyEvent",key,true)
end
elseif (inputState.Name == "End") and down then
down = false
if data.Client then
keyEvent:Fire(key,false)
else
remote:FireServer("KeyEvent",key,false)
end
end
end
local xBtn = data.XboxButton:gsub("Button","")
if #xBtn == 2 then
local handId,hTypeId = xBtn:match("(%u)(%d)")
local hand = hands[handId]
local hType = handTypes[tonumber(hTypeId)]
xBtn = hand .. " " .. hType
else
xBtn = "(" .. xBtn .. ")"
end
table.insert(schemeDocs.Keyboard,key .. " - " .. data.Label)
table.insert(schemeDocs.Gamepad,xBtn .. " - " .. data.Label)
end
local currentSchemeDocMsg
local function onLastInputTypeChanged(inputType)
if currentSchemeDocMsg and not UserInputService.TouchEnabled and not controlSchemeData.HideControls then
local schemeDoc
if inputType.Name:find("Gamepad") then
schemeDoc = "Gamepad"
else
schemeDoc = "Keyboard"
end
currentSchemeDocMsg.Text = schemeDoc .. " Controls:\n\n" .. table.concat(schemeDocs[schemeDoc],"\n")
end
end
local diedCon
local equipped = false
local function onUnequipped()
if equipped then
equipped = false
for key,data in pairs(controlScheme) do
ContextActionService:UnbindAction(data.Label)
end
currentSchemeDocMsg:Destroy()
currentSchemeDocMsg = nil
end
end
local function onEquipped()
if not equipped then
equipped = true
for key,data in pairs(controlScheme) do
ContextActionService:BindAction(data.Label,callbacks[key],true,Enum.KeyCode[data.XboxButton])
ContextActionService:SetTitle(data.Label,data.Label)
end
if UserInputService.TouchEnabled then
spawn(function ()
local playerGui = player:WaitForChild("PlayerGui")
local contextActionGui = playerGui:WaitForChild("ContextActionGui")
local contextButtonFrame = contextActionGui:WaitForChild("ContextButtonFrame")
contextButtonFrame.Size = UDim2.new(3/8,0,3/8,0)
contextButtonFrame.AnchorPoint = Vector2.new(1,1)
contextButtonFrame.Position = UDim2.new(1,0,1,0)
end)
end
currentSchemeDocMsg = Instance.new("Message")
currentSchemeDocMsg.Parent = player
onLastInputTypeChanged(UserInputService:GetLastInputType())
if not diedCon then
local char = tool.Parent
if char then
local humanoid = char:FindFirstChildWhichIsA("Humanoid")
if humanoid then
diedCon = humanoid.Died:Connect(onUnequipped)
end
end
end
end
end
tool.Equipped:Connect(onEquipped)
tool.Unequipped:Connect(onUnequipped)
UserInputService.LastInputTypeChanged:Connect(onLastInputTypeChanged)
end

View File

@ -0,0 +1 @@
{"ClassName": "RemoteEvent"}

View File

@ -17,7 +17,7 @@ local enableBevels = getFlag("EnableBevels")
local debugMode = getFlag("DevTestMode")
local bevelCache = ServerStorage:FindFirstChild("BevelCache")
local bevelsReady = bevelCache:FindFirstChild("BevelsReady")
local bevelsReady = bevelCache and bevelCache:FindFirstChild("BevelsReady")
if not bevelCache then
bevelCache = Instance.new("Folder")
@ -37,7 +37,7 @@ if not enableBevels then
return
end
do
--[[do
local coreBevelCache = ServerStorage:WaitForChild("CoreBevelCache")
for _,bevel in pairs(coreBevelCache:GetChildren()) do
@ -48,7 +48,7 @@ do
end
coreBevelCache:Destroy()
end
end]]
local regen = ServerStorage:FindFirstChild("Regeneration")

View File

@ -4,13 +4,12 @@ local InsertService = game:GetService("InsertService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local hats = ServerStorage:WaitForChild("ServerHatCache")
local requestCharacter = ReplicatedStorage:WaitForChild("RequestCharacter")
local assetUtil = require(ReplicatedStorage:WaitForChild("AssetUtil"))
local itemData = ReplicatedStorage:WaitForChild("ItemData")
local hatData = require(itemData:WaitForChild("Hat"))
local playerDataGet = { Success = false }
pcall(function ()
playerDataGet = require(ServerStorage:WaitForChild("PlayerDataStore"))
end)
@ -20,9 +19,16 @@ if not playerDataGet.Success then
end
local playerDataStore = playerDataGet.DataStore
local limbs = {"Head", "Torso", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}
local requestCharacter = Instance.new("RemoteEvent")
requestCharacter.Name = "RequestCharacter"
requestCharacter.Parent = ReplicatedStorage
local hats = Instance.new("Folder")
hats.Name = "ServerHatCache"
hats.Parent = ServerStorage
local function preBufferHat(hatId)
local hat = hats:FindFirstChild(hatId)
@ -48,21 +54,22 @@ local function safeDestroy(obj)
end
local function onCharacterAdded(char)
local assets = ServerStorage.CharacterAssets
local player = Players:GetPlayerFromCharacter(char)
local bodyColors = script.BodyColors:Clone()
local bodyColors = assets.BodyColors:Clone()
CollectionService:AddTag(bodyColors, "RespectCharacterAsset")
local graphic = script.ShirtGraphic:Clone()
local graphic = assets.ShirtGraphic:Clone()
local shirt = char:FindFirstChildWhichIsA("Shirt")
if not shirt then
shirt = script.Shirt:Clone()
shirt = assets.Shirt:Clone()
end
local pants = char:FindFirstChildWhichIsA("Pants")
if not pants then
pants = script.Pants:Clone()
pants = assets.Pants:Clone()
end
local faceId = 1104210678
@ -70,15 +77,35 @@ local function onCharacterAdded(char)
local humanoid = char:WaitForChild("Humanoid")
CollectionService:AddTag(humanoid, "Animator")
CollectionService:AddTag(humanoid, "HumanoidSound")
local function onDied()
if char:FindFirstChild("HumanoidRootPart") then
char.HumanoidRootPart:Destroy()
local fuse do
local rootPart = char:FindFirstChild("HumanoidRootPart")
local torso = char:FindFirstChild("Torso")
if rootPart and torso then
fuse = Instance.new("WeldConstraint")
fuse.Part0 = torso
fuse.Part1 = rootPart
fuse.Parent = rootPart
end
end
for _,desc in pairs(char:GetDescendants()) do
if desc:IsA("BasePart") then
for _,joint in pairs(desc:GetJoints()) do
if joint ~= fuse then
joint:Destroy()
end
end
end
end
wait(5)
local player = game.Players:GetPlayerFromCharacter(char)
if player then
player:LoadCharacter()
end
@ -121,6 +148,7 @@ local function onCharacterAdded(char)
if player.UserId > 0 and playerDataStore then
local playerData = playerDataStore:GetSaveData(player)
local colorData = playerData:Get("BodyColors")
if colorData then
for _,limb in pairs(limbs) do
local num = colorData[limb]
@ -131,19 +159,24 @@ local function onCharacterAdded(char)
end
local loadout = playerData:Get("Loadout")
if loadout then
local shirtId = loadout.Shirt
local pantsId = loadout.Pants
if shirtId then
shirt.ShirtTemplate = "rbxassetid://" .. shirtId
end
local pantsId = loadout.Pants
if pantsId then
pants.PantsTemplate = "rbxassetid://" .. pantsId
end
faceId = loadout.Face or faceId
spawn(function ()
local hatId = loadout.Hat or 0
if hatId > 0 then
local hatSrc = preBufferHat(hatId)
local hat = hatSrc:Clone()
@ -156,7 +189,8 @@ local function onCharacterAdded(char)
end
if tshirtId > 0 then
local success,img = assetUtil:RequestImage(tshirtId)
local success, img = assetUtil:RequestImage(tshirtId)
if success and img then
graphic.Graphic = img
graphic.Parent = char
@ -169,6 +203,7 @@ local function onCharacterAdded(char)
local head = char:WaitForChild("Head")
local face = head:WaitForChild("face")
face.Texture = "rbxhttp://Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid=" .. faceId
end
@ -180,15 +215,11 @@ end
local function onPlayerAdded(player)
player.CanLoadCharacterAppearance = false
player.CharacterAdded:connect(onCharacterAdded)
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
if game.JobId == "" then
player:LoadCharacter()
end
end
for _,v in pairs(Players:GetPlayers()) do

View File

@ -1,12 +1,15 @@
local Chat = game:GetService("Chat")
local Players = game:GetService("Players")
local TextService = game:GetService("TextService")
local Chat = game:GetService("Chat")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local chatRemote = ReplicatedStorage:WaitForChild("ChatRemote")
local mSafeChatTree = ReplicatedStorage:WaitForChild("SafeChatTree")
local mSafeChatTree = ReplicatedStorage:WaitForChild("SafeChat")
local safeChatTree = require(mSafeChatTree)
local chatRemote = Instance.new("RemoteEvent")
chatRemote.Name = "ChatRemote"
chatRemote.Parent = ReplicatedStorage
local filterCache = {}
local maxChatLength = 128

View File

@ -6,6 +6,7 @@ local FORCE_GRANULARITY = 2
local allowTeamDamage = false
local teamDamage = ServerStorage:FindFirstChild("TeamDamage")
if teamDamage then
allowTeamDamage = teamDamage.Value
end

View File

@ -1,9 +1,12 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local itemData = ReplicatedStorage:WaitForChild("ItemData")
local hatData = require(itemData:WaitForChild("Hat"))
local ServerStorage = game:GetService("ServerStorage")
local grantHatToUser = ServerStorage:WaitForChild("GrantHatToUser")
local grantHatToUser = Instance.new("BindableEvent")
grantHatToUser.Name = "GrantHatToUser"
grantHatToUser.Parent = ServerStorage
local authTable =
{

View File

@ -2,17 +2,19 @@ local ServerStorage = game:GetService("ServerStorage")
local StarterPack = game:GetService("StarterPack")
local Players = game:GetService("Players")
local standardTools = ServerStorage:WaitForChild("StandardTools")
local tools = ServerStorage:WaitForChild("Tools")
local loadTools = ServerStorage:FindFirstChild("LoadTools")
if loadTools then
for toolName in loadTools.Value:gmatch("[^;]+") do
local tool = standardTools:WaitForChild(toolName)
local tool = tools:WaitForChild(toolName)
tool:Clone().Parent = StarterPack
for _,v in pairs(Players:GetPlayers()) do
if v:FindFirstChild("Backpack") and not v:FindFirstChild(tool.Name) then
tool:Clone().Parent = v.Backpack
for _,player in pairs(Players:GetPlayers()) do
local backpack = player:FindFirstChildOfClass("Backpack")
if backpack and not backpack:FindFirstChild(tool.Name) then
tool:Clone().Parent = backpack
end
end
end

View File

@ -205,6 +205,7 @@ local function applyCharacter(humanoid)
local model = humanoid.Parent
if not CollectionService:HasTag(humanoid, "Classified") then
local characterAssets = ServerStorage.CharacterAssets
CollectionService:AddTag(humanoid, "Classified")
for _,v in pairs(model:GetDescendants()) do
@ -213,9 +214,9 @@ local function applyCharacter(humanoid)
end
end
for _,v in pairs(script:GetChildren()) do
if v:IsA("CharacterMesh") then
local copy = v:Clone()
for _,child in pairs(characterAssets:GetChildren()) do
if child:IsA("CharacterMesh") then
local copy = child:Clone()
copy.Parent = model
CollectionService:AddTag(copy, "NoCharacterBevels")
end
@ -223,11 +224,11 @@ local function applyCharacter(humanoid)
delay(1, function ()
if not model:FindFirstChildWhichIsA("Shirt") then
script.Shirt:Clone().Parent = model
characterAssets.Shirt:Clone().Parent = model
end
if not model:FindFirstChildWhichIsA("Pants") then
script.Pants:Clone().Parent = model
characterAssets.Pants:Clone().Parent = model
end
end)
end

View File

@ -8,16 +8,19 @@ local AssetUtil =
}
local assetTypes = {}
for _,assetType in pairs(Enum.AssetType:GetEnumItems()) do
assetTypes[assetType.Value] = assetType.Name
end
function AssetUtil:SafeCall(class,method,...)
local success,response
local tries = 0
local tries = 0
while not success do
success,response = pcall(class[method],class,...)
if not success then
success, response = pcall(class[method], class, ...)
if not success then
if response:find("400") then
success = true
response = false
@ -28,16 +31,19 @@ function AssetUtil:SafeCall(class,method,...)
end
end
end
end
return success,response
end
return success, response
end
function AssetUtil:Import(assetId)
local success,model = self:SafeCall(InsertService,"LoadAsset",assetId)
local success, model = self:SafeCall(InsertService, "LoadAsset", assetId)
if success then
local objects = model:GetChildren()
return true,unpack(objects)
end
return true, unpack(objects)
end
return false
end
@ -47,11 +53,13 @@ function AssetUtil:RequestImage(assetId)
assert(assetId > 0)
if self.TextureCache[assetId] == nil then
local success,response = self:SafeCall(MarketplaceService,"GetProductInfo",assetId)
local success, response = self:SafeCall(MarketplaceService, "GetProductInfo", assetId)
if success then
local result
local result
if response then
local assetType = assetTypes[response.AssetTypeId]
local assetType = assetTypes[response.AssetTypeId]
if assetType == "Image" then -- No transformation needed!
result = "rbxassetid://" .. assetId
elseif assetType == "TeeShirt" then
@ -60,19 +68,20 @@ function AssetUtil:RequestImage(assetId)
result = shirtGraphic.Graphic
end
elseif assetType == "Decal" or assetType == "Face" then
local imported,decal = self:Import(assetId)
local imported, decal = self:Import(assetId)
if imported then
result = decal.Texture
end
end
else
result = ""
end
end
self.TextureCache[assetId] = result
end
end
return true,self.TextureCache[assetId]
return true, self.TextureCache[assetId]
end
return AssetUtil

View File

@ -1,24 +0,0 @@
return function (script)
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local TeleportService = game:GetService("TeleportService")
local c = workspace.CurrentCamera
local moon = script:WaitForChild("Moon")
moon.Locked = true
moon.Size = Vector3.new(50,50,1)
local function moonUpdate()
if TeleportService:GetTeleportSetting("ClassicSky") then
local pos = Lighting:GetMoonDirection() * 900
local origin = c.CFrame.p
moon.Parent = c
moon.CFrame = CFrame.new(origin+pos, origin)
else
moon.Parent = nil
end
end
RunService:BindToRenderStep("MoonUpdate",201,moonUpdate)
return 1
end

View File

@ -1,133 +0,0 @@
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")
-----------------------------------------------------------------
local inGuiFocus = false
local inputQueue = {}
local function checkGuiFocus()
inGuiFocus = (next(inputQueue) ~= nil)
end
local function onInputChanged(input,gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseMovement then
inputQueue[input] = gameProcessed or nil
checkGuiFocus()
end
end
UserInputService.InputChanged:Connect(onInputChanged)
-----------------------------------------------------------------
local activated = false
local player = Players.LocalPlayer
local mouseGui
local function onInputBegan(input,gameProcessed)
if mouseGui then
if input.UserInputType == Enum.UserInputType.Touch and not gameProcessed then
wait(.1)
if input.UserInputState == Enum.UserInputState.End then
activated = true
else
mouseGui.ImageTransparency = 1
end
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)
-----------------------------------------------------------------
local GUN_WAIT_CURSOR = "rbxasset://textures/GunWaitCursor.png"
local GUN_CURSOR = "rbxasset://textures/GunCursor.png"
local IS_TOUCH = UserInputService.TouchEnabled
return function (script)
mouseGui = script.Parent
local hasTool = mouseGui:WaitForChild("HasTool")
UserInputService.MouseIconEnabled = false
local canActivate = true
if UserInputService.TouchEnabled then
local c = workspace.CurrentCamera
local playerGui = player:WaitForChild("PlayerGui")
local touchGui = playerGui:WaitForChild("TouchGui")
local touchFrame = touchGui:WaitForChild("TouchControlFrame")
if c.ViewportSize.Y < 600 then
touchFrame.Size = UDim2.new(0.85,0,0.8,0)
else
touchFrame.Size = UDim2.new(0.9,0,0.9,0)
end
touchFrame.Position = UDim2.new(0.05,0,0,0)
end
local function updateMouse()
local char = player.Character
local tool
local override = false
if char then
tool = char:FindFirstChildWhichIsA("Tool")
hasTool.Value = (tool ~= nil)
if tool then
if tool:FindFirstChild("IconOverride") then
if tool.IconOverride.Value ~= "" then
mouseGui.Image = tool.IconOverride.Value
else
mouseGui.Image = "rbxassetid://1000000"
end
elseif tool.Enabled then
mouseGui.Image = GUN_CURSOR
if IS_TOUCH then
canActivate = true
mouseGui.ImageTransparency = 1
end
else
mouseGui.Image = GUN_WAIT_CURSOR
end
end
else
hasTool.Value = false
end
if inGuiFocus then
mouseGui.Image = "rbxassetid://1000000"
end
local guiInset = GuiService:GetGuiInset()
local pos = UserInputService:GetMouseLocation() - guiInset
local upos = UDim2.new(0,pos.X,0,pos.Y)
if IS_TOUCH then
if hasTool.Value then
mouseGui.Visible = true
if activated and mouseGui.Image == GUN_WAIT_CURSOR then
if canActivate then
canActivate = false
mouseGui.Position = upos
mouseGui.ImageTransparency = -1
end
activated = false
else
mouseGui.ImageTransparency = math.min(1,mouseGui.ImageTransparency + 0.01)
end
else
mouseGui.Visible = false
end
else
mouseGui.Position = upos
end
if UserInputService.MouseIconEnabled then
UserInputService.MouseIconEnabled = false
end
end
RunService:BindToRenderStep("UpdateMouse",1000,updateMouse)
end

View File

@ -1,146 +0,0 @@
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Services
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local TeleportService = game:GetService("TeleportService")
local UserInputService = game:GetService("UserInputService")
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Sky Colors
local midnight = 0
local day = 86400
local hour = day/24
local sunRise = day * .25
local sunSet = day * .75
local riseAndSetTime = hour/2
local times =
{
midnight;
sunRise - hour;
sunRise - riseAndSetTime;
sunRise;
sunRise + riseAndSetTime;
sunSet - riseAndSetTime;
sunSet;
sunSet + (hour/3);
day;
}
local colors =
{
Color3.new();
Color3.new();
Color3.new(.2, .15, .01);
Color3.new(.2, .15, .01);
Color3.new(1, 1, 1);
Color3.new(1, 1, 1);
Color3.new(.4, .2, .05);
Color3.new();
Color3.new();
}
local function linearSpline(x,times,values)
assert(#times == #values)
if #values == 1 or x < times[1] then
return values[1]
end
for i = 2, #times do
if x < times[i] then
local alpha = (times[i] - x) / (times[i] - times[i-1])
return values[i-1]:lerp(values[i], 1-alpha)
end
end
return values[#values]
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local lastTime = 0
local c = workspace.CurrentCamera
local function r()
return -1 + (math.random()*2)
end
local skyAdorn = script:WaitForChild("SkyAdorn")
local night = skyAdorn:WaitForChild("Night")
local nightFrame = night:WaitForChild("NightFrame")
local star = script:WaitForChild("Star")
if UserInputService.TouchEnabled then
-- TODO: Get rid of this when shadow-mapping is available
-- on mobile or the tone mapping is corrected.
spawn(function ()
local legacyToneMap = Lighting:WaitForChild("LegacyToneMap")
legacyToneMap:Destroy()
end)
end
return function (script)
local shadowsOn = true
for i = 1,500 do
local bb = star:Clone()
bb.StudsOffsetWorldSpace = Vector3.new(r(), r(), r()).Unit * 2500
bb.Size = UDim2.new(0, math.random(2, 5), 0, math.random(2, 5))
bb.Adornee = skyAdorn
bb.Parent = skyAdorn
end
local function updateSky()
local shadowState = TeleportService:GetTeleportSetting("StencilShadows")
if shadowState == nil then
TeleportService:SetTeleportSetting("StencilShadows", true)
shadowState = true
end
if shadowState ~= shadowsOn then
shadowsOn = shadowState
if shadowsOn then
local black = Color3.new()
Lighting.GlobalShadows = true
Lighting.Ambient = black:Lerp(Lighting.OutdoorAmbient, 0.5)
else
Lighting.GlobalShadows = false
Lighting.Ambient = Lighting.OutdoorAmbient
end
end
if TeleportService:GetTeleportSetting("ClassicSky") then
local seconds = Lighting:GetMinutesAfterMidnight() * 60
if seconds < 0 then
seconds = day + seconds
end
if seconds ~= lastTime then
local sunDir = game.Lighting:GetSunDirection()
local skyColor = linearSpline(seconds, times, colors)
nightFrame.BackgroundColor3 = skyColor
nightFrame.BackgroundTransparency = math.clamp((sunDir.Y + .033) * 10, 0, 1)
lastTime = seconds
end
local sunDir = Lighting:GetSunDirection()
skyAdorn.CFrame = CFrame.new(c.CFrame.p) * CFrame.new(Vector3.new(), sunDir)
skyAdorn.Parent = (nightFrame.BackgroundTransparency < 1 and c or nil)
else
skyAdorn.Parent = nil
end
end
RunService:BindToRenderStep("UpdateSky", 201, updateSky)
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -1,4 +1,3 @@
return [==[
Hello
Hi
Hi there!
@ -443,5 +442,4 @@ Ok
:-(
:D
:-O
lol
]==]
lol

38
Shared/SafeChat/init.lua Normal file
View File

@ -0,0 +1,38 @@
local safeChatTree =
{
Label = "ROOT";
Branches = {};
}
do
local treeData = script:WaitForChild("RawTreeData")
treeData = treeData.Value
local stack = {}
stack[0] = safeChatTree
for line in treeData:gmatch("[^\n]+") do
if #line > 0 then
local stackIndex = 0
while line:sub(1, 1) == "\t" do
stackIndex = stackIndex + 1
line = line:sub(2)
end
local tree = stack[stackIndex]
assert(tree, "Bad safechat tree setup at depth " .. stackIndex .. ": " .. line)
local branch =
{
Label = line,
Branches = {}
}
table.insert(tree.Branches, branch)
stack[stackIndex + 1] = branch
end
end
end
return safeChatTree

View File

@ -1,18 +0,0 @@
if game.JobId ~= "" and game.GameId ~= 123949867 then
return
end
for _,serviceBin in pairs(script:GetChildren()) do
local className = serviceBin.Name
local service = game:FindFirstChildWhichIsA(className, true)
if not service then
service = game:GetService(className)
end
for _,child in pairs(serviceBin:GetChildren()) do
child.Parent = service
end
end
return 1

View File

@ -4,7 +4,16 @@
"properties":
{
"CanBeDropped": false,
"GripPos": [0, 0, -3.25],
"Grip":
[
0, 0, -3.25,
0, 0, 1,
1, 0, 0,
0, 1, 0
],
"TextureId": "rbxassetid://1256305"
}
}

View File

@ -1,3 +1,5 @@
local Debris = game:GetService("Debris")
ball = script.Parent
damage = 20
@ -24,9 +26,8 @@ function onTouched(hit)
s.Velocity = 15 * v
s.CFrame = CFrame.new(ball.Position + v, v)
ball.BrickCleanup:clone().Parent = s
Debris:AddItem(s, 24)
s.BrickCleanup.Disabled = false
s.Parent = game.Workspace
end
@ -67,7 +68,6 @@ function tagHumanoid(humanoid)
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")

View File

@ -1,3 +1,4 @@
local Debris = game:GetService("Debris")
local Tool = script.Parent
local fireSound = Instance.new("Sound")
@ -9,22 +10,15 @@ fireSound.Parent = Tool.Handle
local colors = {45, 119, 21, 24, 23, 105, 104}
function fire(v)
fireSound:play()
local function fire(v)
fireSound:Play()
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local missile = Instance.new("Part")
local spawnPos = vCharacter.PrimaryPart.Position
spawnPos = spawnPos + (v * 8)
missile.Position = spawnPos
@ -43,9 +37,7 @@ function fire(v)
force.force = Vector3.new(0,45,0)
force.Parent = missile
Tool.BrickCleanup:clone().Parent = missile
local new_script = script.Parent.Paintball:clone()
local new_script = Tool.Paintball:clone()
new_script.Disabled = false
new_script.Parent = missile
@ -54,10 +46,10 @@ function fire(v)
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = game.Workspace
missile:SetNetworkOwner(vPlayer)
Debris:AddItem(missile, 24)
end

View File

@ -1,5 +1,5 @@
local Tool = script.Parent
local Sound = Tool.Sound
local Sounds = Tool.Sounds
local Rocket = Instance.new("Part")
Rocket.Locked = true
@ -13,8 +13,8 @@ Rocket.Size = Vector3.new(1,1,4)
Rocket.BrickColor = BrickColor.new(23)
Tool.RocketScript:clone().Parent = Rocket
Sound.Explosion:clone().Parent = Rocket
Sound.Swoosh:clone().Parent = Rocket
Sounds.Explosion:clone().Parent = Rocket
Sounds.Swoosh:clone().Parent = Rocket
function fire(vTarget)

View File

@ -3,6 +3,14 @@
"properties":
{
"Grip":
[
0, 0, 0,
1, 0, 0,
0, 0, -1,
0, 1, 0
],
"TextureId": "rbxasset://Textures/Bomb.png"
}
}

View File

@ -1,35 +1,37 @@
local wallHeight = 4
local Debris = game:GetService("Debris")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local brickSpeed = 0.04
local wallHeight = 4
local wallWidth = 12
local Tool = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local brickColors = require(ReplicatedStorage:WaitForChild("BrickColors"))
local BrickColors = require(ReplicatedStorage:WaitForChild("BrickColors"))
-- places a brick at pos and returns the position of the brick's opposite corner
function placeBrick(cf, pos, color)
local function placeBrick(cf, pos, color)
local brick = Instance.new("Part")
brick.BrickColor = color
brick.CFrame = cf * CFrame.new(pos + brick.Size / 2)
script.Parent.BrickCleanup:Clone().Parent = brick -- attach cleanup script to this brick
brick.BrickCleanup.Disabled = false
brick.Parent = game.Workspace
brick.Parent = workspace
Debris:AddItem(brick, 24)
return brick, pos + brick.Size
end
function buildWall(cf)
local color = BrickColor.new(brickColors[math.random(1,#brickColors)])
local function buildWall(cf)
local color = BrickColor.new(BrickColors[math.random(1, #BrickColors)])
local bricks = {}
assert(wallWidth>0)
assert(wallWidth > 0)
local y = 0
while y < wallHeight do
local p
local x = -wallWidth/2
while x < wallWidth/2 do
local x = -wallWidth / 2
while x < wallWidth / 2 do
local brick
brick, p = placeBrick(cf, Vector3.new(x, y, 0), color)
x = p.x
@ -37,60 +39,58 @@ function buildWall(cf)
brick:MakeJoints()
wait(brickSpeed)
end
y = p.y
end
--workspace:UnjoinFromOutsiders(bricks)
return bricks
return bricks
end
function snap(v)
if math.abs(v.x)>math.abs(v.z) then
if v.x>0 then
return Vector3.new(1,0,0)
if math.abs(v.X) > math.abs(v.Z) then
if v.X > 0 then
return Vector3.new(1, 0, 0)
else
return Vector3.new(-1,0,0)
return Vector3.new(-1, 0, 0)
end
else
if v.z>0 then
return Vector3.new(0,0,1)
if v.Z > 0 then
return Vector3.new(0, 0, 1)
else
return Vector3.new(0,0,-1)
return Vector3.new(0, 0, -1)
end
end
end
Tool.Enabled = true
function onActivated()
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local character = Tool.Parent
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
local lookAt = snap( (targetPos - character.Head.Position).unit )
local lookAt = snap( (targetPos - character.Head.Position).Unit )
local cf = CFrame.new(targetPos, targetPos + lookAt)
Tool.Handle.BuildSound:play()
Tool.Handle.BuildSound:Play()
buildWall(cf)
wait(5)
Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
Tool.Activated:Connect(onActivated)

View File

@ -0,0 +1,11 @@
{
"ClassName": "Frame",
"Properties":
{
"BackgroundColor3": [0.706, 0.706, 0.706],
"BackgroundTransparency": 0.5,
"Size": [0, 0, 1, 0],
"ZIndex": 0
}
}

View File

@ -5,34 +5,35 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Setup
local ui = script.Parent
local rootFrame = ui:WaitForChild("RootFrame")
local self = rootFrame:WaitForChild("Backpack")
local slotTemp = script:WaitForChild("SlotTemp")
local Players = game:GetService("Players")
local self = script.Parent
local backdrop = self:WaitForChild("Backdrop")
local slotsBin = self:WaitForChild("Slots")
local player = game.Players.LocalPlayer
local slotTemp = slotsBin:WaitForChild("Template")
slotTemp.Parent = nil
local player = Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local toolIndex = 0
local tools = {}
local slots = {}
local tokens =
{
One = 1;
Two = 2;
One = 1;
Two = 2;
Three = 3;
Four = 4;
Five = 5;
Six = 6;
Four = 4;
Five = 5;
Six = 6;
Seven = 7;
Eight = 8;
Nine = 9;
Zero = 10; -- shhh not a hack
Nine = 9;
Zero = 10; -- shhh not a hack
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -44,6 +45,7 @@ local numPress = eNumPress.Event
-- Hack to work around the inputs being overridden while the Plane tool is active.
local function allowGameProcessedBypassHack()
local lastInputType = UserInputService:GetLastInputType()
if lastInputType.Name == "Gamepad1" then
local char = player.Character
if char then
@ -53,6 +55,7 @@ local function allowGameProcessedBypassHack()
end
end
end
return false
end
@ -60,6 +63,7 @@ local function onInputBegan(input,gameProcessed)
if not gameProcessed or allowGameProcessedBypassHack() then
local name = input.UserInputType.Name
local keyCode = input.KeyCode.Name
if name == "Keyboard" then
local toIndex = tokens[keyCode]
if toIndex then
@ -68,12 +72,13 @@ local function onInputBegan(input,gameProcessed)
elseif name == "Gamepad1" then
if keyCode == "ButtonL1" or keyCode == "ButtonR1" then
local nextIndex = toolIndex
if keyCode == "ButtonL1" then
nextIndex = nextIndex - 1
elseif keyCode == "ButtonR1" then
nextIndex = nextIndex + 1
end
print(nextIndex,#tools)
if nextIndex > 0 and nextIndex <= #tools then
eNumPress:Fire(nextIndex)
else
@ -89,18 +94,19 @@ UserInputService.InputBegan:connect(onInputBegan)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local function resortSlots()
for index,tool in ipairs(tools) do
for index, tool in ipairs(tools) do
local slot = slots[tool]
slot.Index.Text = index
slot.LayoutOrder = index
slot.Visible = true
end
backdrop.Size = UDim2.new(#tools,0,1,0)
backdrop.Size = UDim2.new(#tools, 0, 1, 0)
end
local function createSlot(tool)
if not slots[tool] then
local index = #tools+1
local index = #tools + 1
tools[index] = tool
local slot = slotTemp:clone()
@ -109,6 +115,7 @@ local function createSlot(tool)
local textHover = slot:WaitForChild("TextHover")
local selectionOutline = slot:WaitForChild("SelectionOutline")
local toolIcon = slot:WaitForChild("ToolIcon")
local indexLbl = slot:WaitForChild("Index")
local toolName = slot:WaitForChild("ToolName")
@ -127,7 +134,7 @@ local function createSlot(tool)
table.remove(tools, currentIndex)
for _,con in pairs(conReg) do
con:disconnect()
con:Disconnect()
end
slots[tool] = nil
@ -167,24 +174,27 @@ local function createSlot(tool)
end
if tool.TextureId ~= "" then
textHover.Visible = false
if isHovering then
toolIcon.BackgroundTransparency = 0
if isDown then
toolIcon.BackgroundColor3 = Color3.new(0,0,1)
toolIcon.BackgroundColor3 = Color3.new(0, 0, 1)
else
toolIcon.BackgroundColor3 = Color3.new(1,1,0)
toolIcon.BackgroundColor3 = Color3.new(1, 1, 0)
end
else
toolIcon.BackgroundTransparency = 1
end
else
textHover.Visible = true
if isHovering then
textHover.BackgroundTransparency = 0
if isDown then
textHover.BackgroundColor3 = Color3.new(1,1,0)
textHover.BackgroundColor3 = Color3.new(1, 1, 0)
else
textHover.BackgroundColor3 = Color3.new(0.706,0.706,0.706)
textHover.BackgroundColor3 = Color3.fromRGB(180, 180, 180)
end
else
textHover.BackgroundTransparency = 1
@ -198,12 +208,14 @@ local function createSlot(tool)
elseif input.UserInputType.Name == "MouseMovement" or input.UserInputType.Name == "Touch" then
isHovering = true
end
renderUpdate()
end
local function onInputEnded(input)
if input.UserInputType.Name == "MouseButton1" then
isDown = false
if isHovering then
toggleTool()
end
@ -286,8 +298,8 @@ local function onCharacterAdded(char)
onChildAdded(v)
end
char.ChildAdded:connect(onChildAdded)
backpack.ChildAdded:connect(onChildAdded)
char.ChildAdded:Connect(onChildAdded)
backpack.ChildAdded:Connect(onChildAdded)
end
end
@ -295,6 +307,4 @@ if player.Character then
onCharacterAdded(player.Character)
end
player.CharacterAdded:connect(onCharacterAdded)
game.StarterGui.ResetPlayerGuiOnSpawn = false
player.CharacterAdded:Connect(onCharacterAdded)

View File

@ -0,0 +1,9 @@
{
"ClassName": "UIListLayout",
"Properties":
{
"FillDirection": "Horizontal",
"SortOrder": "LayoutOrder"
}
}

View File

@ -1,5 +1,6 @@
<roblox version="4">
<Item class="TextButton" referent="RBX10B644657A3A4518AB0A11A7037EB412">
<Meta name="ExplicitAutoJoints">true</Meta>
<Item class="TextButton" referent="RBX27AB9BD3BC1E484F9D3752C376D8D0C1">
<Properties>
<bool name="Active">true</bool>
<Vector2 name="AnchorPoint">
@ -10,15 +11,15 @@
<bool name="AutoButtonColor">false</bool>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0.7058824</R>
<G>0.7058824</G>
<B>0.7058824</B>
<R>0.70588237</R>
<G>0.70588237</G>
<B>0.70588237</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
@ -28,7 +29,7 @@
<int name="LayoutOrder">0</int>
<float name="LineHeight">1</float>
<bool name="Modal">false</bool>
<string name="Name">SlotTemp</string>
<string name="Name">Template</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
@ -55,9 +56,9 @@
<BinaryString name="Tags"></BinaryString>
<string name="Text"></string>
<Color3 name="TextColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<bool name="TextScaled">false</bool>
<float name="TextSize">14</float>
@ -74,9 +75,8 @@
<token name="TextYAlignment">1</token>
<bool name="Visible">false</bool>
<int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties>
<Item class="TextLabel" referent="RBXF0DF621E41B3480FB5D54ED4A6A8EE45">
<Item class="TextLabel" referent="RBX50D4898CD6264242BE26A1F5ACB88EDA">
<Properties>
<bool name="Active">true</bool>
<Vector2 name="AnchorPoint">
@ -86,15 +86,15 @@
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0.6666667</R>
<G>0.6666667</G>
<B>0.6666667</B>
<R>0.666666687</R>
<G>0.666666687</G>
<B>0.666666687</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
@ -109,9 +109,9 @@
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0.03</XS>
<XS>0.0299999993</XS>
<XO>2</XO>
<YS>0.97</YS>
<YS>0.970000029</YS>
<YO>-2</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
@ -119,9 +119,9 @@
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.2</XS>
<XS>0.200000003</XS>
<XO>0</XO>
<YS>0.2</YS>
<YS>0.200000003</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">2</token>
@ -139,298 +139,17 @@
<G>1</G>
<B>1</B>
</Color3>
<float name="TextStrokeTransparency">0.8</float>
<float name="TextStrokeTransparency">0.800000012</float>
<float name="TextTransparency">0</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">true</bool>
<token name="TextXAlignment">2</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">true</bool>
<int name="ZIndex">3</int>
<bool name="Archivable">true</bool>
</Properties>
<Item class="UITextSizeConstraint" referent="RBXCE4D37A8079B46CDBB0DA9399C3786D7">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<int name="MaxTextSize">20</int>
<int name="MinTextSize">1</int>
<string name="Name">UITextSizeConstraint</string>
<BinaryString name="Tags"></BinaryString>
<bool name="Archivable">true</bool>
</Properties>
</Item>
</Item>
<Item class="Frame" referent="RBXABF08BAAE7CB48519D91328C7C17B674">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0</R>
<G>1</G>
<B>0</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">SelectionOutline</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>-1</XO>
<YS>0</YS>
<YO>-1</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>2</XO>
<YS>1</YS>
<YO>2</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">false</bool>
<int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties>
<Item class="Frame" referent="RBX7860469C1F384A73961E15398C3D3543">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0</R>
<G>1</G>
<B>0</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">Outline</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0.97</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>0.03</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">3</int>
<bool name="Archivable">true</bool>
</Properties>
</Item>
<Item class="Frame" referent="RBXFDA08584EE3E4D30BB6505108EA3442B">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0</R>
<G>1</G>
<B>0</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">Outline</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0.97</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.03</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">3</int>
<bool name="Archivable">true</bool>
</Properties>
</Item>
<Item class="Frame" referent="RBXD1D7D9E66E724D7C917E5356D8C69382">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0</R>
<G>1</G>
<B>0</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">Outline</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.03</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">3</int>
<bool name="Archivable">true</bool>
</Properties>
</Item>
<Item class="Frame" referent="RBX3966B72272E14B06915D038DDE8D7041">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0</R>
<G>1</G>
<B>0</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">Outline</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>0.03</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">3</int>
<bool name="Archivable">true</bool>
</Properties>
</Item>
</Item>
<Item class="Frame" referent="RBX424C17FC1EDB426A97FEFB11B7F31B7B">
<Item class="Frame" referent="RBX0B82AACF232C4A64BDE27B454042FE00">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
@ -440,15 +159,15 @@
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0.7058824</R>
<G>0.7058824</G>
<B>0.7058824</B>
<R>0.70588237</R>
<G>0.70588237</G>
<B>0.70588237</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
@ -479,12 +198,11 @@
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">false</bool>
<int name="ZIndex">3</int>
<bool name="Archivable">true</bool>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
<Item class="ImageLabel" referent="RBXCB12A4154D9A4034BB1FD165A03B4BD3">
<Item class="ImageLabel" referent="RBXDFBED6A6AF524E70A59A0E3D4C77727E">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
@ -500,17 +218,15 @@
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<Content name="Image">
<null></null>
</Content>
<Content name="Image"><null></null></Content>
<Color3 name="ImageColor3">
<R>1</R>
<G>1</G>
@ -532,9 +248,9 @@
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0.15</XS>
<XS>0.150000006</XS>
<XO>0</XO>
<YS>0.15</YS>
<YS>0.150000006</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
@ -543,9 +259,9 @@
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.7</XS>
<XS>0.699999988</XS>
<XO>0</XO>
<YS>0.7</YS>
<YS>0.699999988</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
@ -568,11 +284,10 @@
<YO>0</YO>
</UDim2>
<bool name="Visible">true</bool>
<int name="ZIndex">4</int>
<bool name="Archivable">true</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
<Item class="TextLabel" referent="RBX5319A263BDFD47B9902C76ABDDE1450B">
<Item class="TextLabel" referent="RBXE8FBEDE01CAE494089C4E9E76031469D">
<Properties>
<bool name="Active">true</bool>
<Vector2 name="AnchorPoint">
@ -588,9 +303,9 @@
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
@ -605,9 +320,9 @@
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0.1</XS>
<XS>0.100000001</XS>
<XO>0</XO>
<YS>0.475</YS>
<YS>0.474999994</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
@ -617,7 +332,7 @@
<UDim2 name="Size">
<XS>2</XS>
<XO>0</XO>
<YS>0.17</YS>
<YS>0.170000002</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
@ -631,19 +346,103 @@
<bool name="TextScaled">true</bool>
<float name="TextSize">100</float>
<Color3 name="TextStrokeColor3">
<R>0.4980392</R>
<G>0.4980392</G>
<B>0.4980392</B>
<R>0.498039186</R>
<G>0.498039186</G>
<B>0.498039186</B>
</Color3>
<float name="TextStrokeTransparency">0.5</float>
<float name="TextTransparency">0.2</float>
<float name="TextTransparency">0.200000003</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">true</bool>
<token name="TextXAlignment">0</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">true</bool>
<int name="ZIndex">4</int>
<bool name="Archivable">true</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
<Item class="ImageLabel" referent="RBX4DDC6492689049AFA5EEA42E26EFE0C5">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882362</R>
<G>0.164705887</G>
<B>0.207843155</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<Content name="Image"><url>rbxassetid://4331165254</url></Content>
<Color3 name="ImageColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<Vector2 name="ImageRectOffset">
<X>0</X>
<Y>0</Y>
</Vector2>
<Vector2 name="ImageRectSize">
<X>0</X>
<Y>0</Y>
</Vector2>
<float name="ImageTransparency">0</float>
<int name="LayoutOrder">0</int>
<string name="Name">SelectionOutline</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<token name="ScaleType">0</token>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<Rect2D name="SliceCenter">
<min>
<X>0</X>
<Y>0</Y>
</min>
<max>
<X>0</X>
<Y>0</Y>
</max>
</Rect2D>
<float name="SliceScale">1</float>
<BinaryString name="Tags"></BinaryString>
<UDim2 name="TileSize">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<bool name="Visible">false</bool>
<int name="ZIndex">2</int>
</Properties>
</Item>
</Item>

View File

@ -0,0 +1,9 @@
{
"className": "Frame",
"properties":
{
"BackgroundTransparency": 1,
"Size": [1, 0, 1, 0]
}
}

View File

@ -0,0 +1,8 @@
{
"ClassName": "UIScale",
"Properties":
{
"Scale": 0.1333
}
}

View File

@ -1,3 +1,14 @@
{
"className": "Frame"
"className": "Frame",
"properties":
{
"AnchorPoint": [0, 1],
"BackgroundTransparency": 1,
"SizeConstraint": "RelativeYY",
"Position": [0, 0, 1, 0],
"Size": [1, 0, 1, 0]
}
}

View File

@ -8,25 +8,28 @@ local RunService = game:GetService("RunService")
local TextService = game:GetService("TextService")
local UserInputService = game:GetService("UserInputService")
local LinkedList = require(script:WaitForChild("LinkedList"))
local chat = script.Parent
local util = chat:WaitForChild("Utility")
local ui = script.Parent
local rootFrame = ui:WaitForChild("RootFrame")
local chat = rootFrame:WaitForChild("Chat")
local chatBar = chat:WaitForChild("ChatBar")
local chatOutput = chat:WaitForChild("ChatOutput")
local chatRemote = ReplicatedStorage:WaitForChild("ChatRemote")
local focusBackdrop = chatBar:WaitForChild("FocusBackdrop")
local mainBackdrop = chat:WaitForChild("MainBackdrop")
local messageTemplate = script:WaitForChild("MessageTemplate")
local messageTemplate = util:WaitForChild("MessageTemplate")
local hasCoreGateway, coreGateway = pcall(function ()
local getCoreGateway = script:WaitForChild("GetCoreGateway")
return require(getCoreGateway)
local LinkedList = require(util:WaitForChild("LinkedList"))
local success, RobloxChatMount = pcall(function ()
local chatMount = util:WaitForChild("RobloxChatMount")
return require(chatMount)
end)
if not success then
RobloxChatMount = nil
end
--------------------------------------------------------------------------------------------------------------------------------------
-- Player Colors
--------------------------------------------------------------------------------------------------------------------------------------
@ -53,7 +56,7 @@ local function computePlayerColor(player)
local oddShift = (1 - (length % 2))
local value = 0
for i = 1,length do
for i = 1, length do
local char = pName:sub(i, i):byte()
local rev = (length - i) + oddShift
@ -74,11 +77,14 @@ end
local function beginChatting()
focusBackdrop.Visible = true
mainBackdrop.BackgroundColor3 = Color3.new(1, 1, 1)
if not chatBar:IsFocused() then
chatBar.TextTransparency = 1
chatBar:CaptureFocus()
wait()
chatBar.Text = ""
chatBar.TextTransparency = 0
end
@ -102,13 +108,14 @@ local function onChatFocusLost(enterPressed)
chatRemote:FireServer(msg)
if hasCoreGateway then
coreGateway.ChatWindow.MessagePosted:Fire(msg)
if RobloxChatMount then
RobloxChatMount.ChatWindow.MessagePosted:Fire(msg)
end
end
chatBar.Text = ""
focusBackdrop.Visible = false
mainBackdrop.BackgroundColor3 = focusBackdrop.BackgroundColor3
end
UserInputService.InputBegan:Connect(onInputBegan)

141
UI/Chat/ChatBar.rbxmx Normal file
View File

@ -0,0 +1,141 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="TextBox" referent="RBX53E251EA6BAF4CD383B72398B62CF4C5">
<Properties>
<bool name="Active">true</bool>
<Vector2 name="AnchorPoint">
<X>1</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.168627501</R>
<G>0.168627501</G>
<B>0.168627501</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClearTextOnFocus">true</bool>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<token name="Font">4</token>
<int name="LayoutOrder">0</int>
<float name="LineHeight">1</float>
<bool name="MultiLine">false</bool>
<string name="Name">ChatBar</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<Color3 name="PlaceholderColor3">
<R>1</R>
<G>1</G>
<B>0.784313798</B>
</Color3>
<string name="PlaceholderText">To chat click here or press the &quot;/&quot; key</string>
<UDim2 name="Position">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">true</bool>
<Ref name="SelectionImageObject">null</Ref>
<bool name="ShowNativeInput">true</bool>
<UDim2 name="Size">
<XS>1</XS>
<XO>-3</XO>
<YS>0</YS>
<YO>15</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<BinaryString name="Tags"></BinaryString>
<string name="Text"></string>
<Color3 name="TextColor3">
<R>0</R>
<G>0</G>
<B>0</B>
</Color3>
<bool name="TextEditable">true</bool>
<bool name="TextScaled">false</bool>
<float name="TextSize">15</float>
<Color3 name="TextStrokeColor3">
<R>0</R>
<G>0</G>
<B>0</B>
</Color3>
<float name="TextStrokeTransparency">1</float>
<float name="TextTransparency">0</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">false</bool>
<token name="TextXAlignment">0</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">true</bool>
<int name="ZIndex">3</int>
</Properties>
<Item class="Frame" referent="RBX50915CE1C34B4703AE5B32122C5D3F1F">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0.250980407</R>
<G>0.250980407</G>
<B>0.250980407</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">FocusBackdrop</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>-3</XO>
<YS>1</YS>
<YO>3</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>3</XO>
<YS>0</YS>
<YO>3</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">false</bool>
<int name="ZIndex">2</int>
</Properties>
</Item>
</Item>
</roblox>

73
UI/Chat/ChatOutput.rbxmx Normal file
View File

@ -0,0 +1,73 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Frame" referent="RBX6720E8CE928F45EBA3D9654C3535144F">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">true</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">ChatOutput</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>23</XO>
<YS>0</YS>
<YO>29</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>0</YS>
<YO>96</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
<Item class="UIListLayout" referent="RBX0C1710D255DC439296A21B6E33E76EDE">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<token name="FillDirection">1</token>
<token name="HorizontalAlignment">1</token>
<string name="Name">Stream</string>
<UDim name="Padding">
<S>0</S>
<O>0</O>
</UDim>
<token name="SortOrder">2</token>
<BinaryString name="Tags"></BinaryString>
<token name="VerticalAlignment">2</token>
</Properties>
</Item>
</Item>
</roblox>

View File

@ -1,5 +1,8 @@
<roblox version="4">
<Item class="Frame" referent="RBX59EEFE87DDAF44588210504B322939BC">
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Frame" referent="RBX805E19DEF8FF451382A2B5DAFB3FE5B1">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
@ -9,22 +12,22 @@
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
<R>0.250980407</R>
<G>0.250980407</G>
<B>0.250980407</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.1058824</R>
<G>0.1647059</G>
<B>0.2078432</B>
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">NullSelectionImageObject</string>
<string name="Name">MainBackdrop</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
@ -32,7 +35,7 @@
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
@ -40,17 +43,16 @@
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0</XS>
<XS>1</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
<YO>20</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties>
</Item>
</roblox>

View File

@ -1,16 +1,20 @@
local ChatConnections = {}
local function AddObjects(bindableClass,targetName,...)
local function AddObjects(bindableClass, targetName, ...)
local target = ChatConnections[targetName]
if not target then
target = {}
ChatConnections[targetName] = target
end
local names = {...}
for _,name in pairs(names) do
local signal = Instance.new(bindableClass)
signal.Name = targetName .. "_" .. name
signal.Parent = script
target[name] = signal
end
end
@ -75,11 +79,12 @@ local GuiService = game:GetService("GuiService")
if not GuiService:IsTenFootInterface() then
local tries = 0
local maxAttempts = 30
while (tries < maxAttempts) do
local success,result = pcall(function ()
StarterGui:SetCore("CoreGuiChatConnections", ChatConnections)
end)
if success then
break
else

9
UI/Chat/init.meta.json Normal file
View File

@ -0,0 +1,9 @@
{
"className": "Frame",
"properties":
{
"BackgroundTransparency": 1,
"Size": [1, 0, 1, 0]
}
}

12
UI/ChatPadding.model.json Normal file
View File

@ -0,0 +1,12 @@
{
"ClassName": "UIPadding",
"Properties":
{
"PaddingBottom":
{
"Type": "UDim",
"Value": [0, 20]
}
}
}

View File

@ -1,7 +1,7 @@
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
local function addUIScale(obj,scale)
local function addUIScale(obj, scale)
local uiScale = Instance.new("UIScale")
uiScale.Scale = scale
uiScale.Parent = obj
@ -21,6 +21,7 @@ if GuiService:IsTenFootInterface() then
chat.Visible = false
local chatPadding = gui:WaitForChild("ChatPadding", 1)
if chatPadding then
chatPadding:Destroy()
end

215
UI/GameJoin.rbxmx Normal file
View File

@ -0,0 +1,215 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Frame" referent="RBX3818939CB8564C2E93DE63E7368873F6">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0.5</X>
<Y>0.5</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0.70588237</R>
<G>0.70588237</G>
<B>0.70588237</B>
</Color3>
<float name="BackgroundTransparency">0.5</float>
<Color3 name="BorderColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">3</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">GameJoin</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0.5</XS>
<XO>0</XO>
<YS>0.5</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.600000024</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">false</bool>
<int name="ZIndex">1</int>
</Properties>
<Item class="TextLabel" referent="RBXDD55BDF9391D474184360D3520A1631B">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0.5</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<token name="Font">9</token>
<int name="LayoutOrder">0</int>
<float name="LineHeight">1</float>
<string name="Name">Message</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0.5</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>0.125</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<BinaryString name="Tags"></BinaryString>
<string name="Text">Connecting to server...</string>
<Color3 name="TextColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<bool name="TextScaled">true</bool>
<float name="TextSize">14</float>
<Color3 name="TextStrokeColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="TextStrokeTransparency">0.75</float>
<float name="TextTransparency">0</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">true</bool>
<token name="TextXAlignment">2</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
<Item class="UIAspectRatioConstraint" referent="RBX491BBDD74E71459A8BEE686D18ADF46E">
<Properties>
<float name="AspectRatio">3</float>
<token name="AspectType">0</token>
<BinaryString name="AttributesSerialize"></BinaryString>
<token name="DominantAxis">1</token>
<string name="Name">UIAspectRatioConstraint</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="TextLabel" referent="RBX24452B51E38C431F85635F63300BB3B9">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0.5</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<token name="Font">9</token>
<int name="LayoutOrder">0</int>
<float name="LineHeight">1</float>
<string name="Name">ExitOverride</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0.5</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>0.25</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<BinaryString name="Tags"></BinaryString>
<string name="Text"><![CDATA[You are now being returned to the main menu.
Please hold...]]></string>
<Color3 name="TextColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<bool name="TextScaled">true</bool>
<float name="TextSize">14</float>
<Color3 name="TextStrokeColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="TextStrokeTransparency">0.75</float>
<float name="TextTransparency">0</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">true</bool>
<token name="TextXAlignment">2</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">false</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
</Item>
</roblox>

View File

@ -1,14 +1,14 @@
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled("All",false)
StarterGui:SetCoreGuiEnabled("All", false)
local health = script.Parent
local redBar = health:WaitForChild("RedBar")
local greenBar = redBar:WaitForChild("GreenBar")
local healthBar = health:WaitForChild("HealthBar")
local healthGauge = healthBar:WaitForChild("HealthGauge")
local player = game.Players.LocalPlayer
local c = workspace.CurrentCamera
local camera = workspace.CurrentCamera
if c.ViewportSize.Y < 600 then
if camera.ViewportSize.Y < 600 then
local scale = Instance.new("UIScale")
scale.Scale = 0.6
scale.Parent = health
@ -18,11 +18,13 @@ local function onCharacterAdded(char)
local humanoid = char:WaitForChild("Humanoid")
local function updateHealth(health)
greenBar.Size = UDim2.new(1, 0, health / humanoid.MaxHealth, 0)
healthGauge.Size = UDim2.new(1, 0, health / humanoid.MaxHealth, 0)
end
updateHealth(humanoid.MaxHealth)
humanoid.HealthChanged:Connect(updateHealth)
health.Visible = true
end
if player.Character then

View File

@ -0,0 +1,31 @@
{
"ClassName": "Frame",
"Properties":
{
"BorderSizePixel": 0,
"AnchorPoint": [0.5, 0],
"BackgroundColor3": [1, 0, 0],
"Position": [0.5, 0, 0, 0],
"Size": [0, 12, 0, 112]
},
"Children":
[
{
"Name": "HealthGauge",
"ClassName": "Frame",
"Properties":
{
"BorderSizePixel": 0,
"AnchorPoint": [0.5, 1],
"BackgroundColor3": [0.5058, 0.7725, 0.086],
"Position": [0.5, 0, 1, 0],
"Size": [1, 0, 1, 0]
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"ClassName": "TextLabel",
"Properties":
{
"AnchorPoint": [0.5, 1],
"BackgroundTransparency": 1,
"Font": "Cartoon",
"Text": "Health",
"Position": [0.5, 0, 1, 0],
"Size": [1, 0, 0, 24],
"TextScaled": true,
"TextColor3": [0, 0, 1],
"TextStrokeColor3": [0, 0, 1],
"TextStrokeTransparency": 0.9
}
}

14
UI/Health/init.meta.json Normal file
View File

@ -0,0 +1,14 @@
{
"className": "Frame",
"properties":
{
"AnchorPoint": [1, 0.5],
"BackgroundTransparency": 1,
"Position": [1, -31, 0.5, 0],
"Size": [0, 66, 0, 137],
"Visible": false
}
}

432
UI/HelpWindow.rbxmx Normal file
View File

@ -0,0 +1,432 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="ImageLabel" referent="RBX388E03DEAA9E4925B8441AEB945A5A93">
<Properties>
<bool name="Active">true</bool>
<Vector2 name="AnchorPoint">
<X>0.5</X>
<Y>0.5</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">true</bool>
<Content name="Image"><url>rbxassetid://1041546985</url></Content>
<Color3 name="ImageColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<Vector2 name="ImageRectOffset">
<X>0</X>
<Y>0</Y>
</Vector2>
<Vector2 name="ImageRectSize">
<X>0</X>
<Y>0</Y>
</Vector2>
<float name="ImageTransparency">0</float>
<int name="LayoutOrder">0</int>
<string name="Name">HelpWindow</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0.5</XS>
<XO>0</XO>
<YS>0.5</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<token name="ScaleType">1</token>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.800000012</XS>
<XO>0</XO>
<YS>0.699999988</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<Rect2D name="SliceCenter">
<min>
<X>4</X>
<Y>30</Y>
</min>
<max>
<X>304</X>
<Y>130</Y>
</max>
</Rect2D>
<float name="SliceScale">1</float>
<BinaryString name="Tags"></BinaryString>
<UDim2 name="TileSize">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<bool name="Visible">false</bool>
<int name="ZIndex">5</int>
</Properties>
<Item class="ImageLabel" referent="RBX5776D6410DBF40FC804B2CA1E02DE9B4">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<Content name="Image"><url>rbxassetid://1041647615</url></Content>
<Color3 name="ImageColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<Vector2 name="ImageRectOffset">
<X>0</X>
<Y>0</Y>
</Vector2>
<Vector2 name="ImageRectSize">
<X>0</X>
<Y>0</Y>
</Vector2>
<float name="ImageTransparency">0</float>
<int name="LayoutOrder">0</int>
<string name="Name">Help</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>4</XO>
<YS>0</YS>
<YO>31</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<token name="ScaleType">0</token>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>-8</XO>
<YS>1</YS>
<YO>-36</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<Rect2D name="SliceCenter">
<min>
<X>0</X>
<Y>0</Y>
</min>
<max>
<X>0</X>
<Y>0</Y>
</max>
</Rect2D>
<float name="SliceScale">1</float>
<BinaryString name="Tags"></BinaryString>
<UDim2 name="TileSize">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
<Item class="UIAspectRatioConstraint" referent="RBX602D4E066107450280745E4F7AD2E1EC">
<Properties>
<float name="AspectRatio">2.75</float>
<token name="AspectType">0</token>
<BinaryString name="AttributesSerialize"></BinaryString>
<token name="DominantAxis">0</token>
<string name="Name">UIAspectRatioConstraint</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
<Item class="TextLabel" referent="RBXF46A79214591494998E5D21973DC0BFF">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<token name="Font">2</token>
<int name="LayoutOrder">0</int>
<float name="LineHeight">1</float>
<string name="Name">Title</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>7</XO>
<YS>0</YS>
<YO>2</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.899999976</XS>
<XO>-10</XO>
<YS>0</YS>
<YO>30</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<BinaryString name="Tags"></BinaryString>
<string name="Text">ROBLOX Help</string>
<Color3 name="TextColor3">
<R>0</R>
<G>0</G>
<B>0</B>
</Color3>
<bool name="TextScaled">false</bool>
<float name="TextSize">14</float>
<Color3 name="TextStrokeColor3">
<R>0.494117677</R>
<G>0.494117677</G>
<B>0.494117677</B>
</Color3>
<float name="TextStrokeTransparency">1</float>
<float name="TextTransparency">0</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">false</bool>
<token name="TextXAlignment">0</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">true</bool>
<int name="ZIndex">2</int>
</Properties>
<Item class="TextLabel" referent="RBX30D62D6AF2664583BE2290A7DD8340A1">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<token name="Font">2</token>
<int name="LayoutOrder">0</int>
<float name="LineHeight">1</float>
<string name="Name">Stroke</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>-1</XO>
<YS>0</YS>
<YO>-1</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<BinaryString name="Tags"></BinaryString>
<string name="Text">ROBLOX Help</string>
<Color3 name="TextColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<bool name="TextScaled">false</bool>
<float name="TextSize">14</float>
<Color3 name="TextStrokeColor3">
<R>0.494117677</R>
<G>0.494117677</G>
<B>0.494117677</B>
</Color3>
<float name="TextStrokeTransparency">0.600000024</float>
<float name="TextTransparency">0</float>
<token name="TextTruncate">0</token>
<bool name="TextWrapped">false</bool>
<token name="TextXAlignment">0</token>
<token name="TextYAlignment">1</token>
<bool name="Visible">true</bool>
<int name="ZIndex">-1000</int>
</Properties>
</Item>
</Item>
<Item class="ImageButton" referent="RBX3E8BC7E42F37408BB1EC89AA823ECAAC">
<Properties>
<bool name="Active">true</bool>
<Vector2 name="AnchorPoint">
<X>1</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoButtonColor">true</bool>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882399</R>
<G>0.164705902</G>
<B>0.207843199</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">1</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<Content name="HoverImage"><null></null></Content>
<Content name="Image"><url>rbxassetid://1041651899</url></Content>
<Color3 name="ImageColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<Vector2 name="ImageRectOffset">
<X>0</X>
<Y>0</Y>
</Vector2>
<Vector2 name="ImageRectSize">
<X>0</X>
<Y>0</Y>
</Vector2>
<float name="ImageTransparency">0</float>
<int name="LayoutOrder">0</int>
<bool name="Modal">true</bool>
<string name="Name">Close</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>1</XS>
<XO>-5</XO>
<YS>0</YS>
<YO>5</YO>
</UDim2>
<Content name="PressedImage"><null></null></Content>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<token name="ScaleType">0</token>
<bool name="Selectable">true</bool>
<bool name="Selected">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0</XS>
<XO>22</XO>
<YS>0</YS>
<YO>22</YO>
</UDim2>
<token name="SizeConstraint">1</token>
<Rect2D name="SliceCenter">
<min>
<X>0</X>
<Y>0</Y>
</min>
<max>
<X>0</X>
<Y>0</Y>
</max>
</Rect2D>
<float name="SliceScale">1</float>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<UDim2 name="TileSize">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
<Item class="UIAspectRatioConstraint" referent="RBX47A05B7C0621434187132FD446172C02">
<Properties>
<float name="AspectRatio">2.5</float>
<token name="AspectType">0</token>
<BinaryString name="AttributesSerialize"></BinaryString>
<token name="DominantAxis">0</token>
<string name="Name">UIAspectRatioConstraint</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
</roblox>

View File

@ -25,7 +25,7 @@ local DISK_OFFSET = CFrame.Angles(math.pi / 2,0,0)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local player = game.Players.LocalPlayer
local character,humanoid
local character, humanoid
local function onCharacterAdded(char)
humanoid = char:WaitForChild("Humanoid")
@ -65,7 +65,7 @@ UserInputService.InputChanged:Connect(onInputChanged)
local currentGoal, moveSignal
local function findAngleBetweenXZVectors(vec2, vec1)
return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
return math.atan2(vec1.X * vec2.Z - vec1.Z * vec2.X, vec1.X * vec2.X + vec1.Z * vec2.Z)
end
local function isFinite(num)
@ -73,23 +73,24 @@ local function isFinite(num)
end
local function rotateCameraTowardsGoal()
local c = workspace.CurrentCamera
if c then
local cf = c.CFrame
local focus = c.Focus
local camera = workspace.CurrentCamera
if camera then
local cf = camera.CFrame
local focus = camera.Focus
local desiredAngle = CFrame.new(cf.p,currentGoal).lookVector
local currentAngle = cf.lookVector
local desiredAngle = CFrame.new(cf.Position, currentGoal).lookVector
local currentAngle = cf.LookVector
local angleBetween = findAngleBetweenXZVectors(desiredAngle,currentAngle)
local angleBetween = findAngleBetweenXZVectors(desiredAngle, currentAngle)
if isFinite(angleBetween) then
local abs = math.abs(angleBetween)
local sign = math.sign(angleBetween)
local rotation = math.min(0.01,abs)
local rotation = math.min(0.01, abs)
local cfLocal = focus:toObjectSpace(cf)
c.CFrame = focus * CFrame.Angles(0,-rotation*sign,0) * cfLocal
camera.CFrame = focus * CFrame.Angles(0, -rotation * ign, 0) * cfLocal
end
end
end
@ -98,6 +99,7 @@ local function finishGoal()
if currentGoal then
currentGoal = nil
end
if moveSignal then
moveSignal:Disconnect()
moveSignal = nil
@ -119,7 +121,7 @@ end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local mouse = player:GetMouse()
local mouseIcon = script.Parent
local mouseIcon = script.Parent
mouse.TargetFilter = workspace.CurrentCamera
local lastTarget
@ -153,11 +155,13 @@ local function isFirstPerson()
return head.LocalTransparencyModifier == 1
end
end
return false
end
local function canClickTarget()
local target = mouse.Target
if target then
if target ~= lastTarget then
local canClick = false
@ -190,7 +194,7 @@ local function canRenderDisk(rendering)
if humanoid then
local movement = humanoid.MoveDirection
if movement.Magnitude == 0 then
local pos = mouse.Hit.p
local pos = mouse.Hit.Position
local dist = player:DistanceFromCharacter(pos)
if dist < 32 then

134
UI/Mouse/Mouse.client.lua Normal file
View File

@ -0,0 +1,134 @@
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")
-----------------------------------------------------------------
local inGuiFocus = false
local inputQueue = {}
local function checkGuiFocus()
inGuiFocus = (next(inputQueue) ~= nil)
end
local function onInputChanged(input,gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseMovement then
inputQueue[input] = gameProcessed or nil
checkGuiFocus()
end
end
UserInputService.InputChanged:Connect(onInputChanged)
-----------------------------------------------------------------
local activated = false
local player = Players.LocalPlayer
local mouseGui = script.Parent
local function onInputBegan(input,gameProcessed)
if mouseGui then
if input.UserInputType == Enum.UserInputType.Touch and not gameProcessed then
wait(.1)
if input.UserInputState == Enum.UserInputState.End then
activated = true
else
mouseGui.ImageTransparency = 1
end
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)
-----------------------------------------------------------------
local GUN_WAIT_CURSOR = "rbxasset://textures/GunWaitCursor.png"
local GUN_CURSOR = "rbxasset://textures/GunCursor.png"
local IS_TOUCH = UserInputService.TouchEnabled
local hasTool = false
UserInputService.MouseIconEnabled = false
local canActivate = true
if UserInputService.TouchEnabled then
local camera = workspace.CurrentCamera
local playerGui = player:WaitForChild("PlayerGui")
local touchGui = playerGui:WaitForChild("TouchGui")
local touchFrame = touchGui:WaitForChild("TouchControlFrame")
if camera.ViewportSize.Y < 600 then
touchFrame.Size = UDim2.new(0.85, 0, 0.8, 0)
else
touchFrame.Size = UDim2.new(0.9, 0, 0.9, 0)
end
touchFrame.Position = UDim2.new(0.05, 0, 0, 0)
end
local function updateMouse()
local char = player.Character
local override = false
local tool
if char then
tool = char:FindFirstChildWhichIsA("Tool")
hasTool = (tool ~= nil)
if tool then
if tool:FindFirstChild("IconOverride") then
if tool.IconOverride.Value ~= "" then
mouseGui.Image = tool.IconOverride.Value
else
mouseGui.Image = "rbxassetid://1000000"
end
elseif tool.Enabled then
mouseGui.Image = GUN_CURSOR
if IS_TOUCH then
canActivate = true
mouseGui.ImageTransparency = 1
end
else
mouseGui.Image = GUN_WAIT_CURSOR
end
end
else
hasTool = false
end
if inGuiFocus then
mouseGui.Image = "rbxassetid://1000000"
end
local pos = UserInputService:GetMouseLocation()
local upos = UDim2.new(0, pos.X, 0, pos.Y)
if IS_TOUCH then
mouseGui.Visible = hasTool
if hasTool then
if activated and mouseGui.Image == GUN_WAIT_CURSOR then
if canActivate then
canActivate = false
mouseGui.Position = upos
mouseGui.ImageTransparency = -1
end
activated = false
else
mouseGui.ImageTransparency = math.min(1, mouseGui.ImageTransparency + 0.01)
end
end
else
mouseGui.Position = upos
end
if UserInputService.MouseIconEnabled then
UserInputService.MouseIconEnabled = false
end
end
RunService:BindToRenderStep("UpdateMouse", 1000, updateMouse)

15
UI/Mouse/init.meta.json Normal file
View File

@ -0,0 +1,15 @@
{
"className": "ImageLabel",
"properties":
{
"Size": [0, 80, 0, 80],
"AnchorPoint": [0.5, 0.5],
"BackgroundTransparency": 1,
"Position": [0.5, 0, 0.5, 0],
"Image": "rbxassetid://334630296",
"ZIndex": 100
}
}

View File

@ -0,0 +1,58 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Frame" referent="RBX4E4607493F574512925471F1D23E5724">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>1</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0.600000024</R>
<G>0.600000024</G>
<B>0.600000024</B>
</Color3>
<float name="BackgroundTransparency">0.400000006</float>
<Color3 name="BorderColor3">
<R>0.105882362</R>
<G>0.164705887</G>
<B>0.207843155</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">Backdrop</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>1</XS>
<XO>-10</XO>
<YS>0</YS>
<YO>10</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0</XS>
<XO>10</XO>
<YS>0</YS>
<YO>10</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
</Item>
</roblox>

View File

@ -0,0 +1,68 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Frame" referent="RBXA0F40E2A63FF4A0A891B23C27EA0064B">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3">
<R>0</R>
<G>0</G>
<B>0</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882362</R>
<G>0.164705887</G>
<B>0.207843155</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">Container</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>1</XS>
<XO>-10</XO>
<YS>0</YS>
<YO>10</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>0.165000007</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
</Properties>
<Item class="UIAspectRatioConstraint" referent="RBX102314B5DD3F4DEA9A7CCD490DBC3B97">
<Properties>
<float name="AspectRatio">3</float>
<token name="AspectType">0</token>
<BinaryString name="AttributesSerialize"></BinaryString>
<token name="DominantAxis">0</token>
<string name="Name">AspectRatio</string>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
</roblox>

View File

@ -24,11 +24,13 @@ local statNames = {}
local inTeamMode = false
local basePlayerLbl = script:WaitForChild("BasePlayerLbl")
local baseGroup = script:WaitForChild("BaseGroup")
local baseStat = script:WaitForChild("BaseStat")
local playerList = script.Parent
local templates = playerList:WaitForChild("Templates")
local basePlayerLbl = templates:WaitForChild("BasePlayerLbl")
local baseGroup = templates:WaitForChild("BaseGroup")
local baseStat = templates:WaitForChild("BaseStat")
local backdrop = playerList:WaitForChild("Backdrop")
local container = playerList:WaitForChild("Container")
@ -67,12 +69,14 @@ local PLAYER_COLORS =
local function computePlayerColor(player)
local pName = player.Name
local length = #pName
local oddShift = (1 - (length % 2))
local value = 0
for i = 1,length do
local char = pName:sub(i,i):byte()
local rev = (length - i) + oddShift
if (rev % 4) >= 2 then
value = value - char
else
@ -246,10 +250,12 @@ local function onStatRemoved(stat,statName)
if stat.ClassName == "IntValue" then
local statName = statName or stat.Name
local playerState = getPlayerStateFromStat(stat)
if playerState and playerState.Stats[statName] then
playerState.Stats[statName]:Destroy()
playerState.Stats[statName] = nil
end
decrementStat(statName)
refreshTeamStats()
end
@ -259,6 +265,7 @@ local function onStatAdded(stat)
if stat.ClassName == "IntValue" then
local statName = stat.Name
local playerState = getPlayerStateFromStat(stat)
if playerState then
local changeSignal
@ -289,6 +296,7 @@ local function onStatAdded(stat)
changeSignal:Disconnect()
changeSignal = nil
end
nameSignal:Disconnect()
nameSignal = nil
@ -310,11 +318,14 @@ local function onPlayerChildAdded(leaderstats)
if leaderstats.Name == "leaderstats" then
local player = leaderstats.Parent
local playerState = playerStates[player]
if playerState and not playerState.leaderstats then
playerState.leaderstats = leaderstats
for _,stat in pairs(leaderstats:GetChildren()) do
onStatAdded(stat)
end
leaderstats.ChildAdded:Connect(onStatAdded)
leaderstats.ChildRemoved:Connect(onStatRemoved)
end
@ -326,6 +337,7 @@ local function onPlayerChildRemoved(child)
for _,stat in pairs(child:GetChildren()) do
onStatRemoved(stat)
end
for player,playerState in pairs(playerStates) do
if playerState.leaderstats == child then
playerState.leaderstats = nil
@ -351,12 +363,14 @@ local function onUpdateStatLayout()
for i,statName in pairs(statNames) do
local statLbl = statBin:FindFirstChild(statName)
if not statLbl then
statLbl = baseStat:Clone()
statLbl.Name = statName
statLbl.Text = statName
statLbl.Parent = statBin
end
updateStatLbl(statLbl,i)
end
@ -370,6 +384,7 @@ local function onUpdateStatLayout()
for i,statName in pairs(statNames) do
local statLbl = playerState.Stats[statName]
if statLbl then
if player.Team then
statLbl.TextColor = player.Team.TeamColor
@ -417,6 +432,7 @@ local function onPlayerAdded(player)
playerState.Player = player
playerState.Label = lbl
playerState.Stats = {}
playerStates[player] = playerState
for _,child in pairs(player:GetChildren()) do
@ -457,14 +473,17 @@ Players.PlayerRemoving:Connect(onPlayerRemoved)
local function neutralizePlayer(player)
local playerState = playerStates[player]
if playerState then
local playerLbl = playerState.Label
playerLbl.PlayerName.Text = player.Name
playerLbl.PlayerName.TextColor3 = computePlayerColor(player)
playerLbl.PlayerName.Position = UDim2.new(0,0,0,0)
playerLbl.PlayerName.Position = UDim2.new(0, 0, 0, 0)
for stat,statLbl in pairs(playerState.Stats) do
statLbl.TextColor3 = Color3.new(1,1,1)
end
playerLbl.Visible = (not isTeamMode)
playerLbl.Parent = coreGroup
end
@ -473,17 +492,21 @@ end
local function onPlayerAddedToTeam(player)
local team = player.Team
local group = teamGroups[team]
if group then
local playerState = playerStates[player]
if playerState then
local playerLbl = playerState.Label
playerLbl.PlayerName.TextColor = team.TeamColor
playerLbl.PlayerName.Position = UDim2.new(0,4,0,0)
for stat,statLbl in pairs(playerState.Stats) do
playerLbl.PlayerName.Position = UDim2.new(0, 4, 0, 0)
for stat, statLbl in pairs(playerState.Stats) do
statLbl.TextColor = team.TeamColor
end
playerLbl.Parent = group
playerLbl.Visible = true
eUpdateStatLayout:Fire()
refreshTeamStats()
end
@ -499,18 +522,22 @@ end
local function onUpdateTeamTotal(team)
local teamGroup = teamGroups[team]
if teamGroup then
local teamStats = teamGroup.Header.Stats
local totals = {}
for i,statName in ipairs(statNames) do
local total = totals[i]
if not total then
total = { Name = statName, Value = 0 }
totals[i] = total
end
for _,player in pairs(team:GetPlayers()) do
local playerState = playerStates[player]
if playerState then
local leaderstats = playerState.leaderstats
if leaderstats then
@ -528,6 +555,7 @@ local function onUpdateTeamTotal(team)
for i,statRecord in ipairs(totals) do
local statName = statRecord.Name
local statLbl = teamStats:FindFirstChild(statName)
if not statLbl then
statLbl = baseStat:Clone()
statLbl.Name = statName
@ -535,6 +563,7 @@ local function onUpdateTeamTotal(team)
statLbl.TextStrokeTransparency = 0.5
statLbl.Parent = teamStats
end
statLbl.Text = statRecord.Value
updateStatLbl(statLbl,i)
end
@ -595,10 +624,13 @@ local function onTeamRemoved(team)
neutralizePlayer(player)
end
end
teamGroups[team]:Destroy()
teamGroups[team] = nil
eUpdateStatLayout:Fire()
end
if #Teams:GetTeams() == 0 then
isTeamMode = false
for _,player in pairs(Players:GetPlayers()) do
@ -609,6 +641,7 @@ end
local function onPlayerTeamChange(player)
local team = player.Team
if team then
onPlayerAddedToTeam(player)
else
@ -626,6 +659,7 @@ end
Teams.ChildAdded:Connect(onTeamAdded)
Teams.ChildRemoved:Connect(onTeamRemoved)
updateTeamTotal:Connect(onUpdateTeamTotal)
playerTeamChanged:Connect(onPlayerTeamChange)

Some files were not shown because too many files have changed in this diff Show More