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

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

View File

@ -1,7 +1,7 @@
local TeleportService = game:GetService("TeleportService") local TeleportService = game:GetService("TeleportService")
local classicExp = script:WaitForChild("ClassicExp") local classicExp = script:WaitForChild("Particle")
local c = workspace.CurrentCamera local camera = workspace.CurrentCamera
local baseExpAdorn = Instance.new("UnionOperation") local baseExpAdorn = Instance.new("UnionOperation")
baseExpAdorn.Name = "ExplosionAdorn" baseExpAdorn.Name = "ExplosionAdorn"
@ -15,8 +15,10 @@ local function onDescendantAdded(exp)
if exp:IsA("Explosion") then if exp:IsA("Explosion") then
local cf = CFrame.new(exp.Position) local cf = CFrame.new(exp.Position)
local expAdorn = baseExpAdorn:Clone() local expAdorn = baseExpAdorn:Clone()
local lifeTime = 1.5 local lifeTime = 1.5
exp.Visible = false exp.Visible = false
if TeleportService:GetTeleportSetting("RetroExplosions") then if TeleportService:GetTeleportSetting("RetroExplosions") then
local expObj = Instance.new("SphereHandleAdornment") local expObj = Instance.new("SphereHandleAdornment")
expObj.Adornee = expAdorn expObj.Adornee = expAdorn
@ -24,25 +26,31 @@ local function onDescendantAdded(exp)
expObj.Color3 = Color3.new(1,0,0) expObj.Color3 = Color3.new(1,0,0)
expObj.CFrame = cf expObj.CFrame = cf
expObj.Parent = expAdorn expObj.Parent = expAdorn
lifeTime = 1 lifeTime = 1
if exp.BlastRadius > 1 then if exp.BlastRadius > 1 then
lifeTime = lifeTime - (1/exp.BlastRadius) lifeTime = lifeTime - (1/exp.BlastRadius)
end end
else else
local e = classicExp:Clone()
e.Parent = expAdorn
expAdorn.CFrame = cf
spawn(function () spawn(function ()
local e = classicExp:Clone()
e.Parent = expAdorn
expAdorn.CFrame = cf
local lessParticles = TeleportService:GetTeleportSetting("ReducedParticles") local lessParticles = TeleportService:GetTeleportSetting("ReducedParticles")
local count = lessParticles and 25 or 100 local count = lessParticles and 25 or 100
for i = 1,8 do
for i = 1, 8 do
e:Emit(count) e:Emit(count)
wait(0.125) wait(0.125)
end end
end) end)
end end
expAdorn.Parent = c
expAdorn.Parent = camera
wait(lifeTime) wait(lifeTime)
expAdorn:Destroy() expAdorn:Destroy()
end end
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 return workspace.CurrentCamera
end end
local function projectRay(ray,length) local function projectRay(ray, length)
local origin = ray.Origin local origin = ray.Origin
local direction = ray.Direction local direction = ray.Direction
return Ray.new(origin,direction.Unit * length) return Ray.new(origin, direction.Unit * length)
end end
local function computeSunVisibility() local function computeSunVisibility()
@ -20,29 +20,30 @@ local function computeSunVisibility()
local camera = getCamera() local camera = getCamera()
local cf = camera.CFrame local cf = camera.CFrame
if sunPos:Dot(cf.lookVector) > 0 then if sunPos:Dot(cf.LookVector) > 0 then
local sunView = camera:WorldToViewportPoint(cf.p + sunPos) local sunView = camera:WorldToViewportPoint(cf.Position + sunPos)
local visibility = 0 local visibility = 0
local total = 0 local total = 0
for dx = -1,1 do for dx = -1, 1 do
for dy = -1,1 do for dy = -1, 1 do
local posX = math.floor(sunView.X + dx * 15) local posX = math.floor(sunView.X + dx * 15)
local posY = math.floor(sunView.Y + dy * 15) local posY = math.floor(sunView.Y + dy * 15)
local sunRay = camera:ViewportPointToRay(posX, posY) 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 if not hit then
visibility = visibility + 1 visibility = visibility + 1
end end
total = total + 1 total = total + 1
end end
end end
visibility = visibility / total return visibility / total, sunView
return visibility,sunView
end end
return 0 return 0
@ -52,19 +53,20 @@ local function update()
if TeleportService:GetTeleportSetting("ClassicSky") then if TeleportService:GetTeleportSetting("ClassicSky") then
local sunPos = Lighting:GetSunDirection() local sunPos = Lighting:GetSunDirection()
if sunPos.Y >= -.1 then if sunPos.Y >= -.1 then
local visibility,sunView = computeSunVisibility() local visibility, sunView = computeSunVisibility()
if visibility > 0.001 then if visibility > 0.001 then
local attenuation = (1 - (2*visibility - 1)*(2*visibility - 1)) local attenuation = (1 - (2 * visibility - 1) * (2 * visibility - 1))
local strength = math.clamp((((1 - sunPos.Y)*2) / math.sqrt(2)), 0, 1) local strength = math.clamp((((1 - sunPos.Y) * 2) / math.sqrt(2)), 0, 1)
local opacity = attenuation * 0.4 * strength local opacity = attenuation * 0.4 * strength
local camera = getCamera() local camera = getCamera()
local rayPos = camera:ViewportPointToRay(sunView.X,sunView.Y,1).Origin local rayPos = camera:ViewportPointToRay(sunView.X, sunView.Y, 1).Origin
local rayLook = camera.CFrame.p local rayLook = camera.CFrame.Position
adorn.Parent = camera adorn.Parent = camera
adorn.CFrame = CFrame.new(rayPos,rayLook) adorn.CFrame = CFrame.new(rayPos, rayLook)
sunRays.Transparency = NumberSequence.new(1-opacity) sunRays.Transparency = NumberSequence.new(1 - opacity)
return return
end end
@ -74,6 +76,4 @@ local function update()
adorn.Parent = nil adorn.Parent = nil
end end
return function () RunService:BindToRenderStep("SunRays", 201, update)
RunService:BindToRenderStep("SunRays",201,update)
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,16 +8,19 @@ local AssetUtil =
} }
local assetTypes = {} local assetTypes = {}
for _,assetType in pairs(Enum.AssetType:GetEnumItems()) do for _,assetType in pairs(Enum.AssetType:GetEnumItems()) do
assetTypes[assetType.Value] = assetType.Name assetTypes[assetType.Value] = assetType.Name
end end
function AssetUtil:SafeCall(class,method,...) function AssetUtil:SafeCall(class,method,...)
local success,response local success,response
local tries = 0 local tries = 0
while not success do while not success do
success,response = pcall(class[method],class,...) success, response = pcall(class[method], class, ...)
if not success then
if not success then
if response:find("400") then if response:find("400") then
success = true success = true
response = false response = false
@ -28,16 +31,19 @@ function AssetUtil:SafeCall(class,method,...)
end end
end end
end end
end end
return success,response
return success, response
end end
function AssetUtil:Import(assetId) function AssetUtil:Import(assetId)
local success,model = self:SafeCall(InsertService,"LoadAsset",assetId) local success, model = self:SafeCall(InsertService, "LoadAsset", assetId)
if success then if success then
local objects = model:GetChildren() local objects = model:GetChildren()
return true,unpack(objects) return true, unpack(objects)
end end
return false return false
end end
@ -47,11 +53,13 @@ function AssetUtil:RequestImage(assetId)
assert(assetId > 0) assert(assetId > 0)
if self.TextureCache[assetId] == nil then 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 if success then
local result local result
if response then if response then
local assetType = assetTypes[response.AssetTypeId] local assetType = assetTypes[response.AssetTypeId]
if assetType == "Image" then -- No transformation needed! if assetType == "Image" then -- No transformation needed!
result = "rbxassetid://" .. assetId result = "rbxassetid://" .. assetId
elseif assetType == "TeeShirt" then elseif assetType == "TeeShirt" then
@ -60,19 +68,20 @@ function AssetUtil:RequestImage(assetId)
result = shirtGraphic.Graphic result = shirtGraphic.Graphic
end end
elseif assetType == "Decal" or assetType == "Face" then elseif assetType == "Decal" or assetType == "Face" then
local imported,decal = self:Import(assetId) local imported, decal = self:Import(assetId)
if imported then if imported then
result = decal.Texture result = decal.Texture
end end
end end
else else
result = "" result = ""
end end
self.TextureCache[assetId] = result self.TextureCache[assetId] = result
end end
end end
return true,self.TextureCache[assetId] return true, self.TextureCache[assetId]
end end
return AssetUtil 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 Hello
Hi Hi
Hi there! Hi there!
@ -444,4 +443,3 @@ Ok
:D :D
:-O :-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": "properties":
{ {
"CanBeDropped": false, "CanBeDropped": false,
"GripPos": [0, 0, -3.25],
"Grip":
[
0, 0, -3.25,
0, 0, 1,
1, 0, 0,
0, 1, 0
],
"TextureId": "rbxassetid://1256305" "TextureId": "rbxassetid://1256305"
} }
} }

View File

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

View File

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

View File

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

View File

@ -3,6 +3,14 @@
"properties": "properties":
{ {
"Grip":
[
0, 0, 0,
1, 0, 0,
0, 0, -1,
0, 1, 0
],
"TextureId": "rbxasset://Textures/Bomb.png" "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 brickSpeed = 0.04
local wallHeight = 4
local wallWidth = 12 local wallWidth = 12
local Tool = script.Parent local Tool = script.Parent
local BrickColors = require(ReplicatedStorage:WaitForChild("BrickColors"))
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local brickColors = require(ReplicatedStorage:WaitForChild("BrickColors"))
-- places a brick at pos and returns the position of the brick's opposite corner -- 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") local brick = Instance.new("Part")
brick.BrickColor = color brick.BrickColor = color
brick.CFrame = cf * CFrame.new(pos + brick.Size / 2) brick.CFrame = cf * CFrame.new(pos + brick.Size / 2)
script.Parent.BrickCleanup:Clone().Parent = brick -- attach cleanup script to this brick brick.Parent = workspace
brick.BrickCleanup.Disabled = false Debris:AddItem(brick, 24)
brick.Parent = game.Workspace
return brick, pos + brick.Size return brick, pos + brick.Size
end end
function buildWall(cf) local function buildWall(cf)
local color = BrickColor.new(BrickColors[math.random(1, #BrickColors)])
local color = BrickColor.new(brickColors[math.random(1,#brickColors)])
local bricks = {} local bricks = {}
assert(wallWidth>0) assert(wallWidth > 0)
local y = 0 local y = 0
while y < wallHeight do while y < wallHeight do
local p local p
local x = -wallWidth/2 local x = -wallWidth / 2
while x < wallWidth/2 do
while x < wallWidth / 2 do
local brick local brick
brick, p = placeBrick(cf, Vector3.new(x, y, 0), color) brick, p = placeBrick(cf, Vector3.new(x, y, 0), color)
x = p.x x = p.x
@ -37,60 +39,58 @@ function buildWall(cf)
brick:MakeJoints() brick:MakeJoints()
wait(brickSpeed) wait(brickSpeed)
end end
y = p.y y = p.y
end end
--workspace:UnjoinFromOutsiders(bricks)
return bricks return bricks
end end
function snap(v) function snap(v)
if math.abs(v.x)>math.abs(v.z) then if math.abs(v.X) > math.abs(v.Z) then
if v.x>0 then if v.X > 0 then
return Vector3.new(1,0,0) return Vector3.new(1, 0, 0)
else else
return Vector3.new(-1,0,0) return Vector3.new(-1, 0, 0)
end end
else else
if v.z>0 then if v.Z > 0 then
return Vector3.new(0,0,1) return Vector3.new(0, 0, 1)
else else
return Vector3.new(0,0,-1) return Vector3.new(0, 0, -1)
end end
end end
end end
Tool.Enabled = true Tool.Enabled = true
function onActivated()
function onActivated()
if not Tool.Enabled then if not Tool.Enabled then
return return
end end
Tool.Enabled = false Tool.Enabled = false
local character = Tool.Parent; local character = Tool.Parent
local humanoid = character.Humanoid local humanoid = character.Humanoid
if humanoid == nil then if humanoid == nil then
print("Humanoid not found") print("Humanoid not found")
return return
end end
local targetPos = humanoid.TargetPoint 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) local cf = CFrame.new(targetPos, targetPos + lookAt)
Tool.Handle.BuildSound:play() Tool.Handle.BuildSound:Play()
buildWall(cf) buildWall(cf)
wait(5) wait(5)
Tool.Enabled = true Tool.Enabled = true
end 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 -- Setup
local ui = script.Parent local Players = game:GetService("Players")
local rootFrame = ui:WaitForChild("RootFrame") local self = script.Parent
local self = rootFrame:WaitForChild("Backpack")
local slotTemp = script:WaitForChild("SlotTemp")
local backdrop = self:WaitForChild("Backdrop") local backdrop = self:WaitForChild("Backdrop")
local slotsBin = self:WaitForChild("Slots") 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 UserInputService = game:GetService("UserInputService")
local toolIndex = 0 local toolIndex = 0
local tools = {} local tools = {}
local slots = {} local slots = {}
local tokens = local tokens =
{ {
One = 1; One = 1;
Two = 2; Two = 2;
Three = 3; Three = 3;
Four = 4; Four = 4;
Five = 5; Five = 5;
Six = 6; Six = 6;
Seven = 7; Seven = 7;
Eight = 8; Eight = 8;
Nine = 9; Nine = 9;
Zero = 10; -- shhh not a hack 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. -- Hack to work around the inputs being overridden while the Plane tool is active.
local function allowGameProcessedBypassHack() local function allowGameProcessedBypassHack()
local lastInputType = UserInputService:GetLastInputType() local lastInputType = UserInputService:GetLastInputType()
if lastInputType.Name == "Gamepad1" then if lastInputType.Name == "Gamepad1" then
local char = player.Character local char = player.Character
if char then if char then
@ -53,6 +55,7 @@ local function allowGameProcessedBypassHack()
end end
end end
end end
return false return false
end end
@ -60,6 +63,7 @@ local function onInputBegan(input,gameProcessed)
if not gameProcessed or allowGameProcessedBypassHack() then if not gameProcessed or allowGameProcessedBypassHack() then
local name = input.UserInputType.Name local name = input.UserInputType.Name
local keyCode = input.KeyCode.Name local keyCode = input.KeyCode.Name
if name == "Keyboard" then if name == "Keyboard" then
local toIndex = tokens[keyCode] local toIndex = tokens[keyCode]
if toIndex then if toIndex then
@ -68,12 +72,13 @@ local function onInputBegan(input,gameProcessed)
elseif name == "Gamepad1" then elseif name == "Gamepad1" then
if keyCode == "ButtonL1" or keyCode == "ButtonR1" then if keyCode == "ButtonL1" or keyCode == "ButtonR1" then
local nextIndex = toolIndex local nextIndex = toolIndex
if keyCode == "ButtonL1" then if keyCode == "ButtonL1" then
nextIndex = nextIndex - 1 nextIndex = nextIndex - 1
elseif keyCode == "ButtonR1" then elseif keyCode == "ButtonR1" then
nextIndex = nextIndex + 1 nextIndex = nextIndex + 1
end end
print(nextIndex,#tools)
if nextIndex > 0 and nextIndex <= #tools then if nextIndex > 0 and nextIndex <= #tools then
eNumPress:Fire(nextIndex) eNumPress:Fire(nextIndex)
else else
@ -89,18 +94,19 @@ UserInputService.InputBegan:connect(onInputBegan)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local function resortSlots() local function resortSlots()
for index,tool in ipairs(tools) do for index, tool in ipairs(tools) do
local slot = slots[tool] local slot = slots[tool]
slot.Index.Text = index slot.Index.Text = index
slot.LayoutOrder = index slot.LayoutOrder = index
slot.Visible = true slot.Visible = true
end end
backdrop.Size = UDim2.new(#tools,0,1,0)
backdrop.Size = UDim2.new(#tools, 0, 1, 0)
end end
local function createSlot(tool) local function createSlot(tool)
if not slots[tool] then if not slots[tool] then
local index = #tools+1 local index = #tools + 1
tools[index] = tool tools[index] = tool
local slot = slotTemp:clone() local slot = slotTemp:clone()
@ -109,6 +115,7 @@ local function createSlot(tool)
local textHover = slot:WaitForChild("TextHover") local textHover = slot:WaitForChild("TextHover")
local selectionOutline = slot:WaitForChild("SelectionOutline") local selectionOutline = slot:WaitForChild("SelectionOutline")
local toolIcon = slot:WaitForChild("ToolIcon") local toolIcon = slot:WaitForChild("ToolIcon")
local indexLbl = slot:WaitForChild("Index") local indexLbl = slot:WaitForChild("Index")
local toolName = slot:WaitForChild("ToolName") local toolName = slot:WaitForChild("ToolName")
@ -127,7 +134,7 @@ local function createSlot(tool)
table.remove(tools, currentIndex) table.remove(tools, currentIndex)
for _,con in pairs(conReg) do for _,con in pairs(conReg) do
con:disconnect() con:Disconnect()
end end
slots[tool] = nil slots[tool] = nil
@ -167,24 +174,27 @@ local function createSlot(tool)
end end
if tool.TextureId ~= "" then if tool.TextureId ~= "" then
textHover.Visible = false textHover.Visible = false
if isHovering then if isHovering then
toolIcon.BackgroundTransparency = 0 toolIcon.BackgroundTransparency = 0
if isDown then if isDown then
toolIcon.BackgroundColor3 = Color3.new(0,0,1) toolIcon.BackgroundColor3 = Color3.new(0, 0, 1)
else else
toolIcon.BackgroundColor3 = Color3.new(1,1,0) toolIcon.BackgroundColor3 = Color3.new(1, 1, 0)
end end
else else
toolIcon.BackgroundTransparency = 1 toolIcon.BackgroundTransparency = 1
end end
else else
textHover.Visible = true textHover.Visible = true
if isHovering then if isHovering then
textHover.BackgroundTransparency = 0 textHover.BackgroundTransparency = 0
if isDown then if isDown then
textHover.BackgroundColor3 = Color3.new(1,1,0) textHover.BackgroundColor3 = Color3.new(1, 1, 0)
else else
textHover.BackgroundColor3 = Color3.new(0.706,0.706,0.706) textHover.BackgroundColor3 = Color3.fromRGB(180, 180, 180)
end end
else else
textHover.BackgroundTransparency = 1 textHover.BackgroundTransparency = 1
@ -198,12 +208,14 @@ local function createSlot(tool)
elseif input.UserInputType.Name == "MouseMovement" or input.UserInputType.Name == "Touch" then elseif input.UserInputType.Name == "MouseMovement" or input.UserInputType.Name == "Touch" then
isHovering = true isHovering = true
end end
renderUpdate() renderUpdate()
end end
local function onInputEnded(input) local function onInputEnded(input)
if input.UserInputType.Name == "MouseButton1" then if input.UserInputType.Name == "MouseButton1" then
isDown = false isDown = false
if isHovering then if isHovering then
toggleTool() toggleTool()
end end
@ -286,8 +298,8 @@ local function onCharacterAdded(char)
onChildAdded(v) onChildAdded(v)
end end
char.ChildAdded:connect(onChildAdded) char.ChildAdded:Connect(onChildAdded)
backpack.ChildAdded:connect(onChildAdded) backpack.ChildAdded:Connect(onChildAdded)
end end
end end
@ -295,6 +307,4 @@ if player.Character then
onCharacterAdded(player.Character) onCharacterAdded(player.Character)
end end
player.CharacterAdded:connect(onCharacterAdded) player.CharacterAdded:Connect(onCharacterAdded)
game.StarterGui.ResetPlayerGuiOnSpawn = false

View File

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

View File

@ -1,5 +1,6 @@
<roblox version="4"> <roblox version="4">
<Item class="TextButton" referent="RBX10B644657A3A4518AB0A11A7037EB412"> <Meta name="ExplicitAutoJoints">true</Meta>
<Item class="TextButton" referent="RBX27AB9BD3BC1E484F9D3752C376D8D0C1">
<Properties> <Properties>
<bool name="Active">true</bool> <bool name="Active">true</bool>
<Vector2 name="AnchorPoint"> <Vector2 name="AnchorPoint">
@ -10,15 +11,15 @@
<bool name="AutoButtonColor">false</bool> <bool name="AutoButtonColor">false</bool>
<bool name="AutoLocalize">true</bool> <bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3"> <Color3 name="BackgroundColor3">
<R>0.7058824</R> <R>0.70588237</R>
<G>0.7058824</G> <G>0.70588237</G>
<B>0.7058824</B> <B>0.70588237</B>
</Color3> </Color3>
<float name="BackgroundTransparency">1</float> <float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3"> <Color3 name="BorderColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<token name="BorderMode">0</token> <token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
@ -28,7 +29,7 @@
<int name="LayoutOrder">0</int> <int name="LayoutOrder">0</int>
<float name="LineHeight">1</float> <float name="LineHeight">1</float>
<bool name="Modal">false</bool> <bool name="Modal">false</bool>
<string name="Name">SlotTemp</string> <string name="Name">Template</string>
<Ref name="NextSelectionDown">null</Ref> <Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref> <Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref> <Ref name="NextSelectionRight">null</Ref>
@ -55,9 +56,9 @@
<BinaryString name="Tags"></BinaryString> <BinaryString name="Tags"></BinaryString>
<string name="Text"></string> <string name="Text"></string>
<Color3 name="TextColor3"> <Color3 name="TextColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<bool name="TextScaled">false</bool> <bool name="TextScaled">false</bool>
<float name="TextSize">14</float> <float name="TextSize">14</float>
@ -74,9 +75,8 @@
<token name="TextYAlignment">1</token> <token name="TextYAlignment">1</token>
<bool name="Visible">false</bool> <bool name="Visible">false</bool>
<int name="ZIndex">1</int> <int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties> </Properties>
<Item class="TextLabel" referent="RBXF0DF621E41B3480FB5D54ED4A6A8EE45"> <Item class="TextLabel" referent="RBX50D4898CD6264242BE26A1F5ACB88EDA">
<Properties> <Properties>
<bool name="Active">true</bool> <bool name="Active">true</bool>
<Vector2 name="AnchorPoint"> <Vector2 name="AnchorPoint">
@ -86,15 +86,15 @@
<BinaryString name="AttributesSerialize"></BinaryString> <BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool> <bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3"> <Color3 name="BackgroundColor3">
<R>0.6666667</R> <R>0.666666687</R>
<G>0.6666667</G> <G>0.666666687</G>
<B>0.6666667</B> <B>0.666666687</B>
</Color3> </Color3>
<float name="BackgroundTransparency">0</float> <float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3"> <Color3 name="BorderColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<token name="BorderMode">0</token> <token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
@ -109,9 +109,9 @@
<Ref name="NextSelectionRight">null</Ref> <Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref> <Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.03</XS> <XS>0.0299999993</XS>
<XO>2</XO> <XO>2</XO>
<YS>0.97</YS> <YS>0.970000029</YS>
<YO>-2</YO> <YO>-2</YO>
</UDim2> </UDim2>
<Ref name="RootLocalizationTable">null</Ref> <Ref name="RootLocalizationTable">null</Ref>
@ -119,9 +119,9 @@
<bool name="Selectable">false</bool> <bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref> <Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size"> <UDim2 name="Size">
<XS>0.2</XS> <XS>0.200000003</XS>
<XO>0</XO> <XO>0</XO>
<YS>0.2</YS> <YS>0.200000003</YS>
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<token name="SizeConstraint">2</token> <token name="SizeConstraint">2</token>
@ -139,298 +139,17 @@
<G>1</G> <G>1</G>
<B>1</B> <B>1</B>
</Color3> </Color3>
<float name="TextStrokeTransparency">0.8</float> <float name="TextStrokeTransparency">0.800000012</float>
<float name="TextTransparency">0</float> <float name="TextTransparency">0</float>
<token name="TextTruncate">0</token> <token name="TextTruncate">0</token>
<bool name="TextWrapped">true</bool> <bool name="TextWrapped">true</bool>
<token name="TextXAlignment">2</token> <token name="TextXAlignment">2</token>
<token name="TextYAlignment">1</token> <token name="TextYAlignment">1</token>
<bool name="Visible">true</bool> <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> <int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties> </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>
<Item class="Frame" referent="RBX424C17FC1EDB426A97FEFB11B7F31B7B"> <Item class="Frame" referent="RBX0B82AACF232C4A64BDE27B454042FE00">
<Properties> <Properties>
<bool name="Active">false</bool> <bool name="Active">false</bool>
<Vector2 name="AnchorPoint"> <Vector2 name="AnchorPoint">
@ -440,15 +159,15 @@
<BinaryString name="AttributesSerialize"></BinaryString> <BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool> <bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3"> <Color3 name="BackgroundColor3">
<R>0.7058824</R> <R>0.70588237</R>
<G>0.7058824</G> <G>0.70588237</G>
<B>0.7058824</B> <B>0.70588237</B>
</Color3> </Color3>
<float name="BackgroundTransparency">1</float> <float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3"> <Color3 name="BorderColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<token name="BorderMode">0</token> <token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
@ -479,12 +198,11 @@
<token name="SizeConstraint">0</token> <token name="SizeConstraint">0</token>
<token name="Style">0</token> <token name="Style">0</token>
<BinaryString name="Tags"></BinaryString> <BinaryString name="Tags"></BinaryString>
<bool name="Visible">false</bool> <bool name="Visible">true</bool>
<int name="ZIndex">3</int> <int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties> </Properties>
</Item> </Item>
<Item class="ImageLabel" referent="RBXCB12A4154D9A4034BB1FD165A03B4BD3"> <Item class="ImageLabel" referent="RBXDFBED6A6AF524E70A59A0E3D4C77727E">
<Properties> <Properties>
<bool name="Active">false</bool> <bool name="Active">false</bool>
<Vector2 name="AnchorPoint"> <Vector2 name="AnchorPoint">
@ -500,17 +218,15 @@
</Color3> </Color3>
<float name="BackgroundTransparency">1</float> <float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3"> <Color3 name="BorderColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<token name="BorderMode">0</token> <token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool> <bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"> <Content name="Image"><null></null></Content>
<null></null>
</Content>
<Color3 name="ImageColor3"> <Color3 name="ImageColor3">
<R>1</R> <R>1</R>
<G>1</G> <G>1</G>
@ -532,9 +248,9 @@
<Ref name="NextSelectionRight">null</Ref> <Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref> <Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.15</XS> <XS>0.150000006</XS>
<XO>0</XO> <XO>0</XO>
<YS>0.15</YS> <YS>0.150000006</YS>
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<Ref name="RootLocalizationTable">null</Ref> <Ref name="RootLocalizationTable">null</Ref>
@ -543,9 +259,9 @@
<bool name="Selectable">false</bool> <bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref> <Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size"> <UDim2 name="Size">
<XS>0.7</XS> <XS>0.699999988</XS>
<XO>0</XO> <XO>0</XO>
<YS>0.7</YS> <YS>0.699999988</YS>
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<token name="SizeConstraint">0</token> <token name="SizeConstraint">0</token>
@ -568,11 +284,10 @@
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<bool name="Visible">true</bool> <bool name="Visible">true</bool>
<int name="ZIndex">4</int> <int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties> </Properties>
</Item> </Item>
<Item class="TextLabel" referent="RBX5319A263BDFD47B9902C76ABDDE1450B"> <Item class="TextLabel" referent="RBXE8FBEDE01CAE494089C4E9E76031469D">
<Properties> <Properties>
<bool name="Active">true</bool> <bool name="Active">true</bool>
<Vector2 name="AnchorPoint"> <Vector2 name="AnchorPoint">
@ -588,9 +303,9 @@
</Color3> </Color3>
<float name="BackgroundTransparency">1</float> <float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3"> <Color3 name="BorderColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<token name="BorderMode">0</token> <token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
@ -605,9 +320,9 @@
<Ref name="NextSelectionRight">null</Ref> <Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref> <Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.1</XS> <XS>0.100000001</XS>
<XO>0</XO> <XO>0</XO>
<YS>0.475</YS> <YS>0.474999994</YS>
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<Ref name="RootLocalizationTable">null</Ref> <Ref name="RootLocalizationTable">null</Ref>
@ -617,7 +332,7 @@
<UDim2 name="Size"> <UDim2 name="Size">
<XS>2</XS> <XS>2</XS>
<XO>0</XO> <XO>0</XO>
<YS>0.17</YS> <YS>0.170000002</YS>
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<token name="SizeConstraint">0</token> <token name="SizeConstraint">0</token>
@ -631,19 +346,103 @@
<bool name="TextScaled">true</bool> <bool name="TextScaled">true</bool>
<float name="TextSize">100</float> <float name="TextSize">100</float>
<Color3 name="TextStrokeColor3"> <Color3 name="TextStrokeColor3">
<R>0.4980392</R> <R>0.498039186</R>
<G>0.4980392</G> <G>0.498039186</G>
<B>0.4980392</B> <B>0.498039186</B>
</Color3> </Color3>
<float name="TextStrokeTransparency">0.5</float> <float name="TextStrokeTransparency">0.5</float>
<float name="TextTransparency">0.2</float> <float name="TextTransparency">0.200000003</float>
<token name="TextTruncate">0</token> <token name="TextTruncate">0</token>
<bool name="TextWrapped">true</bool> <bool name="TextWrapped">true</bool>
<token name="TextXAlignment">0</token> <token name="TextXAlignment">0</token>
<token name="TextYAlignment">1</token> <token name="TextYAlignment">1</token>
<bool name="Visible">true</bool> <bool name="Visible">true</bool>
<int name="ZIndex">4</int> <int name="ZIndex">1</int>
<bool name="Archivable">true</bool> </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> </Properties>
</Item> </Item>
</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 TextService = game:GetService("TextService")
local UserInputService = game:GetService("UserInputService") 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 chatBar = chat:WaitForChild("ChatBar")
local chatOutput = chat:WaitForChild("ChatOutput") local chatOutput = chat:WaitForChild("ChatOutput")
local chatRemote = ReplicatedStorage:WaitForChild("ChatRemote") local chatRemote = ReplicatedStorage:WaitForChild("ChatRemote")
local focusBackdrop = chatBar:WaitForChild("FocusBackdrop") local focusBackdrop = chatBar:WaitForChild("FocusBackdrop")
local mainBackdrop = chat:WaitForChild("MainBackdrop") local mainBackdrop = chat:WaitForChild("MainBackdrop")
local messageTemplate = script:WaitForChild("MessageTemplate") local messageTemplate = util:WaitForChild("MessageTemplate")
local hasCoreGateway, coreGateway = pcall(function () local LinkedList = require(util:WaitForChild("LinkedList"))
local getCoreGateway = script:WaitForChild("GetCoreGateway")
return require(getCoreGateway) local success, RobloxChatMount = pcall(function ()
local chatMount = util:WaitForChild("RobloxChatMount")
return require(chatMount)
end) end)
if not success then
RobloxChatMount = nil
end
-------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------
-- Player Colors -- Player Colors
-------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------
@ -53,7 +56,7 @@ local function computePlayerColor(player)
local oddShift = (1 - (length % 2)) local oddShift = (1 - (length % 2))
local value = 0 local value = 0
for i = 1,length do for i = 1, length do
local char = pName:sub(i, i):byte() local char = pName:sub(i, i):byte()
local rev = (length - i) + oddShift local rev = (length - i) + oddShift
@ -74,11 +77,14 @@ end
local function beginChatting() local function beginChatting()
focusBackdrop.Visible = true focusBackdrop.Visible = true
mainBackdrop.BackgroundColor3 = Color3.new(1, 1, 1)
if not chatBar:IsFocused() then if not chatBar:IsFocused() then
chatBar.TextTransparency = 1 chatBar.TextTransparency = 1
chatBar:CaptureFocus() chatBar:CaptureFocus()
wait() wait()
chatBar.Text = "" chatBar.Text = ""
chatBar.TextTransparency = 0 chatBar.TextTransparency = 0
end end
@ -102,13 +108,14 @@ local function onChatFocusLost(enterPressed)
chatRemote:FireServer(msg) chatRemote:FireServer(msg)
if hasCoreGateway then if RobloxChatMount then
coreGateway.ChatWindow.MessagePosted:Fire(msg) RobloxChatMount.ChatWindow.MessagePosted:Fire(msg)
end end
end end
chatBar.Text = "" chatBar.Text = ""
focusBackdrop.Visible = false focusBackdrop.Visible = false
mainBackdrop.BackgroundColor3 = focusBackdrop.BackgroundColor3
end end
UserInputService.InputBegan:Connect(onInputBegan) 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"> <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">
<Item class="Frame" referent="RBX59EEFE87DDAF44588210504B322939BC"> <Meta name="ExplicitAutoJoints">true</Meta>
<External>null</External>
<External>nil</External>
<Item class="Frame" referent="RBX805E19DEF8FF451382A2B5DAFB3FE5B1">
<Properties> <Properties>
<bool name="Active">false</bool> <bool name="Active">false</bool>
<Vector2 name="AnchorPoint"> <Vector2 name="AnchorPoint">
@ -9,22 +12,22 @@
<BinaryString name="AttributesSerialize"></BinaryString> <BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool> <bool name="AutoLocalize">true</bool>
<Color3 name="BackgroundColor3"> <Color3 name="BackgroundColor3">
<R>1</R> <R>0.250980407</R>
<G>1</G> <G>0.250980407</G>
<B>1</B> <B>0.250980407</B>
</Color3> </Color3>
<float name="BackgroundTransparency">0</float> <float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3"> <Color3 name="BorderColor3">
<R>0.1058824</R> <R>0.105882399</R>
<G>0.1647059</G> <G>0.164705902</G>
<B>0.2078432</B> <B>0.207843199</B>
</Color3> </Color3>
<token name="BorderMode">0</token> <token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool> <bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int> <int name="LayoutOrder">0</int>
<string name="Name">NullSelectionImageObject</string> <string name="Name">MainBackdrop</string>
<Ref name="NextSelectionDown">null</Ref> <Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref> <Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref> <Ref name="NextSelectionRight">null</Ref>
@ -32,7 +35,7 @@
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0</XS> <XS>0</XS>
<XO>0</XO> <XO>0</XO>
<YS>0</YS> <YS>1</YS>
<YO>0</YO> <YO>0</YO>
</UDim2> </UDim2>
<Ref name="RootLocalizationTable">null</Ref> <Ref name="RootLocalizationTable">null</Ref>
@ -40,17 +43,16 @@
<bool name="Selectable">false</bool> <bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref> <Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size"> <UDim2 name="Size">
<XS>0</XS> <XS>1</XS>
<XO>0</XO> <XO>0</XO>
<YS>0</YS> <YS>0</YS>
<YO>0</YO> <YO>20</YO>
</UDim2> </UDim2>
<token name="SizeConstraint">0</token> <token name="SizeConstraint">0</token>
<token name="Style">0</token> <token name="Style">0</token>
<BinaryString name="Tags"></BinaryString> <BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool> <bool name="Visible">true</bool>
<int name="ZIndex">1</int> <int name="ZIndex">1</int>
<bool name="Archivable">true</bool>
</Properties> </Properties>
</Item> </Item>
</roblox> </roblox>

View File

@ -1,16 +1,20 @@
local ChatConnections = {} local ChatConnections = {}
local function AddObjects(bindableClass,targetName,...) local function AddObjects(bindableClass, targetName, ...)
local target = ChatConnections[targetName] local target = ChatConnections[targetName]
if not target then if not target then
target = {} target = {}
ChatConnections[targetName] = target ChatConnections[targetName] = target
end end
local names = {...} local names = {...}
for _,name in pairs(names) do for _,name in pairs(names) do
local signal = Instance.new(bindableClass) local signal = Instance.new(bindableClass)
signal.Name = targetName .. "_" .. name signal.Name = targetName .. "_" .. name
signal.Parent = script signal.Parent = script
target[name] = signal target[name] = signal
end end
end end
@ -80,6 +84,7 @@ if not GuiService:IsTenFootInterface() then
local success,result = pcall(function () local success,result = pcall(function ()
StarterGui:SetCore("CoreGuiChatConnections", ChatConnections) StarterGui:SetCore("CoreGuiChatConnections", ChatConnections)
end) end)
if success then if success then
break break
else 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 UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService") local GuiService = game:GetService("GuiService")
local function addUIScale(obj,scale) local function addUIScale(obj, scale)
local uiScale = Instance.new("UIScale") local uiScale = Instance.new("UIScale")
uiScale.Scale = scale uiScale.Scale = scale
uiScale.Parent = obj uiScale.Parent = obj
@ -21,6 +21,7 @@ if GuiService:IsTenFootInterface() then
chat.Visible = false chat.Visible = false
local chatPadding = gui:WaitForChild("ChatPadding", 1) local chatPadding = gui:WaitForChild("ChatPadding", 1)
if chatPadding then if chatPadding then
chatPadding:Destroy() chatPadding:Destroy()
end 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") local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled("All",false) StarterGui:SetCoreGuiEnabled("All", false)
local health = script.Parent local health = script.Parent
local redBar = health:WaitForChild("RedBar") local healthBar = health:WaitForChild("HealthBar")
local greenBar = redBar:WaitForChild("GreenBar") local healthGauge = healthBar:WaitForChild("HealthGauge")
local player = game.Players.LocalPlayer 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") local scale = Instance.new("UIScale")
scale.Scale = 0.6 scale.Scale = 0.6
scale.Parent = health scale.Parent = health
@ -18,11 +18,13 @@ local function onCharacterAdded(char)
local humanoid = char:WaitForChild("Humanoid") local humanoid = char:WaitForChild("Humanoid")
local function updateHealth(health) 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 end
updateHealth(humanoid.MaxHealth) updateHealth(humanoid.MaxHealth)
humanoid.HealthChanged:Connect(updateHealth) humanoid.HealthChanged:Connect(updateHealth)
health.Visible = true
end end
if player.Character then 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 player = game.Players.LocalPlayer
local character,humanoid local character, humanoid
local function onCharacterAdded(char) local function onCharacterAdded(char)
humanoid = char:WaitForChild("Humanoid") humanoid = char:WaitForChild("Humanoid")
@ -65,7 +65,7 @@ UserInputService.InputChanged:Connect(onInputChanged)
local currentGoal, moveSignal local currentGoal, moveSignal
local function findAngleBetweenXZVectors(vec2, vec1) 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 end
local function isFinite(num) local function isFinite(num)
@ -73,23 +73,24 @@ local function isFinite(num)
end end
local function rotateCameraTowardsGoal() local function rotateCameraTowardsGoal()
local c = workspace.CurrentCamera local camera = workspace.CurrentCamera
if c then
local cf = c.CFrame
local focus = c.Focus
local desiredAngle = CFrame.new(cf.p,currentGoal).lookVector if camera then
local currentAngle = cf.lookVector local cf = camera.CFrame
local focus = camera.Focus
local angleBetween = findAngleBetweenXZVectors(desiredAngle,currentAngle) local desiredAngle = CFrame.new(cf.Position, currentGoal).lookVector
local currentAngle = cf.LookVector
local angleBetween = findAngleBetweenXZVectors(desiredAngle, currentAngle)
if isFinite(angleBetween) then if isFinite(angleBetween) then
local abs = math.abs(angleBetween) local abs = math.abs(angleBetween)
local sign = math.sign(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) 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 end
end end
@ -98,6 +99,7 @@ local function finishGoal()
if currentGoal then if currentGoal then
currentGoal = nil currentGoal = nil
end end
if moveSignal then if moveSignal then
moveSignal:Disconnect() moveSignal:Disconnect()
moveSignal = nil moveSignal = nil
@ -153,11 +155,13 @@ local function isFirstPerson()
return head.LocalTransparencyModifier == 1 return head.LocalTransparencyModifier == 1
end end
end end
return false return false
end end
local function canClickTarget() local function canClickTarget()
local target = mouse.Target local target = mouse.Target
if target then if target then
if target ~= lastTarget then if target ~= lastTarget then
local canClick = false local canClick = false
@ -190,7 +194,7 @@ local function canRenderDisk(rendering)
if humanoid then if humanoid then
local movement = humanoid.MoveDirection local movement = humanoid.MoveDirection
if movement.Magnitude == 0 then if movement.Magnitude == 0 then
local pos = mouse.Hit.p local pos = mouse.Hit.Position
local dist = player:DistanceFromCharacter(pos) local dist = player:DistanceFromCharacter(pos)
if dist < 32 then 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 inTeamMode = false
local basePlayerLbl = script:WaitForChild("BasePlayerLbl")
local baseGroup = script:WaitForChild("BaseGroup")
local baseStat = script:WaitForChild("BaseStat")
local playerList = script.Parent 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 backdrop = playerList:WaitForChild("Backdrop")
local container = playerList:WaitForChild("Container") local container = playerList:WaitForChild("Container")
@ -67,12 +69,14 @@ local PLAYER_COLORS =
local function computePlayerColor(player) local function computePlayerColor(player)
local pName = player.Name local pName = player.Name
local length = #pName local length = #pName
local oddShift = (1 - (length % 2)) local oddShift = (1 - (length % 2))
local value = 0 local value = 0
for i = 1,length do for i = 1,length do
local char = pName:sub(i,i):byte() local char = pName:sub(i,i):byte()
local rev = (length - i) + oddShift local rev = (length - i) + oddShift
if (rev % 4) >= 2 then if (rev % 4) >= 2 then
value = value - char value = value - char
else else
@ -246,10 +250,12 @@ local function onStatRemoved(stat,statName)
if stat.ClassName == "IntValue" then if stat.ClassName == "IntValue" then
local statName = statName or stat.Name local statName = statName or stat.Name
local playerState = getPlayerStateFromStat(stat) local playerState = getPlayerStateFromStat(stat)
if playerState and playerState.Stats[statName] then if playerState and playerState.Stats[statName] then
playerState.Stats[statName]:Destroy() playerState.Stats[statName]:Destroy()
playerState.Stats[statName] = nil playerState.Stats[statName] = nil
end end
decrementStat(statName) decrementStat(statName)
refreshTeamStats() refreshTeamStats()
end end
@ -259,6 +265,7 @@ local function onStatAdded(stat)
if stat.ClassName == "IntValue" then if stat.ClassName == "IntValue" then
local statName = stat.Name local statName = stat.Name
local playerState = getPlayerStateFromStat(stat) local playerState = getPlayerStateFromStat(stat)
if playerState then if playerState then
local changeSignal local changeSignal
@ -289,6 +296,7 @@ local function onStatAdded(stat)
changeSignal:Disconnect() changeSignal:Disconnect()
changeSignal = nil changeSignal = nil
end end
nameSignal:Disconnect() nameSignal:Disconnect()
nameSignal = nil nameSignal = nil
@ -310,11 +318,14 @@ local function onPlayerChildAdded(leaderstats)
if leaderstats.Name == "leaderstats" then if leaderstats.Name == "leaderstats" then
local player = leaderstats.Parent local player = leaderstats.Parent
local playerState = playerStates[player] local playerState = playerStates[player]
if playerState and not playerState.leaderstats then if playerState and not playerState.leaderstats then
playerState.leaderstats = leaderstats playerState.leaderstats = leaderstats
for _,stat in pairs(leaderstats:GetChildren()) do for _,stat in pairs(leaderstats:GetChildren()) do
onStatAdded(stat) onStatAdded(stat)
end end
leaderstats.ChildAdded:Connect(onStatAdded) leaderstats.ChildAdded:Connect(onStatAdded)
leaderstats.ChildRemoved:Connect(onStatRemoved) leaderstats.ChildRemoved:Connect(onStatRemoved)
end end
@ -326,6 +337,7 @@ local function onPlayerChildRemoved(child)
for _,stat in pairs(child:GetChildren()) do for _,stat in pairs(child:GetChildren()) do
onStatRemoved(stat) onStatRemoved(stat)
end end
for player,playerState in pairs(playerStates) do for player,playerState in pairs(playerStates) do
if playerState.leaderstats == child then if playerState.leaderstats == child then
playerState.leaderstats = nil playerState.leaderstats = nil
@ -351,12 +363,14 @@ local function onUpdateStatLayout()
for i,statName in pairs(statNames) do for i,statName in pairs(statNames) do
local statLbl = statBin:FindFirstChild(statName) local statLbl = statBin:FindFirstChild(statName)
if not statLbl then if not statLbl then
statLbl = baseStat:Clone() statLbl = baseStat:Clone()
statLbl.Name = statName statLbl.Name = statName
statLbl.Text = statName statLbl.Text = statName
statLbl.Parent = statBin statLbl.Parent = statBin
end end
updateStatLbl(statLbl,i) updateStatLbl(statLbl,i)
end end
@ -370,6 +384,7 @@ local function onUpdateStatLayout()
for i,statName in pairs(statNames) do for i,statName in pairs(statNames) do
local statLbl = playerState.Stats[statName] local statLbl = playerState.Stats[statName]
if statLbl then if statLbl then
if player.Team then if player.Team then
statLbl.TextColor = player.Team.TeamColor statLbl.TextColor = player.Team.TeamColor
@ -417,6 +432,7 @@ local function onPlayerAdded(player)
playerState.Player = player playerState.Player = player
playerState.Label = lbl playerState.Label = lbl
playerState.Stats = {} playerState.Stats = {}
playerStates[player] = playerState playerStates[player] = playerState
for _,child in pairs(player:GetChildren()) do for _,child in pairs(player:GetChildren()) do
@ -457,14 +473,17 @@ Players.PlayerRemoving:Connect(onPlayerRemoved)
local function neutralizePlayer(player) local function neutralizePlayer(player)
local playerState = playerStates[player] local playerState = playerStates[player]
if playerState then if playerState then
local playerLbl = playerState.Label local playerLbl = playerState.Label
playerLbl.PlayerName.Text = player.Name playerLbl.PlayerName.Text = player.Name
playerLbl.PlayerName.TextColor3 = computePlayerColor(player) 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 for stat,statLbl in pairs(playerState.Stats) do
statLbl.TextColor3 = Color3.new(1,1,1) statLbl.TextColor3 = Color3.new(1,1,1)
end end
playerLbl.Visible = (not isTeamMode) playerLbl.Visible = (not isTeamMode)
playerLbl.Parent = coreGroup playerLbl.Parent = coreGroup
end end
@ -473,17 +492,21 @@ end
local function onPlayerAddedToTeam(player) local function onPlayerAddedToTeam(player)
local team = player.Team local team = player.Team
local group = teamGroups[team] local group = teamGroups[team]
if group then if group then
local playerState = playerStates[player] local playerState = playerStates[player]
if playerState then if playerState then
local playerLbl = playerState.Label local playerLbl = playerState.Label
playerLbl.PlayerName.TextColor = team.TeamColor playerLbl.PlayerName.TextColor = team.TeamColor
playerLbl.PlayerName.Position = UDim2.new(0,4,0,0) playerLbl.PlayerName.Position = UDim2.new(0, 4, 0, 0)
for stat,statLbl in pairs(playerState.Stats) do
for stat, statLbl in pairs(playerState.Stats) do
statLbl.TextColor = team.TeamColor statLbl.TextColor = team.TeamColor
end end
playerLbl.Parent = group playerLbl.Parent = group
playerLbl.Visible = true playerLbl.Visible = true
eUpdateStatLayout:Fire() eUpdateStatLayout:Fire()
refreshTeamStats() refreshTeamStats()
end end
@ -499,18 +522,22 @@ end
local function onUpdateTeamTotal(team) local function onUpdateTeamTotal(team)
local teamGroup = teamGroups[team] local teamGroup = teamGroups[team]
if teamGroup then if teamGroup then
local teamStats = teamGroup.Header.Stats local teamStats = teamGroup.Header.Stats
local totals = {} local totals = {}
for i,statName in ipairs(statNames) do for i,statName in ipairs(statNames) do
local total = totals[i] local total = totals[i]
if not total then if not total then
total = { Name = statName, Value = 0 } total = { Name = statName, Value = 0 }
totals[i] = total totals[i] = total
end end
for _,player in pairs(team:GetPlayers()) do for _,player in pairs(team:GetPlayers()) do
local playerState = playerStates[player] local playerState = playerStates[player]
if playerState then if playerState then
local leaderstats = playerState.leaderstats local leaderstats = playerState.leaderstats
if leaderstats then if leaderstats then
@ -528,6 +555,7 @@ local function onUpdateTeamTotal(team)
for i,statRecord in ipairs(totals) do for i,statRecord in ipairs(totals) do
local statName = statRecord.Name local statName = statRecord.Name
local statLbl = teamStats:FindFirstChild(statName) local statLbl = teamStats:FindFirstChild(statName)
if not statLbl then if not statLbl then
statLbl = baseStat:Clone() statLbl = baseStat:Clone()
statLbl.Name = statName statLbl.Name = statName
@ -535,6 +563,7 @@ local function onUpdateTeamTotal(team)
statLbl.TextStrokeTransparency = 0.5 statLbl.TextStrokeTransparency = 0.5
statLbl.Parent = teamStats statLbl.Parent = teamStats
end end
statLbl.Text = statRecord.Value statLbl.Text = statRecord.Value
updateStatLbl(statLbl,i) updateStatLbl(statLbl,i)
end end
@ -595,10 +624,13 @@ local function onTeamRemoved(team)
neutralizePlayer(player) neutralizePlayer(player)
end end
end end
teamGroups[team]:Destroy() teamGroups[team]:Destroy()
teamGroups[team] = nil teamGroups[team] = nil
eUpdateStatLayout:Fire() eUpdateStatLayout:Fire()
end end
if #Teams:GetTeams() == 0 then if #Teams:GetTeams() == 0 then
isTeamMode = false isTeamMode = false
for _,player in pairs(Players:GetPlayers()) do for _,player in pairs(Players:GetPlayers()) do
@ -609,6 +641,7 @@ end
local function onPlayerTeamChange(player) local function onPlayerTeamChange(player)
local team = player.Team local team = player.Team
if team then if team then
onPlayerAddedToTeam(player) onPlayerAddedToTeam(player)
else else
@ -626,6 +659,7 @@ end
Teams.ChildAdded:Connect(onTeamAdded) Teams.ChildAdded:Connect(onTeamAdded)
Teams.ChildRemoved:Connect(onTeamRemoved) Teams.ChildRemoved:Connect(onTeamRemoved)
updateTeamTotal:Connect(onUpdateTeamTotal) updateTeamTotal:Connect(onUpdateTeamTotal)
playerTeamChanged:Connect(onPlayerTeamChange) playerTeamChanged:Connect(onPlayerTeamChange)

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