-- Developed by 89five

local MUSIC = script:WaitForChild("BgMusic")
spawn(function()
	wait(3)
	MUSIC.Looped = true
	MUSIC:Play()
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Modules = ReplicatedStorage:WaitForChild("Modules")
local MarketplaceService = game:GetService("MarketplaceService")

local LocalHelp = require(Modules:WaitForChild("LocalHelp"))
local SharedHelp = require(Modules:WaitForChild("SharedHelp"))
local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local Map = game.Workspace:WaitForChild("Map")
local Camera = game.Workspace.CurrentCamera
local ViewGui = script.Parent:WaitForChild("ViewGui")
local ViewFrame = ViewGui:WaitForChild("ViewportFrame")
local HP = script.Parent:WaitForChild("Health"):WaitForChild("BG"):WaitForChild("Filled")
local ViewBrick = Instance.new("Part")
local Settings = script.Parent:WaitForChild("SettingsFrame")
local Shop = script.Parent:WaitForChild("ShopFrame")
local Buttons = script.Parent:WaitForChild("Buttons")
local LocalSettings = {}
local Debs = {}

local shopItems = SharedHelp.GetProducts()

local Extra = 1.5
local Resolution = 0.25
local UnanchoredParts = {}
local CharFunctions = {}

--Functions
function UpdateFramePos()
	local ResolutionX = Camera.ViewportSize.X
	local ResolutionY = Camera.ViewportSize.Y
	
	local LU = Camera:ScreenPointToRay(0, 0).Origin
	local RU = Camera:ScreenPointToRay(ResolutionX, 0).Origin
	local LD = Camera:ScreenPointToRay(0, ResolutionY).Origin
	local RD = Camera:ScreenPointToRay(ResolutionX, ResolutionY).Origin
	
	
	
	local xSiz = (RU - LU).magnitude * Extra
	local ySiz = (LD - LU).magnitude * Extra
	
	ViewBrick.CFrame = Camera.CFrame + Camera.CFrame.lookVector *0.65
	ViewBrick.Size = Vector3.new(xSiz, ySiz, 1)
	
	ViewGui.CanvasSize = Vector2.new(ResolutionX * Resolution, ResolutionY * Resolution)
end

function AddPositionListener(Original, Local)
	table.insert(UnanchoredParts, {Original, Local})
end

function AddUpdateListener(Original, Local, Property)
	if Property == "CFrame" then
		return AddPositionListener(Original, Local)
	end
	Original:GetPropertyChangedSignal(Property):Connect(function()
		Local[Property] = Original[Property]
	end)
end

function AddPart(Part, Listener)

	for i,v in pairs(Part:GetChildren()) do
		AddPart(v, Listener)
	end
	
	if not Part:IsA("BasePart") then return end
	if Part.ClassName == "Terrain" then return end
	if not Part.Parent then return end
	if Part.Parent.Name == "Ignore" and Part.Name == "Part" then return end
	
	local New = Part:Clone()
	New.Parent = ViewFrame
	--Part.Transparency = 1
	New.CanCollide = false
	New.Anchored = true
	
	if not Part.Anchored then
		AddPositionListener(Part, New)
	end
	
	for i,v in pairs(Part:GetChildren()) do
		if v.Name == "PropertyListen" then
			AddUpdateListener(Part, New, v.Value)
		elseif v.ClassName == "Decal" then
			AddUpdateListener(v, New:FindFirstChild(v.Name), "Transparency")
		end
	end
	
	if Listener then
		for i,v in pairs(Listener) do
			AddUpdateListener(Part, New, v)
		end
	end
	
	if Part.Parent:IsA("Tool") or Part.Parent:FindFirstChild("Humanoid") or Part:FindFirstChild("DestroyListen") or Part.Parent.Name == "Ignore" then
		Part.AncestryChanged:Connect(function(_, parent)
			if not Part:IsDescendantOf(game.Workspace) then
				New:Destroy()
			end
		end)
		if Part.Parent.Name == "Ignore" then
			AddPositionListener(Part, New)
			AddUpdateListener(Part, New, "Transparency")
		end
	end
end

function AddModel(...)
	AddPart(...)
end

function Health(Character)
	if not Character then return end
	local Humanoid = Character:WaitForChild("Humanoid")
	HP.Size = UDim2.new(1,0,Humanoid.Health/Humanoid.MaxHealth,0)
	
	for i,v in pairs(CharFunctions) do
		v:Disconnect()
	end
	
	table.insert(CharFunctions, Humanoid.HealthChanged:Connect(function()
		HP.Size = UDim2.new(1,0,Humanoid.Health/Humanoid.MaxHealth,0)
	end))
end

function ToggleSettings(force)
	local NextVis = not Settings.Visible
	if force ~= nil then
		NextVis = force
	end
	Settings.Visible = NextVis
	Shop.Visible = false
end

function ToggleShop(force)
	local NextVis = not Shop.Visible
	if force ~= nil then
		NextVis = force
	end
	Shop.Visible = NextVis
	Settings.Visible = false
end

--Main
ViewBrick.Anchored = true
ViewBrick.CanCollide = false
ViewBrick.Transparency = 1
ViewBrick.Parent = game.Workspace:WaitForChild("Ignore")

ViewGui.Adornee = ViewBrick

ViewFrame.CurrentCamera = game.Workspace.CurrentCamera

AddPart(Map)
Map:WaitForChild("Effects"):WaitForChild("Regen").ChildAdded:Connect(AddPart)
AddPart(game.Workspace:WaitForChild("Ignore"))
game.Workspace:WaitForChild("Ignore").ChildAdded:Connect(AddPart)
Health(Player.Character)

--Events
Camera.Changed:Connect(UpdateFramePos)
Player.CharacterAdded:Connect(Health)

RunService.RenderStepped:connect(function()
	for i,v in pairs(UnanchoredParts) do
		v[2].CFrame = v[1].CFrame
	end
end)

for i,v in pairs(game.Players:GetChildren()) do
	if v.Character and v ~= Player then
		if v.Character:FindFirstChild("Loaded") then
			AddModel(v.Character)
		end
	end
end
LocalHelp.ConnectRemoteEvent("LoadModel", AddModel)

function UpdateSetting(Setting, Value)
	LocalSettings[Setting] = Value
	if Setting == "Music" then
		if Value > 0 then
			Settings:WaitForChild("Music").Text = " Music: Enabled"
			Settings.Music.BackgroundColor3 = LocalHelp.Green
		else
			Settings:WaitForChild("Music").Text = " Music: Disabled"
			Settings.Music.BackgroundColor3 = LocalHelp.Red
		end
		MUSIC.Volume = Value
	elseif Setting == "OldVideo" then
		if Value then
			Settings:WaitForChild("Retro").Text = " Retro visual effect: Enabled"
			Settings.Retro.BackgroundColor3 = LocalHelp.Green
		else
			Settings:WaitForChild("Retro").Text = " Retro visual effect: Disabled"
			Settings.Retro.BackgroundColor3 = LocalHelp.Red
		end	
		ViewGui.Enabled = Value
	end
end

function LoadLocalData(NewData)
	LocalSettings = NewData["Settings"]
	for i,v in pairs(LocalSettings) do
		UpdateSetting(i, v)
	end
end

function ToolAppearance(T, State)
	T:WaitForChild("Price").Text = State
	
	local col = Color3.fromRGB(0,255,0)
	
	if State == "EQUIP" then
		col = Color3.fromRGB(255, 170, 0)
	else
		
	end
	
	T:WaitForChild("PriceBG").BorderColor3 = col
	T:WaitForChild("BG").ImageColor3 = col
	
end

function ToolUpdate(ToolName, State)
	local it = Shop:WaitForChild("Items"):WaitForChild(ToolName)
	
	if State == "OWNED" then
		ToolAppearance(it, "EQUIP")
	else
		ToolAppearance(it, "UNEQUIP")
	end
	
end

--Others
Settings:WaitForChild("Music").MouseButton1Click:Connect(function()
	if Debs["Music"] then return end
	Debs["Music"] = true
	local NewMusic = 0
	if LocalSettings["Music"] == 0 then
		NewMusic = 1
	end
	UpdateSetting("Music", NewMusic)
	LocalHelp.InvokeRemoteFunction("SettingsChange", "Music", NewMusic)
	Debs["Music"] = false
end)

Settings:WaitForChild("Retro").MouseButton1Click:Connect(function()
	if Debs["Retro"] then return end
	Debs["Retro"] = true
	local NewRetro = not LocalSettings["OldVideo"]
	UpdateSetting("OldVideo", NewRetro)
	LocalHelp.InvokeRemoteFunction("SettingsChange", "OldVideo", NewRetro)
	Debs["Retro"] = false
end)

Settings:WaitForChild("Character").MouseButton1Click:Connect(function()
	if Debs["Character"] then return end
	Debs["Character"] = true
	LocalHelp.InvokeRemoteFunction("SettingsChange", "Character", "Random")
	Debs["Character"] = false
end)

Buttons:WaitForChild("Settings").MouseButton1Click:Connect(ToggleSettings)
Settings:WaitForChild("Exit").MouseButton1Click:Connect(function() ToggleSettings(false) end)

Buttons:WaitForChild("Shop").MouseButton1Click:Connect(ToggleShop)
Shop:WaitForChild("Exit").MouseButton1Click:Connect(function() ToggleShop(false) end)

Buttons.Settings.MouseEnter:Connect(function()
	while LocalHelp.CheckMouseIn(Buttons.Settings) do
		Buttons.Settings:WaitForChild("ImageLabel").Rotation = Buttons.Settings:WaitForChild("ImageLabel").Rotation + 1
		if Buttons.Settings:WaitForChild("ImageLabel").Rotation >= 360 then
			Buttons.Settings:WaitForChild("ImageLabel").Rotation = Buttons.Settings:WaitForChild("ImageLabel").Rotation - 360
		end
		wait()
	end
end)
local MoveIn = 1
local MSP = .01
Buttons.Shop.MouseEnter:Connect(function()
	while LocalHelp.CheckMouseIn(Buttons.Shop) do
		Buttons.Shop:WaitForChild("ImageLabel").Size = Buttons.Shop:WaitForChild("ImageLabel").Size + UDim2.new(MoveIn * MSP, 0, MoveIn * MSP, 0)
		
		if Buttons.Shop:WaitForChild("ImageLabel").Size.X.Scale > 1.2 then
			Buttons.Shop:WaitForChild("ImageLabel").Size = UDim2.new(1.2,0,1.2,0)
			MoveIn = -1
		elseif Buttons.Shop:WaitForChild("ImageLabel").Size.X.Scale < 1 then
			Buttons.Shop:WaitForChild("ImageLabel").Size = UDim2.new(1,0,1,0)
			MoveIn = 1	
		end
		wait()
	end
end)

local ToolDeb = false
for i,v in pairs(shopItems) do
	local T = script:WaitForChild("ShopTemplate"):Clone()
	T.Name = v[1]
	T:WaitForChild("Img").Image = "rbxassetid://"..v[2]
	T.Parent = Shop:WaitForChild("Items")
	
	spawn(function()
		local INFO = MarketplaceService:GetProductInfo(v[3], Enum.InfoType.Product)
		if T:WaitForChild("Price").Text == "BUY" then
			T:WaitForChild("Price").Text = "R$"..INFO.PriceInRobux
		end
	end)
	
	T.MouseButton1Click:Connect(function()
		if ToolDeb then return end
		ToolDeb = true
		local result, message = LocalHelp.InvokeRemoteFunction("SettingsChange", "Tool", v[1])

		if result then
			if message == "BUY" then
				ToggleShop(false)
			else
				ToolAppearance(T, message)
			end
		end
		ToolDeb = false
	end)
end


LocalHelp.ConnectRemoteEvent("LoadLocalData", LoadLocalData)
LocalHelp.ConnectRemoteEvent("ToolUpdate", ToolUpdate)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
wait()
pcall(function()
	local starterGui = game:GetService('StarterGui')
	starterGui:SetCore("TopbarEnabled", false)
end)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: