fix 2009e respawning, add libraries.rbxm
This commit is contained in:
parent
915137ffab
commit
a85f4d9168
|
|
@ -9,6 +9,7 @@
|
||||||
- Updated ReShade to a unofficial build of 4.9.1.
|
- Updated ReShade to a unofficial build of 4.9.1.
|
||||||
- Improved compatibility with ReShade 4.9.1.
|
- Improved compatibility with ReShade 4.9.1.
|
||||||
- Added a new official Novetus redirect for items.
|
- Added a new official Novetus redirect for items.
|
||||||
|
- Fixed a bug where players couldn't respawn in 2009E and 2009E-HD when joining a game.
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
1.3 Pre-Release 2
|
1.3 Pre-Release 2
|
||||||
1.3:
|
1.3:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ if not exist "%gamescriptdir%/2010L" mkdir "%gamescriptdir%/2010L"
|
||||||
if not exist "%gamescriptdir%/2011E" mkdir "%gamescriptdir%/2011E"
|
if not exist "%gamescriptdir%/2011E" mkdir "%gamescriptdir%/2011E"
|
||||||
if not exist "%gamescriptdir%/2011M" mkdir "%gamescriptdir%/2011M"
|
if not exist "%gamescriptdir%/2011M" mkdir "%gamescriptdir%/2011M"
|
||||||
|
|
||||||
echo Copying game scripts...
|
echo Copying client scripts...
|
||||||
XCOPY "%cd%\Novetus\clients\2006S\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2006S"
|
XCOPY "%cd%\Novetus\clients\2006S\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2006S"
|
||||||
XCOPY "%cd%\Novetus\clients\2006S-Shaders\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2006S-Shaders"
|
XCOPY "%cd%\Novetus\clients\2006S-Shaders\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2006S-Shaders"
|
||||||
XCOPY "%cd%\Novetus\clients\2007E\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2007E"
|
XCOPY "%cd%\Novetus\clients\2007E\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2007E"
|
||||||
|
|
@ -32,6 +32,21 @@ XCOPY "%cd%\Novetus\clients\2010L\content\scripts\CSMPFunctions.lua" "%gamescrip
|
||||||
XCOPY "%cd%\Novetus\clients\2011E\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2011E"
|
XCOPY "%cd%\Novetus\clients\2011E\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2011E"
|
||||||
XCOPY "%cd%\Novetus\clients\2011M\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2011M"
|
XCOPY "%cd%\Novetus\clients\2011M\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2011M"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Copying client script libraries...
|
||||||
|
XCOPY "%cd%\Novetus\clients\2006S\content\fonts\libraries.rbxm" "%gamescriptdir%/2006S"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2006S-Shaders\content\fonts\libraries.rbxm" "%gamescriptdir%/2006S-Shaders"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2007E\content\fonts\libraries.rbxm" "%gamescriptdir%/2007E"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2007E-Shaders\content\fonts\libraries.rbxm" "%gamescriptdir%/2007E-Shaders"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2007M\content\fonts\libraries.rbxm" "%gamescriptdir%/2007M"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2007M-Shaders\content\fonts\libraries.rbxm" "%gamescriptdir%/2007M-Shaders"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2008M\content\fonts\libraries.rbxm" "%gamescriptdir%/2008M"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2009E\content\fonts\libraries.rbxm" "%gamescriptdir%/2009E"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2009E-HD\content\fonts\libraries.rbxm" "%gamescriptdir%/2009E-HD"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2010L\content\fonts\libraries.rbxm" "%gamescriptdir%/2010L"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2011E\content\fonts\libraries.rbxm" "%gamescriptdir%/2011E"
|
||||||
|
XCOPY "%cd%\Novetus\clients\2011M\content\fonts\libraries.rbxm" "%gamescriptdir%/2011M"
|
||||||
|
|
||||||
SET launcherscriptdir=%basedir%\launcher
|
SET launcherscriptdir=%basedir%\launcher
|
||||||
if not exist "%launcherscriptdir%" mkdir "%launcherscriptdir%"
|
if not exist "%launcherscriptdir%" mkdir "%launcherscriptdir%"
|
||||||
if not exist "%launcherscriptdir%/3DView" mkdir "%launcherscriptdir%/3DView"
|
if not exist "%launcherscriptdir%/3DView" mkdir "%launcherscriptdir%/3DView"
|
||||||
|
|
@ -45,7 +60,7 @@ XCOPY "%cd%\Novetus\config\splashes-special.txt" "%launcherscriptdir%"
|
||||||
XCOPY "%cd%\Novetus\config\names-special.txt" "%launcherscriptdir%"
|
XCOPY "%cd%\Novetus\config\names-special.txt" "%launcherscriptdir%"
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Moving scripts to GitHub folder...
|
echo Moving client scripts and libraries to GitHub folder...
|
||||||
SET dest=G:\Projects\GitHub\Novetus\Novetus_src
|
SET dest=G:\Projects\GitHub\Novetus\Novetus_src
|
||||||
SET scriptsdir=%dest%\scripts
|
SET scriptsdir=%dest%\scripts
|
||||||
if not exist "%scriptsdir%" mkdir "%scriptsdir%"
|
if not exist "%scriptsdir%" mkdir "%scriptsdir%"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<string name="Source">function onChatted(msg, speaker) source = string.lower(speaker.Name) msg = string.lower(msg) -- Note: This one is NOT caps sensitive if msg == "!!!reset" then speaker.Character.Humanoid.Health = 0 end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)</string>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<string name="Source">function onChatted(msg, speaker) source = string.lower(speaker.Name) msg = string.lower(msg) -- Note: This one is NOT caps sensitive if msg == "!!!reset" then speaker.Character.Humanoid.Health = 0 end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)</string>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<string name="Source">function onChatted(msg, speaker) source = string.lower(speaker.Name) msg = string.lower(msg) -- Note: This one is NOT caps sensitive if msg == "!!!reset" then speaker.Character.Humanoid.Health = 0 end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)</string>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<string name="Source">function onChatted(msg, speaker) source = string.lower(speaker.Name) msg = string.lower(msg) -- Note: This one is NOT caps sensitive if msg == "!!!reset" then speaker.Character.Humanoid.Health = 0 end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)</string>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -592,7 +592,7 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti
|
||||||
while true do
|
while true do
|
||||||
wait(0.001)
|
wait(0.001)
|
||||||
if (Player.Character ~= nil) then
|
if (Player.Character ~= nil) then
|
||||||
if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then
|
if (Player.Character:FindFirstChild("Humanoid") and (Player.Character.Humanoid.Health == 0)) then
|
||||||
wait(5)
|
wait(5)
|
||||||
Player:LoadCharacter()
|
Player:LoadCharacter()
|
||||||
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
|
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -592,7 +592,7 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti
|
||||||
while true do
|
while true do
|
||||||
wait(0.001)
|
wait(0.001)
|
||||||
if (Player.Character ~= nil) then
|
if (Player.Character ~= nil) then
|
||||||
if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then
|
if (Player.Character:FindFirstChild("Humanoid") and (Player.Character.Humanoid.Health == 0)) then
|
||||||
wait(5)
|
wait(5)
|
||||||
Player:LoadCharacter()
|
Player:LoadCharacter()
|
||||||
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
|
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,241 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">Fixer</string>
|
||||||
|
<ProtectedString name="Source">game:GetService("Players").PlayerAdded:connect(function(Player)
|
||||||
|
Player.CharacterAdded:connect(function(char)
|
||||||
|
if (Player.Character ~= nil) then
|
||||||
|
script.Health:clone().Parent = Player.Character
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
Player.Changed:connect(function(Property)
|
||||||
|
if (Property=="Character") and (Player.Character~=nil) then
|
||||||
|
local Character=Player.Character
|
||||||
|
local Humanoid=Character:FindFirstChild("Humanoid")
|
||||||
|
if (Humanoid~=nil) then
|
||||||
|
Humanoid.Died:connect(function() delay(5,function() script.Health:clone().Parent = Player.Character end) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Script" referent="RBX1">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">Health</string>
|
||||||
|
<ProtectedString name="Source">--Responsible for regening a player's humanoid's health
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
-- declarations
|
||||||
|
local Figure = script.Parent
|
||||||
|
local Head = waitForChild(Figure, "Head")
|
||||||
|
local Humanoid = waitForChild(Figure, "Humanoid")
|
||||||
|
local regening = false
|
||||||
|
|
||||||
|
-- regeneration
|
||||||
|
function regenHealth()
|
||||||
|
if regening then return end
|
||||||
|
regening = true
|
||||||
|
|
||||||
|
while Humanoid.Health < Humanoid.MaxHealth do
|
||||||
|
local s = wait(1)
|
||||||
|
local health = Humanoid.Health
|
||||||
|
if health > 0 and health < Humanoid.MaxHealth then
|
||||||
|
local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
|
||||||
|
health = health + newHealthDelta
|
||||||
|
Humanoid.Health = math.min(health,Humanoid.MaxHealth)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if Humanoid.Health > Humanoid.MaxHealth then
|
||||||
|
Humanoid.Health = Humanoid.MaxHealth
|
||||||
|
end
|
||||||
|
|
||||||
|
regening = false
|
||||||
|
end
|
||||||
|
|
||||||
|
Humanoid.HealthChanged:connect(regenHealth)
|
||||||
|
</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
<Item class="Script" referent="RBX2">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">Sorter</string>
|
||||||
|
<ProtectedString name="Source">script.Health:clone().Parent = game.StarterGui
|
||||||
|
script.ResetCommand:clone().Parent = game.Workspace
|
||||||
|
script:remove()</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
<Item class="GuiMain" referent="RBX3">
|
||||||
|
<Properties>
|
||||||
|
<string name="Name">Health</string>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Frame" referent="RBX4">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Active">false</bool>
|
||||||
|
<Color3 name="BackgroundColor3">4285215356</Color3>
|
||||||
|
<float name="BackgroundTransparency">1</float>
|
||||||
|
<Color3 name="BorderColor3">4279970357</Color3>
|
||||||
|
<int name="BorderSizePixel">1</int>
|
||||||
|
<string name="Name">Tray</string>
|
||||||
|
<UDim2 name="Position">
|
||||||
|
<XS>0.949999988</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0.380000025</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<UDim2 name="Size">
|
||||||
|
<XS>0.0450000018</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0.340000004</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<token name="SizeConstraint">0</token>
|
||||||
|
<token name="Style">0</token>
|
||||||
|
<bool name="Visible">true</bool>
|
||||||
|
<int name="ZIndex">1</int>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Frame" referent="RBX5">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Active">false</bool>
|
||||||
|
<Color3 name="BackgroundColor3">4286892054</Color3>
|
||||||
|
<float name="BackgroundTransparency">0</float>
|
||||||
|
<Color3 name="BorderColor3">4278190080</Color3>
|
||||||
|
<int name="BorderSizePixel">0</int>
|
||||||
|
<string name="Name">HealthBar</string>
|
||||||
|
<UDim2 name="Position">
|
||||||
|
<XS>0.420000017</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<UDim2 name="Size">
|
||||||
|
<XS>0.159999996</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0.800000012</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<token name="SizeConstraint">0</token>
|
||||||
|
<token name="Style">0</token>
|
||||||
|
<bool name="Visible">true</bool>
|
||||||
|
<int name="ZIndex">2</int>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Script" referent="RBX6">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">Script</string>
|
||||||
|
<ProtectedString name="Source">h = script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid
|
||||||
|
|
||||||
|
h.Changed:connect(function()
|
||||||
|
script.Parent.Size = UDim2.new(0.2, 0, 0.8 * (h.Health / h.MaxHealth), 0)
|
||||||
|
script.Parent.Position = UDim2.new(0.4, 0, 0.8 * (1- (h.Health / h.MaxHealth)) , 0)
|
||||||
|
end)
|
||||||
|
</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
<Item class="Frame" referent="RBX7">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Active">false</bool>
|
||||||
|
<Color3 name="BackgroundColor3">4289733411</Color3>
|
||||||
|
<float name="BackgroundTransparency">0</float>
|
||||||
|
<Color3 name="BorderColor3">4278190080</Color3>
|
||||||
|
<int name="BorderSizePixel">0</int>
|
||||||
|
<string name="Name">HealthBarBacking</string>
|
||||||
|
<UDim2 name="Position">
|
||||||
|
<XS>0.419999987</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<UDim2 name="Size">
|
||||||
|
<XS>0.159999996</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0.800000012</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<token name="SizeConstraint">0</token>
|
||||||
|
<token name="Style">0</token>
|
||||||
|
<bool name="Visible">true</bool>
|
||||||
|
<int name="ZIndex">1</int>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
<Item class="ImageLabel" referent="RBX8">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Active">false</bool>
|
||||||
|
<Color3 name="BackgroundColor3">4294967295</Color3>
|
||||||
|
<float name="BackgroundTransparency">1</float>
|
||||||
|
<Color3 name="BorderColor3">4279970357</Color3>
|
||||||
|
<int name="BorderSizePixel">1</int>
|
||||||
|
<Content name="Image"><url>rbxasset://../../../shareddata/textures/health.png</url></Content>
|
||||||
|
<string name="Name">ImageLabel</string>
|
||||||
|
<UDim2 name="Position">
|
||||||
|
<XS>0</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0.800000012</YS>
|
||||||
|
<YO>3</YO>
|
||||||
|
</UDim2>
|
||||||
|
<UDim2 name="Size">
|
||||||
|
<XS>1</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0.25</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<token name="SizeConstraint">1</token>
|
||||||
|
<bool name="Visible">true</bool>
|
||||||
|
<int name="ZIndex">1</int>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
<Item class="Script" referent="RBX9">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
<bool name="archivable">true</bool>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
|
|
@ -0,0 +1,703 @@
|
||||||
|
<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">
|
||||||
|
<External>null</External>
|
||||||
|
<External>nil</External>
|
||||||
|
<Item class="Script" referent="RBX0">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">Sorter</string>
|
||||||
|
<ProtectedString name="Source">print("Special thanks to Bitl, Carrot, iago, winsupermario1234, Khangaroo, drslicendice, coke, TheLivingBee, Raymonf, and a bunch of play - testers for help making 2011 fully stable and work. 8)")
|
||||||
|
script.Dialogs:clone().Parent = game.StarterGui
|
||||||
|
script.ReenableDialogScript:clone().Parent = game.Lighting
|
||||||
|
script.TimeoutScript:clone().Parent = game.Lighting
|
||||||
|
script.ResetCommand:clone().Parent = game.Workspace
|
||||||
|
script:remove()</ProtectedString>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Script" referent="RBX1">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<bool name="Disabled">true</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ReenableDialogScript</string>
|
||||||
|
<ProtectedString name="Source">wait(5)
|
||||||
|
local dialog = script.Parent
|
||||||
|
if dialog:IsA("Dialog") then
|
||||||
|
dialog.InUse = false
|
||||||
|
end
|
||||||
|
script:Remove()
|
||||||
|
</ProtectedString>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
<Item class="Script" referent="RBX2">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<bool name="Disabled">true</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">TimeoutScript</string>
|
||||||
|
<ProtectedString name="Source">wait(5)
|
||||||
|
local dialog = script.Parent
|
||||||
|
if dialog:IsA("Dialog") then
|
||||||
|
dialog.InUse = false
|
||||||
|
end
|
||||||
|
script:Remove()
|
||||||
|
</ProtectedString>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
<Item class="Script" referent="RBX3">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">ResetCommand</string>
|
||||||
|
<ProtectedString name="Source">function onChatted(msg, speaker)
|
||||||
|
|
||||||
|
source = string.lower(speaker.Name)
|
||||||
|
msg = string.lower(msg)
|
||||||
|
-- Note: This one is NOT caps sensitive
|
||||||
|
|
||||||
|
if msg == "!!!reset" then
|
||||||
|
speaker.Character.Humanoid.Health = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPlayerEntered(newPlayer)
|
||||||
|
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
<Item class="ScreenGui" referent="RBX4">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<string name="Name">Dialogs</string>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Frame" referent="RBX5">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Active">false</bool>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<Color3 name="BackgroundColor3">4288914085</Color3>
|
||||||
|
<float name="BackgroundTransparency">1</float>
|
||||||
|
<Color3 name="BorderColor3">4279970357</Color3>
|
||||||
|
<int name="BorderSizePixel">1</int>
|
||||||
|
<bool name="Draggable">false</bool>
|
||||||
|
<string name="Name">ControlFrame</string>
|
||||||
|
<UDim2 name="Position">
|
||||||
|
<XS>0</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>0</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<UDim2 name="Size">
|
||||||
|
<XS>1</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>1</YS>
|
||||||
|
<YO>0</YO>
|
||||||
|
</UDim2>
|
||||||
|
<token name="SizeConstraint">0</token>
|
||||||
|
<token name="Style">0</token>
|
||||||
|
<bool name="Visible">true</bool>
|
||||||
|
<int name="ZIndex">1</int>
|
||||||
|
</Properties>
|
||||||
|
<Item class="Frame" referent="RBX6">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Active">false</bool>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<Color3 name="BackgroundColor3">4288914085</Color3>
|
||||||
|
<float name="BackgroundTransparency">1</float>
|
||||||
|
<Color3 name="BorderColor3">4279970357</Color3>
|
||||||
|
<int name="BorderSizePixel">1</int>
|
||||||
|
<bool name="Draggable">false</bool>
|
||||||
|
<string name="Name">BottomLeftControl</string>
|
||||||
|
<UDim2 name="Position">
|
||||||
|
<XS>0</XS>
|
||||||
|
<XO>0</XO>
|
||||||
|
<YS>1</YS>
|
||||||
|
<YO>-46</YO>
|
||||||
|
</UDim2>
|
||||||
|
<UDim2 name="Size">
|
||||||
|
<XS>0</XS>
|
||||||
|
<XO>130</XO>
|
||||||
|
<YS>0</YS>
|
||||||
|
<YO>46</YO>
|
||||||
|
</UDim2>
|
||||||
|
<token name="SizeConstraint">0</token>
|
||||||
|
<token name="Style">0</token>
|
||||||
|
<bool name="Visible">true</bool>
|
||||||
|
<int name="ZIndex">1</int>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
<Item class="LocalScript" referent="RBX7">
|
||||||
|
<Properties>
|
||||||
|
<bool name="Archivable">true</bool>
|
||||||
|
<bool name="Disabled">false</bool>
|
||||||
|
<Content name="LinkedSource"><null></null></Content>
|
||||||
|
<string name="Name">Init</string>
|
||||||
|
<ProtectedString name="Source">--rbxsig%XeVmMtUuu+dXh8pEbcaTkr2m9RJZXY42LaACJ12YYcuPtOUxy4Azi8uMDGU8ZTh7cvZC9BlOWgqmZHKjESSdfOZl0/cgd2JKHPZ2UqiqA1slJa7R5GtCcGXlNPHW8KDYgJGRuwe8h5CSiMDOl6QLTSEegTOG7fzHk/n1AFcRN8I=%
|
||||||
|
--rbxassetid%39250920%
|
||||||
|
--fixed by Carrot#0559
|
||||||
|
|
||||||
|
function waitForProperty(instance, name)
|
||||||
|
while not instance[name] do
|
||||||
|
instance.Changed:wait()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local beter = game.Lighting
|
||||||
|
|
||||||
|
function waitForDialogChildrenMyLord(beter, name)
|
||||||
|
while not beter:FindFirstChild(name) do
|
||||||
|
beter.ChildAdded:wait()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local bois = game.Players.LocalPlayer.PlayerGui
|
||||||
|
|
||||||
|
function waitForFaker(bois, name)
|
||||||
|
while not bois:FindFirstChild(name) do
|
||||||
|
bois.ChildAdded:wait()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local mainFrame
|
||||||
|
local choices = {}
|
||||||
|
local lastChoice
|
||||||
|
local choiceMap = {}
|
||||||
|
local currentConversationDialog
|
||||||
|
local currentConversationPartner
|
||||||
|
local currentAbortDialogScript
|
||||||
|
|
||||||
|
local tooFarAwayMessage = "You are too far away to chat!"
|
||||||
|
local tooFarAwaySize = 300
|
||||||
|
local characterWanderedOffMessage = "Chat ended because you walked away"
|
||||||
|
local characterWanderedOffSize = 350
|
||||||
|
local conversationTimedOut = "Chat ended because you didn't reply"
|
||||||
|
local conversationTimedOutSize = 350
|
||||||
|
|
||||||
|
local player
|
||||||
|
local screenGui
|
||||||
|
local chatNotificationGui
|
||||||
|
local messageDialog
|
||||||
|
local timeoutScript = game.Lighting.ReenableDialogScript
|
||||||
|
local reenableDialogScript = game.Lighting.TimeoutScript
|
||||||
|
local dialogMap = {}
|
||||||
|
local dialogConnections = {}
|
||||||
|
|
||||||
|
local gui = nil
|
||||||
|
--waitForDialogChildrenMyLord(game,"CoreGui")
|
||||||
|
--waitForDialogChildrenMyLord(game.CoreGui,"RobloxGui")
|
||||||
|
--if game.CoreGui.RobloxGui:FindFirstChild("ControlFrame") then
|
||||||
|
-- gui = game.CoreGui.RobloxGui.ControlFrame
|
||||||
|
--else
|
||||||
|
-- gui = game.CoreGui.RobloxGui
|
||||||
|
--end
|
||||||
|
|
||||||
|
function currentTone()
|
||||||
|
if currentConversationDialog then
|
||||||
|
return currentConversationDialog.Tone
|
||||||
|
else
|
||||||
|
return Enum.DialogTone.Neutral
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function createChatNotificationGui()
|
||||||
|
chatNotificationGui = Instance.new("BillboardGui")
|
||||||
|
chatNotificationGui.Name = "ChatNotificationGui"
|
||||||
|
chatNotificationGui.ExtentsOffset = Vector3.new(0,1,0)
|
||||||
|
chatNotificationGui.Size = UDim2.new(4, 0, 5.42857122, 0)
|
||||||
|
chatNotificationGui.SizeOffset = Vector2.new(0,0)
|
||||||
|
chatNotificationGui.StudsOffset = Vector3.new(0.4, 4.3, 0)
|
||||||
|
chatNotificationGui.Enabled = true
|
||||||
|
chatNotificationGui.Active = true
|
||||||
|
|
||||||
|
local image = Instance.new("ImageLabel")
|
||||||
|
image.Name = "Image"
|
||||||
|
image.Active = false
|
||||||
|
image.BackgroundTransparency = 1
|
||||||
|
image.Position = UDim2.new(0,0,0,0)
|
||||||
|
image.Size = UDim2.new(1.0,0,1.0,0)
|
||||||
|
image.Image = ""
|
||||||
|
image.Parent = chatNotificationGui
|
||||||
|
|
||||||
|
|
||||||
|
local button = Instance.new("ImageButton")
|
||||||
|
button.Name = "Button"
|
||||||
|
button.AutoButtonColor = false
|
||||||
|
button.Position = UDim2.new(0.0879999995, 0, 0.0529999994, 0)
|
||||||
|
button.Size = UDim2.new(0.829999983, 0, 0.460000008, 0)
|
||||||
|
button.Image = ""
|
||||||
|
button.BackgroundTransparency = 1
|
||||||
|
button.Parent = image
|
||||||
|
end
|
||||||
|
|
||||||
|
function getChatColor(tone)
|
||||||
|
if tone == Enum.DialogTone.Neutral then
|
||||||
|
return Enum.ChatColor.Blue
|
||||||
|
elseif tone == Enum.DialogTone.Friendly then
|
||||||
|
return Enum.ChatColor.Green
|
||||||
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
|
return Enum.ChatColor.Red
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function styleChoices(tone)
|
||||||
|
for i, obj in pairs(choices) do
|
||||||
|
resetColor(obj, tone)
|
||||||
|
end
|
||||||
|
resetColor(lastChoice, tone)
|
||||||
|
end
|
||||||
|
|
||||||
|
function styleMainFrame(tone)
|
||||||
|
if tone == Enum.DialogTone.Neutral then
|
||||||
|
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
||||||
|
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png"
|
||||||
|
elseif tone == Enum.DialogTone.Friendly then
|
||||||
|
mainFrame.Style = Enum.FrameStyle.ChatGreen
|
||||||
|
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botGreen_tailRight.png"
|
||||||
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
|
mainFrame.Style = Enum.FrameStyle.ChatRed
|
||||||
|
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png"
|
||||||
|
end
|
||||||
|
|
||||||
|
styleChoices(tone)
|
||||||
|
end
|
||||||
|
function setChatNotificationTone(gui, purpose, tone)
|
||||||
|
if tone == Enum.DialogTone.Neutral then
|
||||||
|
gui.Image.Image = "rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
|
||||||
|
elseif tone == Enum.DialogTone.Friendly then
|
||||||
|
gui.Image.Image = "rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
|
||||||
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
|
gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png"
|
||||||
|
end
|
||||||
|
if purpose == Enum.DialogPurpose.Quest then
|
||||||
|
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_bang.png"
|
||||||
|
elseif purpose == Enum.DialogPurpose.Help then
|
||||||
|
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_question.png"
|
||||||
|
elseif purpose == Enum.DialogPurpose.Shop then
|
||||||
|
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_money.png"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createMessageDialog()
|
||||||
|
messageDialog = Instance.new("Frame");
|
||||||
|
messageDialog.Name = "DialogScriptMessage"
|
||||||
|
messageDialog.Style = Enum.FrameStyle.RobloxRound
|
||||||
|
messageDialog.Visible = false
|
||||||
|
|
||||||
|
local text = Instance.new("TextLabel")
|
||||||
|
text.Name = "Text"
|
||||||
|
text.Position = UDim2.new(0,0,0,-1)
|
||||||
|
text.Size = UDim2.new(1,0,1,0)
|
||||||
|
text.FontSize = Enum.FontSize.Size14
|
||||||
|
text.BackgroundTransparency = 1
|
||||||
|
text.TextColor3 = Color3.new(1,1,1)
|
||||||
|
text.Parent = messageDialog
|
||||||
|
end
|
||||||
|
|
||||||
|
function showMessage(msg, size)
|
||||||
|
messageDialog.Text.Text = msg
|
||||||
|
messageDialog.Size = UDim2.new(0,size,0,40)
|
||||||
|
messageDialog.Position = UDim2.new(0.5, -size/2, 0.5, -40)
|
||||||
|
messageDialog.Visible = true
|
||||||
|
wait(2)
|
||||||
|
messageDialog.Visible = false
|
||||||
|
end
|
||||||
|
|
||||||
|
function variableDelay(str)
|
||||||
|
local length = math.min(string.len(str), 100)
|
||||||
|
wait(0.75 + ((length/75) * 1.5))
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
function highlightColor(frame, tone)
|
||||||
|
if tone == Enum.DialogTone.Neutral then
|
||||||
|
frame.BackgroundColor3 = Color3.new(2/255, 108/255, 255/255)
|
||||||
|
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||||
|
elseif tone == Enum.DialogTone.Friendly then
|
||||||
|
frame.BackgroundColor3 = Color3.new(0/255, 128/255, 0/255)
|
||||||
|
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||||
|
elseif tone == Enum.DialogTone.Enemy then
|
||||||
|
frame.BackgroundColor3 = Color3.new(204/255, 0/255, 0/255)
|
||||||
|
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function wanderDialog()
|
||||||
|
print("Wander")
|
||||||
|
mainFrame.Visible = false
|
||||||
|
endDialog()
|
||||||
|
showMessage(characterWanderedOffMessage, characterWanderedOffSize)
|
||||||
|
end
|
||||||
|
|
||||||
|
function timeoutDialog()
|
||||||
|
print("Timeout")
|
||||||
|
mainFrame.Visible = false
|
||||||
|
endDialog()
|
||||||
|
showMessage(conversationTimedOut, conversationTimedOutSize)
|
||||||
|
end
|
||||||
|
function normalEndDialog()
|
||||||
|
print("Done")
|
||||||
|
endDialog()
|
||||||
|
end
|
||||||
|
|
||||||
|
function endDialog()
|
||||||
|
if currentAbortDialogScript then
|
||||||
|
currentAbortDialogScript:Remove()
|
||||||
|
currentAbortDialogScript = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local dialog = currentConversationDialog
|
||||||
|
currentConversationDialog = nil
|
||||||
|
if dialog and dialog.InUse then
|
||||||
|
local reenableScript = reenableDialogScript:Clone()
|
||||||
|
reenableScript.archivable = false
|
||||||
|
reenableScript.Disabled = false
|
||||||
|
reenableScript.Parent = dialog
|
||||||
|
end
|
||||||
|
|
||||||
|
for dialog, gui in pairs(dialogMap) do
|
||||||
|
if dialog and gui then
|
||||||
|
gui.Enabled = not dialog.InUse
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
currentConversationPartner = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function sanitizeMessage(msg)
|
||||||
|
if string.len(msg) == 0 then
|
||||||
|
return "..."
|
||||||
|
else
|
||||||
|
return msg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
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.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.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.Parent = mainFrame
|
||||||
|
|
||||||
|
for n, obj in pairs(choices) do
|
||||||
|
obj.Parent = mainFrame
|
||||||
|
end
|
||||||
|
lastChoice.Parent = mainFrame
|
||||||
|
|
||||||
|
mainFrame.Parent = parent
|
||||||
|
end
|
||||||
|
|
||||||
|
function presentDialogChoices(talkingPart, dialogChoices)
|
||||||
|
if not currentConversationDialog then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
currentConversationPartner = talkingPart
|
||||||
|
local sortedDialogChoices = {}
|
||||||
|
for n, obj in pairs(dialogChoices) do
|
||||||
|
if obj:IsA("DialogChoice") then
|
||||||
|
table.insert(sortedDialogChoices, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.sort(sortedDialogChoices, function(a,b) return a.Name < b.Name end)
|
||||||
|
|
||||||
|
if #sortedDialogChoices == 0 then
|
||||||
|
normalEndDialog()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local pos = 1
|
||||||
|
local yPosition = 0
|
||||||
|
choiceMap = {}
|
||||||
|
for n, obj in pairs(choices) do
|
||||||
|
obj.Visible = false
|
||||||
|
end
|
||||||
|
|
||||||
|
for n, obj in pairs(sortedDialogChoices) do
|
||||||
|
if pos <= #choices then
|
||||||
|
--3 lines is the maximum, set it to that temporarily
|
||||||
|
choices[pos].Size = UDim2.new(1, 0, 0, 24*3)
|
||||||
|
choices[pos].UserPrompt.Text = obj.UserDialog
|
||||||
|
local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y/24)*24
|
||||||
|
|
||||||
|
choices[pos].Position = UDim2.new(0, 0, 0, yPosition)
|
||||||
|
choices[pos].Size = UDim2.new(1, 0, 0, height)
|
||||||
|
choices[pos].Visible = true
|
||||||
|
|
||||||
|
choiceMap[choices[pos]] = obj
|
||||||
|
|
||||||
|
yPosition = yPosition + height
|
||||||
|
pos = pos + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
lastChoice.Position = UDim2.new(0,0,0,yPosition)
|
||||||
|
lastChoice.Number.Text = pos .. ")"
|
||||||
|
|
||||||
|
mainFrame.Size = UDim2.new(0, 350, 0, yPosition+24+32)
|
||||||
|
mainFrame.Position = UDim2.new(0,20,0.0, -mainFrame.Size.Y.Offset-20)
|
||||||
|
styleMainFrame(currentTone())
|
||||||
|
mainFrame.Visible = true
|
||||||
|
end
|
||||||
|
|
||||||
|
function doDialog(dialog)
|
||||||
|
while not Instance.Lock(dialog, player) do
|
||||||
|
wait()
|
||||||
|
end
|
||||||
|
|
||||||
|
if dialog.InUse then
|
||||||
|
Instance.Unlock(dialog)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
dialog.InUse = true
|
||||||
|
Instance.Unlock(dialog)
|
||||||
|
end
|
||||||
|
|
||||||
|
currentConversationDialog = dialog
|
||||||
|
game.Chat:Chat(dialog.Parent, dialog.InitialPrompt, getChatColor(dialog.Tone))
|
||||||
|
variableDelay(dialog.InitialPrompt)
|
||||||
|
|
||||||
|
presentDialogChoices(dialog.Parent, dialog:GetChildren())
|
||||||
|
end
|
||||||
|
|
||||||
|
function renewKillswitch(dialog)
|
||||||
|
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
|
||||||
|
if currentConversationDialog.Parent and (player:DistanceFromCharacter(currentConversationDialog.Parent.Position) >= currentConversationDialog.ConversationDistance) then
|
||||||
|
wanderDialog()
|
||||||
|
end
|
||||||
|
wait(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function startDialog(dialog)
|
||||||
|
if dialog.Parent and dialog.Parent:IsA("BasePart") then
|
||||||
|
if player:DistanceFromCharacter(dialog.Parent.Position) >= dialog.ConversationDistance then
|
||||||
|
showMessage(tooFarAwayMessage, tooFarAwaySize)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
for dialog, gui in pairs(dialogMap) do
|
||||||
|
if dialog and gui then
|
||||||
|
gui.Enabled = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
renewKillswitch(dialog)
|
||||||
|
|
||||||
|
delay(1, checkForLeaveArea)
|
||||||
|
doDialog(dialog)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function removeDialog(dialog)
|
||||||
|
if dialogMap[dialog] then
|
||||||
|
dialogMap[dialog]:Remove()
|
||||||
|
dialogMap[dialog] = nil
|
||||||
|
end
|
||||||
|
if dialogConnections[dialog] then
|
||||||
|
dialogConnections[dialog]:disconnect()
|
||||||
|
dialogConnections[dialog] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function addDialog(dialog)
|
||||||
|
if dialog.Parent then
|
||||||
|
if dialog.Parent:IsA("BasePart") then
|
||||||
|
local chatGui = chatNotificationGui:clone()
|
||||||
|
chatGui.Enabled = not dialog.InUse
|
||||||
|
chatGui.Adornee = dialog.Parent
|
||||||
|
chatGui.Parent = game.Players.LocalPlayer.PlayerGui
|
||||||
|
chatGui.Image.Button.MouseButton1Click:connect(function() startDialog(dialog) end)
|
||||||
|
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||||
|
|
||||||
|
dialogMap[dialog] = chatGui
|
||||||
|
|
||||||
|
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||||
|
if prop == "Parent" and dialog.Parent then
|
||||||
|
--This handles the reparenting case, seperate from removal case
|
||||||
|
removeDialog(dialog)
|
||||||
|
addDialog(dialog)
|
||||||
|
elseif prop == "InUse" then
|
||||||
|
chatGui.Enabled = not currentConversationDialog and not dialog.InUse
|
||||||
|
if dialog == currentConversationDialog then
|
||||||
|
timeoutDialog()
|
||||||
|
end
|
||||||
|
elseif prop == "Tone" or prop == "Purpose" then
|
||||||
|
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else -- still need to listen to parent changes even if current parent is not a BasePart
|
||||||
|
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||||
|
if prop == "Parent" and dialog.Parent then
|
||||||
|
--This handles the reparenting case, seperate from removal case
|
||||||
|
removeDialog(dialog)
|
||||||
|
addDialog(dialog)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--[[function fetchScripts()
|
||||||
|
local model = game:GetService("InsertService"):LoadAsset(39226062)
|
||||||
|
if type(model) == "string" then -- load failed, lets try again
|
||||||
|
wait(0.1)
|
||||||
|
model = game:GetService("InsertService"):LoadAsset(39226062)
|
||||||
|
end
|
||||||
|
if type(model) == "string" then -- not going to work, lets bail
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
waitForDialogChildrenMyLord(model,"TimeoutScript")
|
||||||
|
timeoutScript = model.TimeoutScript
|
||||||
|
waitForDialogChildrenMyLord(model,"ReenableDialogScript")
|
||||||
|
reenableDialogScript = model.ReenableDialogScript
|
||||||
|
end
|
||||||
|
]]--
|
||||||
|
|
||||||
|
function onLoad()
|
||||||
|
waitForProperty(game.Players, "LocalPlayer")
|
||||||
|
player = game.Players.LocalPlayer
|
||||||
|
waitForProperty(player, "Character")
|
||||||
|
|
||||||
|
--print("Fetching Scripts")
|
||||||
|
--fetchScripts()
|
||||||
|
|
||||||
|
--print("Creating Guis")
|
||||||
|
createChatNotificationGui()
|
||||||
|
|
||||||
|
waitForFaker(bois,"Dialogs")
|
||||||
|
--print("Creating MessageDialog")
|
||||||
|
createMessageDialog()
|
||||||
|
messageDialog.Parent = game.Players.LocalPlayer.PlayerGui.Dialogs
|
||||||
|
|
||||||
|
|
||||||
|
--print("Initializing Frame")
|
||||||
|
local frame = Instance.new("Frame")
|
||||||
|
frame.Name = "DialogFrame"
|
||||||
|
frame.Position = UDim2.new(0,0,0,0)
|
||||||
|
frame.Size = UDim2.new(0,0,0,0)
|
||||||
|
frame.BackgroundTransparency = 1
|
||||||
|
frame.Parent = game.Players.LocalPlayer.PlayerGui.Dialogs.ControlFrame.BottomLeftControl
|
||||||
|
initialize(frame)
|
||||||
|
|
||||||
|
--print("Adding Dialogs")
|
||||||
|
game.CollectionService.ItemAdded:connect(function(obj) if obj:IsA("Dialog") then addDialog(obj) end end)
|
||||||
|
game.CollectionService.ItemRemoved:connect(function(obj) if obj:IsA("Dialog") then removeDialog(obj) end end)
|
||||||
|
for i, obj in pairs(game.CollectionService:GetCollection("Dialog")) do
|
||||||
|
if obj:IsA("Dialog") then
|
||||||
|
addDialog(obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
onLoad()</ProtectedString>
|
||||||
|
</Properties>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
</Item>
|
||||||
|
</roblox>
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue