Fix issues with Dialog chats and improve some functions and returns
This commit is contained in:
parent
8b70d83c7f
commit
72df3e5ee4
|
|
@ -1,9 +1,9 @@
|
||||||
echo "Processing corescripts..."
|
echo "Processing corescripts..."
|
||||||
for file in luau/[0-9]*.luau; do
|
for file in luau/[0-9]*.luau; do
|
||||||
darklua process -c dense.json5 $file processed/$(basename "${file::-1}")
|
darklua process -c ../dense.json5 $file processed/$(basename "${file::-1}")
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Processing other corescripts..."
|
echo "Processing other corescripts..."
|
||||||
for file in luau/[a-z]*.luau; do
|
for file in luau/[a-z]*.luau; do
|
||||||
darklua process -c lines.json5 $file processed/$(basename "${file::-1}")
|
darklua process -c ../lines.json5 $file processed/$(basename "${file::-1}")
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -8605,6 +8605,7 @@ declare class ServiceProvider extends Instance
|
||||||
LoadingGuiService: any
|
LoadingGuiService: any
|
||||||
ScriptInformationProvider: ScriptInformationProvider
|
ScriptInformationProvider: ScriptInformationProvider
|
||||||
JointsService: JointsService
|
JointsService: JointsService
|
||||||
|
LogService: any
|
||||||
|
|
||||||
function FindService(self, className: string): Instance
|
function FindService(self, className: string): Instance
|
||||||
function GetService(self, service: "AnimationClipProvider"): AnimationClipProvider
|
function GetService(self, service: "AnimationClipProvider"): AnimationClipProvider
|
||||||
|
|
@ -8809,6 +8810,7 @@ declare class ServiceProvider extends Instance
|
||||||
function GetService(self, service: "LoadingGuiService"): any
|
function GetService(self, service: "LoadingGuiService"): any
|
||||||
function GetService(self, service: "PersonalServerService"): PersonalServerService
|
function GetService(self, service: "PersonalServerService"): PersonalServerService
|
||||||
function GetService(self, service: "Terrain"): Terrain
|
function GetService(self, service: "Terrain"): Terrain
|
||||||
|
function GetService(self, service: "LogService"): any
|
||||||
end
|
end
|
||||||
|
|
||||||
declare class DataModel extends ServiceProvider
|
declare class DataModel extends ServiceProvider
|
||||||
|
|
|
||||||
|
|
@ -615,9 +615,8 @@ end
|
||||||
function currencyTypeToString(currencyType)
|
function currencyTypeToString(currencyType)
|
||||||
if currencyType == Enum.CurrencyType.Tix then
|
if currencyType == Enum.CurrencyType.Tix then
|
||||||
return "Tix"
|
return "Tix"
|
||||||
else
|
|
||||||
return "R$"
|
|
||||||
end
|
end
|
||||||
|
return "R$"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- figure out what currency to use based on the currency you can actually sell the item in and what the script specified
|
-- figure out what currency to use based on the currency you can actually sell the item in and what the script specified
|
||||||
|
|
|
||||||
|
|
@ -451,27 +451,27 @@ function initializeDeveloperConsole()
|
||||||
|
|
||||||
local previousMousePosScroll
|
local previousMousePosScroll
|
||||||
|
|
||||||
local pScrollHandle
|
-- local pScrollHandle
|
||||||
|
|
||||||
local pOffset
|
local pOffset
|
||||||
|
|
||||||
local scrollUpIsDown = false
|
local scrollUpIsDown = false
|
||||||
local scrollDownIsDown = false
|
local scrollDownIsDown = false
|
||||||
|
|
||||||
function clean()
|
local function clean()
|
||||||
previousMousePos = nil
|
previousMousePos = nil
|
||||||
pPos = nil
|
pPos = nil
|
||||||
previousMousePosResize = nil
|
previousMousePosResize = nil
|
||||||
pSize = nil
|
pSize = nil
|
||||||
previousMousePosScroll = nil
|
previousMousePosScroll = nil
|
||||||
pScrollHandle = nil
|
-- pScrollHandle = nil
|
||||||
pOffset = nil
|
pOffset = nil
|
||||||
scrollUpIsDown = false
|
scrollUpIsDown = false
|
||||||
scrollDownIsDown = false
|
scrollDownIsDown = false
|
||||||
end
|
end
|
||||||
|
|
||||||
---Handle Dev-Console Position
|
---Handle Dev-Console Position
|
||||||
function refreshConsolePosition(x, y)
|
local function refreshConsolePosition(x, y)
|
||||||
if not previousMousePos then
|
if not previousMousePos then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -491,7 +491,7 @@ function initializeDeveloperConsole()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
---Handle Dev-Console Size
|
---Handle Dev-Console Size
|
||||||
function refreshConsoleSize(x, y)
|
local function refreshConsoleSize(x, y)
|
||||||
if not previousMousePosResize then
|
if not previousMousePosResize then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -525,7 +525,7 @@ function initializeDeveloperConsole()
|
||||||
local optionsHidden = true
|
local optionsHidden = true
|
||||||
local animating = false
|
local animating = false
|
||||||
--Options
|
--Options
|
||||||
function startAnimation()
|
local function startAnimation()
|
||||||
if animating then
|
if animating then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -561,7 +561,7 @@ function initializeDeveloperConsole()
|
||||||
|
|
||||||
--Scroll Position
|
--Scroll Position
|
||||||
|
|
||||||
function changeOffset(value)
|
local function changeOffset(value)
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
if currentConsole == LOCAL_CONSOLE then
|
||||||
localOffset += value
|
localOffset += value
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
elseif currentConsole == SERVER_CONSOLE then
|
||||||
|
|
@ -572,7 +572,7 @@ function initializeDeveloperConsole()
|
||||||
end
|
end
|
||||||
|
|
||||||
--Refresh Dev-Console Text
|
--Refresh Dev-Console Text
|
||||||
function refreshTextHolderForReal()
|
local function refreshTextHolderForReal()
|
||||||
local childMessages = Dev_TextHolder:GetChildren()
|
local childMessages = Dev_TextHolder:GetChildren()
|
||||||
|
|
||||||
local messageList
|
local messageList
|
||||||
|
|
@ -669,7 +669,7 @@ function initializeDeveloperConsole()
|
||||||
-- (Whenever for one reason or another a lot of output comes in, it can lag
|
-- (Whenever for one reason or another a lot of output comes in, it can lag
|
||||||
-- This will make it behave better in a situation of a lot of output comming in)
|
-- This will make it behave better in a situation of a lot of output comming in)
|
||||||
local refreshQueued = false
|
local refreshQueued = false
|
||||||
function refreshTextHolder()
|
local function refreshTextHolder()
|
||||||
if refreshQueued then
|
if refreshQueued then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -683,7 +683,7 @@ function initializeDeveloperConsole()
|
||||||
--Handle Dev-Console Scrollbar
|
--Handle Dev-Console Scrollbar
|
||||||
|
|
||||||
local inside = 0
|
local inside = 0
|
||||||
function holdingUpButton()
|
local function holdingUpButton()
|
||||||
if scrollUpIsDown then
|
if scrollUpIsDown then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -697,7 +697,7 @@ function initializeDeveloperConsole()
|
||||||
inside -= 1
|
inside -= 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function holdingDownButton()
|
local function holdingDownButton()
|
||||||
if scrollDownIsDown then
|
if scrollDownIsDown then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -733,7 +733,7 @@ function initializeDeveloperConsole()
|
||||||
clean()
|
clean()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function handleScroll(x, y)
|
local function handleScroll(x, y)
|
||||||
if not previousMousePosScroll then
|
if not previousMousePosScroll then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -764,7 +764,7 @@ function initializeDeveloperConsole()
|
||||||
|
|
||||||
Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y)
|
Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y)
|
||||||
previousMousePosScroll = Vector2.new(x, y)
|
previousMousePosScroll = Vector2.new(x, y)
|
||||||
pScrollHandle = Dev_ScrollArea.Handle.AbsolutePosition
|
-- pScrollHandle = Dev_ScrollArea.Handle.AbsolutePosition
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
if currentConsole == LOCAL_CONSOLE then
|
||||||
pOffset = localOffset
|
pOffset = localOffset
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
elseif currentConsole == SERVER_CONSOLE then
|
||||||
|
|
@ -867,7 +867,7 @@ function initializeDeveloperConsole()
|
||||||
|
|
||||||
local str = "%s:%s:%s"
|
local str = "%s:%s:%s"
|
||||||
|
|
||||||
function ConvertTimeStamp(timeStamp)
|
local function ConvertTimeStamp(timeStamp)
|
||||||
local localTime = timeStamp - os.time() + math.floor(tick())
|
local localTime = timeStamp - os.time() + math.floor(tick())
|
||||||
local dayTime = localTime % 86400
|
local dayTime = localTime % 86400
|
||||||
|
|
||||||
|
|
@ -924,9 +924,9 @@ function initializeDeveloperConsole()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
---Dev-Console Message Functionality
|
---Dev-Console Message Functionality
|
||||||
function AddLocalMessage(str, messageType, timeStamp)
|
local function AddLocalMessage(messageStr, messageType, timeStamp)
|
||||||
localMessageList[#localMessageList + 1] = {
|
localMessageList[#localMessageList + 1] = {
|
||||||
Message = str,
|
Message = messageStr,
|
||||||
Time = ConvertTimeStamp(timeStamp),
|
Time = ConvertTimeStamp(timeStamp),
|
||||||
Type = messageType,
|
Type = messageType,
|
||||||
}
|
}
|
||||||
|
|
@ -939,9 +939,9 @@ function initializeDeveloperConsole()
|
||||||
repositionList()
|
repositionList()
|
||||||
end
|
end
|
||||||
|
|
||||||
function AddServerMessage(str, messageType, timeStamp)
|
local function AddServerMessage(messageStr, messageType, timeStamp)
|
||||||
serverMessageList[#serverMessageList + 1] = {
|
serverMessageList[#serverMessageList + 1] = {
|
||||||
Message = str,
|
Message = messageStr,
|
||||||
Time = ConvertTimeStamp(timeStamp),
|
Time = ConvertTimeStamp(timeStamp),
|
||||||
Type = messageType,
|
Type = messageType,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ inside.Name = "inside"
|
||||||
inside.Value = false
|
inside.Value = false
|
||||||
inside.Parent = frameTip
|
inside.Parent = frameTip
|
||||||
|
|
||||||
function setUpListeners(frameToListen)
|
local function setUpListeners(frameToListen)
|
||||||
local fadeSpeed = 0.1
|
local fadeSpeed = 0.1
|
||||||
frameToListen.Parent.MouseEnter:connect(function()
|
frameToListen.Parent.MouseEnter:connect(function()
|
||||||
if frameToListen:FindFirstChild "inside" then
|
if frameToListen:FindFirstChild "inside" then
|
||||||
|
|
@ -50,11 +50,13 @@ function setUpListeners(frameToListen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
function killTip(killFrame)
|
|
||||||
|
local function killTip(killFrame)
|
||||||
killFrame.inside.Value = false
|
killFrame.inside.Value = false
|
||||||
killFrame.BackgroundTransparency = 1
|
killFrame.BackgroundTransparency = 1
|
||||||
killFrame.TextTransparency = 1
|
killFrame.TextTransparency = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
frameToListen.Parent.MouseLeave:connect(function()
|
frameToListen.Parent.MouseLeave:connect(function()
|
||||||
killTip(frameToListen)
|
killTip(frameToListen)
|
||||||
end)
|
end)
|
||||||
|
|
@ -63,7 +65,7 @@ function setUpListeners(frameToListen)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function createSettingsButtonTip(parent)
|
local function createSettingsButtonTip(parent)
|
||||||
if parent == nil then
|
if parent == nil then
|
||||||
parent = bottomLeftControl:FindFirstChild "SettingsButton"
|
parent = bottomLeftControl:FindFirstChild "SettingsButton"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ end
|
||||||
local damageGuiWidth = 5.0
|
local damageGuiWidth = 5.0
|
||||||
local damageGuiHeight = 5.0
|
local damageGuiHeight = 5.0
|
||||||
|
|
||||||
function waitForChild(parent, childName)
|
local function waitForChild(parent, childName)
|
||||||
local child = parent:findFirstChild(childName)
|
local child = parent:findFirstChild(childName)
|
||||||
if child then
|
if child then
|
||||||
return child
|
return child
|
||||||
|
|
@ -55,7 +55,7 @@ end
|
||||||
Humanoid.MaxHealth = myHealth.Value
|
Humanoid.MaxHealth = myHealth.Value
|
||||||
Humanoid.Health = myHealth.Value
|
Humanoid.Health = myHealth.Value
|
||||||
|
|
||||||
function onMaxHealthChange()
|
local function onMaxHealthChange()
|
||||||
Humanoid.MaxHealth = myHealth.Value
|
Humanoid.MaxHealth = myHealth.Value
|
||||||
Humanoid.Health = myHealth.Value
|
Humanoid.Health = myHealth.Value
|
||||||
end
|
end
|
||||||
|
|
@ -79,7 +79,7 @@ end
|
||||||
|
|
||||||
print "newHealth declarations finished"
|
print "newHealth declarations finished"
|
||||||
|
|
||||||
function billboardHealthChange(dmg)
|
local function billboardHealthChange(dmg)
|
||||||
local textLabel = Instance.new "TextLabel"
|
local textLabel = Instance.new "TextLabel"
|
||||||
if dmg > 0 then
|
if dmg > 0 then
|
||||||
textLabel.Text = tostring(dmg)
|
textLabel.Text = tostring(dmg)
|
||||||
|
|
@ -104,7 +104,7 @@ function billboardHealthChange(dmg)
|
||||||
textLabel:remove()
|
textLabel:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
function setMaxHealth()
|
local function setMaxHealth()
|
||||||
--print(Humanoid.Health)
|
--print(Humanoid.Health)
|
||||||
if myHealth.Value >= 0 then
|
if myHealth.Value >= 0 then
|
||||||
Humanoid.MaxHealth = myHealth.Value
|
Humanoid.MaxHealth = myHealth.Value
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
-- CoreGui.RobloxGui.CoreScripts/MainBotChatScript
|
-- CoreGui.RobloxGui.CoreScripts/MainBotChatScript
|
||||||
print "[Mercury]: Loaded corescript 39250920"
|
print "[Mercury]: Loaded corescript 39250920"
|
||||||
|
|
||||||
function waitForProperty(instance, name)
|
local InsertService = game:GetService "InsertService"
|
||||||
|
|
||||||
|
local function waitForProperty(instance, name)
|
||||||
while not instance[name] do
|
while not instance[name] do
|
||||||
instance.Changed:wait()
|
instance.Changed:wait()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function waitForChild(instance, name)
|
local function waitForChild(instance, name)
|
||||||
while not instance:FindFirstChild(name) do
|
while not instance:FindFirstChild(name) do
|
||||||
instance.ChildAdded:wait()
|
instance.ChildAdded:wait()
|
||||||
end
|
end
|
||||||
|
|
@ -39,15 +41,14 @@ else
|
||||||
gui = game.CoreGui.RobloxGui
|
gui = game.CoreGui.RobloxGui
|
||||||
end
|
end
|
||||||
|
|
||||||
function currentTone()
|
local function currentTone()
|
||||||
if currentConversationDialog then
|
if currentConversationDialog then
|
||||||
return currentConversationDialog.Tone
|
return currentConversationDialog.Tone
|
||||||
else
|
|
||||||
return Enum.DialogTone.Neutral
|
|
||||||
end
|
end
|
||||||
|
return Enum.DialogTone.Neutral
|
||||||
end
|
end
|
||||||
|
|
||||||
function createChatNotificationGui()
|
local function createChatNotificationGui()
|
||||||
chatNotificationGui = Instance.new "BillboardGui"
|
chatNotificationGui = Instance.new "BillboardGui"
|
||||||
chatNotificationGui.Name = "ChatNotificationGui"
|
chatNotificationGui.Name = "ChatNotificationGui"
|
||||||
chatNotificationGui.ExtentsOffset = Vector3.new(0, 1, 0)
|
chatNotificationGui.ExtentsOffset = Vector3.new(0, 1, 0)
|
||||||
|
|
@ -79,24 +80,36 @@ function createChatNotificationGui()
|
||||||
button.Parent = image
|
button.Parent = image
|
||||||
end
|
end
|
||||||
|
|
||||||
function getChatColor(tone)
|
local function getChatColor(tone)
|
||||||
if tone == Enum.DialogTone.Neutral then
|
if tone == Enum.DialogTone.Friendly then
|
||||||
return Enum.ChatColor.Blue
|
|
||||||
elseif tone == Enum.DialogTone.Friendly then
|
|
||||||
return Enum.ChatColor.Green
|
return Enum.ChatColor.Green
|
||||||
elseif tone == Enum.DialogTone.Enemy then
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
return Enum.ChatColor.Red
|
return Enum.ChatColor.Red
|
||||||
end
|
end
|
||||||
|
return Enum.ChatColor.Blue
|
||||||
end
|
end
|
||||||
|
|
||||||
function styleChoices(tone)
|
local function resetColor(frame, tone)
|
||||||
|
if tone == Enum.DialogTone.Neutral then
|
||||||
|
frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255)
|
||||||
|
frame.Number.TextColor3 = Color3.new(45 / 255, 142 / 255, 245 / 255)
|
||||||
|
elseif tone == Enum.DialogTone.Friendly then
|
||||||
|
frame.BackgroundColor3 = Color3.new(0 / 255, 77 / 255, 0 / 255)
|
||||||
|
frame.Number.TextColor3 = Color3.new(0 / 255, 190 / 255, 0 / 255)
|
||||||
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
|
frame.BackgroundColor3 = Color3.new(140 / 255, 0 / 255, 0 / 255)
|
||||||
|
frame.Number.TextColor3 = Color3.new(255 / 255, 88 / 255, 79 / 255)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function styleChoices(tone)
|
||||||
for _, obj in pairs(choices) do
|
for _, obj in pairs(choices) do
|
||||||
resetColor(obj, tone)
|
resetColor(obj, tone)
|
||||||
end
|
end
|
||||||
resetColor(lastChoice, tone)
|
resetColor(lastChoice, tone)
|
||||||
end
|
end
|
||||||
|
|
||||||
function styleMainFrame(tone)
|
local function styleMainFrame(tone)
|
||||||
if tone == Enum.DialogTone.Neutral then
|
if tone == Enum.DialogTone.Neutral then
|
||||||
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
||||||
mainFrame.Tail.Image =
|
mainFrame.Tail.Image =
|
||||||
|
|
@ -113,29 +126,31 @@ function styleMainFrame(tone)
|
||||||
|
|
||||||
styleChoices(tone)
|
styleChoices(tone)
|
||||||
end
|
end
|
||||||
function setChatNotificationTone(gui, purpose, tone)
|
|
||||||
|
local function setChatNotificationTone(notificationGui, purpose, tone)
|
||||||
if tone == Enum.DialogTone.Neutral then
|
if tone == Enum.DialogTone.Neutral then
|
||||||
gui.Image.Image =
|
notificationGui.Image.Image =
|
||||||
"rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
|
"rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
|
||||||
elseif tone == Enum.DialogTone.Friendly then
|
elseif tone == Enum.DialogTone.Friendly then
|
||||||
gui.Image.Image =
|
notificationGui.Image.Image =
|
||||||
"rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
|
"rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
|
||||||
elseif tone == Enum.DialogTone.Enemy then
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png"
|
notificationGui.Image.Image =
|
||||||
|
"rbxasset://textures/chatBubble_botRed_notify_bkg.png"
|
||||||
end
|
end
|
||||||
if purpose == Enum.DialogPurpose.Quest then
|
if purpose == Enum.DialogPurpose.Quest then
|
||||||
gui.Image.Button.Image =
|
notificationGui.Image.Button.Image =
|
||||||
"rbxasset://textures/chatBubble_bot_notify_bang.png"
|
"rbxasset://textures/chatBubble_bot_notify_bang.png"
|
||||||
elseif purpose == Enum.DialogPurpose.Help then
|
elseif purpose == Enum.DialogPurpose.Help then
|
||||||
gui.Image.Button.Image =
|
notificationGui.Image.Button.Image =
|
||||||
"rbxasset://textures/chatBubble_bot_notify_question.png"
|
"rbxasset://textures/chatBubble_bot_notify_question.png"
|
||||||
elseif purpose == Enum.DialogPurpose.Shop then
|
elseif purpose == Enum.DialogPurpose.Shop then
|
||||||
gui.Image.Button.Image =
|
notificationGui.Image.Button.Image =
|
||||||
"rbxasset://textures/chatBubble_bot_notify_money.png"
|
"rbxasset://textures/chatBubble_bot_notify_money.png"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function createMessageDialog()
|
local function createMessageDialog()
|
||||||
messageDialog = Instance.new "Frame"
|
messageDialog = Instance.new "Frame"
|
||||||
messageDialog.Name = "DialogScriptMessage"
|
messageDialog.Name = "DialogScriptMessage"
|
||||||
messageDialog.Style = Enum.FrameStyle.RobloxRound
|
messageDialog.Style = Enum.FrameStyle.RobloxRound
|
||||||
|
|
@ -152,7 +167,7 @@ function createMessageDialog()
|
||||||
text.Parent = messageDialog
|
text.Parent = messageDialog
|
||||||
end
|
end
|
||||||
|
|
||||||
function showMessage(msg, size)
|
local function showMessage(msg, size)
|
||||||
messageDialog.Text.Text = msg
|
messageDialog.Text.Text = msg
|
||||||
messageDialog.Size = UDim2.new(0, size, 0, 40)
|
messageDialog.Size = UDim2.new(0, size, 0, 40)
|
||||||
messageDialog.Position = UDim2.new(0.5, -size / 2, 0.5, -40)
|
messageDialog.Position = UDim2.new(0.5, -size / 2, 0.5, -40)
|
||||||
|
|
@ -161,25 +176,12 @@ function showMessage(msg, size)
|
||||||
messageDialog.Visible = false
|
messageDialog.Visible = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function variableDelay(str)
|
local function variableDelay(str)
|
||||||
local length = math.min(string.len(str), 100)
|
local length = math.min(string.len(str), 100)
|
||||||
wait(0.75 + ((length / 75) * 1.5))
|
wait(0.75 + ((length / 75) * 1.5))
|
||||||
end
|
end
|
||||||
|
|
||||||
function resetColor(frame, tone)
|
local function highlightColor(frame, tone)
|
||||||
if tone == Enum.DialogTone.Neutral then
|
|
||||||
frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255)
|
|
||||||
frame.Number.TextColor3 = Color3.new(45 / 255, 142 / 255, 245 / 255)
|
|
||||||
elseif tone == Enum.DialogTone.Friendly then
|
|
||||||
frame.BackgroundColor3 = Color3.new(0 / 255, 77 / 255, 0 / 255)
|
|
||||||
frame.Number.TextColor3 = Color3.new(0 / 255, 190 / 255, 0 / 255)
|
|
||||||
elseif tone == Enum.DialogTone.Enemy then
|
|
||||||
frame.BackgroundColor3 = Color3.new(140 / 255, 0 / 255, 0 / 255)
|
|
||||||
frame.Number.TextColor3 = Color3.new(255 / 255, 88 / 255, 79 / 255)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function highlightColor(frame, tone)
|
|
||||||
if tone == Enum.DialogTone.Neutral then
|
if tone == Enum.DialogTone.Neutral then
|
||||||
frame.BackgroundColor3 = Color3.new(2 / 255, 108 / 255, 255 / 255)
|
frame.BackgroundColor3 = Color3.new(2 / 255, 108 / 255, 255 / 255)
|
||||||
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||||
|
|
@ -192,7 +194,7 @@ function highlightColor(frame, tone)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function endDialog()
|
local function endDialog()
|
||||||
if currentAbortDialogScript then
|
if currentAbortDialogScript then
|
||||||
currentAbortDialogScript:Remove()
|
currentAbortDialogScript:Remove()
|
||||||
currentAbortDialogScript = nil
|
currentAbortDialogScript = nil
|
||||||
|
|
@ -207,163 +209,42 @@ function endDialog()
|
||||||
reenableScript.Parent = dialog
|
reenableScript.Parent = dialog
|
||||||
end
|
end
|
||||||
|
|
||||||
for dialog, gui in pairs(dialogMap) do
|
for dialog2, gui2 in pairs(dialogMap) do
|
||||||
if dialog and gui then
|
if dialog2 and gui2 then
|
||||||
gui.Enabled = not dialog.InUse
|
gui2.Enabled = not dialog2.InUse
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
currentConversationPartner = nil
|
currentConversationPartner = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function wanderDialog()
|
local function wanderDialog()
|
||||||
print "Wander"
|
print "[Mercury]: Dialog wander"
|
||||||
mainFrame.Visible = false
|
mainFrame.Visible = false
|
||||||
endDialog()
|
endDialog()
|
||||||
showMessage(characterWanderedOffMessage, characterWanderedOffSize)
|
showMessage(characterWanderedOffMessage, characterWanderedOffSize)
|
||||||
end
|
end
|
||||||
|
|
||||||
function timeoutDialog()
|
local function timeoutDialog()
|
||||||
print "Timeout"
|
print "[Mercury]: Dialog timeout"
|
||||||
mainFrame.Visible = false
|
mainFrame.Visible = false
|
||||||
endDialog()
|
endDialog()
|
||||||
showMessage(conversationTimedOut, conversationTimedOutSize)
|
showMessage(conversationTimedOut, conversationTimedOutSize)
|
||||||
end
|
end
|
||||||
function normalEndDialog()
|
|
||||||
print "Done"
|
local function normalEndDialog()
|
||||||
|
print "[Mercury]: Dialog done"
|
||||||
endDialog()
|
endDialog()
|
||||||
end
|
end
|
||||||
|
|
||||||
function sanitizeMessage(msg)
|
local function sanitizeMessage(msg)
|
||||||
if string.len(msg) == 0 then
|
if string.len(msg) == 0 then
|
||||||
return "..."
|
return "..."
|
||||||
else
|
|
||||||
return msg
|
|
||||||
end
|
end
|
||||||
|
return msg
|
||||||
end
|
end
|
||||||
|
|
||||||
function selectChoice(choice)
|
local function presentDialogChoices(talkingPart, dialogChoices)
|
||||||
renewKillswitch(currentConversationDialog)
|
|
||||||
|
|
||||||
--First hide the Gui
|
|
||||||
mainFrame.Visible = false
|
|
||||||
if choice == lastChoice then
|
|
||||||
game.Chat:Chat(
|
|
||||||
game.Players.LocalPlayer.Character,
|
|
||||||
"Goodbye!",
|
|
||||||
getChatColor(currentTone())
|
|
||||||
)
|
|
||||||
|
|
||||||
normalEndDialog()
|
|
||||||
else
|
|
||||||
local dialogChoice = choiceMap[choice]
|
|
||||||
|
|
||||||
game.Chat:Chat(
|
|
||||||
game.Players.LocalPlayer.Character,
|
|
||||||
sanitizeMessage(dialogChoice.UserDialog),
|
|
||||||
getChatColor(currentTone())
|
|
||||||
)
|
|
||||||
wait(1)
|
|
||||||
currentConversationDialog:SignalDialogChoiceSelected(
|
|
||||||
player,
|
|
||||||
dialogChoice
|
|
||||||
)
|
|
||||||
game.Chat:Chat(
|
|
||||||
currentConversationPartner,
|
|
||||||
sanitizeMessage(dialogChoice.ResponseDialog),
|
|
||||||
getChatColor(currentTone())
|
|
||||||
)
|
|
||||||
|
|
||||||
variableDelay(dialogChoice.ResponseDialog)
|
|
||||||
presentDialogChoices(
|
|
||||||
currentConversationPartner,
|
|
||||||
dialogChoice:GetChildren()
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function newChoice(numberText)
|
|
||||||
local frame = Instance.new "TextButton"
|
|
||||||
frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255)
|
|
||||||
frame.AutoButtonColor = false
|
|
||||||
frame.BorderSizePixel = 0
|
|
||||||
frame.Text = ""
|
|
||||||
frame.MouseEnter:connect(function()
|
|
||||||
highlightColor(frame, currentTone())
|
|
||||||
end)
|
|
||||||
frame.MouseLeave:connect(function()
|
|
||||||
resetColor(frame, currentTone())
|
|
||||||
end)
|
|
||||||
frame.MouseButton1Click:connect(function()
|
|
||||||
selectChoice(frame)
|
|
||||||
end)
|
|
||||||
frame.RobloxLocked = true
|
|
||||||
|
|
||||||
local number = Instance.new "TextLabel"
|
|
||||||
number.Name = "Number"
|
|
||||||
number.TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255)
|
|
||||||
number.Text = numberText
|
|
||||||
number.FontSize = Enum.FontSize.Size14
|
|
||||||
number.BackgroundTransparency = 1
|
|
||||||
number.Position = UDim2.new(0, 4, 0, 2)
|
|
||||||
number.Size = UDim2.new(0, 20, 0, 24)
|
|
||||||
number.TextXAlignment = Enum.TextXAlignment.Left
|
|
||||||
number.TextYAlignment = Enum.TextYAlignment.Top
|
|
||||||
number.RobloxLocked = true
|
|
||||||
number.Parent = frame
|
|
||||||
|
|
||||||
local prompt = Instance.new "TextLabel"
|
|
||||||
prompt.Name = "UserPrompt"
|
|
||||||
prompt.BackgroundTransparency = 1
|
|
||||||
prompt.TextColor3 = Color3.new(1, 1, 1)
|
|
||||||
prompt.FontSize = Enum.FontSize.Size14
|
|
||||||
prompt.Position = UDim2.new(0, 28, 0, 2)
|
|
||||||
prompt.Size = UDim2.new(1, -32, 1, -4)
|
|
||||||
prompt.TextXAlignment = Enum.TextXAlignment.Left
|
|
||||||
prompt.TextYAlignment = Enum.TextYAlignment.Top
|
|
||||||
prompt.TextWrap = true
|
|
||||||
prompt.RobloxLocked = true
|
|
||||||
prompt.Parent = frame
|
|
||||||
|
|
||||||
return frame
|
|
||||||
end
|
|
||||||
function initialize(parent)
|
|
||||||
choices[1] = newChoice "1)"
|
|
||||||
choices[2] = newChoice "2)"
|
|
||||||
choices[3] = newChoice "3)"
|
|
||||||
choices[4] = newChoice "4)"
|
|
||||||
|
|
||||||
lastChoice = newChoice "5)"
|
|
||||||
lastChoice.UserPrompt.Text = "Goodbye!"
|
|
||||||
lastChoice.Size = UDim2.new(1, 0, 0, 28)
|
|
||||||
|
|
||||||
mainFrame = Instance.new "Frame"
|
|
||||||
mainFrame.Name = "UserDialogArea"
|
|
||||||
mainFrame.Size = UDim2.new(0, 350, 0, 200)
|
|
||||||
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
|
||||||
mainFrame.Visible = false
|
|
||||||
|
|
||||||
local imageLabel = Instance.new "ImageLabel"
|
|
||||||
imageLabel.Name = "Tail"
|
|
||||||
imageLabel.Size = UDim2.new(0, 62, 0, 53)
|
|
||||||
imageLabel.Position = UDim2.new(1, 8, 0.25)
|
|
||||||
imageLabel.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png"
|
|
||||||
imageLabel.BackgroundTransparency = 1
|
|
||||||
imageLabel.RobloxLocked = true
|
|
||||||
imageLabel.Parent = mainFrame
|
|
||||||
|
|
||||||
for _, obj in pairs(choices) do
|
|
||||||
obj.RobloxLocked = true
|
|
||||||
obj.Parent = mainFrame
|
|
||||||
end
|
|
||||||
lastChoice.RobloxLocked = true
|
|
||||||
lastChoice.Parent = mainFrame
|
|
||||||
|
|
||||||
mainFrame.RobloxLocked = true
|
|
||||||
mainFrame.Parent = parent
|
|
||||||
end
|
|
||||||
|
|
||||||
function presentDialogChoices(talkingPart, dialogChoices)
|
|
||||||
if not currentConversationDialog then
|
if not currentConversationDialog then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -419,19 +300,160 @@ function presentDialogChoices(talkingPart, dialogChoices)
|
||||||
mainFrame.Visible = true
|
mainFrame.Visible = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function doDialog(dialog)
|
local function renewKillswitch(dialog)
|
||||||
while not Instance.Lock(dialog, player) do
|
if currentAbortDialogScript then
|
||||||
wait()
|
currentAbortDialogScript:Remove()
|
||||||
|
currentAbortDialogScript = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
currentAbortDialogScript = timeoutScript:Clone()
|
||||||
|
currentAbortDialogScript.archivable = false
|
||||||
|
currentAbortDialogScript.Disabled = false
|
||||||
|
currentAbortDialogScript.Parent = dialog
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function selectChoice(choice)
|
||||||
|
renewKillswitch(currentConversationDialog)
|
||||||
|
|
||||||
|
--First hide the Gui
|
||||||
|
mainFrame.Visible = false
|
||||||
|
if choice == lastChoice then
|
||||||
|
game.Chat:Chat(
|
||||||
|
game.Players.LocalPlayer.Character,
|
||||||
|
"Goodbye!",
|
||||||
|
getChatColor(currentTone())
|
||||||
|
)
|
||||||
|
|
||||||
|
normalEndDialog()
|
||||||
|
else
|
||||||
|
local dialogChoice = choiceMap[choice]
|
||||||
|
|
||||||
|
game.Chat:Chat(
|
||||||
|
game.Players.LocalPlayer.Character,
|
||||||
|
sanitizeMessage(dialogChoice.UserDialog),
|
||||||
|
getChatColor(currentTone())
|
||||||
|
)
|
||||||
|
wait(1)
|
||||||
|
currentConversationDialog:SignalDialogChoiceSelected(
|
||||||
|
player,
|
||||||
|
dialogChoice
|
||||||
|
)
|
||||||
|
game.Chat:Chat(
|
||||||
|
currentConversationPartner,
|
||||||
|
sanitizeMessage(dialogChoice.ResponseDialog),
|
||||||
|
getChatColor(currentTone())
|
||||||
|
)
|
||||||
|
|
||||||
|
variableDelay(dialogChoice.ResponseDialog)
|
||||||
|
presentDialogChoices(
|
||||||
|
currentConversationPartner,
|
||||||
|
dialogChoice:GetChildren()
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function newChoice(numberText)
|
||||||
|
local frame = Instance.new "TextButton"
|
||||||
|
frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255)
|
||||||
|
frame.AutoButtonColor = false
|
||||||
|
frame.BorderSizePixel = 0
|
||||||
|
frame.Text = ""
|
||||||
|
frame.MouseEnter:connect(function()
|
||||||
|
highlightColor(frame, currentTone())
|
||||||
|
end)
|
||||||
|
frame.MouseLeave:connect(function()
|
||||||
|
resetColor(frame, currentTone())
|
||||||
|
end)
|
||||||
|
frame.MouseButton1Click:connect(function()
|
||||||
|
selectChoice(frame)
|
||||||
|
end)
|
||||||
|
frame.RobloxLocked = true
|
||||||
|
|
||||||
|
local number = Instance.new "TextLabel"
|
||||||
|
number.Name = "Number"
|
||||||
|
number.TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255)
|
||||||
|
number.Text = numberText
|
||||||
|
number.FontSize = Enum.FontSize.Size14
|
||||||
|
number.BackgroundTransparency = 1
|
||||||
|
number.Position = UDim2.new(0, 4, 0, 2)
|
||||||
|
number.Size = UDim2.new(0, 20, 0, 24)
|
||||||
|
number.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
number.TextYAlignment = Enum.TextYAlignment.Top
|
||||||
|
number.RobloxLocked = true
|
||||||
|
number.Parent = frame
|
||||||
|
|
||||||
|
local prompt = Instance.new "TextLabel"
|
||||||
|
prompt.Name = "UserPrompt"
|
||||||
|
prompt.BackgroundTransparency = 1
|
||||||
|
prompt.TextColor3 = Color3.new(1, 1, 1)
|
||||||
|
prompt.FontSize = Enum.FontSize.Size14
|
||||||
|
prompt.Position = UDim2.new(0, 28, 0, 2)
|
||||||
|
prompt.Size = UDim2.new(1, -32, 1, -4)
|
||||||
|
prompt.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
prompt.TextYAlignment = Enum.TextYAlignment.Top
|
||||||
|
prompt.TextWrap = true
|
||||||
|
prompt.RobloxLocked = true
|
||||||
|
prompt.Parent = frame
|
||||||
|
|
||||||
|
return frame
|
||||||
|
end
|
||||||
|
|
||||||
|
local function initialize(parent)
|
||||||
|
choices[1] = newChoice "1)"
|
||||||
|
choices[2] = newChoice "2)"
|
||||||
|
choices[3] = newChoice "3)"
|
||||||
|
choices[4] = newChoice "4)"
|
||||||
|
|
||||||
|
lastChoice = newChoice "5)"
|
||||||
|
lastChoice.UserPrompt.Text = "Goodbye!"
|
||||||
|
lastChoice.Size = UDim2.new(1, 0, 0, 28)
|
||||||
|
|
||||||
|
mainFrame = Instance.new "Frame"
|
||||||
|
mainFrame.Name = "UserDialogArea"
|
||||||
|
mainFrame.Size = UDim2.new(0, 350, 0, 200)
|
||||||
|
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
||||||
|
mainFrame.Visible = false
|
||||||
|
|
||||||
|
local imageLabel = Instance.new "ImageLabel"
|
||||||
|
imageLabel.Name = "Tail"
|
||||||
|
imageLabel.Size = UDim2.new(0, 62, 0, 53)
|
||||||
|
imageLabel.Position = UDim2.new(1, 8, 0.25)
|
||||||
|
imageLabel.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png"
|
||||||
|
imageLabel.BackgroundTransparency = 1
|
||||||
|
imageLabel.RobloxLocked = true
|
||||||
|
imageLabel.Parent = mainFrame
|
||||||
|
|
||||||
|
for _, obj in pairs(choices) do
|
||||||
|
obj.RobloxLocked = true
|
||||||
|
obj.Parent = mainFrame
|
||||||
|
end
|
||||||
|
lastChoice.RobloxLocked = true
|
||||||
|
lastChoice.Parent = mainFrame
|
||||||
|
|
||||||
|
mainFrame.RobloxLocked = true
|
||||||
|
mainFrame.Parent = parent
|
||||||
|
end
|
||||||
|
|
||||||
|
local function doDialog(dialog)
|
||||||
|
local il = Instance.Lock(dialog, player)
|
||||||
|
print("for instance", il)
|
||||||
|
while not il do
|
||||||
|
wait()
|
||||||
|
il = Instance.Lock(dialog, player)
|
||||||
|
print("for instance", il)
|
||||||
|
end
|
||||||
|
|
||||||
|
print("testin", dialog)
|
||||||
|
|
||||||
if dialog.InUse then
|
if dialog.InUse then
|
||||||
Instance.Unlock(dialog)
|
Instance.Unlock(dialog)
|
||||||
return
|
return
|
||||||
else
|
|
||||||
dialog.InUse = true
|
|
||||||
Instance.Unlock(dialog)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
dialog.InUse = true
|
||||||
|
Instance.Unlock(dialog)
|
||||||
|
|
||||||
currentConversationDialog = dialog
|
currentConversationDialog = dialog
|
||||||
game.Chat:Chat(
|
game.Chat:Chat(
|
||||||
dialog.Parent,
|
dialog.Parent,
|
||||||
|
|
@ -443,19 +465,7 @@ function doDialog(dialog)
|
||||||
presentDialogChoices(dialog.Parent, dialog:GetChildren())
|
presentDialogChoices(dialog.Parent, dialog:GetChildren())
|
||||||
end
|
end
|
||||||
|
|
||||||
function renewKillswitch(dialog)
|
local function checkForLeaveArea()
|
||||||
if currentAbortDialogScript then
|
|
||||||
currentAbortDialogScript:Remove()
|
|
||||||
currentAbortDialogScript = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
currentAbortDialogScript = timeoutScript:Clone()
|
|
||||||
currentAbortDialogScript.archivable = false
|
|
||||||
currentAbortDialogScript.Disabled = false
|
|
||||||
currentAbortDialogScript.Parent = dialog
|
|
||||||
end
|
|
||||||
|
|
||||||
function checkForLeaveArea()
|
|
||||||
while currentConversationDialog do
|
while currentConversationDialog do
|
||||||
if
|
if
|
||||||
currentConversationDialog.Parent
|
currentConversationDialog.Parent
|
||||||
|
|
@ -471,7 +481,7 @@ function checkForLeaveArea()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function startDialog(dialog)
|
local function startDialog(dialog)
|
||||||
if dialog.Parent and dialog.Parent:IsA "BasePart" then
|
if dialog.Parent and dialog.Parent:IsA "BasePart" then
|
||||||
if
|
if
|
||||||
player:DistanceFromCharacter(dialog.Parent.Position)
|
player:DistanceFromCharacter(dialog.Parent.Position)
|
||||||
|
|
@ -481,9 +491,9 @@ function startDialog(dialog)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
for dialog, gui in pairs(dialogMap) do
|
for dialog2, gui2 in pairs(dialogMap) do
|
||||||
if dialog and gui then
|
if dialog2 and gui2 then
|
||||||
gui.Enabled = false
|
gui2.Enabled = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -494,7 +504,7 @@ function startDialog(dialog)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function removeDialog(dialog)
|
local function removeDialog(dialog)
|
||||||
if dialogMap[dialog] then
|
if dialogMap[dialog] then
|
||||||
dialogMap[dialog]:Remove()
|
dialogMap[dialog]:Remove()
|
||||||
dialogMap[dialog] = nil
|
dialogMap[dialog] = nil
|
||||||
|
|
@ -505,7 +515,7 @@ function removeDialog(dialog)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function addDialog(dialog)
|
local function addDialog(dialog)
|
||||||
if dialog.Parent then
|
if dialog.Parent then
|
||||||
if dialog.Parent:IsA "BasePart" then
|
if dialog.Parent:IsA "BasePart" then
|
||||||
local chatGui = chatNotificationGui:clone()
|
local chatGui = chatNotificationGui:clone()
|
||||||
|
|
@ -551,11 +561,11 @@ function addDialog(dialog)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function fetchScripts()
|
local function fetchScripts()
|
||||||
local model = game:GetService("InsertService"):LoadAsset(39226062)
|
local model = InsertService:LoadAsset(39226062)
|
||||||
if type(model) == "string" then -- load failed, lets try again
|
if type(model) == "string" then -- load failed, lets try again
|
||||||
wait(0.1)
|
wait(0.1)
|
||||||
model = game:GetService("InsertService"):LoadAsset(39226062)
|
model = InsertService:LoadAsset(39226062)
|
||||||
end
|
end
|
||||||
if type(model) == "string" then -- not going to work, lets bail
|
if type(model) == "string" then -- not going to work, lets bail
|
||||||
return
|
return
|
||||||
|
|
@ -567,7 +577,7 @@ function fetchScripts()
|
||||||
reenableDialogScript = model.ReenableDialogScript
|
reenableDialogScript = model.ReenableDialogScript
|
||||||
end
|
end
|
||||||
|
|
||||||
function onLoad()
|
local function onLoad()
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
waitForProperty(game.Players, "LocalPlayer")
|
||||||
player = game.Players.LocalPlayer
|
player = game.Players.LocalPlayer
|
||||||
waitForProperty(player, "Character")
|
waitForProperty(player, "Character")
|
||||||
|
|
|
||||||
|
|
@ -4450,9 +4450,8 @@ t.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
||||||
|
|
||||||
if scrollable then
|
if scrollable then
|
||||||
return dragBar, frame, helpFrame, closeEvent
|
return dragBar, frame, helpFrame, closeEvent
|
||||||
else
|
|
||||||
return dragBar, widgetContainer, helpFrame, closeEvent
|
|
||||||
end
|
end
|
||||||
|
return dragBar, widgetContainer, helpFrame, closeEvent
|
||||||
end
|
end
|
||||||
|
|
||||||
t.Help = function(funcNameOrFunc)
|
t.Help = function(funcNameOrFunc)
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ local function robloxLock(instance)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function resumeGameFunction(shield)
|
local function resumeGameFunction(shield)
|
||||||
shield.Settings:TweenPosition(
|
shield.Settings:TweenPosition(
|
||||||
UDim2.new(0.5, -262, -0.5, -200),
|
UDim2.new(0.5, -262, -0.5, -200),
|
||||||
Enum.EasingDirection.InOut,
|
Enum.EasingDirection.InOut,
|
||||||
|
|
@ -83,7 +83,7 @@ function resumeGameFunction(shield)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function goToMenu(container, menuName, moveDirection, size, position)
|
local function goToMenu(container, menuName, moveDirection, size, position)
|
||||||
if type(menuName) ~= "string" then
|
if type(menuName) ~= "string" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -172,7 +172,7 @@ function goToMenu(container, menuName, moveDirection, size, position)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function resetLocalCharacter()
|
local function resetLocalCharacter()
|
||||||
local player = game.Players.LocalPlayer
|
local player = game.Players.LocalPlayer
|
||||||
if player then
|
if player then
|
||||||
if player.Character and player.Character:FindFirstChild "Humanoid" then
|
if player.Character and player.Character:FindFirstChild "Humanoid" then
|
||||||
|
|
@ -268,7 +268,7 @@ local function CreateTextButtons(frame, buttons, yPos, ySize)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function setRecordGui(recording, stopRecordButton, recordVideoButton)
|
local function setRecordGui(recording, stopRecordButton, recordVideoButton)
|
||||||
if recording then
|
if recording then
|
||||||
stopRecordButton.Visible = true
|
stopRecordButton.Visible = true
|
||||||
recordVideoButton.Text = "Stop Recording"
|
recordVideoButton.Text = "Stop Recording"
|
||||||
|
|
@ -278,12 +278,12 @@ function setRecordGui(recording, stopRecordButton, recordVideoButton)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function recordVideoClick(recordVideoButton, stopRecordButton)
|
local function recordVideoClick(recordVideoButton, stopRecordButton)
|
||||||
recordingVideo = not recordingVideo
|
recordingVideo = not recordingVideo
|
||||||
setRecordGui(recordingVideo, stopRecordButton, recordVideoButton)
|
setRecordGui(recordingVideo, stopRecordButton, recordVideoButton)
|
||||||
end
|
end
|
||||||
|
|
||||||
function backToGame(buttonClicked, shield, settingsButton)
|
local function backToGame(buttonClicked, shield, settingsButton2)
|
||||||
buttonClicked.Parent.Parent.Parent.Parent.Visible = false
|
buttonClicked.Parent.Parent.Parent.Parent.Visible = false
|
||||||
shield.Visible = false
|
shield.Visible = false
|
||||||
for i = 1, #centerDialogs do
|
for i = 1, #centerDialogs do
|
||||||
|
|
@ -292,10 +292,10 @@ function backToGame(buttonClicked, shield, settingsButton)
|
||||||
end
|
end
|
||||||
centerDialogs = {}
|
centerDialogs = {}
|
||||||
game.GuiService:RemoveCenterDialog(shield)
|
game.GuiService:RemoveCenterDialog(shield)
|
||||||
settingsButton.Active = true
|
settingsButton2.Active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function setDisabledState(guiObject)
|
local function setDisabledState(guiObject)
|
||||||
if not guiObject then
|
if not guiObject then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -796,7 +796,7 @@ local function createGameMainMenu(baseZIndex, shield)
|
||||||
game:FindFirstChild "LoadingGuiService"
|
game:FindFirstChild "LoadingGuiService"
|
||||||
and #game.LoadingGuiService:GetChildren() > 0
|
and #game.LoadingGuiService:GetChildren() > 0
|
||||||
then
|
then
|
||||||
local gameSettingsButton = createTextButton(
|
gameSettingsButton = createTextButton(
|
||||||
"Game Instructions",
|
"Game Instructions",
|
||||||
Enum.ButtonStyle.RobloxButton,
|
Enum.ButtonStyle.RobloxButton,
|
||||||
Enum.FontSize.Size24,
|
Enum.FontSize.Size24,
|
||||||
|
|
@ -1112,49 +1112,29 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function translateSavedQualityLevelToInt(savedQualityLevel)
|
local function translateSavedQualityLevelToInt(savedQualityLevel)
|
||||||
if savedQualityLevel == Enum.SavedQualitySetting.Automatic then
|
local sqs = Enum.SavedQualitySetting
|
||||||
return 0
|
if savedQualityLevel == sqs.QualityLevel1 then
|
||||||
elseif
|
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel1
|
|
||||||
then
|
|
||||||
return 1
|
return 1
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel2 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel2
|
|
||||||
then
|
|
||||||
return 2
|
return 2
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel3 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel3
|
|
||||||
then
|
|
||||||
return 3
|
return 3
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel4 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel4
|
|
||||||
then
|
|
||||||
return 4
|
return 4
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel5 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel5
|
|
||||||
then
|
|
||||||
return 5
|
return 5
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel6 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel6
|
|
||||||
then
|
|
||||||
return 6
|
return 6
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel7 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel7
|
|
||||||
then
|
|
||||||
return 7
|
return 7
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel8 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel8
|
|
||||||
then
|
|
||||||
return 8
|
return 8
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel9 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel9
|
|
||||||
then
|
|
||||||
return 9
|
return 9
|
||||||
elseif
|
elseif savedQualityLevel == sqs.QualityLevel10 then
|
||||||
savedQualityLevel == Enum.SavedQualitySetting.QualityLevel10
|
|
||||||
then
|
|
||||||
return 10
|
return 10
|
||||||
end
|
end
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local function enableGraphicsWidget()
|
local function enableGraphicsWidget()
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ print "[Mercury]: Loaded corescript 48488235"
|
||||||
|
|
||||||
local ADMINS = {
|
local ADMINS = {
|
||||||
taskmanager = 1,
|
taskmanager = 1,
|
||||||
Heliodex = 1,
|
heliodex = 1,
|
||||||
multako = "http://banland.xyz/asset/?id=6923328292",
|
multako = "http://banland.xyz/asset/?id=6923328292",
|
||||||
mercury = 1,
|
mercury = 1,
|
||||||
pizzaboxer = "http://banland.xyz/asset/?id=6917566633",
|
pizzaboxer = "http://banland.xyz/asset/?id=6917566633",
|
||||||
|
|
@ -183,7 +183,7 @@ end
|
||||||
imgName asset name of image to fill background
|
imgName asset name of image to fill background
|
||||||
@Return: background gui object
|
@Return: background gui object
|
||||||
--]]
|
--]]
|
||||||
function MakeBackgroundGuiObj(imgName)
|
local function MakeBackgroundGuiObj(imgName)
|
||||||
return Obj.Create "ImageLabel" {
|
return Obj.Create "ImageLabel" {
|
||||||
Name = "Background",
|
Name = "Background",
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
|
|
@ -193,7 +193,7 @@ function MakeBackgroundGuiObj(imgName)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
--[[ turns 255 integer color value to a color3 --]]
|
--[[ turns 255 integer color value to a color3 --]]
|
||||||
function Color3I(r, g, b)
|
local function Color3I(r, g, b)
|
||||||
return Color3.new(r / 255, g / 255, b / 255)
|
return Color3.new(r / 255, g / 255, b / 255)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -203,13 +203,12 @@ end
|
||||||
membershipType Enum of membership status
|
membershipType Enum of membership status
|
||||||
@Return: string of image asset
|
@Return: string of image asset
|
||||||
--]]
|
--]]
|
||||||
function getMembershipTypeIcon(membershipType, playerName)
|
local function getMembershipTypeIcon(membershipType, playerName)
|
||||||
if ADMINS[string.lower(playerName)] ~= nil then
|
if ADMINS[string.lower(playerName)] ~= nil then
|
||||||
if ADMINS[string.lower(playerName)] == 1 then
|
if ADMINS[string.lower(playerName)] == 1 then
|
||||||
return "http://banland.xyz/asset/?id=6923330951"
|
return "http://banland.xyz/asset/?id=6923330951"
|
||||||
else
|
|
||||||
return ADMINS[string.lower(playerName)]
|
|
||||||
end
|
end
|
||||||
|
return ADMINS[string.lower(playerName)]
|
||||||
elseif membershipType == Enum.MembershipType.None then
|
elseif membershipType == Enum.MembershipType.None then
|
||||||
return ""
|
return ""
|
||||||
elseif membershipType == Enum.MembershipType.BuildersClub then
|
elseif membershipType == Enum.MembershipType.BuildersClub then
|
||||||
|
|
@ -299,7 +298,7 @@ end
|
||||||
child name of child object to look for
|
child name of child object to look for
|
||||||
@Return: object waited for
|
@Return: object waited for
|
||||||
--]]
|
--]]
|
||||||
function WaitForChild(parent, child)
|
local function WaitForChild(parent, child)
|
||||||
while not parent:FindFirstChild(child) do
|
while not parent:FindFirstChild(child) do
|
||||||
wait()
|
wait()
|
||||||
debugprint(" child " .. parent.Name .. " waiting for " .. child)
|
debugprint(" child " .. parent.Name .. " waiting for " .. child)
|
||||||
|
|
@ -1002,7 +1001,7 @@ end)
|
||||||
-- return numEnts
|
-- return numEnts
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
function AreAllEntriesOnScreen()
|
local function AreAllEntriesOnScreen()
|
||||||
return #MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale
|
return #MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale
|
||||||
<= 1 + DefaultBottomClipPos
|
<= 1 + DefaultBottomClipPos
|
||||||
end
|
end
|
||||||
|
|
@ -1011,24 +1010,25 @@ end
|
||||||
-- return 1 + DefaultBottomClipPos
|
-- return 1 + DefaultBottomClipPos
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
function GetMaxScroll()
|
local function GetMaxScroll()
|
||||||
return DefaultBottomClipPos * -1
|
return DefaultBottomClipPos * -1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- can be optimized by caching when this varible changes
|
-- can be optimized by caching when this varible changes
|
||||||
function GetMinScroll()
|
local function GetMinScroll()
|
||||||
if AreAllEntriesOnScreen() then
|
if AreAllEntriesOnScreen() then
|
||||||
return GetMaxScroll()
|
return GetMaxScroll()
|
||||||
else
|
|
||||||
return (
|
|
||||||
GetMaxScroll()
|
|
||||||
- (#MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale)
|
|
||||||
) + (1 + DefaultBottomClipPos)
|
|
||||||
end
|
end
|
||||||
|
return (
|
||||||
|
GetMaxScroll()
|
||||||
|
- (#MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale)
|
||||||
|
) + (1 + DefaultBottomClipPos)
|
||||||
end
|
end
|
||||||
|
|
||||||
function AbsoluteToPercent(x, y)
|
local function AbsoluteToPercent(x, y)
|
||||||
return Vector2.new(x, y) / ScreenGui.AbsoluteSize
|
return Vector2.new(x, y) / ScreenGui.AbsoluteSize
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
tweens property of element from starta to enda over length of time
|
tweens property of element from starta to enda over length of time
|
||||||
Warning: should be put in a Spawn call
|
Warning: should be put in a Spawn call
|
||||||
|
|
@ -1039,7 +1039,7 @@ end
|
||||||
enda alpha to end tweening on
|
enda alpha to end tweening on
|
||||||
length how many seconds to spend tweening
|
length how many seconds to spend tweening
|
||||||
--]]
|
--]]
|
||||||
function TweenProperty(obj, propName, inita, enda, length)
|
local function TweenProperty(obj, propName, inita, enda, length)
|
||||||
local startTime = tick()
|
local startTime = tick()
|
||||||
while tick() - startTime < length do
|
while tick() - startTime < length do
|
||||||
obj[propName] = ((enda - inita) * ((tick() - startTime) / length))
|
obj[propName] = ((enda - inita) * ((tick() - startTime) / length))
|
||||||
|
|
@ -1048,6 +1048,7 @@ function TweenProperty(obj, propName, inita, enda, length)
|
||||||
end
|
end
|
||||||
obj[propName] = enda
|
obj[propName] = enda
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
UGLY UGLY HACK FUNCTION
|
UGLY UGLY HACK FUNCTION
|
||||||
replace with some sort of global input catching A.S.A. FREAKING P.
|
replace with some sort of global input catching A.S.A. FREAKING P.
|
||||||
|
|
@ -1057,8 +1058,7 @@ end
|
||||||
polledFunction function to call on mouse moved events in this gui
|
polledFunction function to call on mouse moved events in this gui
|
||||||
exitFunction function to call when click event is fired
|
exitFunction function to call when click event is fired
|
||||||
--]]
|
--]]
|
||||||
|
local function WaitForClick(frameParent, polledFunction, exitFunction)
|
||||||
function WaitForClick(frameParent, polledFunction, exitFunction)
|
|
||||||
if WaitForClickLock then
|
if WaitForClickLock then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1227,7 +1227,7 @@ end
|
||||||
--[[
|
--[[
|
||||||
opens the abuse dialog, initialises text to display selectedplayer
|
opens the abuse dialog, initialises text to display selectedplayer
|
||||||
--]]
|
--]]
|
||||||
function OpenAbuseDialog()
|
local function OpenAbuseDialog()
|
||||||
debugprint "adding report dialog"
|
debugprint "adding report dialog"
|
||||||
AbusePlayerLabel.Text = SelectedPlayer.Name
|
AbusePlayerLabel.Text = SelectedPlayer.Name
|
||||||
--AbuseDescriptionBox.Text = ""
|
--AbuseDescriptionBox.Text = ""
|
||||||
|
|
@ -1260,7 +1260,7 @@ end
|
||||||
--[[
|
--[[
|
||||||
creates dropdownbox, registers all listeners for abuse dialog
|
creates dropdownbox, registers all listeners for abuse dialog
|
||||||
--]]
|
--]]
|
||||||
function InitReportAbuse()
|
local function InitReportAbuse()
|
||||||
UpdateAbuseFunction = function(abuseText)
|
UpdateAbuseFunction = function(abuseText)
|
||||||
AbuseName = abuseText
|
AbuseName = abuseText
|
||||||
if AbuseName and SelectedPlayer then
|
if AbuseName and SelectedPlayer then
|
||||||
|
|
@ -1297,16 +1297,14 @@ end
|
||||||
local function GetFriendStatus(player)
|
local function GetFriendStatus(player)
|
||||||
if player == game.Players.LocalPlayer then
|
if player == game.Players.LocalPlayer then
|
||||||
return Enum.FriendStatus.NotFriend
|
return Enum.FriendStatus.NotFriend
|
||||||
else
|
|
||||||
local success, result = pcall(function()
|
|
||||||
return game.Players.LocalPlayer:GetFriendStatus(player)
|
|
||||||
end)
|
|
||||||
if success then
|
|
||||||
return result
|
|
||||||
else
|
|
||||||
return Enum.FriendStatus.NotFriend
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
local success, result = pcall(function()
|
||||||
|
return game.Players.LocalPlayer:GetFriendStatus(player)
|
||||||
|
end)
|
||||||
|
if success then
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
return Enum.FriendStatus.NotFriend
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
|
@ -1460,8 +1458,9 @@ function StatAdded(nchild, playerEntry)
|
||||||
StatChanged(playerEntry, property)
|
StatChanged(playerEntry, property)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
--returns whether any of the existing players has this stat
|
--returns whether any of the existing players has this stat
|
||||||
function DoesStatExist(statName, exception)
|
local function DoesStatExist(statName, exception)
|
||||||
for _, playerf in pairs(PlayerFrames) do
|
for _, playerf in pairs(PlayerFrames) do
|
||||||
if
|
if
|
||||||
playerf.Player ~= exception
|
playerf.Player ~= exception
|
||||||
|
|
@ -1530,12 +1529,10 @@ function GetScoreValue(score)
|
||||||
elseif score:IsA "BoolValue" then
|
elseif score:IsA "BoolValue" then
|
||||||
if score.Value then
|
if score.Value then
|
||||||
return 1
|
return 1
|
||||||
else
|
|
||||||
return 0
|
|
||||||
end
|
end
|
||||||
else
|
return 0
|
||||||
return score.Value
|
|
||||||
end
|
end
|
||||||
|
return score.Value
|
||||||
end
|
end
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -658,12 +658,12 @@ function resolveDrag(gearClone, x, y)
|
||||||
then
|
then
|
||||||
reorganizeLoadout(gearClone, false)
|
reorganizeLoadout(gearClone, false)
|
||||||
return false
|
return false
|
||||||
else
|
|
||||||
if dragBeginPos then
|
|
||||||
gearClone.Position = dragBeginPos
|
|
||||||
end
|
|
||||||
return -1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if dragBeginPos then
|
||||||
|
gearClone.Position = dragBeginPos
|
||||||
|
end
|
||||||
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
function unequipAllItems(dontEquipThis)
|
function unequipAllItems(dontEquipThis)
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,8 @@ function JsonWriter:IsArray(t)
|
||||||
for k, _ in pairs(t) do
|
for k, _ in pairs(t) do
|
||||||
if not isindex(k) then
|
if not isindex(k) then
|
||||||
return false, "{", "}"
|
return false, "{", "}"
|
||||||
else
|
|
||||||
count = math.max(count, k)
|
|
||||||
end
|
end
|
||||||
|
count = math.max(count, k)
|
||||||
end
|
end
|
||||||
return true, "[", "]", count
|
return true, "[", "]", count
|
||||||
end
|
end
|
||||||
|
|
@ -253,9 +252,8 @@ function JsonReader:Read()
|
||||||
elseif peek == "/" then
|
elseif peek == "/" then
|
||||||
self:ReadComment()
|
self:ReadComment()
|
||||||
return self:Read()
|
return self:Read()
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function JsonReader:ReadTrue()
|
function JsonReader:ReadTrue()
|
||||||
|
|
|
||||||
|
|
@ -199,9 +199,8 @@ local function autoAlignToFace(parts)
|
||||||
local aatf = parts:FindFirstChild "AutoAlignToFace"
|
local aatf = parts:FindFirstChild "AutoAlignToFace"
|
||||||
if aatf then
|
if aatf then
|
||||||
return aatf.Value
|
return aatf.Value
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getClosestAlignedWorldDirection(aVector3InWorld)
|
local function getClosestAlignedWorldDirection(aVector3InWorld)
|
||||||
|
|
@ -221,24 +220,20 @@ local function getClosestAlignedWorldDirection(aVector3InWorld)
|
||||||
if math.abs(xDot) > math.abs(yDot) and math.abs(xDot) > math.abs(zDot) then
|
if math.abs(xDot) > math.abs(yDot) and math.abs(xDot) > math.abs(zDot) then
|
||||||
if xDot > 0 then
|
if xDot > 0 then
|
||||||
return 0
|
return 0
|
||||||
else
|
|
||||||
return 3
|
|
||||||
end
|
end
|
||||||
|
return 3
|
||||||
elseif
|
elseif
|
||||||
math.abs(yDot) > math.abs(xDot) and math.abs(yDot) > math.abs(zDot)
|
math.abs(yDot) > math.abs(xDot) and math.abs(yDot) > math.abs(zDot)
|
||||||
then
|
then
|
||||||
if yDot > 0 then
|
if yDot > 0 then
|
||||||
return 1
|
return 1
|
||||||
else
|
|
||||||
return 4
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if zDot > 0 then
|
|
||||||
return 2
|
|
||||||
else
|
|
||||||
return 5
|
|
||||||
end
|
end
|
||||||
|
return 4
|
||||||
end
|
end
|
||||||
|
if zDot > 0 then
|
||||||
|
return 2
|
||||||
|
end
|
||||||
|
return 5
|
||||||
end
|
end
|
||||||
|
|
||||||
local function positionPartsAtCFrame3(aCFrame, currentParts)
|
local function positionPartsAtCFrame3(aCFrame, currentParts)
|
||||||
|
|
@ -422,21 +417,18 @@ end
|
||||||
local function getTargetPartBoundingBox(targetPart)
|
local function getTargetPartBoundingBox(targetPart)
|
||||||
if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then
|
if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then
|
||||||
return getBoundingBox2(targetPart.Parent)
|
return getBoundingBox2(targetPart.Parent)
|
||||||
else
|
|
||||||
return getBoundingBox2(targetPart)
|
|
||||||
end
|
end
|
||||||
|
return getBoundingBox2(targetPart)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getMouseTargetCFrame(targetPart)
|
local function getMouseTargetCFrame(targetPart)
|
||||||
if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then
|
if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then
|
||||||
if targetPart.Parent:IsA "Tool" then
|
if targetPart.Parent:IsA "Tool" then
|
||||||
return targetPart.Parent.Handle.CFrame
|
return targetPart.Parent.Handle.CFrame
|
||||||
else
|
|
||||||
return targetPart.Parent:GetModelCFrame()
|
|
||||||
end
|
end
|
||||||
else
|
return targetPart.Parent:GetModelCFrame()
|
||||||
return targetPart.CFrame
|
|
||||||
end
|
end
|
||||||
|
return targetPart.CFrame
|
||||||
end
|
end
|
||||||
|
|
||||||
local function isBlocker(part) -- returns whether or not we want to cancel the stamp because we're blocked by this part
|
local function isBlocker(part) -- returns whether or not we want to cancel the stamp because we're blocked by this part
|
||||||
|
|
@ -450,7 +442,8 @@ local function isBlocker(part) -- returns whether or not we want to cancel the s
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if
|
if
|
||||||
part:FindFirstChild "RobloxStamper" or part:FindFirstChild "RobloxModel"
|
part:FindFirstChild "RobloxStamper"
|
||||||
|
or part:FindFirstChild "RobloxModel"
|
||||||
then
|
then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -565,17 +558,16 @@ local function findConfigAtMouseTarget(Mouse, stampData)
|
||||||
if nil == cellPos then
|
if nil == cellPos then
|
||||||
hitPlane = false
|
hitPlane = false
|
||||||
return admissibleConfig, targetConfig
|
return admissibleConfig, targetConfig
|
||||||
else
|
|
||||||
targetPart = game.Workspace.Terrain
|
|
||||||
hitPlane = true
|
|
||||||
-- Take into account error that will occur.
|
|
||||||
cellPos = Vector3.new(cellPos.X - 1, cellPos.Y, cellPos.Z)
|
|
||||||
mouseHitInWorld = game.Workspace.Terrain:CellCenterToWorld(
|
|
||||||
cellPos.x,
|
|
||||||
cellPos.y,
|
|
||||||
cellPos.z
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
targetPart = game.Workspace.Terrain
|
||||||
|
hitPlane = true
|
||||||
|
-- Take into account error that will occur.
|
||||||
|
cellPos = Vector3.new(cellPos.X - 1, cellPos.Y, cellPos.Z)
|
||||||
|
mouseHitInWorld = game.Workspace.Terrain:CellCenterToWorld(
|
||||||
|
cellPos.x,
|
||||||
|
cellPos.y,
|
||||||
|
cellPos.z
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- test mouse hit location
|
-- test mouse hit location
|
||||||
|
|
@ -828,9 +820,8 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId)
|
||||||
return BrickColor.new "Really blue"
|
return BrickColor.new "Really blue"
|
||||||
elseif terrainValue == 17 then
|
elseif terrainValue == 17 then
|
||||||
return BrickColor.new "Bright blue"
|
return BrickColor.new "Bright blue"
|
||||||
else
|
|
||||||
return BrickColor.new "Bright green"
|
|
||||||
end
|
end
|
||||||
|
return BrickColor.new "Bright green"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setupFakeTerrainPart(cellMat, cellType, cellOrient)
|
local function setupFakeTerrainPart(cellMat, cellType, cellOrient)
|
||||||
|
|
@ -2600,7 +2591,8 @@ t.SetupStamperDragger = function(
|
||||||
stringTag.Parent = stampData.CurrentParts
|
stringTag.Parent = stampData.CurrentParts
|
||||||
|
|
||||||
if
|
if
|
||||||
stampData.CurrentParts:FindFirstChild "RobloxStamper" == nil
|
stampData.CurrentParts:FindFirstChild "RobloxStamper"
|
||||||
|
== nil
|
||||||
then
|
then
|
||||||
local stringTag2 = Instance.new "BoolValue"
|
local stringTag2 = Instance.new "BoolValue"
|
||||||
stringTag2.Name = "RobloxStamper"
|
stringTag2.Name = "RobloxStamper"
|
||||||
|
|
|
||||||
|
|
@ -1092,8 +1092,6 @@ function Chat:CheckIfInBounds(value)
|
||||||
and Chat.MessageQueue[1]["Player"].Position.Y.Scale < 0
|
and Chat.MessageQueue[1]["Player"].Position.Y.Scale < 0
|
||||||
then
|
then
|
||||||
return true
|
return true
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,14 @@ local placeId, sleeptime, access, url, killID, deathID, timeout, injectScriptAss
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
local BadgeService = game:GetService "BadgeService"
|
local BadgeService = game:GetService "BadgeService"
|
||||||
local FriendService = game:GetService "FriendService"
|
local FriendService = game:GetService "FriendService"
|
||||||
|
local ScriptContext = game:GetService "ScriptContext"
|
||||||
|
local RunService = game:GetService "RunService"
|
||||||
|
|
||||||
-- StartGame --
|
-- StartGame --
|
||||||
pcall(function()
|
pcall(function()
|
||||||
game:GetService("ScriptContext"):AddStarterScript(injectScriptAssetID)
|
ScriptContext:AddStarterScript(injectScriptAssetID)
|
||||||
end)
|
end)
|
||||||
game:GetService("RunService"):Run()
|
RunService:Run()
|
||||||
|
|
||||||
-- REQUIRES: StartGanmeSharedArgs.txt
|
-- REQUIRES: StartGanmeSharedArgs.txt
|
||||||
-- REQUIRES: MonitorGameStatus.txt
|
-- REQUIRES: MonitorGameStatus.txt
|
||||||
|
|
@ -89,11 +91,10 @@ end)
|
||||||
|
|
||||||
url = "_BASE_URL"
|
url = "_BASE_URL"
|
||||||
|
|
||||||
local scriptContext = game:GetService "ScriptContext"
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
scriptContext:AddStarterScript(libraryRegistrationScriptAssetID)
|
ScriptContext:AddStarterScript(libraryRegistrationScriptAssetID)
|
||||||
end)
|
end)
|
||||||
scriptContext.ScriptsDisabled = true
|
ScriptContext.ScriptsDisabled = true
|
||||||
|
|
||||||
-- game:SetPlaceID(nil, false)
|
-- game:SetPlaceID(nil, false)
|
||||||
game:GetService("ChangeHistoryService"):SetEnabled(false)
|
game:GetService("ChangeHistoryService"):SetEnabled(false)
|
||||||
|
|
@ -274,14 +275,15 @@ ns:Start(_SERVER_PORT, sleeptime)
|
||||||
game:GetService("Visit"):SetPing("_SERVER_PRESENCE_URL", 30)
|
game:GetService("Visit"):SetPing("_SERVER_PRESENCE_URL", 30)
|
||||||
|
|
||||||
if timeout then
|
if timeout then
|
||||||
scriptContext:SetTimeout(timeout)
|
ScriptContext:SetTimeout(timeout)
|
||||||
end
|
end
|
||||||
scriptContext.ScriptsDisabled = false
|
ScriptContext.ScriptsDisabled = false
|
||||||
|
|
||||||
--delay(1, function()
|
--delay(1, function()
|
||||||
-- loadfile(url .. "/analytics/GamePerfMonitor.ashx")(game.JobId, placeId)
|
-- loadfile(url .. "/analytics/GamePerfMonitor.ashx")(game.JobId, placeId)
|
||||||
--end)
|
--end)
|
||||||
|
|
||||||
|
-- yimy stuff
|
||||||
local reset = ";mc"
|
local reset = ";mc"
|
||||||
game.Players.PlayerAdded:connect(function(player)
|
game.Players.PlayerAdded:connect(function(player)
|
||||||
player.Chatted:connect(function(msg)
|
player.Chatted:connect(function(msg)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue